diff --git a/projects/examples/demos/snake.tal b/projects/examples/demos/snake.tal index e3e383e..697ae6f 100644 --- a/projects/examples/demos/snake.tal +++ b/projects/examples/demos/snake.tal @@ -96,7 +96,7 @@ INC GTHk ?&>loop-body POP2 &end JMP2r -@set-pos ( z mod -- ) +@set-pos ( z mod max -- ) LDZ OVR INC ?{ ROT STZ POP JMP2r } DIVk MUL SUB SWP STZ diff --git a/projects/examples/exercises/tak.tal b/projects/examples/exercises/tak.tal new file mode 100644 index 0000000..6a903f3 --- /dev/null +++ b/projects/examples/exercises/tak.tal @@ -0,0 +1,12 @@ +@on-reset ( -> ) + #0b #14 #18 tak + #010e DEO + BRK + +@tak ( z y x -- res ) + LTHk ?{ POP2 JMP2r } + ROT ROTk ROTk + ( x-1 ) #01 SUB tak STH + ( y-1 ) #01 SUB tak STH + ( z-1 ) #01 SUB tak STHr STHr !tak +