11-28-2020, 02:07 AM
Can you give me more examples than Xanan Zirge for identifying whether pieces are in the crosscut?
I need to make it so that only pieces inside the crosscut can be swapped. For instance - the commented line - how would I incorporate such a condition (swaps must resolve a cut) in a way that works?
(define "IsNotCut" (not (is Pattern {F R F R F} whats:{(mover) (next)})))
(game "Test"
(players 2)
(equipment {(board (square 8))
(piece "Ball" Each
(forEach Site
(sites Around (from)
if:(is Enemy (who at:(to)))
)
(move Swap Pieces (from) (site))
)
)
(regions P1 { (sites Side N) (sites Side S) } )
(regions P2 { (sites Side W) (sites Side E) } )
})
(rules
(start {(place "Ball1" (sites {56 58 60 62 49 51 53 55 40 42 44 46 33 35 37 39 24 26 28 30 17 19 21 23 8 10 12 14 1 3 5 7} )) (place "Ball2" (sites {0 2 4 6 9 11 13 15 16 18 20 22 25 27 29 31 32 34 36 38 41 43 45 47 48 50 52 54 57 59 61 63}))} )
(play
(forEach Piece)
// ifAfterwards:"IsNotCut"
)
(end {(if (is Connected Orthogonal Mover) (result Mover Win))})
)
)
I need to make it so that only pieces inside the crosscut can be swapped. For instance - the commented line - how would I incorporate such a condition (swaps must resolve a cut) in a way that works?
(define "IsNotCut" (not (is Pattern {F R F R F} whats:{(mover) (next)})))
(game "Test"
(players 2)
(equipment {(board (square 8))
(piece "Ball" Each
(forEach Site
(sites Around (from)
if:(is Enemy (who at:(to)))
)
(move Swap Pieces (from) (site))
)
)
(regions P1 { (sites Side N) (sites Side S) } )
(regions P2 { (sites Side W) (sites Side E) } )
})
(rules
(start {(place "Ball1" (sites {56 58 60 62 49 51 53 55 40 42 44 46 33 35 37 39 24 26 28 30 17 19 21 23 8 10 12 14 1 3 5 7} )) (place "Ball2" (sites {0 2 4 6 9 11 13 15 16 18 20 22 25 27 29 31 32 34 36 38 41 43 45 47 48 50 52 54 57 59 61 63}))} )
(play
(forEach Piece)
// ifAfterwards:"IsNotCut"
)
(end {(if (is Connected Orthogonal Mover) (result Mover Win))})
)
)