*

\ memory 5 saves the index of working frame
0 5 ! : i 5 @ dup 1 + 5 ! ;
: n 4 ; \ n by n frames are shown
: /mod ( i n -- ir iq ) 2dup / floor push mod floor pop ;
\ paste pic at next frame on pic0 as pic1
: | ( pic0 pic -- pic1 ) i n /mod n 1 - swap -
y n * floor = swap ( pic0 pic iq=iy ir )
x n * floor = and ( pic0 pic iq=iy&ir=ix ) * + ;
: x x n * 1 mod ; : y y n * 1 mod ; 0
: x' x .5 - ; : y' y .5 - ;
0 | 1 | .8 | pi 10 / |
x | y | x y + | x y - |
x y * | x y / | x' | y' |
x' y' + | x' y' - | x' y' * | x' y' / |

comments powered by Disqus