Unitile is a game for two players, Red and Blue, on a 5×5 board. Every cell but one holds a red tile or a blue tile. The board has twelve red tiles and twelve blue tiles. The one unoccupied cell is called the bubble.
In the starting position, the bubble is the center cell. The 24 tiles fill the other cells in reading order, from left to right within each row, and row by row from the top. The colors of the tiles alternate in that order. The first tile, in the top left corner, is blue. Figure 1 shows the starting position.
The players alternate sliding tiles, one slide per turn, starting with Red. On your turn, you choose a tile of either color that is orthogonally adjacent to the bubble and slide it into the bubble. The cell that the tile has left becomes the new bubble.
A group is a maximal set of orthogonally interconnected, same-colored tiles. A color is united when all of its tiles form a single group. The game ends as soon as a move unites a color. The player of that color wins. A move can unite the opponent’s color, and a player who makes such a move loses.
Each color has a value, the average number of random slides needed to unite the tiles of that color, starting from the current position. Every move must lower the total of the two values, except a move that unites a color. Such a move ends the game and is always legal. This rule guarantees that the player to move always has a legal move, that no position can repeat, and that every game ends with a winner.
The values cannot be worked out by hand, so this app puts a green dot on every tile that can legally slide. In Figure 2, Red has slid the red tile above the bubble down, and a white ring marks it. Three tiles can now slide, and each of them has a green dot. Sliding the red tile back up would return to the starting position, and that slide is not legal.
The values, the rule, and the proof that the rule always leaves a legal move are explained in Unitile_rules.pdf at marksteeregames.com.
Feel free to publish these rules and to program the game of Unitile. No licensing fee or royalties are expected. However, please don’t change the name or the rules, and please attribute the game to me, Mark Steere. My other games can be found at marksteeregames.com.
The app knows every legal move from a table computed in advance from the values. A second table, also computed in advance, tells which player wins every position with perfect play. With perfect play, Blue, the second player, wins.
Six computer levels. Level 1 slides at random. Levels 2 to 5 play the perfect move part of the time and a random legal move otherwise, from 15 percent of the time at level 2 to 75 percent at level 5. Level 6, Unbeatable, always plays perfectly. When it can win, it never lets the win slip. When it cannot, it chooses the moves that leave you the most chances to go wrong. Against level 6, a player who takes Red cannot win.
With Confirm moves on, a tap on a legal tile marks it with a dashed gold outline and shows it faintly in the bubble. Confirm slides it, and so does a second tap on the tile. A tap on another legal tile chooses that tile instead. A tap anywhere else, or on the Undo button, cancels the choice. With Confirm moves off, a tap slides the tile at once. Once a tile has slid, Undo takes back your last move.
The line above the board counts the groups of each color. When marking is on, a green dot marks every tile that can slide, as in Figure 2. A white ring marks the tile that slid last. Hint marks the tile that level 6 would slide. Record shows the game as text that you can copy.