part1 (1614B)
1--- Day 13: Care Package --- 2 3As you ponder the solitude of space and the ever-increasing three-hour roundtrip for messages 4between you and Earth, you notice that the Space Mail Indicator Light is blinking. To help keep you 5sane, the Elves have sent you a care package. 6 7It's a new game for the ship's arcade cabinet! Unfortunately, the arcade is [1m[97mall the way[0m on the other 8end of the ship. Surely, it won't be hard to build your own - the care package even comes with 9schematics. 10 11The arcade cabinet runs Intcode software like the game the Elves sent (your puzzle input). It has a 12primitive screen capable of drawing square [1m[97mtiles[0m on a grid. The software draws tiles to the screen 13with output instructions: every three output instructions specify the x position (distance from the 14left), y position (distance from the top), and tile id. The tile id is interpreted as follows: 15 16 17 - 0 is an [1m[97mempty[0m tile. No game object appears in this tile. 18 19 - 1 is a [1m[97mwall[0m tile. Walls are indestructible barriers. 20 21 - 2 is a [1m[97mblock[0m tile. Blocks can be broken by the ball. 22 23 - 3 is a [1m[97mhorizontal paddle[0m tile. The paddle is indestructible. 24 25 - 4 is a [1m[97mball[0m tile. The ball moves diagonally and bounces off objects. 26 27 28For example, a sequence of output values like 1,2,3,6,5,4 would draw a [1m[97mhorizontal paddle[0m tile (1 29tile from the left and 2 tiles from the top) and a [1m[97mball[0m tile (6 tiles from the left and 5 tiles from 30the top). 31 32Start the game. [1m[97mHow many block tiles are on the screen when the game exits?[0m 33 34