From a512c1dc2753a6e8eb5a448d7d8ac66296afa454 Mon Sep 17 00:00:00 2001 From: ericp Date: Tue, 29 Oct 2024 11:25:08 +0100 Subject: [PATCH] Sparro added --- Common/res/lud/board/space/line/Sparro.lud | 164 ++++++++++++++++++ .../replacement/eliminate/target/Vanguard.lud | 4 +- .../board/space/line/Sparro/RandomTrial_0.txt | 65 +++++++ .../board/space/line/Sparro/RandomTrial_1.txt | 65 +++++++ 4 files changed, 296 insertions(+), 2 deletions(-) create mode 100644 Common/res/lud/board/space/line/Sparro.lud create mode 100644 Player/res/random_trials/board/space/line/Sparro/RandomTrial_0.txt create mode 100644 Player/res/random_trials/board/space/line/Sparro/RandomTrial_1.txt diff --git a/Common/res/lud/board/space/line/Sparro.lud b/Common/res/lud/board/space/line/Sparro.lud new file mode 100644 index 0000000000..40d9a6d8e5 --- /dev/null +++ b/Common/res/lud/board/space/line/Sparro.lud @@ -0,0 +1,164 @@ +(game "Sparro" + (players 2) + (equipment { + (board (square 4 pyramidal:True) use:Vertex) + (piece "Ball" Each) + (piece "Ball" Neutral) + (hand Each) + }) + + (rules + (start { + (place "Ball0" {8 10 14 18 20}) + (place "Ball" "Hand" count:12) + }) + + (play + (if + (= (size Array (array (sites Occupied by:All))) 6) + (if + (is In (last To) (sites Corners)) + (move + (from (handSite Mover)) + (to + (intersection (difference (sites Perimeter) (sites Corners))(sites Empty)) + if:(is Flat) + ) + ) + (move + (from (handSite Mover)) + (to + (intersection (sites Corners) (sites Empty)) + if:(is Flat) + ) + ) + ) + (move + (from (handSite Mover)) + (to + (sites Empty) + if:(is Flat) + ) + (then //not working, have to change it (take into account one ball possibly making 2 lines and lines not being made of ups and downs) + (if + (and {(is Line 3 DSW through:(last To) Mover useOpposites:False) (is Line 3 DNE through:(last To) Mover useOpposites:False) (or (is Line 3 DSE through:(last To) Mover useOpposites:False) (is Line 3 DNW through:(last To) Mover useOpposites:False))}) + (and { + (addScore Mover 3) + (forget Value "LastScored" All) + (remember Value "LastScored" (mover)) + }) + (if + (and {(is Line 3 DNW through:(last To) Mover useOpposites:False) (is Line 3 DSE through:(last To) Mover useOpposites:False) (or (is Line 3 DNE through:(last To) Mover useOpposites:False) (is Line 3 DSW through:(last To) Mover useOpposites:False))}) + (and { + (addScore Mover 3) + (forget Value "LastScored" All) + (remember Value "LastScored" (mover)) + }) + (if + (and (is Line 3 DNW through:(last To) Mover useOpposites:False) (or {(is Line 3 DNE through:(last To) Mover useOpposites:False) (is Line 3 DSW through:(last To) Mover useOpposites:False) (is Line 3 DSE through:(last To) Mover useOpposites:False)})) + (and { + (addScore Mover 2) + (forget Value "LastScored" All) + (remember Value "LastScored" (mover)) + }) + (if + (and (is Line 3 DNE through:(last To) Mover useOpposites:False) (or (is Line 3 DSW through:(last To) Mover useOpposites:False) (is Line 3 DSE through:(last To) Mover useOpposites:False))) + (and { + (addScore Mover 2) + (forget Value "LastScored" All) + (remember Value "LastScored" (mover)) + }) + (if + (and (is Line 3 DSW through:(last To) Mover useOpposites:False) (is Line 3 DSE through:(last To) Mover useOpposites:False)) + (and { + (addScore Mover 2) + (forget Value "LastScored" All) + (remember Value "LastScored" (mover)) + }) + (if + (and (is Line 3 N through:(last To) Mover useOpposites:False) (or (is Line 3 W through:(last To) Mover useOpposites:False) (is Line 3 E through:(last To) Mover useOpposites:False))) + (and { + (addScore Mover 2) + (forget Value "LastScored" All) + (remember Value "LastScored" (mover)) + }) + (if + (and (is Line 3 S through:(last To) Mover useOpposites:False) (or (is Line 3 W through:(last To) Mover useOpposites:False) (is Line 3 E through:(last To) Mover useOpposites:False))) + (and { + (addScore Mover 2) + (forget Value "LastScored" All) + (remember Value "LastScored" (mover)) + }) + (if + (and (is Line 4 SameLayer through:(last To) Mover) (not ((is Line 4 SameLayer through:(last To) Mover useOpposites:False)))) + (and { + (addScore Mover 2) + (forget Value "LastScored" All) + (remember Value "LastScored" (mover)) + }) + (if + (or {(is Line 3 SameLayer through:(last To) Mover) (is Line 3 DNW through:(last To) Mover useOpposites:False) (is Line 3 DNE through:(last To) Mover useOpposites:False) (is Line 3 DSE through:(last To) Mover useOpposites:False) (is Line 3 DSW through:(last To) Mover useOpposites:False)}) + (and { + (addScore Mover 1) + (forget Value "LastScored" All) + (remember Value "LastScored" (mover)) + }) + (addScore Mover 0) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + + (end { + (if + (and (= (count Pieces in:(sites Occupied by:All container:"Board")) 29) (> (score Next) (score Mover))) + (result Next Win) + ) + (if + (and (= (count Pieces in:(sites Occupied by:All container:"Board")) 29) (< (score Next) (score Mover))) + (result Mover Win) + ) + (if + (and {(= (count Pieces in:(sites Occupied by:All container:"Board")) 29) (= (score Next) (score Mover)) (= (arrayValue (values Remembered "LastScored") index:0) 1)}) + (result P1 Win) + ) + (if + (and {(= (count Pieces in:(sites Occupied by:All container:"Board")) 29) (= (score Next) (score Mover)) (= (arrayValue (values Remembered "LastScored") index:0) 2)}) + (result P2 Win) + ) + (if + (and {(= (count Pieces in:(sites Occupied by:All container:"Board")) 29) (= (score Next) (score Mover))}) + (result P2 Win) + ) + }) + ) +) + +//------------------------------------------------------------------------------ + +(metadata + + (info + { + } + ) + + (graphics { + (piece Scale "Ball" 1.0) + (board Style Shibumi) + (piece Colour Neutral fillColour:(colour Red)) + (piece Colour P1 fillColour:(colour White)) + (piece Colour P2 fillColour:(colour Black)) + (show Score) + }) + +) diff --git a/Common/res/lud/board/war/replacement/eliminate/target/Vanguard.lud b/Common/res/lud/board/war/replacement/eliminate/target/Vanguard.lud index ee29925556..598e30eee1 100644 --- a/Common/res/lud/board/war/replacement/eliminate/target/Vanguard.lud +++ b/Common/res/lud/board/war/replacement/eliminate/target/Vanguard.lud @@ -178,7 +178,7 @@ (metadata (info { - - } + + } ) ) diff --git a/Player/res/random_trials/board/space/line/Sparro/RandomTrial_0.txt b/Player/res/random_trials/board/space/line/Sparro/RandomTrial_0.txt new file mode 100644 index 0000000000..f879beabe6 --- /dev/null +++ b/Player/res/random_trials/board/space/line/Sparro/RandomTrial_0.txt @@ -0,0 +1,65 @@ +game=../Common/res/lud/board/space/line/Sparro.lud +START GAME OPTIONS +END GAME OPTIONS +RNG internal state=65,-69,-127,-50,-55,-117,-29,43 +Move=[Move:mover=0,from=8,to=8,actions=[Add:type=Vertex,to=8,what=3]] +Move=[Move:mover=0,from=10,to=10,actions=[Add:type=Vertex,to=10,what=3]] +Move=[Move:mover=0,from=14,to=14,actions=[Add:type=Vertex,to=14,what=3]] +Move=[Move:mover=0,from=18,to=18,actions=[Add:type=Vertex,to=18,what=3]] +Move=[Move:mover=0,from=20,to=20,actions=[Add:type=Vertex,to=20,what=3]] +Move=[Move:mover=0,from=30,to=30,actions=[Add:type=Cell,to=30,what=1,count=12]] +Move=[Move:mover=0,from=31,to=31,actions=[Add:type=Cell,to=31,what=2,count=12]] +Move=[Move:mover=1,from=30,to=7,actions=[Move:typeFrom=Cell,from=30,typeTo=Vertex,to=7,decision=true],[SetScore:player=1,score=0,add=true]] +Move=[Move:mover=2,from=31,to=26,actions=[Move:typeFrom=Cell,from=31,typeTo=Vertex,to=26,decision=true]] +Move=[Move:mover=1,from=30,to=0,actions=[Move:typeFrom=Cell,from=30,typeTo=Vertex,to=0,decision=true],[SetScore:player=1,score=0,add=true]] +Move=[Move:mover=2,from=31,to=22,actions=[Move:typeFrom=Cell,from=31,typeTo=Vertex,to=22,decision=true],[SetScore:player=2,score=0,add=true]] +Move=[Move:mover=1,from=30,to=3,actions=[Move:typeFrom=Cell,from=30,typeTo=Vertex,to=3,decision=true],[SetScore:player=1,score=0,add=true]] +Move=[Move:mover=2,from=31,to=27,actions=[Move:typeFrom=Cell,from=31,typeTo=Vertex,to=27,decision=true],[SetScore:player=2,score=0,add=true]] +Move=[Move:mover=1,from=30,to=2,actions=[Move:typeFrom=Cell,from=30,typeTo=Vertex,to=2,decision=true],[SetScore:player=1,score=0,add=true]] +Move=[Move:mover=2,from=31,to=29,actions=[Move:typeFrom=Cell,from=31,typeTo=Vertex,to=29,decision=true],[SetScore:player=2,score=0,add=true]] +Move=[Move:mover=1,from=30,to=28,actions=[Move:typeFrom=Cell,from=30,typeTo=Vertex,to=28,decision=true],[SetScore:player=1,score=0,add=true]] +Move=[Move:mover=2,from=31,to=12,actions=[Move:typeFrom=Cell,from=31,typeTo=Vertex,to=12,decision=true],[SetScore:player=2,score=1,add=true],[RememberValue:name=LastScored,value=2]] +Move=[Move:mover=1,from=30,to=24,actions=[Move:typeFrom=Cell,from=30,typeTo=Vertex,to=24,decision=true],[SetScore:player=1,score=0,add=true]] +Move=[Move:mover=2,from=31,to=25,actions=[Move:typeFrom=Cell,from=31,typeTo=Vertex,to=25,decision=true],[SetScore:player=2,score=0,add=true]] +Move=[Move:mover=1,from=30,to=17,actions=[Move:typeFrom=Cell,from=30,typeTo=Vertex,to=17,decision=true],[SetScore:player=1,score=1,add=true],[ForgetValue:name=LastScored,value=2],[RememberValue:name=LastScored,value=1]] +Move=[Move:mover=2,from=31,to=13,actions=[Move:typeFrom=Cell,from=31,typeTo=Vertex,to=13,decision=true],[SetScore:player=2,score=0,add=true]] +Move=[Move:mover=1,from=30,to=1,actions=[Move:typeFrom=Cell,from=30,typeTo=Vertex,to=1,decision=true],[SetScore:player=1,score=2,add=true],[ForgetValue:name=LastScored,value=1],[RememberValue:name=LastScored,value=1]] +Move=[Move:mover=2,from=31,to=6,actions=[Move:typeFrom=Cell,from=31,typeTo=Vertex,to=6,decision=true],[SetScore:player=2,score=0,add=true]] +Move=[Move:mover=1,from=30,to=23,actions=[Move:typeFrom=Cell,from=30,typeTo=Vertex,to=23,decision=true],[SetScore:player=1,score=0,add=true]] +Move=[Move:mover=2,from=31,to=4,actions=[Move:typeFrom=Cell,from=31,typeTo=Vertex,to=4,decision=true],[SetScore:player=2,score=0,add=true]] +Move=[Move:mover=1,from=30,to=16,actions=[Move:typeFrom=Cell,from=30,typeTo=Vertex,to=16,decision=true],[SetScore:player=1,score=0,add=true]] +Move=[Move:mover=2,from=31,to=21,actions=[Move:typeFrom=Cell,from=31,typeTo=Vertex,to=21,decision=true],[SetScore:player=2,score=1,add=true],[ForgetValue:name=LastScored,value=1],[RememberValue:name=LastScored,value=2]] +Move=[Move:mover=1,from=30,to=5,actions=[Move:typeFrom=Cell,from=30,typeTo=Vertex,to=5,decision=true],[SetScore:player=1,score=0,add=true]] +Move=[Move:mover=2,from=31,to=11,actions=[Move:typeFrom=Cell,from=31,typeTo=Vertex,to=11,decision=true],[SetScore:player=2,score=0,add=true]] +Move=[Move:mover=1,from=30,to=19,actions=[Move:typeFrom=Cell,from=30,typeTo=Vertex,to=19,decision=true],[SetScore:player=1,score=1,add=true],[ForgetValue:name=LastScored,value=2],[RememberValue:name=LastScored,value=1]] +Move=[Move:mover=2,from=31,to=9,actions=[Move:typeFrom=Cell,from=31,typeTo=Vertex,to=9,decision=true],[SetScore:player=2,score=0,add=true]] +LEGAL MOVES LIST SIZE = 12 +LEGAL MOVES LIST SIZE = 4 +LEGAL MOVES LIST SIZE = 10 +LEGAL MOVES LIST SIZE = 9 +LEGAL MOVES LIST SIZE = 8 +LEGAL MOVES LIST SIZE = 7 +LEGAL MOVES LIST SIZE = 6 +LEGAL MOVES LIST SIZE = 5 +LEGAL MOVES LIST SIZE = 4 +LEGAL MOVES LIST SIZE = 5 +LEGAL MOVES LIST SIZE = 6 +LEGAL MOVES LIST SIZE = 5 +LEGAL MOVES LIST SIZE = 4 +LEGAL MOVES LIST SIZE = 5 +LEGAL MOVES LIST SIZE = 4 +LEGAL MOVES LIST SIZE = 5 +LEGAL MOVES LIST SIZE = 4 +LEGAL MOVES LIST SIZE = 4 +LEGAL MOVES LIST SIZE = 3 +LEGAL MOVES LIST SIZE = 3 +LEGAL MOVES LIST SIZE = 2 +LEGAL MOVES LIST SIZE = 3 +LEGAL MOVES LIST SIZE = 2 +LEGAL MOVES LIST SIZE = 1 +numInitialPlacementMoves=7 +winner=1 +endtype=NaturalEnd +rankings=0.0,1.0,2.0 +SANDBOX=false +LUDII_VERSION=1.3.13 diff --git a/Player/res/random_trials/board/space/line/Sparro/RandomTrial_1.txt b/Player/res/random_trials/board/space/line/Sparro/RandomTrial_1.txt new file mode 100644 index 0000000000..fba32443b4 --- /dev/null +++ b/Player/res/random_trials/board/space/line/Sparro/RandomTrial_1.txt @@ -0,0 +1,65 @@ +game=../Common/res/lud/board/space/line/Sparro.lud +START GAME OPTIONS +END GAME OPTIONS +RNG internal state=-72,-32,-33,106,-56,-94,64,-46 +Move=[Move:mover=0,from=8,to=8,actions=[Add:type=Vertex,to=8,what=3]] +Move=[Move:mover=0,from=10,to=10,actions=[Add:type=Vertex,to=10,what=3]] +Move=[Move:mover=0,from=14,to=14,actions=[Add:type=Vertex,to=14,what=3]] +Move=[Move:mover=0,from=18,to=18,actions=[Add:type=Vertex,to=18,what=3]] +Move=[Move:mover=0,from=20,to=20,actions=[Add:type=Vertex,to=20,what=3]] +Move=[Move:mover=0,from=30,to=30,actions=[Add:type=Cell,to=30,what=1,count=12]] +Move=[Move:mover=0,from=31,to=31,actions=[Add:type=Cell,to=31,what=2,count=12]] +Move=[Move:mover=1,from=30,to=7,actions=[Move:typeFrom=Cell,from=30,typeTo=Vertex,to=7,decision=true],[SetScore:player=1,score=0,add=true]] +Move=[Move:mover=2,from=31,to=0,actions=[Move:typeFrom=Cell,from=31,typeTo=Vertex,to=0,decision=true]] +Move=[Move:mover=1,from=30,to=1,actions=[Move:typeFrom=Cell,from=30,typeTo=Vertex,to=1,decision=true],[SetScore:player=1,score=0,add=true]] +Move=[Move:mover=2,from=31,to=17,actions=[Move:typeFrom=Cell,from=31,typeTo=Vertex,to=17,decision=true],[SetScore:player=2,score=0,add=true]] +Move=[Move:mover=1,from=30,to=27,actions=[Move:typeFrom=Cell,from=30,typeTo=Vertex,to=27,decision=true],[SetScore:player=1,score=0,add=true]] +Move=[Move:mover=2,from=31,to=26,actions=[Move:typeFrom=Cell,from=31,typeTo=Vertex,to=26,decision=true],[SetScore:player=2,score=0,add=true]] +Move=[Move:mover=1,from=30,to=2,actions=[Move:typeFrom=Cell,from=30,typeTo=Vertex,to=2,decision=true],[SetScore:player=1,score=0,add=true]] +Move=[Move:mover=2,from=31,to=22,actions=[Move:typeFrom=Cell,from=31,typeTo=Vertex,to=22,decision=true],[SetScore:player=2,score=0,add=true]] +Move=[Move:mover=1,from=30,to=12,actions=[Move:typeFrom=Cell,from=30,typeTo=Vertex,to=12,decision=true],[SetScore:player=1,score=0,add=true]] +Move=[Move:mover=2,from=31,to=16,actions=[Move:typeFrom=Cell,from=31,typeTo=Vertex,to=16,decision=true],[SetScore:player=2,score=0,add=true]] +Move=[Move:mover=1,from=30,to=28,actions=[Move:typeFrom=Cell,from=30,typeTo=Vertex,to=28,decision=true],[SetScore:player=1,score=0,add=true]] +Move=[Move:mover=2,from=31,to=4,actions=[Move:typeFrom=Cell,from=31,typeTo=Vertex,to=4,decision=true],[SetScore:player=2,score=0,add=true]] +Move=[Move:mover=1,from=30,to=24,actions=[Move:typeFrom=Cell,from=30,typeTo=Vertex,to=24,decision=true],[SetScore:player=1,score=0,add=true]] +Move=[Move:mover=2,from=31,to=23,actions=[Move:typeFrom=Cell,from=31,typeTo=Vertex,to=23,decision=true],[SetScore:player=2,score=0,add=true]] +Move=[Move:mover=1,from=30,to=3,actions=[Move:typeFrom=Cell,from=30,typeTo=Vertex,to=3,decision=true],[SetScore:player=1,score=1,add=true],[RememberValue:name=LastScored,value=1]] +Move=[Move:mover=2,from=31,to=6,actions=[Move:typeFrom=Cell,from=31,typeTo=Vertex,to=6,decision=true],[SetScore:player=2,score=0,add=true]] +Move=[Move:mover=1,from=30,to=5,actions=[Move:typeFrom=Cell,from=30,typeTo=Vertex,to=5,decision=true],[SetScore:player=1,score=0,add=true]] +Move=[Move:mover=2,from=31,to=29,actions=[Move:typeFrom=Cell,from=31,typeTo=Vertex,to=29,decision=true],[SetScore:player=2,score=0,add=true]] +Move=[Move:mover=1,from=30,to=13,actions=[Move:typeFrom=Cell,from=30,typeTo=Vertex,to=13,decision=true],[SetScore:player=1,score=0,add=true]] +Move=[Move:mover=2,from=31,to=25,actions=[Move:typeFrom=Cell,from=31,typeTo=Vertex,to=25,decision=true],[SetScore:player=2,score=1,add=true],[ForgetValue:name=LastScored,value=1],[RememberValue:name=LastScored,value=2]] +Move=[Move:mover=1,from=30,to=19,actions=[Move:typeFrom=Cell,from=30,typeTo=Vertex,to=19,decision=true],[SetScore:player=1,score=2,add=true],[ForgetValue:name=LastScored,value=2],[RememberValue:name=LastScored,value=1]] +Move=[Move:mover=2,from=31,to=11,actions=[Move:typeFrom=Cell,from=31,typeTo=Vertex,to=11,decision=true],[SetScore:player=2,score=1,add=true],[ForgetValue:name=LastScored,value=1],[RememberValue:name=LastScored,value=2]] +Move=[Move:mover=1,from=30,to=9,actions=[Move:typeFrom=Cell,from=30,typeTo=Vertex,to=9,decision=true],[SetScore:player=1,score=1,add=true],[ForgetValue:name=LastScored,value=2],[RememberValue:name=LastScored,value=1]] +Move=[Move:mover=2,from=31,to=21,actions=[Move:typeFrom=Cell,from=31,typeTo=Vertex,to=21,decision=true],[SetScore:player=2,score=1,add=true],[ForgetValue:name=LastScored,value=1],[RememberValue:name=LastScored,value=2]] +LEGAL MOVES LIST SIZE = 12 +LEGAL MOVES LIST SIZE = 4 +LEGAL MOVES LIST SIZE = 10 +LEGAL MOVES LIST SIZE = 10 +LEGAL MOVES LIST SIZE = 10 +LEGAL MOVES LIST SIZE = 9 +LEGAL MOVES LIST SIZE = 9 +LEGAL MOVES LIST SIZE = 9 +LEGAL MOVES LIST SIZE = 8 +LEGAL MOVES LIST SIZE = 8 +LEGAL MOVES LIST SIZE = 7 +LEGAL MOVES LIST SIZE = 7 +LEGAL MOVES LIST SIZE = 6 +LEGAL MOVES LIST SIZE = 5 +LEGAL MOVES LIST SIZE = 4 +LEGAL MOVES LIST SIZE = 4 +LEGAL MOVES LIST SIZE = 3 +LEGAL MOVES LIST SIZE = 3 +LEGAL MOVES LIST SIZE = 3 +LEGAL MOVES LIST SIZE = 4 +LEGAL MOVES LIST SIZE = 4 +LEGAL MOVES LIST SIZE = 3 +LEGAL MOVES LIST SIZE = 2 +LEGAL MOVES LIST SIZE = 1 +numInitialPlacementMoves=7 +winner=1 +endtype=NaturalEnd +rankings=0.0,1.0,2.0 +SANDBOX=false +LUDII_VERSION=1.3.13