MCPcopy Create free account
hub / github.com/asweigart/PythonStdioGames / main

Function main

src/gamesbyexample/hourglass.py:52–73  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

50
51
52def 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
76def runHourglassSimulation(allSand):

Callers 1

hourglass.pyFile · 0.70

Calls 2

runHourglassSimulationFunction · 0.85
clearMethod · 0.80

Tested by

no test coverage detected