Project03 - Tic-Tac-Toe using Minimax
Due:
Tue, Mar 22, 2022 at 11:59 PM
to Github Classroom Assignment
Requirements
- You will evolve your lab04 solution to support two modes of Tic-Tac-Toe game play:
- If
argc > 2
your program will accept board values inargv[]
, just like lab04, and use Minimax to output the optimal next move for that board.- You may assume that it’s ‘O’s turn, and ‘X’ is the maximizer
- If
argc == 1
your program will use a loop to play a full game, with a human playing ‘X’ and the computer using Minimax to play ‘O’.- ‘X’ always goes first
- If
- Your program must be called
project03
and must include aMakefile
Given
We will discuss recursion and the Minimax algorithm in lecture
Example Output
Your program’s output must exactly match the format below
$ ./project03 O ? O X ? X ? ? ?
O | ? | O
--+---+--
X | ? | X
--+---+--
? | ? | ?
O: 0 1
$ ./project03 O ? X X O ? ? ? ?
O | ? | X
--+---+--
X | O | ?
--+---+--
? | ? | ?
O: 2 2
Rubric
NB: Since Minimax is a well-known algorithm, many explanations and implementations are available. You must develop your own original code, working individually.
- 70 pts: Correctness for a single move, tested by the
grade
script - 20 pts: Multiple-move game play including validation of input and legal moves, tested manually
- 10 pts: Neatness, including (but not limited to):
- Consistent naming and indentation
- Helpful comments
- No dead (commented-out) code or unnecessarily complex code
- No build products in the repo
- 1 pt. Extra credit: generalize your program to play Checkers