02-03-2021, 01:16 AM
(This post was last modified: 02-03-2021, 01:30 AM by dale walton.)
Actually this code is working Except...
(define "DozerLocation"
(= 3 (count Pieces Mover in:(sites Incident Cell of:Vertex at:#1)))
)
(define "Plow"
(move Select
(from (forEach (sites Board Vertex) if:("DozerLocation" (site))))
(to (sites Distance Vertex Adjacent from:(from) 2))
(then
(and
(forEach
Site
(sites Incident Cell of:Vertex at:(last From))
(remove (site))
)
(forEach
Site
(sites Incident Cell of:Vertex at:(last To))
(add (to (site)))
)))))
The player doesn't auto-detect that the selection dots should show on vertices. If the (move Select... ludeme had a Vertex argument, this could easily be resolved.
The code above is for a game played on the cells of a Hex board. The selects, as written obviously show up on cells far from where I intend, but the code works in moving a triplet from one place to another. - all that is missing is to have the selection dots show on the vertices.
Checking corresponding cells for occupancy could still be an issue - I am thinking about how to do it.
(define "DozerLocation"
(= 3 (count Pieces Mover in:(sites Incident Cell of:Vertex at:#1)))
)
(define "Plow"
(move Select
(from (forEach (sites Board Vertex) if:("DozerLocation" (site))))
(to (sites Distance Vertex Adjacent from:(from) 2))
(then
(and
(forEach
Site
(sites Incident Cell of:Vertex at:(last From))
(remove (site))
)
(forEach
Site
(sites Incident Cell of:Vertex at:(last To))
(add (to (site)))
)))))
The player doesn't auto-detect that the selection dots should show on vertices. If the (move Select... ludeme had a Vertex argument, this could easily be resolved.
The code above is for a game played on the cells of a Hex board. The selects, as written obviously show up on cells far from where I intend, but the code works in moving a triplet from one place to another. - all that is missing is to have the selection dots show on the vertices.
Checking corresponding cells for occupancy could still be an issue - I am thinking about how to do it.