AP Computer Science – Game Projects
Tic-Tac-Toe – Write a program to play this classic game in 2-player format. Game play should look like this:
Player X’s turn
7 8 9
4 5 6
1 2 3
Player O’s turn
7 8 9
4 X 6
1 2 3
Player X’s turn
O 8 9
4 X 6
1 2 3
Etc…
Notes:
- You should use an array (1-D or 2-D) to manage the game board
- Make sure a player does not choose a spot that has already been chosen. This requires error-checking and making the player choose again until they choose an available spot.
- Determining whether the game is over can be tricky. Think it through.
Hangman – Write a program that uses a collection of words of your choice to play this classic game (one player). You can decide on the rules. Game play should look like this:
Letters used: e a t w s r
Misses: 3
w**ar*
Next Guess: d
Letters used: e a t w s r d
Misses: 3
w**ard
Next Guess: l
etc…
|