Introduction
Requirement
2017/3/8 Upload Assignment: Homework 3 TicTacToe – CS172A …
1/6
Assignments Homework 3 Upload Assignment: Homework 3 TicTacToe H
Due Date
Tuesday, March 7, 2017
10:00 AM
Points Possible
50
CS 172 Homework 3 TicTacToe
Written Questions (30pts)
1. R6.3 pg 295 (4 pts)
2. R6.8 pg 295 (4 pts)
3. R6.9 pg 296 (9 pts, 3 per part) Prototype each function and describe what it does.
4. R6.13 pg 296 (5pts)
5. R6.15 pg 296 (8pts, 2 per part) Prototype each function and give Pseudocode for its
implementation.
Programming Assignment (70pts)
In this assignment, you will make a TicTacToe game in C++. You will be provided with starting code.
Your task is to complete the tBoard object which controls the game mechanics. The customer (in this
case your Professors) have already determined what the user interface should look like. You need to
make a class that completes the game.
One of the goals of this project is to simulate how a team project would work in a company. You have
no control over how the input/output with the user works. That has already been decided. You just
need to figure out how to implement the back end to make design work.
Inputs:
Both Players enter their names so that the game can refer to them and declare a winner.
Moves are entered as two integers with a space between them on the same line. The first is
the row number. The second is the column number. For example, 0 2 means row 0 column 2
should be marked.
Outputs:
Which symbol is assigned to each user is displayed.
After each move is entered the board is redrawn to show the move took place. The board
must be drawn EXACTLY as shown in the sample run below.
If a players move was invalid, then they may attempt another move (see next section).
Error Checking:
Cancel Save Draft Submit
Upload Assignment: Homework 3 TicTacToe
ASSIGNMENT INFORMATION
?
Home Courses Community Content Collection Tech Support
Weiyi He 75
2017/3/8 Upload Assignment: Homework 3 TicTacToe – CS172A …
2/6
If a user makes an illegal move (either space already taken or out of range) the move should
fail and the user should be asked for another move, etc.., until a valid move is selected.
Game Mechanics:
The game only allows legal moves.
A winner should be declared immediately after the winning move is made.
A tie should be declared after the final move is made.
Full Rules of TicTacToe can be found
Programming Assignment:
You are provided with the following code. You may not change any of these files.
main.cpp Handles printing output and getting input
symbol.cpp Gives and Enum for the three symbols possible in spaces (blank, X, O)
symbol.h H File for Enum
You are given an incomplete tic.h file. It includes the methods that are required by the main.cpp file.
You must complete the TicTacToe program by implementing tic.cpp and completing tic.h. You may
add new methods and attibutes to the class, but you may not change any of the methods given. You
cannot change main.cpp, so any method used there must work as expected.
What to Submit:
Homework_3.doc or Homework_3.pdf Answers to Written Questions
main.cpp Main Game Program
tic.h Header for Game
tic.cpp Implementation for Game
symbol.cpp Enum for Symbols
symbol.h Header for Symbols
System Manual See Instructions :
CurrentSlide=0
You may submit either the individual files, or a zip file with all the files in it.
Grading for Part 2
We are going to run a bunch of different test runs. Therefore we suggest you yourself do a
lot of different tests to feel confident that your code works properly in all cases.
Code Compiles Correctly 10pts
Program Construc���on (all instruc���ons above are followed and code logical flow is correct)
45pts
Internal Documenta���on 5pts
Code follows good style. guidelines 5pts
External Documenta���on 5pts
Example Game
2017/3/8 Upload Assignment: Homework 3 TicTacToe – CS172A …
3/6
2017/3/8 Upload Assignment: Homework 3 TicTacToe – CS172A …
4/6
2017/3/8 Upload Assignment: Homework 3 TicTacToe – CS172A …
5/6
main.cpp
symbol.cpp
symbol.h
tic.h
Write Submission
Browse Content Collection
ASSIGNMENT SUBMISSION
Text Submission
Attach File
ADD COMMENTS
Comments
Browse My Computer
2017/3/8 Upload Assignment: Homework 3 TicTacToe – CS172A …
6/6
Character count: 0
When finished, make sure to click Submit.
Optionally, click Save as Draft to save changes and continue working later, or click Cancel to quit
without saving changes.
Cancel Save Draft Submit