Im trying to make a codebreaker game but for some reason it doesnt work please help
done = 0
guess = 0
import random
a=random.randrange(0,9)
str(a)
b=random.randrange(0,9)
str(b)
c=random.randrange(0,9)
str(c)
d=random.randrange(0,9)
str(d)
print a,b,c,d #Its on so I can guess the correct number
while done == 0:
ag=raw_input("Input a single digit between 9 and 0 : ")
bg=raw_input("Input a single digit between 9 and 0 : ")
cg=raw_input("Input a single digit between 9 and 0 : ")
dg=raw_input("Input a single digit between 9 and 0 : ")
print ag,bg,cg,dg
if ag == a and bg == b and cg == c and dg == d:
print "Well Done! You Got it correct in " ,guess, " times!"
done = 1
else:
print "Incorrect"
if ag == a :
print "You succsessfully guessed the first number!"
if bg == b :
print "You succsessfully guessed the second number!"
if cg == c :
print "You succsessfully guessed the third number!"
if dg == d :
print "You succsessfully guessed the forth number!"
Im thinking this is supposed to work as when I get some right numbers it will print that you got "n" number correct but it always comes out with this :
>> 5 8 3 3
>> Input a single digit between 9 and 0 : 5
>> Input a single digit between 9 and 0 : 8
>> Input a single digit between 9 and 0 : 3
>> Input a single digit between 9 and 0 : 3
>> 5 8 3 3
>> Incorrect