make and play math video games

Reset Reset
Pause Pause
Fullscreen Fullscreen
Toggle Sound Sound

On keyboards, use the arrow keys, X (A-button), and Z (B-button).


View source code

The goal

Use the arrow keys to transform the displayed matrix until you arrive at

If you make too many moves, you will lose a life! If you run out of time, you will also lose a life! You’ve got five lives before the game is over.

How do I control this?

Moving “right” will add the second row to the first row, e.g.,

Moving “left” undoes this by subtracting the second row from the first row, e.g.,

Moving “up” and “down” are similar, but the roles of the first and second rows are exchanged. For instance, moving “up” will add the first row to the second row as in

while moving “down” subtracts the first row from the second row as in

One way to remember this is that right and left (the x-axis) affects the first row, while moving up and down (the y-axis) affects the second row. Right and up mean “add.”

What’s with the background?

The background displays the upper half plane transformed by the displayed matrix regarded as a linear fractional transformation.