Saturday, March 6, 2021

Play Terni Lapilli (Three Stones) - Ancient Roman Tic-tac-toe

Terni Lapilli (Three Stones) is an ancient Roman game, superficially similar to tic-tac-toe, and played on 3x3 grid. Each player has 3 stones, and places one of them on their turn till all their stones are on the board. After that, in each move, the player moves one of their stones along one of the lines to an adjacent empty spot on the grid. The first player to get 3 in a row, wins the game.

Example Terni Lapilli Board

The standard variant allows diagonal moves, and allows a victory to be claimed when 3 stones are lined up vertically, horizontally or diagonally. The other variant (popular in England) is called Nine Holes, and does not allow diagonal moves, and the winner must get the 3 stones to line up only horizontally or vertically. The standard variant is also known as Achi.

You can play the game in your browser at Parlor Games.

Choose between NOVICE (easy to beat), NORMAL (medium difficulty) and EXPERT (hard to beat) when you play against the computer.

Sunday, February 7, 2021

Brainvita - New Artwork and Improved Brainvita Solver

Brainvita at parlor games has been updated with new artwork. The marbles now look like real marbles rather than just filled circles. You can switch the color of the marble by using the theme (☀) button below the brainvita board.

Brainvita Solver

The original brainvita solver uses a brute force algorithm that recursively tries each move at the current position, and find which tree leads to the least number of marbles left in the end. Because the recursion can be 31 deep, the number of possibilities was so great that it was not feasible to find the "best move". The algorithm uses a 1 second cut-off to stop the evaluation, and return the best move found so far. In practice, this meant that for most early board position, the "best" move will invariably the first move tried, as the subtrees containing the alternative moves were never evaluated.

The "new" solver makes the following improvements:

  1. Memoization: when a particular board position is encountered during evaluation, we remember the best result that we obtained for it, and store it in an array. If the same position is encountered -later, we don't need to re-compute the answer, and simply look it up. As there are roughly 2^33 distinct positions, we have to limit how many positions we remember. After a bit of trial and error, remembering the "most recently used" 100,000 positions gave a good balance between storage needs and efficiency. With this combination, the hit rate of the result cache was nearly 75%!
  2. Orphan Marbles: Even with the speedup obtained by Memoization, the number of possibilities is still too large. We now look at how many "orphan" (not adjacent to any other marbles) are there. Positions with too many (current cutoff is 6) orphan marbles are unlikely to yield a good result, so we skip evaluating the trees that begin with such unfavorable positions.
You can use the hint (💡) button to have the computer play a single move, or click the computer (💻) button to have the computer play till the end. When the there are no more moves left, the rematch (↺) button will appear, and you can use it to reset the board to the initial position.

Even after the two optimizations described above, we cannot completely be assured that the best solution is found from an arbitrary starting position, so there is still scope for improvements. If anyone has suggestions for improving the solver, please let me know in the comments.

Thursday, January 21, 2021

Play Aadu Puli Aattam (ஆடுபுலி ஆட்டம்) on Parlor Games

Aadu Puli Aattam (ஆடுபுலி ஆட்டம்) is a traditional 2-player hunting strategy board game from India, popular in Tamil Nadu. You can now play this game from your browser with a friend, or against the computer. Head over to Parlor Games to try this classic game.

One player controls 3 tigers (which all start at the apex triangle of the board), and the other player controls 15 goats (all are off the board, and placed one by one). The aim of the goats is to immobilize the tigers by surrounding them. The tigers aim to hunt the goats, capturing a goat by jumping over an adjacent goat and landing on an empty spot right beyond the goat. The hunt occurs in a straight line. The tiger player wins if 5 goats have been captured.

