Display the game instructions.
()
| 121 | print('from 0 to 14.') |
| 122 | |
| 123 | def showInstructions(): |
| 124 | """Display the game instructions.""" |
| 125 | print('''Instructions: |
| 126 | You are the captain of the Simon, a treasure-hunting ship. Your current |
| 127 | mission is to use sonar devices to find 3 sunken treasure chests at the |
| 128 | bottom of the ocean. But your sonar only finds distance, not direction. |
| 129 | |
| 130 | Enter the coordinates to drop a sonar device. The ocean map will be |
| 131 | marked with how far away the nearest chest is, or an X if it is beyond |
| 132 | the sonar device's range. For example, the C marks are where chests are. |
| 133 | The sonar device shows a 3 because the closest chest is 3 spaces away. |
| 134 | |
| 135 | 1 2 3 |
| 136 | 012345678901234567890123456789012 |
| 137 | |
| 138 | 0 ~~~~.~...~.~..~~~..~.~~..~~~..~.~ 0 |
| 139 | 1 ~.~.~..~~.~...~~~...~~.~.~~~.~~~~ 1 |
| 140 | 2 .~.C..3.~~~~.C.~~~~.....~~..~~~.. 2 |
| 141 | 3 ........~~~.....~~~.~.....~.~..~. 3 |
| 142 | 4 ~.~~~~.~~.~~.C.~..~~.~~~.~...~..~ 4 |
| 143 | |
| 144 | 012345678901234567890123456789012 |
| 145 | 1 2 3 |
| 146 | (In the real game, the chests are not visible in the ocean.) |
| 147 | |
| 148 | Press Enter to continue...''') |
| 149 | input() |
| 150 | |
| 151 | print('''When you drop a sonar device directly on a chest, you |
| 152 | retrieve it. The other sonar devices update to show the distance to the |
| 153 | next nearest chest. The chests are beyond the range of the sonar device |
| 154 | on the left, so it shows an X. |
| 155 | |
| 156 | 1 2 3 |
| 157 | 012345678901234567890123456789012 |
| 158 | |
| 159 | 0 ~~~~.~...~.~..~~~..~.~~..~~~..~.~ 0 |
| 160 | 1 ~.~.~..~~.~...~~~...~~.~.~~~.~~~~ 1 |
| 161 | 2 .~.X..7.~~~~.C.~~~~.....~~..~~~.. 2 |
| 162 | 3 ........~~~.....~~~.~.....~.~..~. 3 |
| 163 | 4 ~.~~~~.~~.~~.C.~..~~.~~~.~...~..~ 4 |
| 164 | |
| 165 | 012345678901234567890123456789012 |
| 166 | 1 2 3 |
| 167 | |
| 168 | The treasure chests don't move around. Sonar devices can detect treasure |
| 169 | chests up to a distance of 9 spaces. Try to collect all 3 chests before |
| 170 | running out of sonar devices. Good luck! |
| 171 | |
| 172 | Press enter to continue...''') |
| 173 | input() |
| 174 | |
| 175 | |
| 176 | print('Sonar, by Al Sweigart al@inventwithpython.com') |