UVa 114
From Algorithmist
Contents |
[edit] 114 - Simulation Wizardry
[edit] Summary
Simulate a pinball game according to a set of rules.
[edit] Explanation
Simulate a pinball game according to a set of rules:
- If a ball hits a bumper or a wall, turn right 90 degrees.
- When a ball hits a bumper, add that the point value of the bumper, and subtract the life value.
[edit] Input
4 4 0 2 2 2 1 0 3 3 1 0 2 3 1 1 2 3 1 2 2 3 1 3 2 3 1 4 2 3 1 5
[edit] Output
0 0 1 2 2 5

