Handbook
Glossary
generate-food ( snake-game -- snake-game )
Vocabulary
snake-game
.
game
Inputs
snake-game
an
object
Outputs
snake-game
an
object
Definition
USING:
accessors
kernel
random
;
IN:
snake-game.game
:
generate-food
( snake-game -- snake-game )
dup
[
snake>>
]
[
snake-loc>>
]
bi
snake-unoccupied-indices
random
index>game-loc
>>food-loc
;