= |@math| $last |@math| $op $value * = |@math| $op $value $last = |@math| $last |@math| $op * $value = |@math| $op $last $value = || set new pen color? |pen color| r $g $b |@math| $r = |pen color| $r $g $b = || set new pen color? |pen color| $r g $b |@math| $g = |pen color| $r $g $b = || set new pen color? |pen color|$r $g b |@math| $b = |pen color| $r $g $b = || set new pen color = = || next color |pen color| $r $g $b = |@math| random 50 255 |@math| random 50 255 |@math| random 100 255 || set new pen color |pen color| r g b = || jump |backtrack| $row $col = |matrix position| $row $col |@math| multiply $col 2 |@math| multiply $row 2 || jump pen x || jump pen y || next color = || jump |generate| = = || jump pen x |pen position| $oldx $y |@math| $x = |pen position| $x $y = || jump pen y |pen position| $x $oldy |@math| $y = |pen position| $x $y = || mark cell at |@math| $index = |@array| set cells $index seen = || mark cell at? |location| $row $col = |@math| multiply $row 128 |@math| add $col * = || find neighbors |location| $row $col = || get free cell downwards |col| downwards $col |@math| add $row 1 || get free cell rightwards |row| rightwards $row |@math| add $col 1 || get free cell upwards |col| upwards $col |@math| add $row -1 || get free cell leftwards |row| leftwards $row |@math| add $col -1 = || get free cell $dir |col| $dir $col |@math| -1 = = || get free cell $dir |col| $dir $col |@math| 128 = = || get free cell $dir |row| $dir $row |@math| -1 = = || get free cell $dir |row| $dir $row |@math| 128 = = || get free cell $dir |col| $dir $col |@math| $row = |@math| multiply $row 128 |@math| add $col * || is $dir cell free |location| $row $col = || get free cell $dir |row| $dir $row |@math| $col = |@math| multiply $row 128 |@math| add $col * || is $dir cell free |location| $row $col = || is downwards cell free |@array| cells $index |location| $row $col = |downwards cell| $row $col = || is rightwards cell free |@array| cells $index |location| $row $col = |rightwards cell| $row $col = || is upwards cell free |@array| cells $index |location| $row $col = |upwards cell| $row $col = || is leftwards cell free |@array| cells $index |location| $row $col = |leftwards cell| $row $col = || is $dir cell free |@array| cells $index $value |location| $row $col = = || is $dir cell free? |@math| $index = |@array| get cells $index = || go in direction |@math| 1 |upwards cell| $row $col = |matrix position| $row $col || mark cell at |location| $row $col || move up || move up || clear navigation state = || go in direction |@math| 2 |rightwards cell| $row $col = |matrix position| $row $col || mark cell at |location| $row $col || move right || move right || clear navigation state = || go in direction |@math| 3 |downwards cell| $row $col = |matrix position| $row $col || mark cell at |location| $row $col || move down || move down || clear navigation state = || go in direction |@math| 4 |leftwards cell| $row $col = |matrix position| $row $col || mark cell at |location| $row $col || move left || move left || clear navigation state = || go in direction? |@math| 1 |sweep|= |@math| 2 = || go in direction? |@math| 2 |sweep|= |@math| 3 = || go in direction? |@math| 3 |sweep|= |@math| 4 = || go in direction? |@math| 4 |sweep|= |@math| 1 = || go in direction |@math| $n = || clear navigation state || jump = || clear navigation state |upwards cell| $r $c = || push location to backtrack stack || clear navigation state = || clear navigation state |rightwards cell| $r $c = || push location to backtrack stack || clear navigation state = || clear navigation state |downwards cell| $r $c = || push location to backtrack stack || clear navigation state = || clear navigation state |leftwards cell| $r $c = || push location to backtrack stack || clear navigation state = || clear navigation state? |sweep| = = || clear navigation state? |location| $row $col = = || clear navigation state = = || push location to backtrack stack |location| $row $col = |backtrack| $row $col = || push location to backtrack stack = = || pick a random direction |matrix position| $row $col = |@math| random 1 5 || find neighbors |location| $row $col || go in direction |location| $row $col |sweep| |sweep| |sweep| = || update |generate|? = || pick a random direction == |@array| create cells 16384 |matrix position| 64 64 |screen resolution| 256 256 |pen position| 128 128 || pen brush pencil || pen down || pen color 255 64 128 |generate|