Skip to content

Instantly share code, notes, and snippets.

@behrouz-bakhtiari
Last active October 29, 2021 01:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save behrouz-bakhtiari/7c4ed77cab5ce863f79543b55f9da0a7 to your computer and use it in GitHub Desktop.
Save behrouz-bakhtiari/7c4ed77cab5ce863f79543b55f9da0a7 to your computer and use it in GitHub Desktop.
def game_run():
fell = []
panes = [random.choice([[0,1], [1,0]]) for i in range(num_steps)] # 0 for breakable, 1 for solid
for i in range(num_players):
steps = [random.randint(0,1) for j in range(num_steps)] # 0 for left, 1 for right
for j in range(num_steps):
if panes[j][steps[j]] == 1:
panes[j] = [1, 1]
else:
panes[j] = [1, 1]
fell.append(i)
break
return fell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment