Homework # 1 (Due Date: Tuesday October 24 by Midnight)

Submit your homework via E-learning

Name your code file Section#_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.

The game player is asked to guess the positions of a number of boys and girls without accedinetally clicking on a bomb to win the game. The game is a loss if a bomb is clicked before all boys and girls are found.

Visit RGB color picker to lookup red, green, and blue for colors

  1. [DONE] Start by creating a vector of 25 Cells and randomally initialize the Cells types to {empty, boy, girl, bomb}.
  2. [DONE] Draw a 5x5 grid of cells that occupies the bottom 85% of the drawing space.
  3. [DONE] Cell are colored grey when the same starts. glColor3f (0.7, 0.7, 0.7);
  4. [DONE] numBoys, numGrils, and numBoms are initialized and don't need to be changed during the game. The player is shown how many boys, girls, and bombs are there.
  5. [TODO] Implement the functions drawBoy, drawGirl, and drawBomb.
  6. [TODO] When the player clicks a cell, the property clicked is set to true. If the cell type is empty the cell is colored white otherwise boy, girl or bomb is drawn.
  7. [TODO] if numBombsFound > 1 then the game is a lost
  8. [TODO] if numBoys == numBoysFound and numGirls == numGirlsFound then the game is a win
  9. [TODO] Press 'R' or 'r' on the keyboard resets the game.
  10. [DONE] Press “ESC” on the keyboard to exit the application.