Handbook
Glossary
generate-sprite-sheet ( image rows cols -- seq )
Vocabulary
snake-game
.
sprites
Inputs
image
an
object
rows
an
object
cols
an
object
Outputs
seq
an
object
Definition
USING:
accessors
arrays
kernel
math
math.vectors
sequences
;
IN:
snake-game.sprites
::
generate-sprite-sheet
( image rows cols -- seq )
cols rows
2array
:>
split-dims image
dim>>
split-dims
[
/
]
2map
first2
:>
( sw sh ) rows
<iota>
sh
v*n
:>
ys cols
<iota>
sh
v*n
:>
xs ys xs
[
swap
[
image
]
2dip
sw sh
image-part
]
cartesian-map
f
join
;