()
| 11 | |
| 12 | |
| 13 | def main(): |
| 14 | print('''Counting Quiz, by Al Sweigart al@inventwithpython.com |
| 15 | |
| 16 | Use multiplication and subtraction to count the number of stars |
| 17 | shown as fast as possible. For example: |
| 18 | |
| 19 | * * * * * * |
| 20 | * * * * * |
| 21 | * * * * * |
| 22 | |
| 23 | This is a 6 x 3 star field with 2 missing stars. |
| 24 | The answer is 6 x 3 - 2 = 16 |
| 25 | |
| 26 | The quiz is 60 seconds long. |
| 27 | ''') |
| 28 | |
| 29 | while True: |
| 30 | input('Press Enter to begin...') |
| 31 | runQuiz() |
| 32 | print('Would you like to play again? Y/N') |
| 33 | response = input('> ').upper() |
| 34 | if not response.startswith('Y'): |
| 35 | print('Thanks for playing!') |
| 36 | break |
| 37 | |
| 38 | |
| 39 | def runQuiz(): |
no test coverage detected