Paper-and-Pencil Games

This project consists of 4 simple Paper-and-Pencil games: Tic-Tac-Toe, Dots and Boxes, Hangman, and Battleship.

Each game has a single player mode (vs AI), and a multiplayer mode on the same screen.
There are 3 difficulties of AI for each game.

Tic-Tac-Toe:
Easy AI: Plays a random cell each time.
Medium AI: Will play the 3rd in a row to win, and will block the player if they are about to win. Otherwise it plays a random cell.
Hard AI: Unbeatable. Plays the correct strategy which includes creating and blocking forks.

Dots & Boxes:
Easy AI: If it can close a box it will. Otherwise it plays a random line.
Medium AI: Never plays the 3rd side of a box, and includes several strategies of chaining.
Hard AI: A more advanced version of the medium AI, it plays an additional strategy called "double-cross" to force the player to open longer chains. It's not a perfect AI and is by no means unbeatable.

Hangman:
AI difficulty just changes the range of the word lengths.

Battleship:
Easy AI: Plays a random cell each time.
Medium AI: Plays a random cell until it hits a ship, at which point it starts following all 4 directions to find the rest of the ship (as a human would think). If it hits another ship in the process of finding the rest of the first ship, it remembers it and saves it for later (chained).
Hard AI: Guesses in a smart way. It check the length of longest ship it hasn't sunken yet, and tries to find consecutive cells of that length and plays the middle cell. That way it doesn't waste cells while searching. Once it hits a ship, it guesses the rest of it correctly (yes, it cheats!).