06-16-2021, 07:43 AM
(This post was last modified: 06-17-2021, 03:46 AM by dale walton.
Edit Reason: I solved one of the problems with a work around, which should help in identifying that bug.
)
In this version, I commented out the Diagonal connections for testing overall, and ran into strange behavior of being able to select sites that are occupied by balls. I changed the remove to specifically remove only as many connection pieces at a site as needed to enable placement, but the problem of allowing selection of the ball-occupied sites still exists. See trial.
------------------------------------------------------
For this case changing:
(= 2 (count Pieces #1 "Ball" in:(intersection (sites Around Cell (from)) (sites Around Cell (to)))))
to
Work-around:
(= 2
(count Sites Cell
in:(intersection
{
(sites occupied by:#1 component:"Ball" on:Cell)
(sites Around Cell (from))
(sites Around Cell (to))
}
)))
Worked,
--> so the bug appears to be that "Ball" in (count Pieces #1 "Ball" is not being processed.
-------------------------------------------------------------------
Also please confirm that the bug concerning the use of the wrong index in the following (currently commented out code) is the bug that was already fixed for N-Meshed, as the fix is not yet released:
i.e in:
(add
(piece (id "I" Mover))
(to Edge ("HalfWayEdge" (last To) (value)))
)
or in
(define "SharedCells" (intersection (sites Around Cell #1 Orthogonal) (sites Around Cell #2 Orthogonal)))
(define "HalfWayEdge"
(min (intersection
(array (sites Incident Edge of:Cell at:(regionSite ("SharedCells" #1 #2) index:0)))
(array (sites Incident Edge of:Cell at:(regionSite ("SharedCells" #1 #2) index:1)))
))
(I also had compile problems when trying with out the array conversions, when passing a (value) parameter, and other problems when passing a (site) parameter, which is why the strange construction) - but the construct is working except for the location on the screen.
(i.e. the pieces end up on the wrong edges, or if the Cell locations are to big, the Edge locations between them are bigger than the range of CELL (instead of EDGE) locations causing out-of-range errors.)
------------------------------------------------------
For this case changing:
(= 2 (count Pieces #1 "Ball" in:(intersection (sites Around Cell (from)) (sites Around Cell (to)))))
to
Work-around:
(= 2
(count Sites Cell
in:(intersection
{
(sites occupied by:#1 component:"Ball" on:Cell)
(sites Around Cell (from))
(sites Around Cell (to))
}
)))
Worked,
--> so the bug appears to be that "Ball" in (count Pieces #1 "Ball" is not being processed.
-------------------------------------------------------------------
Also please confirm that the bug concerning the use of the wrong index in the following (currently commented out code) is the bug that was already fixed for N-Meshed, as the fix is not yet released:
i.e in:
(add
(piece (id "I" Mover))
(to Edge ("HalfWayEdge" (last To) (value)))
)
or in
(define "SharedCells" (intersection (sites Around Cell #1 Orthogonal) (sites Around Cell #2 Orthogonal)))
(define "HalfWayEdge"
(min (intersection
(array (sites Incident Edge of:Cell at:(regionSite ("SharedCells" #1 #2) index:0)))
(array (sites Incident Edge of:Cell at:(regionSite ("SharedCells" #1 #2) index:1)))
))
(I also had compile problems when trying with out the array conversions, when passing a (value) parameter, and other problems when passing a (site) parameter, which is why the strange construction) - but the construct is working except for the location on the screen.
(i.e. the pieces end up on the wrong edges, or if the Cell locations are to big, the Edge locations between them are bigger than the range of CELL (instead of EDGE) locations causing out-of-range errors.)