08-11-2020, 11:54 AM
I have posted the game Trike.lud to the "upload new games" subforum, but there is a really strange bug where if P2 decides to invoke the swap rule, they automatically lose. I tried to circumvent this with an "(and" to check if it is not the first turn before triggering endgame, but the problem I suspect is that there are no LinesOfSight coming from a Swap. Is there a way to make "last To" not include Swap, or if it doesn't, a way to tell the computer that Swap is actually a Move, so it shouldn't trigger endgame. Here is my attempt to fix this , but it didn't work.
(game "Trike"
(players 2)
(equipment
{
(board (hex triangle <Board>))
(piece "Ball" Each)
}
)
(rules
(meta (swap))
(play
(if (= (count Moves) 0)
(move Add (to (sites Empty)))
(move Add (to (sites LineOfSight Empty at:(last To)))
(then
(if
(and
(!= (count Turns) 2)
(= (count Sites in:(sites LineOfSight Empty at:(last To))) 0)
)
(addScore Mover 1)
)
)
)
)
)
(end
(if
(and
(= (count Sites in:(sites LineOfSight Empty at:(last To))) 0)
(!= (count Turns) 2)
)
(byScore
{
(score P1 (+ (score P1) ("Nbors" (last To) P1)))
(score P2 (+ (score P2) ("Nbors" (last To) P2)))
}
)
)
)
)
)
(game "Trike"
(players 2)
(equipment
{
(board (hex triangle <Board>))
(piece "Ball" Each)
}
)
(rules
(meta (swap))
(play
(if (= (count Moves) 0)
(move Add (to (sites Empty)))
(move Add (to (sites LineOfSight Empty at:(last To)))
(then
(if
(and
(!= (count Turns) 2)
(= (count Sites in:(sites LineOfSight Empty at:(last To))) 0)
)
(addScore Mover 1)
)
)
)
)
)
(end
(if
(and
(= (count Sites in:(sites LineOfSight Empty at:(last To))) 0)
(!= (count Turns) 2)
)
(byScore
{
(score P1 (+ (score P1) ("Nbors" (last To) P1)))
(score P2 (+ (score P2) ("Nbors" (last To) P2)))
}
)
)
)
)
)