Projects

Four Squares

To play this game, decompose the number shown into a sum of 4 squares.

Example: if the number shown is 2313 = 452 + 122 + 122 + 02, you may enter 451212.

Try to solve 30 as fast as possible. My fastest time is 208.83 seconds.

You can also use your keyboard (0..9, backspace, s).

Lagrange proved that there is at least 1 way to decompose any positive integer.

A common technique is to subtract the largest possible square from the number such that the remaining 3 squares add up to something ≠ 3 (mod 4).

Example: 1451 should be subtracted by 372. 1451 - 372 = 82 = 92 + 12.

Epicycles

Click on the canvas in different places a few times

Press d(raw) and see what happens

Editing points:

click: add a point

space: delete the last added point

d: start the epicycle animation

c and v: cycle through the points. c makes the oldest point the newest and v does the opposite

p, then o, then i: delete all points. It takes 3 key presses so you don't accidentally delete everything

Drawing animation:

r: stop the animation and return to editing points

space: pause/play the animation

a: increase the number of epicycles (by 2) and restarts the drawing

s: decrease the number of epicycles (by 2) and restarts the drawing

b: toggles the blue circles

g: toggles the green lines

f: toggles the white trace