04-08-2020, 08:07 PM
(This post was last modified: 04-08-2020, 08:08 PM by Wolfgang Konen.)
Reversi: In your definition of Reversi you do not have the standard start setting. As https://en.wikipedia.org/wiki/Reversi says:
“Convention has initial board position such that the disks with dark side up are to the north-east and south-west. The dark player moves first.”
Your setting is the same for the start board, but the white player moves first.
I suggest below a slightly modified Reversi.lud where the black player moves first.
This makes it easier to compare to other agents which were perhaps trained with the standard setting.
Another tiny thing: Many people may search for Reversi under the name Othello. Perhaps you could add alternative game names with which one could search for games.
The following is just a copy of your Reversi definition with state numbers switched in the two "fill" statements:
(game "Reversi"
(players 2)
(equipment {
(reversiBoard 8)
(Piece "Disc" None)
}
)
(rules
(start
{
(fill "Disc0" {28 35} state:2)
(fill "Disc0" {27 36} state:1)
}
)
(play
(bySite
(setVar "current" (from))
(empty)
(concatenate
(custodial
of: (isEnemy (state (to)))
by: (isFriend (state (step)))
effect: (crossProduct (to (indexOf "Disc0") state: (mover) site: (var "current")) (flip) )
)
(then
(setScore
{P1 P2}
{(size (sitesOfState 1)) (size (sitesOfState 2))}
)
)
)
)
)
(byScore (or (allPass) (stalemated Next)))
)
)
(metadata
{ "rules" "Trap other pieces between your own to capture them, but be aware that the opponent may do the same.
Pieces will change sides (colors) dozens of times. The winner is the one with the most pieces when no more pieces can be played on the board."}
{"getColourFromLocalState" "true"}
{ "Source" "https://en.wikipedia.org/wiki/Reversi"}
{"Features" "rel:to=<{}>:pat=<refl=true,rots=all,els=[-{}]> 0.0;
rel:to=<{}>:pat=<refl=true,rots=all,els=[-{}, #{0.0}, #{0.25}]>:comment=\"Play in corner of board.\" 5.0;
rel:to=<{}>:pat=<refl=true,rots=all,els=[-{}, !#{0.0}, #{0.0, 0.0}, #{0.25, 0.0}, -{0.25, -0.25}]>:comment=\"Dont play around empty corner of board.\" -2.0;
rel:to=<{}>:pat=<refl=true,rots=all,els=[-{}, #{0.0}, -{0.25}, !#{-0.25}, #{0.25, 0.0}]>:comment=\"Dont play around empty corner of board.\" -2.0"}
)
“Convention has initial board position such that the disks with dark side up are to the north-east and south-west. The dark player moves first.”
Your setting is the same for the start board, but the white player moves first.
I suggest below a slightly modified Reversi.lud where the black player moves first.
This makes it easier to compare to other agents which were perhaps trained with the standard setting.
Another tiny thing: Many people may search for Reversi under the name Othello. Perhaps you could add alternative game names with which one could search for games.
The following is just a copy of your Reversi definition with state numbers switched in the two "fill" statements:
(game "Reversi"
(players 2)
(equipment {
(reversiBoard 8)
(Piece "Disc" None)
}
)
(rules
(start
{
(fill "Disc0" {28 35} state:2)
(fill "Disc0" {27 36} state:1)
}
)
(play
(bySite
(setVar "current" (from))
(empty)
(concatenate
(custodial
of: (isEnemy (state (to)))
by: (isFriend (state (step)))
effect: (crossProduct (to (indexOf "Disc0") state: (mover) site: (var "current")) (flip) )
)
(then
(setScore
{P1 P2}
{(size (sitesOfState 1)) (size (sitesOfState 2))}
)
)
)
)
)
(byScore (or (allPass) (stalemated Next)))
)
)
(metadata
{ "rules" "Trap other pieces between your own to capture them, but be aware that the opponent may do the same.
Pieces will change sides (colors) dozens of times. The winner is the one with the most pieces when no more pieces can be played on the board."}
{"getColourFromLocalState" "true"}
{ "Source" "https://en.wikipedia.org/wiki/Reversi"}
{"Features" "rel:to=<{}>:pat=<refl=true,rots=all,els=[-{}]> 0.0;
rel:to=<{}>:pat=<refl=true,rots=all,els=[-{}, #{0.0}, #{0.25}]>:comment=\"Play in corner of board.\" 5.0;
rel:to=<{}>:pat=<refl=true,rots=all,els=[-{}, !#{0.0}, #{0.0, 0.0}, #{0.25, 0.0}, -{0.25, -0.25}]>:comment=\"Dont play around empty corner of board.\" -2.0;
rel:to=<{}>:pat=<refl=true,rots=all,els=[-{}, #{0.0}, -{0.25}, !#{-0.25}, #{0.25, 0.0}]>:comment=\"Dont play around empty corner of board.\" -2.0"}
)