In this game, a firefighter and a pyromaniac walk around a circular path lined with trees, some of which are on fire. Each time they pass a tree that is on fire, the firefighter has the option to extinguish it or not; each time they pass a tree that is not on fire, the pyromaniac has the option to set it on fire or not. If at any point there are no trees on fire, the firefighter wins. In the classic version of the game, the pyromaniac cannot win, except by the firefighter choosing to forfeit. This version of the game has an optional setting to give the pyromaniac a win condition.
The game can be played at jamessundstrom.github.io/HW2.
When you open the game, you'll see a main menu which lets you launch a game of your preference. You can choose a 2-player game, a 1-player game against the computer (controlling either the firefighter or the pyromaniac), or demonstration mode (in which the computer controls both characters). When you launch the game, a random starting position will be generated.
From the main menu, you can also choose to go to the Settings menu, which lets you control three options:
-
Here, you can choose the minimum and maximum number of trees that will be used in the randomly-generated game. By default, a game has 5-7 trees.
-
You can also choose to enable a condition for the pyromaniac to win. Specifically, the pyromaniac wins by threefold repetition, i.e., if the game has been in the same position three times. (For purposes of this calculation, two board positions that are rotations of each other count as the same position.)
-
You can change the difficulty setting for computer-controlled characters
The idea of the game has been around for a while. The particular description in terms of a firefighter and a pyromaniac is from the Carnegie Mellon University Math Club Problem of the Day (Problem 15).
The fire image used in the game is from http://www.clker.com/clipart-414743.html.
The tree image used in the game is from http://www.publicdomainfiles.com/show_file.php?id=13925582418820.
The firefighter helmet image used in the game is from https://creazilla.com/media/clipart/67571/firefighter-hat.
The torch image used in the game is from https://www.pngwing.com/en/free-png-bucho.