\ reversi-turn 17/12/98 10:30 am vassilii \ Turn context and manipulation variable turn variable black-stones variable white-stones variable last-lin variable last-col : last2! ( col lin -- ) last-lin ! last-col ! ; : field-erase field [ side dup * board-cells 0 ] 2literal fill ; : 2x2 \ Reset to the init. position field-erase white 3 3 field! black 3 4 field! black 4 3 field! white 4 4 field! black turn ! -1. last2! \ invalidate last move \ (see further mark-last) 2 black-stones ! 2 white-stones ! ; : mark-last \ Draw a cross on last cell last-lin @ dup 0< if drop \ no moves yet else cell-width * last-col @ cell-width * ( y0 x0 ) 2dup [ cell-width 2 / ] literal + over cell-width + over invert-line >r [ cell-width 2 / ] literal + r> 2dup cell-width + invert-line then ;