Ludii Forum
Cells around a vertex - Printable Version

+- Ludii Forum (https://ludii.games/forums)
+-- Forum: Suggestions (https://ludii.games/forums/forumdisplay.php?fid=10)
+--- Forum: Ludii Features / Services (https://ludii.games/forums/forumdisplay.php?fid=11)
+--- Thread: Cells around a vertex (/showthread.php?tid=405)

Pages: 1 2


RE: Cells around a vertex - dale walton - 02-16-2021

Another issue I find is that Ludii doesn't seem to define the OffDiagonal directions for Hexagonal vertices. i.e the short diagonal directions that should be the same direction as the cell to cell directions.

If the are not defined, I won't be able to use them for determining the cell to Cell directions they are parallel to...

--------------------------------
As a separate issue, With no working direction to them, I can't even select them, even this: isn't working for me:
Select
(from Vertex (sites Empty Vertex))
(to Vertex
 (sites Around Vertex ((sites Around Vertex (from) Adjacent)) Adjacent)
)

-------------------------------
I think my easiest work-around is to play on the Verticies of a triangular grid, and select the cells for the group moves...

Edit:
ran into another bug/problem
(move
  Add
  (to Vertex (sites Empty Vertex)
  if: (= 0 (count Pieces Next in:(sites Around Vertex (to))))
)

The condition did not work for the triangular grid ontil I specified use:Vertex for the board.

The boards are different as well, because without use:Vertex you give a colored board with space for both cells and triangles. That is the board where it did not work.

----------------------
What is the difference between:

(sites Cell Vertex (from))  --- this one works on the use:vertex board.
(sites Incident Vertex of:Cell at:(from)) --- this one does not work on the use:vertex board.

But on the cell board, the second form worked, and the analogous:
(sites Incident Cell of:Vertex at:(from)) worked , and doesn't have a corresponding (and confusing - it should be something like "IncidentCell" ) simple form

Which is preferred? which will you make to work for all the boards?


RE: Cells around a vertex - dale walton - 02-17-2021

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


RE: Cells around a vertex - Eric Piette - 02-22-2021

Hi,

(set Direction ...) is in reality to set the rotation state of a piece.
So you can not use a direction in entry of that.

FYI: we are going to rename that ludeme to (set Rotation ...) to be clearer.

Regards,
Eric


RE: Cells around a vertex - dale walton - 02-23-2021

Good to know. However it was the last thing I tried. The other errors were from trying to use it in (sites Direction ... (directions ...)), and in (slide ... (directions ...)) since that was in your original example, but those were kicked out by the compiler before as syntax errors.

So which ludemes use direction in the sense of rotation, and which use it in the sense of absolute direction. And in the new (directions ...) ludeme what is the data structure and kind of values created, and which ludemes is it compatible with?

Other unanswered questions:
1) OffDiagonal directions for Hexagonal vertices. Do you have them, if not when?

2) The following should select the Off-diagonal vertices on a hex grid, (i.e the short diadonals of the hexes or vertexes at 2 steps distance) but does not Why?
Select (from Vertex (sites Empty Vertex)) (to Vertex (sites Around Vertex ((sites Around Vertex (from) Adjacent)) Adjacent))

3) Why doesn't the following work on the Cell-and-vertex board (ie why does (board Tri use:Vertex) need to be specified in order to make it work?
(move Add (to Vertex (sites Empty Vertex) if: (= 0 (count Pieces Next in:(sites Around Vertex (to)))))

4.What is the difference between the following, and why do they require different board geometries?:

(sites Cell Vertex (from)) --- this one works on the use:vertex board.
(sites Incident Vertex of:Cell at:(from)) --- this one does not work on the use:vertex board.


RE: Cells around a vertex - Eric Piette - 02-24-2021

Hi,

The rotation state has nothing related to the direction functions.
The rotation state is to modify the facing direction of a piece dynamically, you can see its use in Ploy.lud

The (directions ...) function is not new, this is like that since more than half a year. AbsoluteDirection, RelativeDirection are all DirectionFunctions and some others directions functions exist (see the LGLG to see all). All the ludemes with Direction in entry can use them. However, it is possible that some ludemes are still using AbsoluteDirection alone, so in that case the directionFunction will not work for them, like that was the case for Push before the last release. For some that can be normal, but in general Direction should be in entry.
For the data, that ludeme is converting any ludeme in entry to a set of absoluteDirection, then the eval method of each ludeme use them to use the steps/radials etc...

1) OffDiagonalDirection has a strict definition (see LGLG: "All directions between two cells sharing a vertex but not an edge."), this is computed for all the tilings. If you think they are not there, that's because this is probably not OffDiagonalDirection. Apparently you speak about vertices, as you can see in that definition, this is not OffDiagonal.

2) Can not answer with just that. I need a concrete example, but if this is not the right result, I guess the description is incorrect.

3) Same here.

4) The first one is returning the indices of the cells of the vertex from, the second one is returning the list of vertices of the cell from which is not the same.

To expect a good and quicker answer, please use a different thread for each question with when possible an example .lud showing the issue, when you put too much questions in the same message, that becomes to hard to follow for us and often not possible to help you.

Regards,
Eric


RE: Cells around a vertex - dale walton - 02-24-2021

Thanks for covering all the points of the 2nd post.

Re #1 OffDiagonal, I can see that, but this means that this relationship exists for a given tiling, but not for it's dual. So one would expect an equivalent function: perhaps called ShortDiagonal for the directions parallel to the short diagonals of the cells. that connect alternate vertices. \

Since the "ShortDiagonal" vertex to Vertex direction is not known to the program, even though it is parallel to the known cell-to-cell direction, does using the (directions) function to obtain it work?


RE: Cells around a vertex - Eric Piette - 02-25-2021

Hi,

No (directions ...) can return only existing directions.

Regards,
Eric


RE: Cells around a vertex - dale walton - 02-25-2021

OK, that is a good reason then that it would be good for this "ShortDiagonal" direction to "exist".