02-17-2021, 09:35 AM
Well I have a script that starts to show what I'm trying to do and the problems.
I tried to follow your slide examples, because other moves might be different, but I was not successful - Then I tried to use (set Direction ... and SameDirection to handle it.)
Maybe you can help to see what is wrong in the attached file ....
Here are examples of the errors during my edits.
Unexpected syntax '(sites Direction from...' in '(is Empty (sites Direction fr...'.
Player 1 to move.
Unexpected syntax 'Adjacent' in '(slide (from if:(not (is Empt...'.
Player 1 to move.
Unexpected syntax 'Vertex' in '(slide (from if:(not (is Empt...'.
Player 1 to move.
Unexpected syntax 'Vertex' in '(slide (directions Cell from:...'.
Player 1 to move.
<html><h2>Syntax error: Could not create "game" ludeme from description.</h2><br/><p>//<br/>(define "Place"<br/> (move<br/> Add<br/> (to Vertex (sites Empty Vertex) <br/> if:(or<br/> (= 0 (count Pieces Next in:(sites Around Vertex (to))))<br/> (not (all Sites (sites Incident Cell of:Vertex at:(to)) if:(not ("TriangleLiberty" (site)))))<br/>))))<br/><br/>(define "TriangleLiberty" // argument is vertex location<br/> (= 2 (count Pieces Mover in:(sites Cell Vertex (#1))))<br/>)<br/>(define "DozerLocation" (sites Cell Vertex (#1)))<br/>(define "IsDozerLocation" (= 3 (count Pieces Mover in:("DozerLocation" #1))))<br/><br/>//Check for at least one empty in or ahead of the Rubble in front of the Dozer <br/>(define "CanPlow" // (last From, last To) <br/> (= 0 <br/> (+<br/> (results <br/> from:(difference ("DozerLocation" #2) ("DozerLocation" #1))<br/> (if <br/> (< 0<br/> (count Sites <br/> in:(intersection<br/> (sites Empty Vertex)<br/> (sites Direction <br/> from:(from) <br/>// (directions Cell from:(#1) to:(#2))<br/>SameDirection<br/> included:True<br/> distance:1<br/> Vertex<br/> ))))<br/> 0<br/> 1<br/>)))))<br/><br/>(define "PushRubble" // (last From, last To) - Rubble pieces can belong to either player<br/> (forEach Site<br/> (difference ("DozerLocation" #2) ("DozerLocation" #1))<br/> (slide<br/> (from if:(not (is Empty (from))))<br/>// (directions Cell from:#1 to:#2)<br/>SameDirection<br/>// Adjacent <br/>// Vertex<br/>)))<br/><br/>(define "PushBlade" // (last From, last To)<br/> (forEach Site<br/> (intersection ("DozerLocation" #1) ("DozerLocation" #2))<br/> (slide<br/>// (directions Cell from:#1 to:#2) <br/>SameDirection<br/>// Adjacent <br/>// Vertex<br/>)))<br/><br/>(define "MoveDozerEngine" // (last From, last To)<br/> (forEach Site<br/> (difference ("DozerLocation" #1) ("DozerLocation" #2))<br/> (slide<br/>// (directions Cell from:#1 to:#2)<br/>SameDirection<br/>// Adjacent<br/>// Vertex<br/>)))<br/><br/>(define "Plow"<br/> (move Select<br/> (from Cell (sites Board Cell) if:("IsDozerLocation" (from)))<br/> (to Cell (sites Around Cell (from) OffDiagonal))<br/> (then <br/> (if <br/> ("CanPlow" (last From) (last To))<br/> (and<br/> {<br/> ("PushRubble" (last From) (last To))<br/> ("PushBlade" (last From) (last To))<br/> ("MoveDozerEngine" (last From) (last To))<br/> }<br/>)))))<br/><br/>(define "CanPlow2"<br/> (< 1<br/> (min <br/> (results<br/> from:("DozerLocation" (last From)) <br/> (max 1 (count Sites in:(sites Around (from) distance:2 (directions Cell from:(last From) to:(last To)) Adjacent if:(is Empty (site)))))<br/> )<br/>)))<br/> <br/><br/>(define "BoardUsed" (<BoardShape:gridType> <BoardSize:smallSide>))<br/><br/>(option "Board Size" <BoardSize> args:{<smallSide> } <br/> {<br/> (item "Infuse 2" <2> "Order 2 board")<br/> (item "Infuse 3" <3> "Order 3 board")<br/> (item "Infuse 4" <4> "Order 4 board")<br/> (item "Infuse 5" <5> "Order 5 board")**<br/> (item "Infuse 6" <6> "Order 6 board")<br/> (item "Infuse 7" <7> "Order 7 board")<br/> (item "Infuse 8" <8> "Order 8 board")*<br/> (item "Infuse 9" <9> "Order 9 board")<br/> }<br/>)<br/>(option "Board Grid" <BoardShape> args:{<gridType> } <br/> {<br/> (item "Square Grid" <square> "Square Grid")*<br/> (item "Hex Grid" <tri Hexagon> "Hex Grid")<br/> (item "Hex Limping" <tri Limping> "Hex N / N+1 Grid")**<br/> }<br/>)<br/><br/>//-------------------------------------------------<br/><br/>(<font color=red>game</font> "Oomph"<br/> (players 2)<br/> (equipment<br/> {<br/> (board "BoardUsed" use:Vertex)<br/> (piece "Disc" Each)<br/> }<br/> )<br/> (rules<br/> (start (set Score Each 0))<br/> (play<br/> (if <br/> (was Pass)<br/> (or<br/> (move Pass)<br/> (priority <br/> ("Plow")<br/> ("Place")<br/> )<br/> )<br/> (or<br/> {<br/> ("Place")<br/> ("Plow")<br/> (move Pass)<br/> }<br/> )<br/> )<br/> )<br/> (end <br/> {<br/> (if <br/> (and<br/> (all Passed)<br/> (> (score Mover) (score Next))<br/> )<br/> (result Mover Win)<br/> )<br/> (if <br/> (and<br/> (all Passed)<br/> (le (score Mover) (score Next))<br/> )<br/> (result Next Win)<br/> )<br/> }<br/> )<br/> )<br/>) <br/><br/>//---------------------------------------------<br/><br/>(metadata<br/> (info<br/> {<br/> (description "Played on cells of a hex grid on a large board.<br/>A turn has up to three parts: Placement followed by movement, followed by capture.<br/>Each and all parts are optional.<br/><br/>Placement: a single stone is placed on an empty cell that either is not adjacent to an opponent's piece, or else that shares a vertex with two existing friendly stones.<br/><br/>Movement:<br/>A vertex surrounded by 3 friendly stones is selected as the starting point. If a placement was made on the turn, one of the 3 stones must be the stone that was placed. The 3 stones at that vertex all shift by one cell in one of the six grid directions. They are able to push stones on the two cells in front of them, provided that no other stones will be displaced by the move.<br/><br/>Capture: Any isolated stone, or maximal group of mutually connected stones which can no longer have a stone of its color placed adjacent at some cell around it, is removed in its entirety. If there is more than one such group the player must choose which to remove.<br/><br/>The <font color=red>game</font> ends when both players pass or when one is eliminated.<br/><br/>Scoring is by territory. One's territory is all the cells one occupies plus all the cells that only you can place a piece on.")<br/> (rules "Oomph is a territorial placement <font color=red>game</font> that includes invasive movements by triplets of pieces called 'Dozers' that can displace that can displace upto two more pieces in a plowing action.<br/> <br/>Goal: Most territory when the <font color=red>game</font> ends. <br/>Territory is any cell with your stone and every cell where you may play a stone. (Both player's territories may overlap by this definition, but the result is the same as excluding the overlapping territory from both players territory.) <br/><br/>Start on an empty board. <br/>Each turn has upto three actions: <br/>1) Placement<br/>2) Plowing<br/>3) Capture<br/>These actions are optional, may only be taken once per turn, and are never taken out of order.<br/><br/>Placement:<br/>A single stone is placed on an empty cell. The chosen cell may be adjacent to an enemy stone only if it also shares a vertex with two existing friendly stones, such that the placed stone will form a triangle (Dozer) with them. Otherwise the player must choose a cell for placement that is not adjacent to an enemy stone.<br/><br/>Plowing:<br/>If a placement was made that formed a Dozer, that Dozer move as a unit, one cell distance 'plowing' up to two stones on its leading edge along with it. The plowing move may not be taken if either of the plowed stones would end up on an occupied space. <br/><br/>Plowing is not available as an action after placements that do not form a Dozer.<br/><br/>If no placement was made, then any three player's stones sharing a vertex may be used as a 'Dozer'<br/>The plowed stones. <br/><br/>Capture: Any isolated stone, or maximal group of mutually connected stones which can no longer have a stone of its color placed adjacent at some cell around it, is removed in its entirety. If there is more than one such group the player must choose which to remove.<br/><br/>Ending the <font color=red>game</font>. The <font color=red>game</font> ends after three consecutive passes. Any completed turn that returns the <font color=red>game</font> to a previous board state is considered to be a pass for the sake of this rule.<br/> <br/>The winner is the player with the most territory. Alternatively, players may end the <font color=red>game</font> by agreeing on the ammont of territory that each would have in a future stable <font color=red>game</font> state.<br/>")<br/> (source "BGG")<br/> (version "1.1.14")<br/> (classification "experimental")<br/> (author "Dale W. Walton")<br/> (credit "Dale W. Walton")<br/> (date "19-11-2020")<br/> }<br/> )<br/>)<br/><br/></p></html>
Player 1 to move.
Unexpected syntax '(directions Cell from...' in '(set Direction (directions Ce...'.
I tried to follow your slide examples, because other moves might be different, but I was not successful - Then I tried to use (set Direction ... and SameDirection to handle it.)
Maybe you can help to see what is wrong in the attached file ....
Here are examples of the errors during my edits.
Unexpected syntax '(sites Direction from...' in '(is Empty (sites Direction fr...'.
Player 1 to move.
Unexpected syntax 'Adjacent' in '(slide (from if:(not (is Empt...'.
Player 1 to move.
Unexpected syntax 'Vertex' in '(slide (from if:(not (is Empt...'.
Player 1 to move.
Unexpected syntax 'Vertex' in '(slide (directions Cell from:...'.
Player 1 to move.
<html><h2>Syntax error: Could not create "game" ludeme from description.</h2><br/><p>//<br/>(define "Place"<br/> (move<br/> Add<br/> (to Vertex (sites Empty Vertex) <br/> if:(or<br/> (= 0 (count Pieces Next in:(sites Around Vertex (to))))<br/> (not (all Sites (sites Incident Cell of:Vertex at:(to)) if:(not ("TriangleLiberty" (site)))))<br/>))))<br/><br/>(define "TriangleLiberty" // argument is vertex location<br/> (= 2 (count Pieces Mover in:(sites Cell Vertex (#1))))<br/>)<br/>(define "DozerLocation" (sites Cell Vertex (#1)))<br/>(define "IsDozerLocation" (= 3 (count Pieces Mover in:("DozerLocation" #1))))<br/><br/>//Check for at least one empty in or ahead of the Rubble in front of the Dozer <br/>(define "CanPlow" // (last From, last To) <br/> (= 0 <br/> (+<br/> (results <br/> from:(difference ("DozerLocation" #2) ("DozerLocation" #1))<br/> (if <br/> (< 0<br/> (count Sites <br/> in:(intersection<br/> (sites Empty Vertex)<br/> (sites Direction <br/> from:(from) <br/>// (directions Cell from:(#1) to:(#2))<br/>SameDirection<br/> included:True<br/> distance:1<br/> Vertex<br/> ))))<br/> 0<br/> 1<br/>)))))<br/><br/>(define "PushRubble" // (last From, last To) - Rubble pieces can belong to either player<br/> (forEach Site<br/> (difference ("DozerLocation" #2) ("DozerLocation" #1))<br/> (slide<br/> (from if:(not (is Empty (from))))<br/>// (directions Cell from:#1 to:#2)<br/>SameDirection<br/>// Adjacent <br/>// Vertex<br/>)))<br/><br/>(define "PushBlade" // (last From, last To)<br/> (forEach Site<br/> (intersection ("DozerLocation" #1) ("DozerLocation" #2))<br/> (slide<br/>// (directions Cell from:#1 to:#2) <br/>SameDirection<br/>// Adjacent <br/>// Vertex<br/>)))<br/><br/>(define "MoveDozerEngine" // (last From, last To)<br/> (forEach Site<br/> (difference ("DozerLocation" #1) ("DozerLocation" #2))<br/> (slide<br/>// (directions Cell from:#1 to:#2)<br/>SameDirection<br/>// Adjacent<br/>// Vertex<br/>)))<br/><br/>(define "Plow"<br/> (move Select<br/> (from Cell (sites Board Cell) if:("IsDozerLocation" (from)))<br/> (to Cell (sites Around Cell (from) OffDiagonal))<br/> (then <br/> (if <br/> ("CanPlow" (last From) (last To))<br/> (and<br/> {<br/> ("PushRubble" (last From) (last To))<br/> ("PushBlade" (last From) (last To))<br/> ("MoveDozerEngine" (last From) (last To))<br/> }<br/>)))))<br/><br/>(define "CanPlow2"<br/> (< 1<br/> (min <br/> (results<br/> from:("DozerLocation" (last From)) <br/> (max 1 (count Sites in:(sites Around (from) distance:2 (directions Cell from:(last From) to:(last To)) Adjacent if:(is Empty (site)))))<br/> )<br/>)))<br/> <br/><br/>(define "BoardUsed" (<BoardShape:gridType> <BoardSize:smallSide>))<br/><br/>(option "Board Size" <BoardSize> args:{<smallSide> } <br/> {<br/> (item "Infuse 2" <2> "Order 2 board")<br/> (item "Infuse 3" <3> "Order 3 board")<br/> (item "Infuse 4" <4> "Order 4 board")<br/> (item "Infuse 5" <5> "Order 5 board")**<br/> (item "Infuse 6" <6> "Order 6 board")<br/> (item "Infuse 7" <7> "Order 7 board")<br/> (item "Infuse 8" <8> "Order 8 board")*<br/> (item "Infuse 9" <9> "Order 9 board")<br/> }<br/>)<br/>(option "Board Grid" <BoardShape> args:{<gridType> } <br/> {<br/> (item "Square Grid" <square> "Square Grid")*<br/> (item "Hex Grid" <tri Hexagon> "Hex Grid")<br/> (item "Hex Limping" <tri Limping> "Hex N / N+1 Grid")**<br/> }<br/>)<br/><br/>//-------------------------------------------------<br/><br/>(<font color=red>game</font> "Oomph"<br/> (players 2)<br/> (equipment<br/> {<br/> (board "BoardUsed" use:Vertex)<br/> (piece "Disc" Each)<br/> }<br/> )<br/> (rules<br/> (start (set Score Each 0))<br/> (play<br/> (if <br/> (was Pass)<br/> (or<br/> (move Pass)<br/> (priority <br/> ("Plow")<br/> ("Place")<br/> )<br/> )<br/> (or<br/> {<br/> ("Place")<br/> ("Plow")<br/> (move Pass)<br/> }<br/> )<br/> )<br/> )<br/> (end <br/> {<br/> (if <br/> (and<br/> (all Passed)<br/> (> (score Mover) (score Next))<br/> )<br/> (result Mover Win)<br/> )<br/> (if <br/> (and<br/> (all Passed)<br/> (le (score Mover) (score Next))<br/> )<br/> (result Next Win)<br/> )<br/> }<br/> )<br/> )<br/>) <br/><br/>//---------------------------------------------<br/><br/>(metadata<br/> (info<br/> {<br/> (description "Played on cells of a hex grid on a large board.<br/>A turn has up to three parts: Placement followed by movement, followed by capture.<br/>Each and all parts are optional.<br/><br/>Placement: a single stone is placed on an empty cell that either is not adjacent to an opponent's piece, or else that shares a vertex with two existing friendly stones.<br/><br/>Movement:<br/>A vertex surrounded by 3 friendly stones is selected as the starting point. If a placement was made on the turn, one of the 3 stones must be the stone that was placed. The 3 stones at that vertex all shift by one cell in one of the six grid directions. They are able to push stones on the two cells in front of them, provided that no other stones will be displaced by the move.<br/><br/>Capture: Any isolated stone, or maximal group of mutually connected stones which can no longer have a stone of its color placed adjacent at some cell around it, is removed in its entirety. If there is more than one such group the player must choose which to remove.<br/><br/>The <font color=red>game</font> ends when both players pass or when one is eliminated.<br/><br/>Scoring is by territory. One's territory is all the cells one occupies plus all the cells that only you can place a piece on.")<br/> (rules "Oomph is a territorial placement <font color=red>game</font> that includes invasive movements by triplets of pieces called 'Dozers' that can displace that can displace upto two more pieces in a plowing action.<br/> <br/>Goal: Most territory when the <font color=red>game</font> ends. <br/>Territory is any cell with your stone and every cell where you may play a stone. (Both player's territories may overlap by this definition, but the result is the same as excluding the overlapping territory from both players territory.) <br/><br/>Start on an empty board. <br/>Each turn has upto three actions: <br/>1) Placement<br/>2) Plowing<br/>3) Capture<br/>These actions are optional, may only be taken once per turn, and are never taken out of order.<br/><br/>Placement:<br/>A single stone is placed on an empty cell. The chosen cell may be adjacent to an enemy stone only if it also shares a vertex with two existing friendly stones, such that the placed stone will form a triangle (Dozer) with them. Otherwise the player must choose a cell for placement that is not adjacent to an enemy stone.<br/><br/>Plowing:<br/>If a placement was made that formed a Dozer, that Dozer move as a unit, one cell distance 'plowing' up to two stones on its leading edge along with it. The plowing move may not be taken if either of the plowed stones would end up on an occupied space. <br/><br/>Plowing is not available as an action after placements that do not form a Dozer.<br/><br/>If no placement was made, then any three player's stones sharing a vertex may be used as a 'Dozer'<br/>The plowed stones. <br/><br/>Capture: Any isolated stone, or maximal group of mutually connected stones which can no longer have a stone of its color placed adjacent at some cell around it, is removed in its entirety. If there is more than one such group the player must choose which to remove.<br/><br/>Ending the <font color=red>game</font>. The <font color=red>game</font> ends after three consecutive passes. Any completed turn that returns the <font color=red>game</font> to a previous board state is considered to be a pass for the sake of this rule.<br/> <br/>The winner is the player with the most territory. Alternatively, players may end the <font color=red>game</font> by agreeing on the ammont of territory that each would have in a future stable <font color=red>game</font> state.<br/>")<br/> (source "BGG")<br/> (version "1.1.14")<br/> (classification "experimental")<br/> (author "Dale W. Walton")<br/> (credit "Dale W. Walton")<br/> (date "19-11-2020")<br/> }<br/> )<br/>)<br/><br/></p></html>
Player 1 to move.
Unexpected syntax '(directions Cell from...' in '(set Direction (directions Ce...'.