A Tic-Tac-Toe Terminal Application
GitHub Repo
"Animal Tic-Tac-Toe” is a terminal (command line) application which is a variation on the classic Tic-Tac-Toe game. In the game two players (one human user against one computer user) will take turns placing an X or O marker on a three-by-three grid. The winner is whichever player is first to place three of their markers in a horizonal, vertical or diagonal row. If both players play optimally the game will end in a draw.
Features
- An Easy mode Person vs. Environment (PvE). The user can select to play on easy mode against a computer-controlled player who will randomly select where to go based on the free positions available. There are two easy computer players the user can select from: Pete the Panda or Katie the Koala.
- An Expert mode Person vs. Environment (PvE). The user can select to play on expert mode against a computer-controlled player that will select the optimal position to place their marker each time. It is an unbeatable player which will either win or tie all games. When an expert player goes first it will position their marker in one of the randomly chosen corner positions. At all other times this player will invoke a recursive minimax function to return the optimal position based which position has the highest utility score (after testing all the possible free moves on the board). There are two expert computer players the user can select from: Ollie the Octopus and Danni the Dolphin (both known to be highly intelligent animals).
- Game play order is determined by the outcome of a Scissors-Paper-Rock game.
- Users can login to maintain their game/play history. A user log option allows the user to login so that their game play history can be maintained. User credentials are maintained in a separate csv file. Passwords must meet validation criteria and be confirmed by the user. When the app begins users are given the option to register as a new user, log in with an existing username or to play as a guest.
- Game play data is maintained and the top 10 players (as calculated based on the total number of wins) are printed to the console at the end of each game.