()
| 50 | |
| 51 | |
| 52 | def main(): |
| 53 | bext.fg('yellow') |
| 54 | bext.clear() |
| 55 | |
| 56 | # Draw the quit message: |
| 57 | bext.goto(0, 0) |
| 58 | print('Ctrl-C to quit.', end='') |
| 59 | |
| 60 | # Display the walls of the hourglass: |
| 61 | for wall in HOURGLASS: |
| 62 | bext.goto(wall[X], wall[Y]) |
| 63 | print(WALL, end='') |
| 64 | |
| 65 | while True: # Main program loop. |
| 66 | allSand = list(INITIAL_SAND) |
| 67 | |
| 68 | # Draw the initial sand: |
| 69 | for sand in allSand: |
| 70 | bext.goto(sand[X], sand[Y]) |
| 71 | print(SAND, end='') |
| 72 | |
| 73 | runHourglassSimulation(allSand) |
| 74 | |
| 75 | |
| 76 | def runHourglassSimulation(allSand): |
no test coverage detected