generate-sprite-sheet ( image rows cols -- seq )


Vocabulary
snake-game.sprites

Inputs
imagean object
rowsan object
colsan object


Outputs
seqan object


Definition


:: 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 ;