11-20-2020, 10:16 PM
I played around a bit with Connect Four, trying to put it onto a cylinder, but it seems to be not quite as straightforward. I tried two ideas:
First attempt: adding edges to a rectangle. That seemed easy, I just changed the board definitions by adding some edges:
Here the first line is for the 1D stacked modelisation, and the second line for the 2D "slide to the bottom" one. However, lines of four pieces crossing the new edges are not recognized. I don't know how the "is Line" function works - my guess is that the pieces have to follow consecutive edges in the same direction, and the new edges have no "East" direction assigned to continue a line? Also, to allow diagonal lines across the gluing, would one have to add also diagonal edges to the graph?
Second attempt: use a circular board. That was actually my first try, but here I modified more. Now I made the boards circular:
Also since now the directions are different, I had to make a few changes to the definitions in the beginning, at least for the 2D modelisation (for the 1D stacked I just tried to keep it as it is). First change, pieces are inserted in the perimeter instead of the top:
Second change, I thought that "phase" is the angular coordinate on a circular board, so I tried this:
But apparently I was wrong... So I tried to define another function to slide the pieces inward as much as possible, but it's still not quite working:
Anyway, aside from pieces ending up in the wrong place, lines in the angular or diagonal directions are not recognized in either of the two modelisations. They are recognized only if they are stacked on top in the 1D option / radial in the 2D option.
So I guess that to properly handle such cases, one would need something like a cylinder board ludeme which sets up the proper graph / a line implementation which recognizes the additional cases...
I'll attach my two modifications, in case someone would like to try it out.
First attempt: adding edges to a rectangle. That seemed easy, I just changed the board definitions by adding some edges:
Code:
<(board (add (rectangle 1 7) edges:{{{6 0}}}))>
<(board (add (rectangle 6 7) edges:{{{6 0} {13 7} {20 14} {27 21} {34 28} {41 35}}}))>
Here the first line is for the 1D stacked modelisation, and the second line for the 2D "slide to the bottom" one. However, lines of four pieces crossing the new edges are not recognized. I don't know how the "is Line" function works - my guess is that the pieces have to follow consecutive edges in the same direction, and the new edges have no "East" direction assigned to continue a line? Also, to allow diagonal lines across the gluing, would one have to add also diagonal edges to the graph?
Second attempt: use a circular board. That was actually my first try, but here I modified more. Now I made the boards circular:
Code:
<(board (circle {7}))>
<(board (circle {7 7 7 7 7 7}))>
Also since now the directions are different, I had to make a few changes to the definitions in the beginning, at least for the 2D modelisation (for the 1D stacked I just tried to keep it as it is). First change, pieces are inserted in the perimeter instead of the top:
Code:
(define "EmptyTop" (intersection (sites Perimeter) (sites Empty)))
Second change, I thought that "phase" is the angular coordinate on a circular board, so I tried this:
Code:
(define "LastColumn" (sites Phase (phase of:(last To))))
But apparently I was wrong... So I tried to define another function to slide the pieces inward as much as possible, but it's still not quite working:
Code:
(define "Distance" (- (count Sites in:(intersection (sites Empty) (sites Direction from:(last To) In))) 1))
(define "Drop" (slide (from (last To)) In (between (exact "Distance"))))
Anyway, aside from pieces ending up in the wrong place, lines in the angular or diagonal directions are not recognized in either of the two modelisations. They are recognized only if they are stacked on top in the 1D option / radial in the 2D option.
So I guess that to properly handle such cases, one would need something like a cylinder board ludeme which sets up the proper graph / a line implementation which recognizes the additional cases...
I'll attach my two modifications, in case someone would like to try it out.