▦ MATRIX THINKING

PLAY WITH THE REPRESENTATION

One matrix.
Two ways to see a game.

The snake is a list of coordinates.
The field is a matrix. Watch both change together.

01 / THE DATA · field[row, column]
02 / THE GAME · same matrix, drawnSYNCHRONIZED
0 · empty1 · body2 · apple3 · head

Point to a cell in either view to find its partner.

The head is at [5, 4]. Moving right adds [0, 1]. Predict the next head position, then take a step.

CHOOSE A DIRECTION

Arrow keys work while this lab has focus.
One turn per step. Edges wrap. Hit your body and the game ends.

A JavaScript learning model, not Python execution. The two views are drawn from the same matrix after each step.