decimal : >fix ( n --- n<<4 ) 2* 2* 2* 2* ; : fix> ( n<<4 --- n ) 2/ 2/ 2/ 2/ ; variable qx1 variable qy1 variable qx2 variable qy2 variable qx1v variable qy1v variable qx2v variable qy2v variable qvel 120 qvel ! : rnd_vel ( --- vel ) qvel @ rnd 1+ ; : rnd_sign ( n --- +-n ) 2 rnd if negate then ; : qinit fb_width >fix rnd qx1 ! fb_height >fix rnd qy1 ! fb_width >fix rnd qx2 ! fb_height >fix rnd qy2 ! rnd_vel rnd_sign qx1v ! rnd_vel rnd_sign qy1v ! rnd_vel rnd_sign qx2v ! rnd_vel rnd_sign qy2v ! ; : qmove ( max >vel >coord --- ) >r \ max >vel r: >coord dup @ r@ +! swap >fix \ >vel max r@ @ 0< if 0 r@ ! rnd_vel 2 pick ! then dup r@ @ <= if dup 1- r@ ! rnd_vel negate 2 pick ! then r> drop 2drop ; variable qix-trace : qix qinit begin fb_width qx1v qx1 qmove fb_height qy1v qy1 qmove fb_width qx2v qx2 qmove fb_height qy2v qy2 qmove qx1 @ fix> qy1 @ fix> qx2 @ fix> qy2 @ fix> line 1 color +! again ;