COMP 2012H Honors Object-Oriented Programming and Data Structures

Lab 1 VS Code, Fundamentals of C++, and Program Flow Control

Common Errors

  1. Negative health, e.g. if Player has only 1 health and doesn't DEFEND, and Computer ATTACKS with CHARGE counter of 1 or more, the game ends with Player's health in the negative. However, not a vital problem.

  2. Forgetting to ask the Player again when receiving an invalid input.

  3. Placing the Computer action code inside the Player action input loop, which advances the PRNG sequence after every invalid Player input, thus causing a PRNG sequence desynchronization compared to the expected output. Instead, Computer action should be done outside the loop. Not a vital problem, but it is an inefficiency.

  4. Forgetting to ask the Player to choose a different action if they tried to CHARGE when already at FULL CHARGE.