A student is writing a climbing simulation game in Python.
| 0 | 1 | 2 | 3 | 4 | 5 | 6 |
|---|---|---|---|---|---|---|
| R | R |
0 in a list of handholds representing a cliff.1 or 2 to climb up that many spaces:
1 increases the climber's position by 1.2 increases the climber's position by 2.'R'):
Slipped! is displayed0position = 0
top_index = len(cliff) - 1
while position < top_index:
Extend the program from Figure 3 so that the game works as described in Figure 2.
When writing your program you should assume:
cliff'R' characters in cliff can vary'R' characters in cliff can vary'R' characters have already been added to the list called cliffcliff list can be of any length.You should use indentation as appropriate, meaningful variable name(s), and Python syntax in your answer.
298 exam-style questions on AQA GCSE Computer Science Programming concepts. Each one has a worked solution and a mark scheme showing where the marks go.