Handbook
Glossary
location-matrix ( board -- loclist )
Vocabulary
gamelib
.
board
Inputs
board
an
object
Outputs
loclist
an
object
Definition
USING:
accessors
assocs
ranges
sequences
;
IN:
gamelib.board
::
location-matrix
( board -- loclist )
board
width>>
:>
w board
height>>
:>
h w
[0..b)
:>
single-row h
[0..b)
:>
single-col h
[
single-row
]
replicate
concat
:>
x-vals h
[
w
]
replicate
:>
w-list w-list single-col
[
make-n-k
]
2map
concat
:>
y-vals x-vals y-vals
zip
;