Extra Credit Lab - Tick Tack Toe with computer opponent

Due: Nov 29, 11:55pm

Instructions

This optional lab is an opportunity to get points back on a previous lab lost due to incorrectness or lateness. You may complete this lab and add points earned to one previous lab (Labs 1-6 only), up to 100%. Alternatively, you may apply these points to the Code Lab grade.

How it works. Complete the work by the due date (no late wok will be accepted for this without prior approval). As part of the assign, in the text part of the Moodle assignment, clearly explain which assignment you would like these points to apply toward. You can ONLY pick one.

Your Goal: Your goal is to take the Tick Tack Toe program created in class, and a give it an automatic computer opponent. The game will then allow the user to play as many games as they want, with the program keeping score of wins, loses, and draws for each player (the human and the computer. The game will start and ask the user if they want to be X or O. It will then randomly determine who goes first for first game. From then on who goes first will alternate.

Grading Table

C++ code includes comments, with project information at top, pre and post conditions for each functions and other comments as needed.

5

The C++ code has good formatting, indentation, and organization.

5

Good variable and function names, appropriate use of constants rather then literal numbers.

5

Functions: Logic divided up into cohesive functions with a single purpose

10

Runs: Run examples showing complete operation of system features. You must demonstrate that the systems has the features added.

40

Required features: Program must have a computer opponent. Program starts up and the user picks X or O, a random user starts, and from then on starters alternate. After each game the win/loss/draw tally is displayed, and the user can choose to continue.

20

You may only pick ONE of the options below. Clearly explain which option you pick in the text area of Moodle when you turn it in. You must supply evidence in the form of runs and explanations for the option you choose.

Option 1: Program fully plays as a "dumb" opponent. Use random numbers to generate only LEGAL computer moves.

10

Option 2: Computer plays with some well defined strategy making it harder to beat. Explain your strategy in the the text area of the Moodle assignment for credit here. The most obvious strategy is to watch for, and block opponent when they have two out of three in a row.

20

Option 3 (bonus points): Your program never loses, winning if it can, only tieing when it cannot lose. For this you can get points above 100, which can be directed to another project of your choosing. This can be applied to any lab (1-9).

50

Total

100

Super Duper Bonus Extra Credit - These are points above 100 you may direct to one additional assignment.