Extended Y

To view this content, you need to install Java from java.com

This Java applet implements the game of Y and the game of hex. It can implement the swap rule (a.k.a. the pie rule), and it also contains two special nested games. The size 15 game of Y and the size 21 game of hex each contain a set of three concentrically nested games in one.

Rules for Y: Players alternate turns placing one game piece of their color on the board. The first player to connect all three sides of the board wins; the corners count as belonging to both sides of the board to which they are adjacent.

Rules for Hex: Players alternate turns placing one game piece of their color on the board. Each player is assigned two sides in which to connect: the side lined with the player's color and the side opposite of that side. The first player to connect both of their assigned sides wins; the corners count as belonging to both sides of the board to which they are adjacent.

Swap Rule: If the "Allow swap rule" box is checked at the start of the game (before the game is reset) then the swap rule is in effect. After the first player makes their first move, the second player has the option of either: letting the move stand, in which case they are the second player and move immediately, or switching places, in which case they are now the first player, and the "new" second player now makes their "first" move. Effectively, the second player becomes the first player, and it is as if that move was theirs; the game proceeds from that opening move with the newly reversed roles. In the Java applet, this is modeled by swapping the colors of the game pieces already on the board. The colors of the players themselves remain the same.

Rules for Nested Hex and Y: In the Java applet, when the size 15 game of Y or the size 21 game of Hex is played, three nested games are played instead of a single game. The three games are played simultaneously and the winner of the majority of them is the overall winner. The three game boards are shown by the circles in bold. All three game boards are concentrically nested.


Commands:
  • Place mouse where you want the next game piece to go. Right-click to set piece.
  • 'r' will reset the board. Same as clicking the "RESET" button.
  • The "Use Swap" button will swap the colors of the game pieces. It can only be used by Player 2 after Player 1 has gone once.
  • After setting all the options you wish, the game must be reset before the new options take effect.

Source Code

Built with Processing and the MyGUI Library.

Algorithm for determining winner adapted from Alexander Bogomolny's Y Can't End in a Draw page.

Comments are closed.