02-23-2023, 08:19 PM
(This post was last modified: 02-23-2023, 08:20 PM by AlexanderBrady.)
I am trying to create a code where piece A can jump a line of pieces of types A, B, or C, but only if at least one C is present in the line. Is this possible?
Here is the code I have written, but it only allows A to jump if all pieces in the line are C.
Here is the code I have written, but it only allows A to jump if all pieces in the line are C.
Code:
(move Hop
(between
(max (count Rows))
if:(and (or {
(is Empty (between))
("IsPieceAt" "Soldier" Mover (between))
("IsPieceAt" "Shooter" Mover (between))
("IsPieceAt" "Base" Mover (between))
} )
(>= (count Pieces Mover if:("IsPieceAt" "Base" Mover (between))) 1)
)
)
(to if:(is Empty (to)))
(then (promote (last To) (piece "Shooter") Mover))
)