// 2011.07.06 # Doj

:noname  player-y! player-x! ;oninit_ S
:noname  ;init
:noname  
  food-generate 
  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 draw_# 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

lab 
################################################
#                                              #
#                                              #
#                                              #
#       S      a      b        c               #
#                                              #
#                                              #
#                                              #
#                                              #
#                                              #
#                                              #
#                                              #
#                                              #
#                                              #
#                                              #
#                                              #
#                                              #
#                                              #
#                                              #
#                                              #
#                                              #
#                                              #
#                                              #
#                                              #
#                                              #
#                                              #
#                                              #
#                                              #
#####################FFF########################
\lab
maze!
centrize
