Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # dice game - scores
- # roll even number +10, roll odd -5 ( cant go below zero ) roll a double get an extra roll
- # DONT JUST COPY THIS, I WILL ASK QUESTIONS!
- import random
- """
- d1 = random.randint(1,6)
- d2 = random.randint(1,6)
- """
- d1 = int(input("Enter d1 >>"))
- d2 = int(input("Enter d2 >>"))
- d3 = 0
- tot = d1 + d2
- if tot % 2 ==0: # testing there for an even number
- #tot = tot +10
- tot +=10
- else:
- tot -= 5 # tot = tot -5
- if tot < 0:
- tot = 0
- if d1 == d2: # checking for both the same
- d3 = random.randint(1,6)
- tot += d3
- #print("die1=",d1,"die2=", d2, "die3=",d3,"total=", tot)
- #print("die1= " + str(d1) +" die2= " +str(d2) + " tot= " +str(tot)) # concatenation + casting
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement