My own slot machine... in progress


#1

I am trying to make a homemade slot machine that can analise how much money you have left, if you want to spin, then it gives you three numbers. If the numbers are 7, 8, 9, they you get 100 dollars. here is the code, but it sends you directly to you lose. PLZ HELP

import random
count = 0
money = 60
rand_num = random.randint(1, 10)
spin = raw_input('Do you want to spin? y/n ')

while count > 3 and money <= 30 and spin == ‘y’:
print rand_num
count += 1
money -= 10
if num == 7 and num == 8 and num == 9:
print 'Yay you struck BIG money!!! +100 dollars!'
else:
print ‘You lose!’


#2

From just a quick peek, it looks like num is never set, therefore it can never be 7, 8 nor 9. Additionally, your if comparison is checking to see if num is 7 and 8 and 9. How can it be all three at the same time?


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.