Skip to main content
Arthur De Belen (Boston, MA, US)

Frogs and Toads Are Friends

Toads and Frogs, according to the Wikipedia article of the same title, was invented by Richard Guy as a game between two players, with the rules constrained by simple mathematics.

It can be thought of as a board game, like on a chess board, except we only take 1 row of eight of uncolored squares. The three leftmost squares start with one toad on each of them, the three rightmost squares with one frog each, and the middle two remain empty.

One player controls the toads, who want to reach the right side, and the other controls the frogs, who want to reach the left side. The game proceeds through each player alternating in taking moves towards the goals of the animals they control, and in order for one of them to win, the other must not be able to take a turn allowed by the rules.

The rules are as follows:

An interesting property of these rules is that for each turn the selection of which frog or toad to move determines which square it could land on, since not both of the squares mentioned can be allowed moves at the same time.

Below is an interactive way for you to try out the game, either to play against yourself or play with another person on the same device. The box labelled "Board" will contain the board of squares, and to take a turn you can just click on the frog ("F") or toad ("T") to move. The player controlling the toads will make the first move. Any attempt to make a move not allowed by the rules or to make a move out of turn order (alternating toads and frogs) will result in no change to the board. The board will also indicate if there is no possible move left.

The box labelled "Restart" contains buttons to reset the board to what it would look like at the start. Each button represents a different board size and different number of animals per player.

Lastly, the box labelled "Undo" contains buttons to undo the last moves played on the board, with each button undoing a different number of moves.

The above were implemented using techniques I learned from Chris Fernandi's website, specifically these two blog posts: post 1 and post 2.

This game is also one of many games studied as examples in the first volume of Winning Ways for Your Mathematical Plays written by Berlekamp, Conway, and Guy and published by A K Peters out of Wellesley, Massachusetts, United States. I haven't thoroughly studied the volume but it brings up an interesting notion of numbers.

Specifically, it describes a concept of assigning a number to a two-player game, roughly described as the number of turns needed to counteract the advantage one of the players has. Eventually the possibilities of this value deviate from the integers, and the volume brings up more abstract concepts like the addition of two games, the negation of games, and games whose value isn't positive, negative, or zero.

I can't say I'll come back to this topic but it is a neat one to learn about.


Footnote: more specifically, Winning Ways talks about games where

Also, the title of the blog post refers to the book Frog and Toad are Friends, the first of a series of children's books known as the Frog and Toad series that according to Wikipedia was written by Arnold Stark Lobel. I learned about the series from a picture of a cover somewhere online and found the cover cute.

According to the Wikipedia page about him, Lobel passed in 1987 while battling acquired immunodeficiency syndrome (AIDS).