Handbook
Glossary
move-loc ( loc dir -- loc )
Vocabulary
snake-game
.
game
Inputs
loc
an
object
dir
an
object
Outputs
loc
an
object
Definition
USING:
assocs
math.vectors
sequences
;
IN:
snake-game.game
:
move-loc
( loc dir -- loc )
H{
{
:up
{
0 -1
}
}
{
:down
{
0 1
}
}
{
:right
{
1 0
}
}
{
:left
{
-1 0
}
}
}
at
v+
snake-game-dim
[
?roll-over
]
2map
;