Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update diceRoller.py #27

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 24 additions & 18 deletions diceRoller.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#Coin flip program
die roll program
#Describe the purpose of this program here.

inport random;time

import random,time
#dice face
s1 = "- - - - -\n| |\n| O |\n| |\n- - - - -\n"
s2 = "- - - - -\n| O |\n| |\n| O |\n- - - - -\n"
s3 = "- - - - -\n| O |\n| O |\n| O |\n- - - - -\n"
Expand All @@ -11,24 +11,30 @@
s6 = "- - - - -\n| O O |\n| O O |\n| O O |\n- - - - -\n"

def roll():
Print("rolling....."
roll = rand.randing(7)


def show_dice(roll)
if roll = 1:
print(S1)
else roll = 2
roll = random.randint(1,6)#picks a random number from 1-6
return roll
#displays the andom number in its dice form
def show_dice(roll):
if roll == 1:
print(s1)
elif roll == 2:
print(s2)
else roll = 3
elif roll == 3:
print(s3)
else roll = 4
elif roll ==4:
print(s4)
else roll = 5
elif roll == 5:
print(s5)
else roll = 6
elif roll == 6:
print(s6)

roll
time.sleep(1)
show_dice(roll)
def roll_dice():
myroll = roll()
time.sleep(1)
show_dice(myroll)
def debug():#funtion for debuging
while True:#for debugging purposes it infinetely repeats diferent random numbers so i could check if all numbers would be displayed
myroll = roll()
time.sleep(1)
show_dice(myroll)#displays myroll