Handbook
Glossary
update-location ( board loc flowcell-object -- )
Vocabulary
gamelib
.
demos
.
flow-demo
Inputs
board
an
object
loc
an
object
flowcell-object
an
object
Outputs
None
Definition
USING:
accessors
gamelib.board
gamelib.cell-object
kernel
math
;
IN:
gamelib.demos.flow-demo
::
update-location
( board loc flowcell-object -- )
flowcell-object
flow-on?
[
flowcell-object
flow>>
:>
flow-obj flow-obj
target>>
:>
target flow-obj
counter>>
1
+
:>
counter counter target
=
[
flow-obj
direction>>
:>
direction board loc
direction flowcell-object
move-object
drop
flow-obj 0
>>counter
drop
]
[
flow-obj counter
>>counter
drop
]
if
flowcell-object flow-obj
>>flow
drop
]
when
;