03-11-2021, 08:55 AM
(This post was last modified: 03-11-2021, 09:35 AM by dale walton.
Edit Reason: To answer about getting rid of remember...
)
Please try to understand. What I did was intentional and correct. You can see my intent in the other bug report that uses (do) to solve the problem.
The (and .... ) choices should be closed before the (then ) consequences that it contains are handled to be consistent with the rest of the language.
However in the turn shown in the moves tab, we see moves occurring before the remember items have been completed.
If slide is smart enough, I can get rid of the remembers, but I was getting partial slides, and I need the 5 locations (triangle and two locations in front of it with any player's pieces, to move as a block. Is that what slide does?
In any case, this just freezes on red dots for a while, then reverts to blue dots without doing anything
(define "Plow"
(move Select
(from Cell (sites Board Cell) if:("IsDozerLocation" (from)))
(to Cell (sites Around Cell (from) OffDiagonal))
(then
(and
{
("Shift" (difference ("DozerLocation" (last To)) ("DozerLocation" (last From))))
("Shift" (intersection ("DozerLocation" (last From)) ("DozerLocation" (last To))))
("Shift" (difference ("DozerLocation" (last From)) ("DozerLocation" (last To))))
}
))))
(define "DozerLocation" (sites Incident Vertex of:Cell at:(#1)))
(define "Shift"
(slide
(from Vertex #1)
(directions Cell from:(last From) to:(last To))
(between (exact 1))
))
-----------------------------------------------------------
Ideally the following should work and be enough:
(define "Plow"
(move Select
(from Cell (sites Board Cell) if:("IsDozerLocation" (from)))
(to Cell (sites Around Cell (from) OffDiagonal))
(then
("Shift" (union ("DozerLocation" (last To)) ("DozerLocation" (last From))))
)))
The (and .... ) choices should be closed before the (then ) consequences that it contains are handled to be consistent with the rest of the language.
However in the turn shown in the moves tab, we see moves occurring before the remember items have been completed.
If slide is smart enough, I can get rid of the remembers, but I was getting partial slides, and I need the 5 locations (triangle and two locations in front of it with any player's pieces, to move as a block. Is that what slide does?
In any case, this just freezes on red dots for a while, then reverts to blue dots without doing anything
(define "Plow"
(move Select
(from Cell (sites Board Cell) if:("IsDozerLocation" (from)))
(to Cell (sites Around Cell (from) OffDiagonal))
(then
(and
{
("Shift" (difference ("DozerLocation" (last To)) ("DozerLocation" (last From))))
("Shift" (intersection ("DozerLocation" (last From)) ("DozerLocation" (last To))))
("Shift" (difference ("DozerLocation" (last From)) ("DozerLocation" (last To))))
}
))))
(define "DozerLocation" (sites Incident Vertex of:Cell at:(#1)))
(define "Shift"
(slide
(from Vertex #1)
(directions Cell from:(last From) to:(last To))
(between (exact 1))
))
-----------------------------------------------------------
Ideally the following should work and be enough:
(define "Plow"
(move Select
(from Cell (sites Board Cell) if:("IsDozerLocation" (from)))
(to Cell (sites Around Cell (from) OffDiagonal))
(then
("Shift" (union ("DozerLocation" (last To)) ("DozerLocation" (last From))))
)))