// 2011.07.06 # Doj

  :noname  player-y! player-x! ;oninit_ S

variable *super-food-x
variable *super-food-y
:noname  COLOR 2dup PURPLES GEN[]2 ^ set-color 
         30 size->global draw-sized-cell ; draw_ .
:noname  2dup passed 
         2dup COLOR PURPLES GEN[]2 ^ true 30 snake+ 
         32 rrot maze[]! 
         pchar" data\sounds\super.wav" sound
         food- ate+ ; enter_ .
:noname  ;init

:noname  
  food-generate 
  1000 random 0= if 46 *super-food-x @ *super-food-y @ maze[]! then
  200 snake# 3 * - *MIN_STEP_DELTA !
;after-update

24 constant FOOD_SIZE

: draw_#  COLOR 2dup ÒÐÀÂÀ GEN[]2 ( ÒÐÀÂßÍÎÉ-ÇÅË¨ÍÛÉ) ^ set-color draw-cell-rect ;
:noname  draw_# ;draw_ #

30 constant exit-length
:noname  snake# exit-length > if 2drop 
         else COLOR 2dup BROWNS GEN[]2 ^ set-color draw-cell-rect then ;draw_ F
:noname  snake# exit-length > if [ *prev @ ] literal next else stopped then ;enter_ F

:noname  COLOR 2dup BROWNS GEN[]2 ^ set-color 
         FOOD_SIZE size->global draw-sized-cell ;
draw_food

:noname  2dup passed 
         2dup COLOR BROWNS GEN[]2 ^ true FOOD_SIZE snake+ 
         32 rrot maze[]! 
         food- ate+
         pchar" data\sounds\eat.wav" sound
; enter_food

:noname  *super-food-y ! *super-food-x ! ; oninit_ s

variable *2x
variable *2y
variable *4x
variable *4y
variable *6x
variable *6y
variable *8x
variable *8y

:noname  *2y ! *2x ! ; oninit_ 2
:noname  *4y ! *4x ! ; oninit_ 4
:noname  *6y ! *6x ! ; oninit_ 6
:noname  *8y ! *8x ! ; oninit_ 8

:noname  2drop *2x @ *2y @ teleport ; enter_ 1
:noname  2drop *4x @ *4y @ teleport ; enter_ 3
:noname  2drop *6x @ *6y @ teleport ; enter_ 5
:noname  2drop *8x @ *8y @ teleport ; enter_ 7

:noname  COLOR ÖÈÀÍ ^ set-color draw-cell-rect ; 
dup draw_ 1
dup draw_ 3
dup draw_ 5
dup draw_ 7
drop

lab 
################NNNNN################
#              #NNNNN#              #
#              #NNNNN#              #
#              #NNNNN#              #
#              #NNNNN#              #
#       8      #NNNNN#     6        #
#   Sabc       #NNNNN#              #
#              #NNNNN#              #
#              #NNNNN#              #
#              #NNNNN#              #
#              #NNNNN#              #
#       1      #NNNNN#     7        #
#              #NNNNN#              #
#              #NNNNN#              #
#              #NNNNN#              #
################NNNNN################
NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
NNNN$$$$$$$$$$$$NNNNN$$$$$$$$$$$$NNNN
NNNN$          $NNNNN$          $NNNN
NNNN$          $NNNNN$          $NNNN
NNNN$    4     $NNNNN$     2    $NNNN
NNNN$          $NNNNN$          $NNNN
NNNN$          $NNNNN$          $NNNN
NNNN$    s     $NNNNN$          $NNNN
NNNN$    5     $NNNNN$     3    $NNNN
NNNN$          $NNNNN$          $NNNN
NNNN$          $NNNNN$          $NNNN
NNNN$          $NNNNN$          $NNNN
NNNN$$$$$$$$$$$$NNNNN$$$$$FF$$$$$NNNN
\lab
maze!
  : draw_# COLOR 2dup PURPLES GEN[]2 ^ set-color draw-cell-rect ;
  :noname  draw_# ;draw_ #
  :noname  COLOR 2dup BROWNS GEN[]2 ^ set-color draw-cell-rect ;draw_ $
  :noname  stopped ;enter_ $
  centrize
