Why test?
Did you play the game developed so far? If not, just try playing it once. During the combat with the enemy, the following can be observed. For each attack, either Sir Foo or the enemy sustains injuries. This is indicated by the reduced hit points. For example, in the sample game output shown next, Sir Foo
gets hit in the first attack turn, whereas the enemy is injured in the next two attack turns.
A new feature was requested
A user requested an enhancement to the combat scenario: "During combat, the program asks whether you want to continue attacking the enemy. In each attack move, one of the warriors, the player or the enemy, gets injured. Can you make it more interesting? What if both the warriors escape unhurt sometimes?" |
It will benefit you as well Sir Foo! We will go ahead and implement this minor enhancement. Despite Sir Foo's stiff opposition, you rushed to implement this new feature. |
You implemented this feature
Recall that the gameutils.weighted_random_selection
function...