Skip to content

Instantly share code, notes, and snippets.

@ulrichzwingli
Created September 26, 2017 16:20
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 ulrichzwingli/07054eb4fd4c7f8adeae10edb847a633 to your computer and use it in GitHub Desktop.
Save ulrichzwingli/07054eb4fd4c7f8adeae10edb847a633 to your computer and use it in GitHub Desktop.
more of a Pseudo code for playing Beginners Rollet (with Limitations)
# allocating numbers to rollet categories
for rollet in range (36)
// initializing cell counts of categories to zero
rcc = 0, bcc = 0, ecc = 0, occ = 0, dz2c = 0, dz3c = 0, fh=0, sh=0, r1=0,r2=0,r3=0
if (rollet <=1 and rollet >= 10)
y = rollet % 2
if (y is 0):
bcc +=1, ecc +=1
black[bcc] = rollet
even[ecc] = rollet
else
rcc+=1, occ+=1
red[rcc] = rollet, odd[occ] = rollet
elif (rollet <=11 and rollet >= 18):
y = rollet % 2
if (y is 0):
rcc += 1, ecc += 1
red[rcc] = rollet, even[ecc] = rollet
else
bcc += 1
black[bcc] = rollet
occ += 1, odd[occ] = rollet
elif (rollet <= 19 and rollet >= 28):
y = rollet % 2
if (y is 0):
bcc += 1, ecc += 1
black[bcc] = rollet
even [ecc] = rollet
else
rcc += 1, occ += 1
red[rcc] = rollet, odd[occ] = rollet
else
y = rollet % 2
if (y is 0 ):
rcc += 1, ecc += 1
red[rcc] = rollet, even[ecc] = rollet
else
bcc += 1, occ += 1,
black[bcc] = rollet
odd[occ] = rollet
# allocation of numbers finished for 4 rollet categories
# allocation begin for dozen categories, first half, second half
# and row 1, row 2 and row 3 categories
for rollet in range (1,12):
dozen1[rollet] = rollet
for rollet in range (13,24):
dz2c += 1
dozen2[dz2c] = rollet
for rollet in range (25,36):
dz3c += 1
dozen3[dz3c] = rollet
for rollet in range (1,18):
fh += 1
firsthalf[fh] = rollet
for rollet in range (19,36):
sh += 1
secondhalf[sh] = rollet
for rollet in range (1,36,3):
r1 += 1
row1[r1] = rollet
for rollet in range (2,36,3):
r2 += 1
row2[r2] = rollet
for rollet in range (3,36,3):
r3 += 1, row3[r3] = rollet
# all allocation complete
# defining function play
def play():
print ("$$$$$$$ Lets start the game of Rollet $$$$$$$")
print (" put your bet from the following categories")
print (" Black, Red, Even, Odd, Dozen1, Dozen2, Dozen3, Fisrt Half, Second half")
print (" Row1, Row2, Row3 or any number between 1 to 36")
userBet = raw_input ("???")
userDen = raw_input ("Enter the denomibnation you want to play")
print ("Time to roll a Dice")
dice = random.randint(1,36)
print ("And the dice value is......" + dice)
# conditional statements to follow for checking teh winning condition
if (userBet is dice):
prize = userDen * 35
print (" You won Jackpot of" + prize + "$")
break
elif (userBet is "Black"):
if (dice in black):
prize = userDen * 2
print (" You won Jackpot of" + prize + "$")
break
elif (userBet is "Red"):
if (dice in red):
prize = UserDen * 2
print (" You won Jackpot of" + prize + "$")
break
elif (userBet is "Even"):
if (dice in even):
prize = UserDen * 2
print (" You won Jackpot of" + prize + "$")
break
elif (userBet is "Odd"):
if (dice in odd):
prize = UserDen * 2
print (" You won Jackpot of" + prize + "$")
break
elif (userBet is "Dozen1"):
if (dice in dozen1):
prize = UserDen * 3
print (" You won Jackpot of" + prize + "$")
break
elif (userBet is "Dozen2"):
if (dice in dozen2):
prize = UserDen * 3
print (" You won Jackpot of" + prize + "$")
break
elif (userBet is "Dozen3"):
if (dice in dozen3):
prize = UserDen * 3
print (" You won Jackpot of" + prize + "$")
break
elif (userBet is "First Half"):
if (dice in firsthalf):
prize = UserDen * 2
print (" You won Jackpot of" + prize + "$")
break
elif (userBet is "Second Half"):
if (dice in secondhalf):
prize = UserDen * 2
print (" You won Jackpot of" + prize + "$")
break
elif (userBet is "Row1"):
if (dice in row1):
prize = UserDen * 3
print (" You won Jackpot of" + prize + "$")
break
elif (userBet is "Row2"):
if (dice in row2):
prize = UserDen * 3
print (" You won Jackpot of" + prize + "$")
break
elif (userBet is "Row3"):
if (dice in row3):
prize = UserDen * 3
print (" You won Jackpot of" + prize + "$")
break
userChoice = raw_input ("Do you wanna Play More (Y/N) ?")
if userChoice is "Y"
play()
else
print ( "It was good to play with you, Good Bye !")
return
print " Welcome to Rollet"
userChoice = raw_input(" Do you wanna Play (Y/N) ? ")
if (userChoice is "Y")
play()
else
print ( "It was good to play with you, Good Bye !")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment