BasketMC

Image Test Pattern, Episode 10: TIS-100

  • Published on

Episode 10 opens the first image puzzle, Image Test Pattern 1. Basket works out from the manual how the image panel takes coordinates and colors, and fills the screen with white from one node. Image Test Pattern 2 asks for a checkerboard, and a two-node program passes it before the video ends.

Learning the image panel

The puzzle text reads "Fill the image buffer with the specified target test pattern," and the target is a plain white square. A red node marked "COMMUNICATION FAILURE" sits in the middle row. "I forget how this works," the commentary admits, and turns to the imaging page of the manual.

The first test sends "MOV 0 DOWN" twice, then "MOV 3 DOWN" and "MOV -1 DOWN", and one white pixel appears in the top left corner. The manual's own example, with a row of "MOV 4 DOWN" lines, gives a red pixel instead. "So the first two are the coordinates." Without the -1, a long row of colors "doesn't loop", the commentary finds, and counts 30 pixels across.

The Image Test Pattern 1 screen running test 1 step by step: a white target panel at top left, a single red pixel in the top left corner of the image panel below it, a red node marked "COMMUNICATION FAILURE", and a bottom node holding "MOV 0 DOWN", "MOV 0 DOWN", five lines of "MOV 4 DOWN" and "MOV -1 DOWN"

Thirty white pixels, row by row

White is 3, so one node gets a loop: "MOV 30 ACC", "LOOP1: MOV 3 DOWN", "SUB 1", "JGZ LOOP1", then "MOV -1 DOWN" to end the row. The game flags "SUB 1 ACC" with "TOO MANY OPERANDS". "Oh, right. That's implied." An outer loop counts rows from "MOV -1 ACC", keeping the count with "SAV" and "SWP".

The first version sends the row number as both coordinates. "The first number is the X," the commentary notes, and the first line becomes "MOV 0 DOWN". White rows fill the panel, and the puzzle passes in 2353 cycles with 1 node and 12 instructions, one more than the friend's score beside Basket's. Dropping the outer label setup and the final jump brings it to 2335 cycles and 10 instructions. "Yes, okay, great. I'm doing great."

The Image Test Pattern 1 screen running test 1: the image panel has one full white row across the top and a second row most of the way across, under a white target, while one node runs a program starting "MOV -1 ACC" and "LOOP2:" with "LOOP1:MOV 3 DOWN" highlighted and "JMP LOOP2" at the end

A checkerboard

Image Test Pattern 2 has the same puzzle text, but the target is a black and white checkerboard. Basket pastes the last program into the bottom node and gives the node to its right a toggle: "SET3: MOV 3 ACC", "LOOP: MOV ACC LEFT", "JEZ SET3", "MOV 0 ACC", "JMP LOOP". The row loop now sends "MOV RIGHT DOWN". The commentary notes that the target goes "from black to then black again" between rows, runs it once ("Yeah, stripes, good."), then adds "MOV RIGHT NIL" after each row to throw one value away. The checkerboard fills in, and the puzzle passes in 2613 cycles with 2 nodes and 16 instructions.

The Image Test Pattern 2 screen with "TEST 1 PASSED IN 2613 CYCLES" at top left: a black and white checkerboard target, the first rows of the same checkerboard drawn in the image panel, and two bottom nodes, the left one sending "MOV RIGHT DOWN" and the right one holding "SET3: MOV 3 ACC", "LOOP: MOV ACC LEFT", "JEZ SET3", "MOV 0 ACC" and "JMP LOOP"

Where it ends

The friend's score has two fewer instructions. Moving a label onto a line by itself leaves the total at 16: "it didn't actually count a label on its line by itself." "I guess I want to be okay with this for now, and I might come back and try to optimize it some more." The segment map shows both Image Test Patterns as nominal, and the video cuts to the end card.