08-31-2022, 09:09 AM
(08-26-2022, 05:20 PM)Michael Wrote: In light of what I have now learned about (do next:), this needs to be
or something functionally equivalent.Code:(do
(remove (sites Outer) count:(size Stack at:(last To)))
next:("UpdateKing")
(pass)
)
Sorry for the confusion. That didn't make sense. What I meant is that ("UpdateKing") needs to be like this:
Code:
(define "UpdateKing"
(if
(= 1
(count Sites
in:(forEach
(sites Occupied by:Mover)
if:(=
(size Stack at:(site))
(max
(results
from:(sites Occupied by:Mover)
to:0
(size Stack at:(from))
)
)
)
)
)
)
(forEach Piece
(if
(=
(size Stack at:(from))
(max
(results
from:(sites Occupied by:Mover)
to:0
(size Stack at:(from))
)
)
)
(set State at:(from) 1)
(set State at:(from) 0)
)
Mover
top:True
)
(pass) //THIS IS NEW
)
)