08-20-2020, 05:00 PM
Can the connected chain include connectivity via the empty adjacent-to-occupied cells, but just not include them in the count, are they excluded from both connecting and being counted?
=============================
I am just learning myself, so this would need a real programmer to check and verify syntax and whether the approach is even possible... I hope I don't set you off on the wrong track, but it seems this last week the staff have got a lot of work , so I will try:
First of all, this looks hard, and is far from a good first project to learn the language. But that's the way I learn too.
A start would be to define "IsolatedCells" and "NumberFriendlyLOS" eg:
(define "IsolatedCells" (forEach (sites Empty) if:(not (sites Around NotEmpty)))
or
(define "IsolatedCells" (difference (sites Empty) (sites Around NotEmpty)))
I am not sure how to define "NumberFriendlyLOS"
Then in the move one would like to count liberties at the cells, but that would require asking the program to count at a location within "IsolatedCells" region, but the program only count "at": or "In:" but not both combined...
so I guess a work around could be not to define "IsolatedCells", but rather to add neutral pieces, on every turn, to the (sites Around NotEmpty) before moves are calculated then
the decision move would be...
(forEach Piece (move Add
(to (sites Empty)
if:(> (count (Liberties at:(to) Orthogonal))
("NumberFriendlyLOS")
)
)
)
and then remove all the neutral pieces after the decision move is made.
Every small syntax problem (eg don't add spaces after the ":" ) is going to throw the compiler, so you have a lot of work ahead, -- but I also am thinking it is great that this project exists, and good if we can try to support it by learning it and using it.
=============================
I am just learning myself, so this would need a real programmer to check and verify syntax and whether the approach is even possible... I hope I don't set you off on the wrong track, but it seems this last week the staff have got a lot of work , so I will try:
First of all, this looks hard, and is far from a good first project to learn the language. But that's the way I learn too.
A start would be to define "IsolatedCells" and "NumberFriendlyLOS" eg:
(define "IsolatedCells" (forEach (sites Empty) if:(not (sites Around NotEmpty)))
or
(define "IsolatedCells" (difference (sites Empty) (sites Around NotEmpty)))
I am not sure how to define "NumberFriendlyLOS"
Then in the move one would like to count liberties at the cells, but that would require asking the program to count at a location within "IsolatedCells" region, but the program only count "at": or "In:" but not both combined...
so I guess a work around could be not to define "IsolatedCells", but rather to add neutral pieces, on every turn, to the (sites Around NotEmpty) before moves are calculated then
the decision move would be...
(forEach Piece (move Add
(to (sites Empty)
if:(> (count (Liberties at:(to) Orthogonal))
("NumberFriendlyLOS")
)
)
)
and then remove all the neutral pieces after the decision move is made.
Every small syntax problem (eg don't add spaces after the ":" ) is going to throw the compiler, so you have a lot of work ahead, -- but I also am thinking it is great that this project exists, and good if we can try to support it by learning it and using it.