In the picture above, it is your (Katara's) turn next, shown by the yellow highlight, and you are controlling the tigers. Your most advantageous move is to use the topmost tiger to jump over either of the goats that are below it, and capture them. The computer is controlling the goats.


For the first 15 moves of the player controlling the goats, he places exactly one goat on the board. Once all 15 goats are placed, the goats can move by exactly one square.

On every move, the tiger player either
  1. Moves a tiger to an adjacent empty spot.
  2. Jumps over an adjacent goat to land on an empty spot that is next adjacent in the straight line (lines are drawn on the board) connecting the tiger and goat. The goat that is jumped over is "captured", and removed from the board.
For a full description of the rules, and hints on strategy, read the Rules and Strategy page.

Playing against the Computer

There are three levels of computer player (Novice/Normal/Expert), with Normal being the default. If you want a really easy game, pick Novice in the game creation page. 

If you have made at least 30 moves in the game, and neither player has won, you can chose to draw the game by "rematch", which will start a new game with the player roles reversed (goat player becomes tiger player and vice versa).

Friday, January 8, 2021

Play Brainvita on Parlor Games

Now you can play Brainvita on Parlor Games. This single player game is also known as a Peg Solitaire. You start with a 33 peg grid (see below) with all but the center hole filled with marbles. In each move, the player jumps one marble over another to land on an empty peg, removing the marble that is jumped over from the board. You can only jump up, down, left or right. Diagonal jumps are not allowed. The game ends when there are no moves possible. The lower the number of marbles that are left on the board, the better your score.

Brainvita starting board position

While it is easy to finish with 3-4 marbles, it is much harder to end up with just 2, or one! If you are having trouble figuring out how, start from the empty board position and click on the computer icon below the board to have the computer play the entire game!  

If you have made some moves, and are wondering which move will work best, click on the hint (light bulb) icon to have the computer make a single move. The computer uses brute-force to attempt the solution (within a time constraint) so depending upon the board position, it may not always end up with the best answer. See here for additional information.

Happy puzzle solving!

Monday, January 4, 2021


You can play Tic-tac-toe on parlor-games, either with a friend, or against the computer. Tic-Tac-Toe is a game for two players, played on a 3x3 grid. The players take turns filling in one square in the grid with their token (X and O). The player using the X token makes the first move. If any player manages to fill 3 squares in a straight line, he wins. The three tokens can be either be in a line that is horizontal, vertical or diagonal. If all the squares are filled without either player managing 3 in a row, the game ends in a draw.

Below is a sample tic-tac-toe game. It is Aang's turn next, and he can win in this move by filling the middle column of the bottom row with "X".

If you chose to play against the computer, you can toggle the level of difficulty between NOVICE/NORMAL/EXPERT. It is still possible to beat the computer on EXPERT, as it still looks only one move ahead.

When the game ends, you can chose rematch to start a new game. The new game starts with the tokens exchanged, so if you had gone first playing "X", you will be the second player playing "O" in the new game. The game keeps a running score: Wins score 2 points, and draws score 1 point to each player.

For a good overview of tic-tac-toe strategy, see the wikipedia article.

Monday, December 28, 2020

Starting a new Board Game session

Here are the instructions to start playing a game using

  1. Decide which one of you will be the "Host". The host is responsible for creating a game session, and entering the names of the people who will be playing the game.
  2. On the main page click on the "Host" button under host. If you had previously hosted a session, you may see the "Re-Join" button under the Host section.

  3. You will see your existing games that are in progress, and you can re-connect or you can click on the one of the new games that you want to start.

  4. When you start the game, you will enter the names of the friends you want to join the session. Make sure that you click on "Me" for at least one player, so that you can also be part of the game. For each of the other friends, copy down the automatically generated 6 digit code. Once you create the game your friends will use the "Play" option, and enter the 6 digit code, to join the game you created.

  5. Any player who has reached the game's start/hub page can supply the 6 digit codes for their friends who need to join the session. Once everyone has clicked on the "Join" link against their name, the game will start.

Happy Board Gaming!

Launching Parlor (Board) Games

Some of the fondest memories of my childhood involve marathon Monopoly/Scrabble "all-day" game sessions with my cousins & friends, with just the necessary bio-breaks.  While we still play occasionally, with the inevitable scattering of our playing group to the four corners of the globe it is has become a much rarer thing. I have been looking for a way to help us play board games together on the computer. While there are many different free/paid options for this, I didn't find one that exactly met our needs.

Of course, the best way to play board games is in person, with all your friends in your room, and your favorite game in front of you, and with snacks within arms-reach. I have taken the code I wrote a while ago, and published it here: You don't need to register/login to use this site. Starting a board game session is as easy as selecting "host", and then sharing the 6 digit code to your game with the friends you wish to play with.

The site is fairly bare-bones now, but keep an eye out for enhancements coming shortly. My goal is to publish at least one new board game every month. Right now, tic-tac-toe and cassino are the only two playable games there, and they are missing "play against the computer" option.

Play Terni Lapilli (Three Stones) - Ancient Roman Tic-tac-toe

Terni Lapilli (Three Stones) is an ancient Roman game, superficially similar to tic-tac-toe, and played on 3x3 grid. Each player has 3 stone...