Handbook
Glossary
move-snake ( snake dir -- snake )
Vocabulary
snake-game
.
game
Inputs
snake
an
object
dir
an
object
Outputs
snake
an
object
Definition
USING:
accessors
kernel
sequences
;
IN:
snake-game.game
:
move-snake
( snake dir -- snake )
[
dup
but-last
[
dir>>
]
map
]
dip
opposite-dir
prefix
[
>>dir
]
2map
;