A Java application, which allows the user to play Tic Tac Toe on the command line.
- Coming soon
- Choose to play the following games:
- Human vs Human
- Human vs Computer
- Human vs Unbeatable Computer
- Computer vs Human
- Computer vs Computer
- Computer vs Unbeatable Computer
- Unbeatable Computer vs Human
- Unbeatable Computer vs Computer
- Unbeatable Computer vs Unbeatable Computer
- Save the game state to a database during the game
- Resume a saved game
git clone https://github.com/itsellej/java-tic-tac-toe
cd java-tic-tac-toe
mvn package
// Note: add database url, username and password
java -DDBURL=url -DDBUSERNAME=username -DDBPASSWORD=password -jar target/java-tic-tac-toe-1.0-SNAPSHOT.jar
Note: to save and retrieve games, a PostgreSQL database, with a table called "saved_games" will need to exist with the following columns set to not null
:
- id: integer (primary key)
- game_name: text
- current_player_mark: text
- current_player_type: text
- opponent_mark: text
- opponent_type: text
- squares: text[]
The language used to create this application is Java, version 11, using the build automation tool, Maven.
The testing library used is JUnit, version 5.4.2.
- Cases where the user is prompted to enter input again:
- Game type selection: if
'start'
or'existing'
is not entered - Loading a saved game: if the game name entered does not exist
- Player type selection: if
'human'
,'computer'
or'unbeatable'
is not entered - Move selection: if 1-9, or
'save'
is not entered during game play
- Game type selection: if