March 2018
Beginner
336 pages
8h 6m
English
So far, we have established that we would track several components in the game. These are listed here along with the variable name that we will use in our scripts:
Based on what we decided earlier regarding the end-of-game condition, we can apply the following mathematical checks to determine if the game has ended and what the outcome is. Each end-of-game condition is listed in the following table along with the outcome:
| Condition number | End-of-game condition | Outcome |
| 1 | numberOfCucumbers == 0 | Cucumber Beetles Win |
| 2 |
numberOfCucumberBeetles == 0 |
Cucumber Man Wins |
| 3 | livesLeft == ... |
Read now
Unlock full access