Homework # 1 (Due Date: Saturday July 7 by Midnight)
Submit your homework via E-learning
Name your code file StudentID_FirstName.cpp
Download and run the executable file to have a better idea of what the homework should do.
Download the framework code Hw1.cpp and add your code there.
We are going to build Tic Tac Toe game where two players take turn inserting circles or crosses into a 3x3 grid. The first to lay out a vertical, horizonatal, or diangonal row of circles or crosses wins the game.
Visit RGB color picker to lookup red, green, and blue for colors
- [DONE] Prompt the players to enter their first names.
- [DONE] Draw a 3x3 grid of cells that occupies the bottom 50% of the drawing space. (function DrawGrid)
- [TODO] Draw two players (with different colors) on the left and right sides of the grid. Their names should appear too.
- [TODO] Highlight the active player by drawing a rectangle around him.
- [DONE] When a player wins the game or the game ends with a tie a message appears on the screen and the players can no longer click on the grid cells.
- [Partially DONE] When player 1 clicks on an empty cell a circle is drawn inside that cell. Cross is drawn when player 2 clicks inside an empty cell.
- [TODO] When a player makes out a vertical, horizonatal, or diangonal row of circles or crosses he wins and the game is over.
- [TODO] When all cells are clicked and it is not a win then it is a tie and the game is over.
- [TODO] Press 'R' or 'r' on the keyboard resets the game.
- [DONE] Press “ESC” on the keyboard to exit the application.