Skip to content

Commit

Permalink
Merge pull request geekcomputers#659 from yehudalevavi/diceV2_dynamic…
Browse files Browse the repository at this point in the history
…Update

Improvements on the "user interface" which allow the user to reroll …
  • Loading branch information
geekcomputers authored Nov 9, 2019
2 parents 3f17f0d + 883a814 commit 3154a34
Showing 1 changed file with 18 additions and 9 deletions.
27 changes: 18 additions & 9 deletions diceV2_dynamic.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,24 @@ def getDices():
return dices


dices = getDices()
# =================================================================
# Output section.


rollOutput = ""

for dice in dices:
rollOutput = rollOutput + str(dice.roll()) + ", "

rollOutput = rollOutput[:-2]
print(rollOutput)
def output():
dices = getDices()
input("Do you wanna roll? press enter")
cont = True
while cont:
rollOutput = ""
for dice in dices:
rollOutput = rollOutput + str(dice.roll()) + ", "
rollOutput = rollOutput[:-2]
print(rollOutput)

print("do you want to roll again?")
ans = input('press enter to continue, and [exit] to exit')
if ans == 'exit':
cont = False

if __name__ == "__main__":
output()

0 comments on commit 3154a34

Please sign in to comment.