Tic Tac Toe

Silly Premise

You are in lecture for a really boring class and the professor is speaking about a reading that you did not even know existed. Your friend taps you on the shoulder and says, "Hey, wanna play some Tic Tac Toe?" You panic!!! Your palms start to sweat and the hairs on the base of your neck stand on edge. YOU FORGOT HOW TO PLAY TIC TAC TOE!!!!

Luckily, cs101 has this situation all in hand. You calmly pick out a notebook, make a 3x3 grid, and play Tic Tac Toe like the champion you are. Good work! Now you are ready for Vegas.

Assignment

Write Tic Tac Toe. Tic Tac Toe (or TTT) is an old game that involves two players and a 3x3 matrix. Alternating, each person fills in one of the grid squares with an X or an O (the players choose which one they are beforehand). When one player has three of the same symbol in a vertical, diagonal, or horizontal row, they win. If no one wins, the two players tie and all is well.

Specs

Write a human versus human TTT game that makes sure that each player follows the rules and tells you when one player has won or the game is over. Your squares should be able to be clicked on by the player as his "choice".

Concepts Covered


Any questions??? Mail Saul with any questions or concerns...
Return to Thoughtful Program Journal