09-17-2020, 08:04 AM
(This post was last modified: 09-17-2020, 08:46 AM by dale walton.)
I am doing a connection test by filling, like I was able to do for AbroBad, as a work-around for the lack of a proper connection test applicable to the game.
However I got a strange result: in the below code, I don't understand why the empty area around the blue piece is not filled upon pink's first move which would revoke the filling entirely, rather than this partial fill that causes the the game to end. (in the real code I can't use groupProduct as it would occasionally lead to false terminations - but that is not the issue here. The issue here is empty cells are not being filled.)
(game "test of fragments"
(players 2)
(equipment
{
(board
(rotate
26.565
(square
(poly
{
{1 5} {2 4} {8 1} {9 2} {12 8} {11 9} {5 12}
{4 11}
}
)
)
)
)
(piece "Disc" Each)
}
)
(rules
(play
(move
Add
(to (sites Empty))
(then
(do
(add (piece (next)) (to (sites Empty)))
ifAfterwards:(!=
(count Pieces Next)
(groupProduct Next)
)
)
)
)
)
(end
(if
(and
(<
10
(count
Sites
in:(difference (sites Board) (sites Empty))
)
)
(or { (= 1 (count Groups Mover)) })
)
(if (is Blocked Mover) (result Next Win))
(result Mover Win)
)
)
)
)
This approach is also giving strange results:
(game "test of fragments"
(players 2)
(equipment
{
(board
(rotate
26.565
(square
(poly
{
{1 4} {2 3} {6 1} {7 2} {9 6} {8 7} {4 9}
{3 8}
}
)
)
)
)
(piece "Disc" Each)
}
)
(rules
(play
(move
Add
(to (sites Empty))
(then
(do
(forEach
Site
(sites Empty)
(add (piece (next)) (to (site)))
)
ifAfterwards:(!=
(count Pieces Next)
(count Groups of:(next))
)
(then (set Score Next (count Groups of:(next))))
)
)
)
)
(end
(if
(and
(<
10
(count
Sites
in:(difference (sites Board) (sites Empty))
)
)
(or { (= 1 (count Groups Mover)) })
)
(if (is Blocked Mover) (result Next Win))
(result Mover Win)
)
)
)
)
[quote pid='612' dateline='1600329871']
dale waltonI am doing a connection test by filling, like I was able to do for AbroBad, as a work-around for the lack of a proper connection test applicable to the game.
However I got a strange result: in the below code, I don't understand why the empty area around the blue piece is not filled upon pink's first move which would revoke the filling entirely, rather than this partial fill that causes the the game to end. (in the real code I can't use groupProduct as it would occasionally lead to false terminations - but that is not the issue here. The issue here is empty cells are not being filled.)
(game "test of fragments"
(players 2)
(equipment
{
(board
(rotate
26.565
(square
(poly
{
{1 5} {2 4} {8 1} {9 2} {12 8} {11 9} {5 12}
{4 11}
}
)
)
)
)
(piece "Disc" Each)
}
)
(rules
(play
(move
Add
(to (sites Empty))
(then
(do
(add (piece (next)) (to (sites Empty)))
ifAfterwards:(!=
(count Pieces Next)
(groupProduct Next)
)
)
)
)
)
(end
(if
(and
(<
10
(count
Sites
in:(difference (sites Board) (sites Empty))
)
)
(or { (= 1 (count Groups Mover)) })
)
(if (is Blocked Mover) (result Next Win))
(result Mover Win)
)
)
)
)
This approach is also giving strange results:
(game "test of fragments"
(players 2)
(equipment
{
(board
(rotate
26.565
(square
(poly
{
{1 4} {2 3} {6 1} {7 2} {9 6} {8 7} {4 9}
{3 8}
}
)
)
)
)
(piece "Disc" Each)
}
)
(rules
(play
(move
Add
(to (sites Empty))
(then
(do
(forEach
Site
(sites Empty)
(add (piece (next)) (to (site)))
)
ifAfterwards:(!=
(count Pieces Next)
(count Groups of:(next))
)
(then (set Score Next (count Groups of:(next))))
)
)
)
)
(end
(if
(and
(<
10
(count
Sites
in:(difference (sites Board) (sites Empty))
)
)
(or { (= 1 (count Groups Mover)) })
)
(if (is Blocked Mover) (result Next Win))
(result Mover Win)
)
)
)
)
[/quote]
[/quote]
Tried to edit the font, but got lots of copies - sorry for that.
Note that the behavior goes back to the first style when I change the line:
ifAfterwards:(!=
(count Pieces Next)
(count Groups of:(next))
)
To:
ifAfterwards:(gt (count Groups of:(next)) 1)
Which is conceptually correct for what I intend to do, but not producing correct results.
However I got a strange result: in the below code, I don't understand why the empty area around the blue piece is not filled upon pink's first move which would revoke the filling entirely, rather than this partial fill that causes the the game to end. (in the real code I can't use groupProduct as it would occasionally lead to false terminations - but that is not the issue here. The issue here is empty cells are not being filled.)
(game "test of fragments"
(players 2)
(equipment
{
(board
(rotate
26.565
(square
(poly
{
{1 5} {2 4} {8 1} {9 2} {12 8} {11 9} {5 12}
{4 11}
}
)
)
)
)
(piece "Disc" Each)
}
)
(rules
(play
(move
Add
(to (sites Empty))
(then
(do
(add (piece (next)) (to (sites Empty)))
ifAfterwards:(!=
(count Pieces Next)
(groupProduct Next)
)
)
)
)
)
(end
(if
(and
(<
10
(count
Sites
in:(difference (sites Board) (sites Empty))
)
)
(or { (= 1 (count Groups Mover)) })
)
(if (is Blocked Mover) (result Next Win))
(result Mover Win)
)
)
)
)
This approach is also giving strange results:
(game "test of fragments"
(players 2)
(equipment
{
(board
(rotate
26.565
(square
(poly
{
{1 4} {2 3} {6 1} {7 2} {9 6} {8 7} {4 9}
{3 8}
}
)
)
)
)
(piece "Disc" Each)
}
)
(rules
(play
(move
Add
(to (sites Empty))
(then
(do
(forEach
Site
(sites Empty)
(add (piece (next)) (to (site)))
)
ifAfterwards:(!=
(count Pieces Next)
(count Groups of:(next))
)
(then (set Score Next (count Groups of:(next))))
)
)
)
)
(end
(if
(and
(<
10
(count
Sites
in:(difference (sites Board) (sites Empty))
)
)
(or { (= 1 (count Groups Mover)) })
)
(if (is Blocked Mover) (result Next Win))
(result Mover Win)
)
)
)
)
[quote pid='612' dateline='1600329871']
dale waltonI am doing a connection test by filling, like I was able to do for AbroBad, as a work-around for the lack of a proper connection test applicable to the game.
However I got a strange result: in the below code, I don't understand why the empty area around the blue piece is not filled upon pink's first move which would revoke the filling entirely, rather than this partial fill that causes the the game to end. (in the real code I can't use groupProduct as it would occasionally lead to false terminations - but that is not the issue here. The issue here is empty cells are not being filled.)
(game "test of fragments"
(players 2)
(equipment
{
(board
(rotate
26.565
(square
(poly
{
{1 5} {2 4} {8 1} {9 2} {12 8} {11 9} {5 12}
{4 11}
}
)
)
)
)
(piece "Disc" Each)
}
)
(rules
(play
(move
Add
(to (sites Empty))
(then
(do
(add (piece (next)) (to (sites Empty)))
ifAfterwards:(!=
(count Pieces Next)
(groupProduct Next)
)
)
)
)
)
(end
(if
(and
(<
10
(count
Sites
in:(difference (sites Board) (sites Empty))
)
)
(or { (= 1 (count Groups Mover)) })
)
(if (is Blocked Mover) (result Next Win))
(result Mover Win)
)
)
)
)
This approach is also giving strange results:
(game "test of fragments"
(players 2)
(equipment
{
(board
(rotate
26.565
(square
(poly
{
{1 4} {2 3} {6 1} {7 2} {9 6} {8 7} {4 9}
{3 8}
}
)
)
)
)
(piece "Disc" Each)
}
)
(rules
(play
(move
Add
(to (sites Empty))
(then
(do
(forEach
Site
(sites Empty)
(add (piece (next)) (to (site)))
)
ifAfterwards:(!=
(count Pieces Next)
(count Groups of:(next))
)
(then (set Score Next (count Groups of:(next))))
)
)
)
)
(end
(if
(and
(<
10
(count
Sites
in:(difference (sites Board) (sites Empty))
)
)
(or { (= 1 (count Groups Mover)) })
)
(if (is Blocked Mover) (result Next Win))
(result Mover Win)
)
)
)
)
[/quote]
(09-17-2020, 08:04 AM)dale walton Wrote:
[quote pid='612' dateline='1600329871']
dale waltonI am doing a connection test by filling, like I was able to do for AbroBad, as a work-around for the lack of a proper connection test applicable to the game.
However I got a strange result: in the below code, I don't understand why the empty area around the blue piece is not filled upon pink's first move which would revoke the filling entirely, rather than this partial fill that causes the the game to end. (in the real code I can't use groupProduct as it would occasionally lead to false terminations - but that is not the issue here. The issue here is empty cells are not being filled.)
(game "test of fragments"
(players 2)
(equipment
{
(board
(rotate
26.565
(square
(poly
{
{1 5} {2 4} {8 1} {9 2} {12 8} {11 9} {5 12}
{4 11}
}
)
)
)
)
(piece "Disc" Each)
}
)
(rules
(play
(move
Add
(to (sites Empty))
(then
(do
(add (piece (next)) (to (sites Empty)))
ifAfterwards:(!=
(count Pieces Next)
(groupProduct Next)
)
)
)
)
)
(end
(if
(and
(<
10
(count
Sites
in:(difference (sites Board) (sites Empty))
)
)
(or { (= 1 (count Groups Mover)) })
)
(if (is Blocked Mover) (result Next Win))
(result Mover Win)
)
)
)
)
This approach is also giving strange results:
(game "test of fragments"
(players 2)
(equipment
{
(board
(rotate
26.565
(square
(poly
{
{1 4} {2 3} {6 1} {7 2} {9 6} {8 7} {4 9}
{3 8}
}
)
)
)
)
(piece "Disc" Each)
}
)
(rules
(play
(move
Add
(to (sites Empty))
(then
(do
(forEach
Site
(sites Empty)
(add (piece (next)) (to (site)))
)
ifAfterwards:(!=
(count Pieces Next)
(count Groups of:(next))
)
(then (set Score Next (count Groups of:(next))))
)
)
)
)
(end
(if
(and
(<
10
(count
Sites
in:(difference (sites Board) (sites Empty))
)
)
(or { (= 1 (count Groups Mover)) })
)
(if (is Blocked Mover) (result Next Win))
(result Mover Win)
)
)
)
)
[/quote]
Tried to edit the font, but got lots of copies - sorry for that.
Note that the behavior goes back to the first style when I change the line:
ifAfterwards:(!=
(count Pieces Next)
(count Groups of:(next))
)
To:
ifAfterwards:(gt (count Groups of:(next)) 1)
Which is conceptually correct for what I intend to do, but not producing correct results.