ALL (421)
# 6030048821 (17.37) 1 (2021-02-13 22:51) turn = 1 win = False #turn 1 P = V = X = 0 guess = input("Turn #"+str(turn)+" : ").strip().upper() if guess[0] in code: if guess[0] == code[0]: P += 1 else: V += 1 else: X += 1 if guess[1] in code: if guess[1] == code[1]: P += 1 else: V += 1 else: X += 1 if guess[2] in code: if guess[2] == code[2]: P += 1 else: V += 1 else: X += 1 if guess[3] in code: if guess[3] == code[3]: P += 1 else: V += 1 else: X += 1 if P == 4: print("Congratulations! You won the game.") win = True else: print(" P=%d,V=%d,X=%d" % (P,V,X)) turn += 1 #------ #turn 2 if not win: P = V = X = 0 guess = input("Turn #"+str(turn)+" : ").strip().upper() if guess[0] in code: if guess[0] == code[0]: P += 1 else: V += 1 else: X += 1 if guess[1] in code: if guess[1] == code[1]: P += 1 else: V += 1 else: X += 1 if guess[2] in code: if guess[2] == code[2]: P += 1 else: V += 1 else: X += 1 if guess[3] in code: if guess[3] == code[3]: P += 1 else: V += 1 else: X += 1 if P == 4: print("Congratulations! You won the game.") win = True else: print(" P=%d,V=%d,X=%d" % (P,V,X)) turn += 1 #------ #turn 3 if not win: P = V = X = 0 guess = input("Turn #"+str(turn)+" : ").strip().upper() if guess[0] in code: if guess[0] == code[0]: P += 1 else: V += 1 else: X += 1 if guess[1] in code: if guess[1] == code[1]: P += 1 else: V += 1 else: X += 1 if guess[2] in code: if guess[2] == code[2]: P += 1 else: V += 1 else: X += 1 if guess[3] in code: if guess[3] == code[3]: P += 1 else: V += 1 else: X += 1 if P == 4: print("Congratulations! You won the game.") win = True else: print(" P=%d,V=%d,X=%d" % (P,V,X)) turn += 1 #------ #turn 4 if not win: P = V = X = 0 guess = input("Turn #"+str(turn)+" : ").strip().upper() if guess[0] in code: if guess[0] == code[0]: P += 1 else: V += 1 else: X += 1 if guess[1] in code: if guess[1] == code[1]: P += 1 else: V += 1 else: X += 1 if guess[2] in code: if guess[2] == code[2]: P += 1 else: V += 1 else: X += 1 if guess[3] in code: if guess[3] == code[3]: P += 1 else: V += 1 else: X += 1 if P == 4: print("Congratulations! You won the game.") win = True else: print("Sorry! You just lost it.") print("The answer is",code) print("Please try again...") #------ |
# 6030182121 (20.00) 2 (2021-02-15 13:59) import sys turn = input("Turn #1 : ") P = 0 B = 0 if turn[0] == code[0]: P += 1 if turn[1] == code[1]: P += 1 if turn[2] == code[2]: P +=1 if turn[3] == code[3]: P += 1 print(WINNING_MSG) sys.exit() else: P += 0 if turn[0] in code: B += 1 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: P += 0 if turn[3] == code[3]: P += 1 if turn[0] in code: B += 1 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: P += 0 if turn[0] in code: B += 1 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: P += 0 if turn[2] == code[2]: P +=1 if turn[3] == code[3]: P += 1 if turn[0] in code: B += 1 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: P += 0 if turn[0] in code: B += 1 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: P += 0 if turn[3] == code[3]: P += 1 if turn[0] in code: B += 1 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: P += 0 if turn[0] in code: B += 1 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else : P += 0 if turn[1] == code[1]: P += 1 if turn[2] == code[2]: P += 1 if turn[3] == code[3]: P += 1 if turn[0] in code: B += 1 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: P += 0 if turn[0] in code: B += 1 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: P += 0 if turn[3] == code[3]: P += 1 if turn[0] in code: B += 1 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: P += 0 if turn[0] in code: B += 1 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: P += 0 if turn[2] == code[2]: P += 1 if turn[3] == code[3]: P += 1 if turn[0] in code: B += 1 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: P += 0 if turn[0] in code: B += 1 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: P += 0 if turn[3] == code[3]: P += 1 if turn[0] in code: B += 1 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: P += 0 if turn[0] in code: B += 1 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) #--------------------------------------------------------- turn = input("Turn #2 : ") P = 0 B = 0 if turn[0] == code[0]: P += 1 if turn[1] == code[1]: P += 1 if turn[2] == code[2]: P +=1 if turn[3] == code[3]: P += 1 print(WINNING_MSG) sys.exit() else: P += 0 if turn[0] in code: B += 1 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: P += 0 if turn[3] == code[3]: P += 1 if turn[0] in code: B += 1 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: P += 0 if turn[0] in code: B += 1 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: P += 0 if turn[2] == code[2]: P +=1 if turn[3] == code[3]: P += 1 if turn[0] in code: B += 1 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: P += 0 if turn[0] in code: B += 1 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: P += 0 if turn[3] == code[3]: P += 1 if turn[0] in code: B += 1 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: P += 0 if turn[0] in code: B += 1 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else : P += 0 if turn[1] == code[1]: P += 1 if turn[2] == code[2]: P += 1 if turn[3] == code[3]: P += 1 if turn[0] in code: B += 1 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: P += 0 if turn[0] in code: B += 1 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: P += 0 if turn[3] == code[3]: P += 1 if turn[0] in code: B += 1 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: P += 0 if turn[0] in code: B += 1 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: P += 0 if turn[2] == code[2]: P += 1 if turn[3] == code[3]: P += 1 if turn[0] in code: B += 1 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: P += 0 if turn[0] in code: B += 1 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: P += 0 if turn[3] == code[3]: P += 1 if turn[0] in code: B += 1 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: P += 0 if turn[0] in code: B += 1 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) #--------------------------------------------------------- turn = input("Turn #3 : ") P = 0 B = 0 if turn[0] == code[0]: P += 1 if turn[1] == code[1]: P += 1 if turn[2] == code[2]: P +=1 if turn[3] == code[3]: P += 1 print(WINNING_MSG) sys.exit() else: P += 0 if turn[0] in code: B += 1 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: P += 0 if turn[3] == code[3]: P += 1 if turn[0] in code: B += 1 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: P += 0 if turn[0] in code: B += 1 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: P += 0 if turn[2] == code[2]: P +=1 if turn[3] == code[3]: P += 1 if turn[0] in code: B += 1 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: P += 0 if turn[0] in code: B += 1 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: P += 0 if turn[3] == code[3]: P += 1 if turn[0] in code: B += 1 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: P += 0 if turn[0] in code: B += 1 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else : P += 0 if turn[1] == code[1]: P += 1 if turn[2] == code[2]: P += 1 if turn[3] == code[3]: P += 1 if turn[0] in code: B += 1 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: P += 0 if turn[0] in code: B += 1 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: P += 0 if turn[3] == code[3]: P += 1 if turn[0] in code: B += 1 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: P += 0 if turn[0] in code: B += 1 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: P += 0 if turn[2] == code[2]: P += 1 if turn[3] == code[3]: P += 1 if turn[0] in code: B += 1 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: P += 0 if turn[0] in code: B += 1 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: P += 0 if turn[3] == code[3]: P += 1 if turn[0] in code: B += 1 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: P += 0 if turn[0] in code: B += 1 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) #--------------------------------------------------- turn = input("Turn #4 : ") P = 0 B = 0 if turn[0] == code[0]: P += 1 if turn[1] == code[1]: P += 1 if turn[2] == code[2]: P +=1 if turn[3] == code[3]: P += 1 print(WINNING_MSG) sys.exit() else: P += 0 if turn[0] in code: B += 1 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: P += 0 if turn[3] == code[3]: P += 1 if turn[0] in code: B += 1 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: P += 0 if turn[0] in code: B += 1 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: P += 0 if turn[2] == code[2]: P +=1 if turn[3] == code[3]: P += 1 if turn[0] in code: B += 1 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: P += 0 if turn[0] in code: B += 1 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: P += 0 if turn[3] == code[3]: P += 1 if turn[0] in code: B += 1 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: P += 0 if turn[0] in code: B += 1 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else : P += 0 if turn[1] == code[1]: P += 1 if turn[2] == code[2]: P += 1 if turn[3] == code[3]: P += 1 if turn[0] in code: B += 1 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: P += 0 if turn[0] in code: B += 1 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: P += 0 if turn[3] == code[3]: P += 1 if turn[0] in code: B += 1 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: P += 0 if turn[0] in code: B += 1 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: P += 0 if turn[2] == code[2]: P += 1 if turn[3] == code[3]: P += 1 if turn[0] in code: B += 1 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: P += 0 if turn[0] in code: B += 1 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: P += 0 if turn[3] == code[3]: P += 1 if turn[0] in code: B += 1 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: P += 0 if turn[0] in code: B += 1 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B +=0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[1] in code: B += 1 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[2] in code: B += 1 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 if turn[3] in code: B += 1 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) else: B += 0 print(" P="+str(P)+","+"V="+str(abs(P-B))+","+"X="+str(4-(abs(P-B)+P))) print(LOSING_MSG) print("The answer is "+ code) print("Please try again" + 3*".") sys.exit() |
# 6030239321 (20.00) 3 (2021-02-13 00:18) print("Turn #1 : ",end='') x = input().strip() if check(x)==False : print("Turn #2 : ",end='') x = input().strip() if check(x)==False : print("Turn #3 : ",end='') x = input().strip() if check(x)==False : print("Turn #4 : ",end='') x = input().strip() if check(x)==False : print(LOSING_MSG) print("The answer is "+code) print("Please try again...") #--------------------------------------------------- |
# 6030380021 (19.11) 4 (2021-02-15 20:57) print("Turn #1 :") a = input().strip() p = v = x = 0 if a[0] == code[0]: p += 1 elif a[0] in code: v += 1 elif a[0] not in code: x += 1 if a[1] == code[1]: p += 1 elif a[1] in code: v += 1 elif a[1] not in code: x += 1 if a[2] == code[2]: p += 1 elif a[2] in code: v += 1 elif a[2] not in code: x += 1 if a[3] == code[3]: p += 1 elif a[3] in code: v += 1 elif a[3] not in code: x += 1 if p == 4: print(WINNING_MSG) exit() else: print("P="+str(p)+",V="+str(v)+",X="+str(x)) print("Turn #2 :") a = input().strip() p = v = x = 0 if a[0] == code[0]: p += 1 elif a[0] in code: v += 1 elif a[0] not in code: x += 1 if a[1] == code[1]: p += 1 elif a[1] in code: v += 1 elif a[1] not in code: x += 1 if a[2] == code[2]: p += 1 elif a[2] in code: v += 1 elif a[2] not in code: x += 1 if a[3] == code[3]: p += 1 elif a[3] in code: v += 1 elif a[3] not in code: x += 1 if p == 4: print(WINNING_MSG) exit() else: print("P="+str(p)+",V="+str(v)+",X="+str(x)) print("Turn #3 :") a = input().strip() p = v = x = 0 if a[0] == code[0]: p += 1 elif a[0] in code: v += 1 elif a[0] not in code: x += 1 if a[1] == code[1]: p += 1 elif a[1] in code: v += 1 elif a[1] not in code: x += 1 if a[2] == code[2]: p += 1 elif a[2] in code: v += 1 elif a[2] not in code: x += 1 if a[3] == code[3]: p += 1 elif a[3] in code: v += 1 elif a[3] not in code: x += 1 if p == 4: print(WINNING_MSG) exit() else: print("P="+str(p)+",V="+str(v)+",X="+str(x)) print("Turn #4 :") a = input().strip() p = v = x = 0 if a[0] == code[0]: p += 1 elif a[0] in code: v += 1 elif a[0] not in code: x += 1 if a[1] == code[1]: p += 1 elif a[1] in code: v += 1 elif a[1] not in code: x += 1 if a[2] == code[2]: p += 1 elif a[2] in code: v += 1 elif a[2] not in code: x += 1 if a[3] == code[3]: p += 1 elif a[3] in code: v += 1 elif a[3] not in code: x += 1 if p == 4: print(WINNING_MSG) exit() else: print("P="+str(p)+",V="+str(v)+",X="+str(x)) print(LOSING_MSG) print("The answer is "+code) print("Please try again...") |
# 6030924521 (17.23) 5 (2021-02-14 19:08) p1 = 0 v1 = 0 x1 = 0 incode1 = "" t1 = input("Turn #1 : ") if t1[0] == code[0] : p1 += 1 incode1 += code[0] if t1[1] == code[1] : p1 +=1 incode1 += code[1] if t1[2] == code[2] : p1 +=1 incode1 += code[2] if t1[3] == code[3] : p1 +=1 incode1 += code[3] for e in t1[0:] : if e not in incode1[0:] : if e == code[0] : v1+=1 elif e == code[1] : v1 += 1 elif e == code[2] : v1 += 1 elif e == code[3] : v1 += 1 else : v1+=0 x1 = len(code)- (p1+v1) print(" P",p1,sep ="=",end=",") print("V",v1,sep="=",end=",") print("X",x1,sep="=",) if p1 == 4 : print(WINNING_MSG) #------------------------------------ p2 = 0 v2 = 0 x2 = 0 incode2 = "" t2 = input("Turn #2 : ") if t2[0] == code[0] : p2 += 1 incode2 += code[0] if t2[1] == code[1] : p2 +=1 incode2 += code[1] if t2[2] == code[2] : p2 +=1 incode2 += code[2] if t2[3] == code[3] : p2 +=1 incode2 += code[3] for e in t2[0:] : if e not in incode2[0:] : if e == code[0] : v2+=1 elif e == code[1] : v2 += 1 elif e == code[2] : v2 += 1 elif e == code[3] : v2 += 1 else : v2+=0 x2 = len(code)- (p2+v2) print(" P",p2,sep ="=",end=",") print("V",v2,sep="=",end=",") print("X",x2,sep="=",) if p2 == 4 : print(WINNING_MSG) #------------------------------------ p3 = 0 v3 = 0 x3 = 0 incode3 = "" t3 = input("Turn #3 : ") if t3[0] == code[0] : p3 += 1 incode3 += code[0] if t3[1] == code[1] : p3 +=1 incode3 += code[1] if t3[2] == code[2] : p3 +=1 incode3 += code[2] if t3[3] == code[3] : p3 +=1 incode3 += code[3] for e in t3[0:] : if e not in incode3[0:] : if e == code[0] : v3+=1 elif e == code[1] : v3 += 1 elif e == code[2] : v3 += 1 elif e == code[3] : v3 += 1 else : v3+=0 x3 = len(code)- (p3+v3) print(" P",p3,sep ="=",end=",") print("V",v3,sep="=",end=",") print("X",x3,sep="=",) if p3 == 4 : print(WINNING_MSG) #------------------------------------ p4 = 0 v4 = 0 x4 = 0 incode4 = "" t4 = input("Turn #4 : ") if t4[0] == code[0] : p4 += 1 incode4 += code[0] if t4[1] == code[1] : p4 +=1 incode4 += code[1] if t4[2] == code[2] : p4 +=1 incode4 += code[2] if t4[3] == code[3] : p4 +=1 incode4 += code[3] for e in t4[0:] : if e not in incode4[0:] : if e == code[0] : v4+=1 elif e == code[1] : v4 += 1 elif e == code[2] : v4 += 1 elif e == code[3] : v4 += 1 else : v4+=0 x4 = len(code)- (p4+v4) print(" P",p2,sep ="=",end=",") print("V",v2,sep="=",end=",") print("X",x2,sep="=",) if p4 == 4 : print(WINNING_MSG) else : print(LOSING_MSG) print("The answer is",code) print("Please try again...") |
# 6130097621 (19.11) 6 (2021-02-15 16:18) #1 a = str(input("Turn #1 : ")) P = 0 V = 0 X = 0 if a[0] == code[0] : P = P+1 elif a[0] == code[1] or a[0] == code[2] or a[0] == code[3] : V = V+1 else : X = X+1 if a[1] == code[1] : P = P+1 elif a[1] == code[2] or a[1] == code[3] or a[1] == code[0] : V = V+1 else : X = X+1 if a[2] == code[2] : P = P+1 elif a[2] == code[3] or a[2] == code[0] or a[2] == code[1] : V = V+1 else : X = X+1 if a[3] == code[3] : P = P+1 elif a[3] == code[0] or a[3] == code[1] or a[3] == code[2] : V = V+1 else : X = X+1 print(" ""P="+str(P)+",V="+str(V)+",X="+str(X)) if P == 4: print("Congratulations! You won the game.") exit() #2 a = str(input("Turn #2 : ")) P = 0 V = 0 X = 0 if a[0] == code[0] : P = P+1 elif a[0] == code[1] or a[0] == code[2] or a[0] == code[3] : V = V+1 else : X = X+1 if a[1] == code[1] : P = P+1 elif a[1] == code[2] or a[1] == code[3] or a[1] == code[0] : V = V+1 else : X = X+1 if a[2] == code[2] : P = P+1 elif a[2] == code[3] or a[2] == code[0] or a[2] == code[1] : V = V+1 else : X = X+1 if a[3] == code[3] : P = P+1 elif a[3] == code[0] or a[3] == code[1] or a[3] == code[2] : V = V+1 else : X = X+1 print(" ""P="+str(P)+",V="+str(V)+",X="+str(X)) if P == 4 : print("Congratulations! You won the game.") exit() #3 a = str(input("Turn #3 : ")) P = 0 V = 0 X = 0 if a[0] == code[0] : P = P+1 elif a[0] == code[1] or a[0] == code[2] or a[0] == code[3] : V = V+1 else : X = X+1 if a[1] == code[1] : P = P+1 elif a[1] == code[2] or a[1] == code[3] or a[1] == code[0] : V = V+1 else : X = X+1 if a[2] == code[2] : P = P+1 elif a[2] == code[3] or a[2] == code[0] or a[2] == code[1] : V = V+1 else : X = X+1 if a[3] == code[3] : P = P+1 elif a[3] == code[0] or a[3] == code[1] or a[3] == code[2] : V = V+1 else : X = X+1 print(" ""P="+str(P)+",V="+str(V)+",X="+str(X)) if P == 4 : print("Congratulations! You won the game.") exit() #4 a = str(input("Turn #4 : ")) P = 0 V = 0 X = 0 if a[0] == code[0] : P = P+1 elif a[0] == code[1] or a[0] == code[2] or a[0] == code[3] : V = V+1 else : X = X+1 if a[1] == code[1] : P = P+1 elif a[1] == code[2] or a[1] == code[3] or a[1] == code[0] : V = V+1 else : X = X+1 if a[2] == code[2] : P = P+1 elif a[2] == code[3] or a[2] == code[0] or a[2] == code[1] : V = V+1 else : X = X+1 if a[3] == code[3] : P = P+1 elif a[3] == code[0] or a[3] == code[1] or a[3] == code[2] : V = V+1 else : X = X+1 print(" ""P="+str(P)+",V="+str(V)+",X="+str(X)) if P == 4 : print("Congratulations! You won the game.") exit() else : print("Sorry! You just lost it.") print("The answer is",code) print("Please try again...") |
# 6130917221 (20.00) 7 (2021-02-13 02:45) code2 = list(code) P = 0; V = 0; X = 0 n = 1 #1----------------------------------------------------- if n == 1 : ip = input('Turn #' + str(n) + ' : ') ip = list(ip) if ip[0] in code2 : if ip[0] == code2[0] : P += 1 elif ip[0] == code2[1] or code2[2] or code2[3] : V += 1 else : X += 1 if ip[1] in code2 : if ip[1] == code2[1] : P += 1 elif ip[1] == code2[0] or code2[2] or code2[3] : V += 1 else : X += 1 if ip[2] in code2 : if ip[2] == code2[2] : P += 1 elif ip[2] == code2[0] or code2[1] or code2[3] : V += 1 else : X += 1 if ip[3] in code2 : if ip[3] == code2[3] : P += 1 elif ip[3] == code2[0] or code2[1] or code2[2] : V += 1 else : X += 1 #2----------------------------------------------------- if P == 4 : print(WINNING_MSG) pass else : n += 1 print(' P=' + str(P) + ',V=' + str(V) + ',X=' + str(X)) ip = input('Turn #' + str(n) + ' : ') ip = list(ip) P = 0; V = 0; X = 0 if ip[0] in code2 : if ip[0] == code2[0] : P += 1 elif ip[0] == code2[1] or code2[2] or code2[3] : V += 1 else : X += 1 if ip[1] in code2 : if ip[1] == code2[1] : P += 1 elif ip[1] == code2[0] or code2[2] or code2[3] : V += 1 else : X += 1 if ip[2] in code2 : if ip[2] == code2[2] : P += 1 elif ip[2] == code2[0] or code2[1] or code2[3] : V += 1 else : X += 1 if ip[3] in code2 : if ip[3] == code2[3] : P += 1 elif ip[3] == code2[0] or code2[1] or code2[2] : V += 1 else : X += 1 #3----------------------------------------------------- if P == 4 : print(WINNING_MSG) pass else : n += 1 print(' P=' + str(P) + ',V=' + str(V) + ',X=' + str(X)) ip = input('Turn #' + str(n) + ' : ') ip = list(ip) P = 0; V = 0; X = 0 if ip[0] in code2 : if ip[0] == code2[0] : P += 1 elif ip[0] == code2[1] or code2[2] or code2[3] : V += 1 else : X += 1 if ip[1] in code2 : if ip[1] == code2[1] : P += 1 elif ip[1] == code2[0] or code2[2] or code2[3] : V += 1 else : X += 1 if ip[2] in code2 : if ip[2] == code2[2] : P += 1 elif ip[2] == code2[0] or code2[1] or code2[3] : V += 1 else : X += 1 if ip[3] in code2 : if ip[3] == code2[3] : P += 1 elif ip[3] == code2[0] or code2[1] or code2[2] : V += 1 else : X += 1 #4----------------------------------------------------- if P == 4 : print(WINNING_MSG) pass else : n += 1 print(' P=' + str(P) + ',V=' + str(V) + ',X=' + str(X)) ip = input('Turn #' + str(n) + ' : ') ip = list(ip) P = 0; V = 0; X = 0 if ip[0] in code2 : if ip[0] == code2[0] : P += 1 elif ip[0] == code2[1] or code2[2] or code2[3] : V += 1 else : X += 1 if ip[1] in code2 : if ip[1] == code2[1] : P += 1 elif ip[1] == code2[0] or code2[2] or code2[3] : V += 1 else : X += 1 if ip[2] in code2 : if ip[2] == code2[2] : P += 1 elif ip[2] == code2[0] or code2[1] or code2[3] : V += 1 else : X += 1 if ip[3] in code2 : if ip[3] == code2[3] : P += 1 elif ip[3] == code2[0] or code2[1] or code2[2] : V += 1 else : X += 1 #----------------------------------------------------- if P == 4 : print(WINNING_MSG) else : print(' P=' + str(P) + ',V=' + str(V) + ',X=' + str(X)) print(LOSING_MSG) print('''The answer is ''' + code) print('''Please try again... ''') |
# 6130924621 (20.00) 8 (2021-02-14 00:45) p=0 v=0 x=0 n=1 if n==1: c=input("Turn #"+str(n)+" : ") if code[0] in c[0]: p+=1 if code[1] in c[1]: p+=1 if code[2] in c[2]: p+=1 if code[3] in c[3]: p+=1 if code[0] in c[:]: v+=1 else: x+=1 if code[1] in c[:]: v+=1 else: x+=1 if code[2] in c[:]: v+=1 else: x+=1 if code[3] in c[:]: v+=1 else: x+=1 if p==4: print(WINNING_MSG) pass else: print(" "+'P='+str(p)+","+'V='+str(int(v)-int(p))+","+'X='+str(x)) n+=1 p=0 v=0 x=0 if n==2: c=input("Turn #"+str(n)+" : ") if code[0] in c[0]: p+=1 if code[1] in c[1]: p+=1 if code[2] in c[2]: p+=1 if code[3] in c[3]: p+=1 if code[0] in c[:]: v+=1 else: x+=1 if code[1] in c[:]: v+=1 else: x+=1 if code[2] in c[:]: v+=1 else: x+=1 if code[3] in c[:]: v+=1 else: x+=1 if p==4: print(WINNING_MSG) pass else: print(" "+'P='+str(p)+","+'V='+str(int(v)-int(p))+","+'X='+str(x)) n+=1 p=0 v=0 x=0 if n==3: c=input("Turn #"+str(n)+" : ") if code[0] in c[0]: p+=1 if code[1] in c[1]: p+=1 if code[2] in c[2]: p+=1 if code[3] in c[3]: p+=1 if code[0] in c[:]: v+=1 else: x+=1 if code[1] in c[:]: v+=1 else: x+=1 if code[2] in c[:]: v+=1 else: x+=1 if code[3] in c[:]: v+=1 else: x+=1 if p==4: print(WINNING_MSG) pass else: print(" "+'P='+str(p)+","+'V='+str(int(v)-int(p))+","+'X='+str(x)) p=0 v=0 x=0 n+=1 if n==4: c=input("Turn #"+str(n)+" : ") if code[0] in c[0]: p+=1 if code[1] in c[1]: p+=1 if code[2] in c[2]: p+=1 if code[3] in c[3]: p+=1 if code[0] in c[:]: v+=1 else: x+=1 if code[1] in c[:]: v+=1 else: x+=1 if code[2] in c[:]: v+=1 else: x+=1 if code[3] in c[:]: v+=1 else: x+=1 if p==4: print(WINNING_MSG) pass else: print(" "+'P='+str(p)+","+'V='+str(int(v)-int(p))+","+'X='+str(x)) n+=1 p=0 v=0 x=0 print(LOSING_MSG) print("The answer is "+str(code)) print("Please try again...") |
# 6230041021 (13.51) 9 (2021-02-13 00:09) q = input() p = 0 v = 0 x = 0 if q[0] == code[0]: p += 1 elif q[0] in code : v += 1 if q[1] == code[1]: p += 1 elif q[1] in code : v += 1 if q[2] == code[2]: p += 1 elif q[2] in code : v += 1 if q[3] == code[3]: p += 1 elif q[3] in code : v += 1 x = 4 - (p+ v) p = str(p) v = str(v) x = str(x) if p == '4': print('Turn #1 :'+ q) print(WINNING_MSG) else: print('Turn #1 :'+ q) print(' '+'p='+ p,'v='+ v,'x='+ x) q = input() p = 0 v = 0 x = 0 if q[0] == code[0]: p += 1 elif q[0] in code : v += 1 if q[1] == code[1]: p += 1 elif q[1] in code : v += 1 if q[2] == code[2]: p += 1 elif q[2] in code : v += 1 if q[3] == code[3]: p += 1 elif q[3] in code : v += 1 x = 4 - (p+ v) p = str(p) v = str(v) x = str(x) if p == '4': print('Turn #2 :'+ q) print(WINNING_MSG) else: print('Turn #2 :'+ q) print(' '+'p='+ p,'v='+ v,'x='+ x) q = input() p = 0 v = 0 x = 0 if q[0] == code[0]: p += 1 elif q[0] in code : v += 1 if q[1] == code[1]: p += 1 elif q[1] in code : v += 1 if q[2] == code[2]: p += 1 elif q[2] in code : v += 1 if q[3] == code[3]: p += 1 elif q[3] in code : v += 1 x = 4 - (p+ v) p = str(p) v = str(v) x = str(x) if p == '4': print('Turn #3 :'+ q) print(WINNING_MSG) else: print('Turn #3 :'+ q) print(' '+'p='+ p,'v='+ v,'x='+ x) q = input() p = 0 v = 0 x = 0 if q[0] == code[0]: p += 1 elif q[0] in code : v += 1 if q[1] == code[1]: p += 1 elif q[1] in code : v += 1 if q[2] == code[2]: p += 1 elif q[2] in code : v += 1 if q[3] == code[3]: p += 1 elif q[3] in code : v += 1 x = 4 - (p+ v) p = str(p) v = str(v) x = str(x) if p == '4': print('Turn #4 :'+ q) print(WINNING_MSG) else: print(LOSING_MSG) print('The anser is '+code) print('Please try again...') |
# 6230092021 (20.00) 10 (2021-02-11 23:59) x=input("Turn #1 : ") p1=0 v1=0 x1=0 if x[0]==code[0]: p1+=1 v1+=0 x1+=0 elif x[0] in code and x[0]!=code[0]: p1+=0 v1+=1 x1+=0 elif x[0]!=code[0] and x[0]!=code[1] and x[0]!=code[2] and x[0]!=code[3]: p1+=0 v1+=0 x1+=1 if x[1]==code[1]: p1+=1 v1+=0 x1+=0 elif x[1] in code and x[1]!=code[1]: p1+=0 v1+=1 x1+=0 elif x[1]!=code[0] and x[1]!=code[1] and x[1]!=code[2] and x[1]!=code[3]: p1+=0 v1+=0 x1+=1 if x[2]==code[2]: p1+=1 v1+=0 x1+=0 elif x[2] in code and x[2]!=code[2]: p1+=0 v1+=1 x1+=0 elif x[2]!=code[0] and x[2]!=code[1] and x[2]!=code[2] and x[2]!=code[3]: p1+=0 v1+=0 x1+=1 if x[3]==code[3]: p1+=1 v1+=0 x1+=0 elif x[3] in code and x[3]!=code[3]: p1+=0 v1+=1 x1+=0 elif x[3]!=code[0] and x[3]!=code[1] and x[3]!=code[2] and x[3]!=code[3]: p1+=0 v1+=0 x1+=1 p1=str(p1) v1=str(v1) x1=str(x1) result='P='+p1+','+'V='+v1+','+'X='+x1 if result =='P=4,V=0,X=0': print("Congratulations! You won the game.") else: print(result) x=input("Turn #2 : ") p1=0 v1=0 x1=0 if x[0]==code[0]: p1+=1 v1+=0 x1+=0 elif x[0] in code and x[0]!=code[0]: p1+=0 v1+=1 x1+=0 elif x[0]!=code[0] and x[0]!=code[1] and x[0]!=code[2] and x[0]!=code[3]: p1+=0 v1+=0 x1+=1 if x[1]==code[1]: p1+=1 v1+=0 x1+=0 elif x[1] in code and x[1]!=code[1]: p1+=0 v1+=1 x1+=0 elif x[1]!=code[0] and x[1]!=code[1] and x[1]!=code[2] and x[1]!=code[3]: p1+=0 v1+=0 x1+=1 if x[2]==code[2]: p1+=1 v1+=0 x1+=0 elif x[2] in code and x[2]!=code[2]: p1+=0 v1+=1 x1+=0 elif x[2]!=code[0] and x[2]!=code[1] and x[2]!=code[2] and x[2]!=code[3]: p1+=0 v1+=0 x1+=1 if x[3]==code[3]: p1+=1 v1+=0 x1+=0 elif x[3] in code and x[3]!=code[3]: p1+=0 v1+=1 x1+=0 elif x[3]!=code[0] and x[3]!=code[1] and x[3]!=code[2] and x[3]!=code[3]: p1+=0 v1+=0 x1+=1 p1=str(p1) v1=str(v1) x1=str(x1) result='P='+p1+','+'V='+v1+','+'X='+x1 if result =='P=4,V=0,X=0': print("Congratulations! You won the game.") else: print(result) x=input("Turn #3 : ") p1=0 v1=0 x1=0 if x[0]==code[0]: p1+=1 v1+=0 x1+=0 elif x[0] in code and x[0]!=code[0]: p1+=0 v1+=1 x1+=0 elif x[0]!=code[0] and x[0]!=code[1] and x[0]!=code[2] and x[0]!=code[3]: p1+=0 v1+=0 x1+=1 if x[1]==code[1]: p1+=1 v1+=0 x1+=0 elif x[1] in code and x[1]!=code[1]: p1+=0 v1+=1 x1+=0 elif x[1]!=code[0] and x[1]!=code[1] and x[1]!=code[2] and x[1]!=code[3]: p1+=0 v1+=0 x1+=1 if x[2]==code[2]: p1+=1 v1+=0 x1+=0 elif x[2] in code and x[2]!=code[2]: p1+=0 v1+=1 x1+=0 elif x[2]!=code[0] and x[2]!=code[1] and x[2]!=code[2] and x[2]!=code[3]: p1+=0 v1+=0 x1+=1 if x[3]==code[3]: p1+=1 v1+=0 x1+=0 elif x[3] in code and x[3]!=code[3]: p1+=0 v1+=1 x1+=0 elif x[3]!=code[0] and x[3]!=code[1] and x[3]!=code[2] and x[3]!=code[3]: p1+=0 v1+=0 x1+=1 p1=str(p1) v1=str(v1) x1=str(x1) result='P='+p1+','+'V='+v1+','+'X='+x1 if result =='P=4,V=0,X=0': print("Congratulations! You won the game.") else: print(result) x=input("Turn #4 : ") p1=0 v1=0 x1=0 if x[0]==code[0]: p1+=1 v1+=0 x1+=0 elif x[0] in code and x[0]!=code[0]: p1+=0 v1+=1 x1+=0 elif x[0]!=code[0] and x[0]!=code[1] and x[0]!=code[2] and x[0]!=code[3]: p1+=0 v1+=0 x1+=1 if x[1]==code[1]: p1+=1 v1+=0 x1+=0 elif x[1] in code and x[1]!=code[1]: p1+=0 v1+=1 x1+=0 elif x[1]!=code[0] and x[1]!=code[1] and x[1]!=code[2] and x[1]!=code[3]: p1+=0 v1+=0 x1+=1 if x[2]==code[2]: p1+=1 v1+=0 x1+=0 elif x[2] in code and x[2]!=code[2]: p1+=0 v1+=1 x1+=0 elif x[2]!=code[0] and x[2]!=code[1] and x[2]!=code[2] and x[2]!=code[3]: p1+=0 v1+=0 x1+=1 if x[3]==code[3]: p1+=1 v1+=0 x1+=0 elif x[3] in code and x[3]!=code[3]: p1+=0 v1+=1 x1+=0 elif x[3]!=code[0] and x[3]!=code[1] and x[3]!=code[2] and x[3]!=code[3]: p1+=0 v1+=0 x1+=1 p1=str(p1) v1=str(v1) x1=str(x1) result='P='+p1+','+'V='+v1+','+'X='+x1 if result =='P=4,V=0,X=0': print("Congratulations! You won the game.") else: print(result) print('Sorry! You just lost it.') print('The answer is',code) print('Please try again...') |
# 6230131921 (20.00) 11 (2021-02-15 18:37) name = input('Turn #1 : ') P = 0 V = 0 if code == name: print(WINNING_MSG) else: if code[0] == name[0]: P +=1 if code[1] == name[1]: P +=1 if code[2] == name[2]: P +=1 if code[3] == name[3]: P +=1 if code[0] == name[1] or code[0] == name[2] or code[0] == name[3]: V +=1 if code[1] == name[0] or code[1] == name[2] or code[1] == name[3]: V +=1 if code[2] == name[0] or code[2] == name[1] or code[2] == name[3]: V +=1 if code[3] == name[0] or code[3] == name[1] or code[3] == name[2]: V +=1 X = 4-P-V print(" P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) name2 = input('Turn #2 : ') P1 = 0 V1 = 0 if code == name2: print(WINNING_MSG) else: if code[0] == name2[0]: P1 +=1 if code[1] == name2[1]: P1 +=1 if code[2] == name2[2]: P1 +=1 if code[3] == name2[3]: P1 +=1 if code[0] == name2[1] or code[0] == name2[2] or code[0] == name2[3]: V1 +=1 if code[1] == name2[0] or code[1] == name2[2] or code[1] == name2[3]: V1 +=1 if code[2] == name2[0] or code[2] == name2[1] or code[2] == name2[3]: V1 +=1 if code[3] == name2[0] or code[3] == name2[1] or code[3] == name2[2]: V1 +=1 X1 = 4-P1-V1 print(" P="+str(P1)+","+"V="+str(V1)+","+"X="+str(X1)) name3 = input('Turn #3 : ') P2 = 0 V2 = 0 if code == name3: print(WINNING_MSG) else: if code[0] == name3[0]: P2 +=1 if code[1] == name3[1]: P2 +=1 if code[2] == name3[2]: P2 +=1 if code[3] == name3[3]: P2 +=1 if code[0] == name3[1] or code[0] == name3[2] or code[0] == name3[3]: V2 +=1 if code[1] == name3[0] or code[1] == name3[2] or code[1] == name3[3]: V2 +=1 if code[2] == name3[0] or code[2] == name3[1] or code[2] == name3[3]: V2 +=1 if code[3] == name3[0] or code[3] == name3[1] or code[3] == name3[2]: V2 +=1 X2 = 4-P2-V2 print(" P="+str(P2)+","+"V="+str(V2)+","+"X="+str(X2)) name4 = input('Turn #4 : ') P3 = 0 V3 = 0 if code == name4: print(WINNING_MSG) else: if code[0] == name4[0]: P3 +=1 if code[1] == name4[1]: P3 +=1 if code[2] == name4[2]: P3 +=1 if code[3] == name4[3]: P3 +=1 if code[0] == name4[1] or code[0] == name4[2] or code[0] == name4[3]: V3 +=1 if code[1] == name4[0] or code[1] == name4[2] or code[1] == name4[3]: V3 +=1 if code[2] == name4[0] or code[2] == name4[1] or code[2] == name4[3]: V3 +=1 if code[3] == name4[0] or code[3] == name4[1] or code[3] == name4[2]: V3 +=1 X3 = 4-P3-V3 print(" P="+str(P3)+","+"V="+str(V3)+","+"X="+str(X3)) print(LOSING_MSG) print("The answer is"+" "+str(code)) print("Please try again...") |
# 6230133121 (20.00) 12 (2021-02-15 15:45) P,V,W = 0,0,0 fill = input('Turn #1 : ') if fill == code: W = 1 print(WINNING_MSG) elif fill[0]==code[0]: P+=1 elif fill[0]==code[1] or fill[0]==code[2] or fill[0]==code[3]: V+=1 if fill[1]==code[1]: P+=1 elif fill[1]==code[0] or fill[1]==code[2] or fill[1]==code[3]: V+=1 if fill[2]==code[2]: P+=1 elif fill[2]==code[0] or fill[2]==code[1] or fill[2]==code[3]: V+=1 if fill[3]==code[3]: P+=1 elif fill[3]==code[0] or fill[3]==code[1] or fill[3]==code[2]: V+=1 if W != 1: print(' P='+str(P)+',V='+str(V)+',X='+str(4-P-V)) #-------------------------------------------------------- if W != 1: P,V,W = 0,0,0 fill = input('Turn #2 : ') if fill == code: W = 1 print(WINNING_MSG) elif fill[0]==code[0]: P+=1 elif fill[0]==code[1] or fill[0]==code[2] or fill[0]==code[3]: V+=1 if fill[1]==code[1]: P+=1 elif fill[1]==code[0] or fill[1]==code[2] or fill[1]==code[3]: V+=1 if fill[2]==code[2]: P+=1 elif fill[2]==code[0] or fill[2]==code[1] or fill[2]==code[3]: V+=1 if fill[3]==code[3]: P+=1 elif fill[3]==code[0] or fill[3]==code[1] or fill[3]==code[2]: V+=1 if W != 1: print(' P='+str(P)+',V='+str(V)+',X='+str(4-P-V)) #------------------------------------------------------- if W != 1: fill = input('Turn #3 : ') P,V,W = 0,0,0 if fill == code: W = 1 print(WINNING_MSG) elif fill[0]==code[0]: P+=1 elif fill[0]==code[1] or fill[0]==code[2] or fill[0]==code[3]: V+=1 if fill[1]==code[1]: P+=1 elif fill[1]==code[0] or fill[1]==code[2] or fill[1]==code[3]: V+=1 if fill[2]==code[2]: P+=1 elif fill[2]==code[0] or fill[2]==code[1] or fill[2]==code[3]: V+=1 if fill[3]==code[3]: P+=1 elif fill[3]==code[0] or fill[3]==code[1] or fill[3]==code[2]: V+=1 if W !=1 : print(' P='+str(P)+',V='+str(V)+',X='+str(4-P-V)) #-------------------------------------------------------------------- if W != 1: fill = input('Turn #4 : ') P,V,W = 0,0,0 if fill == code: W = 1 print(WINNING_MSG) elif fill[0]==code[0]: P+=1 elif fill[0]==code[1] or fill[0]==code[2] or fill[0]==code[3]: V+=1 if fill[1]==code[1]: P+=1 elif fill[1]==code[0] or fill[1]==code[2] or fill[1]==code[3]: V+=1 if fill[2]==code[2]: P+=1 elif fill[2]==code[0] or fill[2]==code[1] or fill[2]==code[3]: V+=1 if fill[3]==code[3]: P+=1 elif fill[3]==code[0] or fill[3]==code[1] or fill[3]==code[2]: V+=1 if W!=1: print(' P='+str(P)+',V='+str(V)+',X='+str(4-P-V)) print(LOSING_MSG) print('The answer is',code) print('Please try again...') |
# 6230153721 (18.86) 13 (2021-02-13 23:41) P=0 V=0 X=0 a=input('Turn #1 : ') if a[0]==code[0]: P+=1 elif a[0] in code: V+=1 else: X+=1 if a[1]==code[1]: P+=1 elif a[1] in code: V+=1 else: X+=1 if a[2]==code[2]: P+=1 elif a[2] in code: V+=1 else: X+=1 if a[3]==code[3]: P+=1 elif a[3] in code: V+=1 else: X+=1 if a==code: print(WINNING_MSG) else: print(' P='+str(P)+',V='+str(V)+',X='+str(X)) P=0 V=0 X=0 b=input('Turn #2 : ') if b[0]==code[0]: P+=1 elif b[0] in code: V+=1 else: X+=1 if b[1]==code[1]: P+=1 elif b[1] in code: V+=1 else: X+=1 if b[2]==code[2]: P+=1 elif b[2] in code: V+=1 else: X+=1 if b[3]==code[3]: P+=1 elif b[3] in code: V+=1 else: X+=1 if b==code: print(WINNING_MSG) else: print(' P='+str(P)+',V='+str(V)+',X='+str(X)) P=0 V=0 X=0 c=input('Turn #3 : ') if c[0]==code[0]: P+=1 elif c[0] in code: V+=1 else: X+=1 if c[1]==code[1]: P+=1 elif c[1] in code: V+=1 else: X+=1 if c[2]==code[2]: P+=1 elif c[2] in code: V+=1 else: X+=1 if c[3]==code[3]: P+=1 elif c[3] in code: V+=1 else: X+=1 if c==code: print(WINNING_MSG) else: print(' P='+str(P)+',V='+str(V)+',X='+str(X)) P=0 V=0 X=0 d=input('Turn #4 : ') if d[0]==code[0]: P+=1 elif d[0] in code: V+=1 else: X+=1 if d[1]==code[1]: P+=1 elif c[1] in code: V+=1 else: X+=1 if d[2]==code[2]: P+=1 elif d[2] in code: V+=1 else: X+=1 if d[3]==code[3]: P+=1 elif d[3] in code: V+=1 else: X+=1 if d==code: print(WINNING_MSG) else: print(' P='+str(P)+',V='+str(V)+',X='+str(X)) print(LOSING_MSG) print('The answer is '+code) print('Please try again...') |
# 6230154321 (20.00) 14 (2021-02-14 19:36) n=1 P=0 V=0 X=0 a=input('Turn #'+str(n)+' '+':'+' ') if a[0]==code[0]: P+=1 elif a[0] in code: V+=1 elif a[0] not in code: X+=1 if a[1]==code[1]: P+=1 elif a[1] in code: V+=1 elif a[1] not in code: X+=1 if a[2]==code[2]: P+=1 elif a[2] in code: V+=1 elif a[2] not in code: X+=1 if a[3]==code[3]: P+=1 elif a[3] in code: V+=1 elif a[3] not in code: X+=1 if P!=4: print(' '*len('Turn #'+str(n)+' '+':'+' ')+'P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) P=0 V=0 X=0 a=input('Turn #'+str(n+1)+' '+':'+' ') if a[0]==code[0]: P+=1 elif a[0] in code: V+=1 elif a[0] not in code: X+=1 if a[1]==code[1]: P+=1 elif a[1] in code: V+=1 elif a[1] not in code: X+=1 if a[2]==code[2]: P+=1 elif a[2] in code: V+=1 elif a[2] not in code: X+=1 if a[3]==code[3]: P+=1 elif a[3] in code: V+=1 elif a[3] not in code: X+=1 if P!=4: print(' '*len('Turn #'+str(n)+' '+':'+' ')+'P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) P=0 V=0 X=0 a=input('Turn #'+str(n+2)+' '+':'+' ') if a[0]==code[0]: P+=1 elif a[0] in code: V+=1 elif a[0] not in code: X+=1 if a[1]==code[1]: P+=1 elif a[1] in code: V+=1 elif a[1] not in code: X+=1 if a[2]==code[2]: P+=1 elif a[2] in code: V+=1 elif a[2] not in code: X+=1 if a[3]==code[3]: P+=1 elif a[3] in code: V+=1 elif a[3] not in code: X+=1 if P!=4: print(' '*len('Turn #'+str(n)+' '+':'+' ')+'P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) P=0 V=0 X=0 a=input('Turn #'+str(n+3)+' '+':'+' ') if a[0]==code[0]: P+=1 elif a[0] in code: V+=1 elif a[0] not in code: X+=1 if a[1]==code[1]: P+=1 elif a[1] in code: V+=1 elif a[1] not in code: X+=1 if a[2]==code[2]: P+=1 elif a[2] in code: V+=1 elif a[2] not in code: X+=1 if a[3]==code[3]: P+=1 elif a[3] in code: V+=1 elif a[3] not in code: X+=1 if P!=4: print(' '*len('Turn #'+str(n)+' '+':'+' ')+'P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) print('Sorry! You just lost it.') print('The answer is'+' '+' '+code) print('Please try again...') elif P==4: print('Congratulations! You won the game.') |
# 6230444321 (19.11) 15 (2021-02-15 17:05) true = False for i in range(1,5): P = 0 V = 0 X = 4 A = input() if A == code : true = True print("Turn #"+str(i)+" : "+code) print("Congratulations! You won the game.") break for j in range(4): if A[j] == code[j] : P += 1 X -= 1 else: if A[j] in code : V += 1 X -= 1 print("Turn #"+str(i)+" : "+A) print(" P="+str(P)+",V="+str(V)+",X="+str(X)) if not true : print("Sorry! You just lost it.") print("The answer is "+code) print("Please try again...") |
# 6230585121 (20.00) 16 (2021-02-15 21:29) guess = input('Turn #1 : ') P = 0 for i in range(0,4): if guess[i] == code[i]: P += 1 C = 0 for i in range(0,4): if guess[i] in code: C += 1 V = C-P X = 4-P-V if P == 4: print(WINNING_MSG) else: print(' '+'P='+str(P)+',V='+str(V)+',X='+str(X)) guess = input('Turn #2 : ') P = 0 for i in range(0,4): if guess[i] == code[i]: P += 1 C = 0 for i in range(0,4): if guess[i] in code: C += 1 V = C-P X = 4-P-V if P == 4: print(WINNING_MSG) else: print(' '+'P='+str(P)+',V='+str(V)+',X='+str(X)) guess = input('Turn #3 : ') P = 0 for i in range(0,4): if guess[i] == code[i]: P += 1 C = 0 for i in range(0,4): if guess[i] in code: C += 1 V = C-P X = 4-P-V if P == 4: print(WINNING_MSG) else: print(' '+'P='+str(P)+',V='+str(V)+',X='+str(X)) guess = input('Turn #4 : ') P = 0 for i in range(0,4): if guess[i] == code[i]: P += 1 C = 0 for i in range(0,4): if guess[i] in code: C += 1 V = C-P X = 4-P-V if P == 4: print(WINNING_MSG) else: print(' '+'P='+str(P)+',V='+str(V)+',X='+str(X)) print(LOSING_MSG) print('The answer is '+code) print('Please try again...') |
# 6231004021 (20.00) 17 (2021-02-11 15:47) won = False if not won: p, v, x = 0, 0, 0 inp = input("Turn #1 : ") if inp[0] in code: if inp[0] == code[0]: p += 1 else: v += 1 else: x += 1 if inp[1] in code: if inp[1] == code[1]: p += 1 else: v += 1 else: x += 1 if inp[2] in code: if inp[2] == code[2]: p += 1 else: v += 1 else: x += 1 if inp[3] in code: if inp[3] == code[3]: p += 1 else: v += 1 else: x += 1 if p == 4: won = True else: print(f" P={p},V={v},X={x}") if not won: p, v, x = 0, 0, 0 inp = input("Turn #2 : ") if inp[0] in code: if inp[0] == code[0]: p += 1 else: v += 1 else: x += 1 if inp[1] in code: if inp[1] == code[1]: p += 1 else: v += 1 else: x += 1 if inp[2] in code: if inp[2] == code[2]: p += 1 else: v += 1 else: x += 1 if inp[3] in code: if inp[3] == code[3]: p += 1 else: v += 1 else: x += 1 if p == 4: won = True else: print(f" P={p},V={v},X={x}") if not won: p, v, x = 0, 0, 0 inp = input("Turn #3 : ") if inp[0] in code: if inp[0] == code[0]: p += 1 else: v += 1 else: x += 1 if inp[1] in code: if inp[1] == code[1]: p += 1 else: v += 1 else: x += 1 if inp[2] in code: if inp[2] == code[2]: p += 1 else: v += 1 else: x += 1 if inp[3] in code: if inp[3] == code[3]: p += 1 else: v += 1 else: x += 1 if p == 4: won = True else: print(f" P={p},V={v},X={x}") if not won: p, v, x = 0, 0, 0 inp = input("Turn #4 : ") if inp[0] in code: if inp[0] == code[0]: p += 1 else: v += 1 else: x += 1 if inp[1] in code: if inp[1] == code[1]: p += 1 else: v += 1 else: x += 1 if inp[2] in code: if inp[2] == code[2]: p += 1 else: v += 1 else: x += 1 if inp[3] in code: if inp[3] == code[3]: p += 1 else: v += 1 else: x += 1 if p == 4: won = True else: print(f" P={p},V={v},X={x}") if won: print(WINNING_MSG) else: print(LOSING_MSG) print(f"The answer is {code}") print("Please try again..") |
# 6231008621 (14.81) 18 (2021-02-15 20:48) end = False turn = 0 p, v, x = 0, 0, 0 def check_p(code, pos, tmp): return tmp[pos] == code[pos] def check_v(code, pos, tmp): for c in code: if(tmp[pos] == c): return True return False for count in range (4): if(not end): turn += 1 tmp = input("Turn #"+str(turn)+": ") for pos in range(4): if(check_p(code, pos, tmp)): p += 1 elif(check_v(code, pos, tmp)): v += 1 else: x += 1 print(" P="+str(p)+",V=",str(v),"X=",str(x)) p, v, x = 0, 0, 0 if(end): print(WINNING_MSG) else: print(LOSING_MSG) print("The answer is", code) print("Please try again...") |
# 6231012021 (20.00) 19 (2021-02-15 17:01) x=input("Turn #1 : ") po=0 vo=0 xo=0 if x[0]==code[0]: po+=1 vo+=0 xo+=0 elif x[0] in code and x[0]!=code[0]: po+=0 vo+=1 xo+=0 elif x[0]!=code[0] and x[0]!=code[1] and x[0]!=code[2] and x[0]!=code[3]: po+=0 vo+=0 xo+=1 if x[1]==code[1]: po+=1 vo+=0 xo+=0 elif x[1] in code and x[1]!=code[1]: po+=0 vo+=1 xo+=0 elif x[1]!=code[0] and x[1]!=code[1] and x[1]!=code[2] and x[1]!=code[3]: po+=0 vo+=0 xo+=1 if x[2]==code[2]: po+=1 vo+=0 xo+=0 elif x[2] in code and x[2]!=code[2]: po+=0 vo+=1 xo+=0 elif x[2]!=code[0] and x[2]!=code[1] and x[2]!=code[2] and x[2]!=code[3]: po+=0 vo+=0 xo+=1 if x[3]==code[3]: po+=1 vo+=0 xo+=0 elif x[3] in code and x[3]!=code[3]: po+=0 vo+=1 xo+=0 elif x[3]!=code[0] and x[3]!=code[1] and x[3]!=code[2] and x[3]!=code[3]: po+=0 vo+=0 xo+=1 po=str(po) vo=str(vo) xo=str(xo) result='P='+po+','+'V='+vo+','+'X='+xo if result =='P=4,V=0,X=0': print(WINNING_MSG) else: print(' ',result) x=input("Turn #2 : ") po=0 vo=0 xo=0 if x[0]==code[0]: po+=1 vo+=0 xo+=0 elif x[0] in code and x[0]!=code[0]: po+=0 vo+=1 xo+=0 elif x[0]!=code[0] and x[0]!=code[1] and x[0]!=code[2] and x[0]!=code[3]: po+=0 vo+=0 xo+=1 if x[1]==code[1]: po+=1 vo+=0 xo+=0 elif x[1] in code and x[1]!=code[1]: po+=0 vo+=1 xo+=0 elif x[1]!=code[0] and x[1]!=code[1] and x[1]!=code[2] and x[1]!=code[3]: po+=0 vo+=0 xo+=1 if x[2]==code[2]: po+=1 vo+=0 xo+=0 elif x[2] in code and x[2]!=code[2]: po+=0 vo+=1 xo+=0 elif x[2]!=code[0] and x[2]!=code[1] and x[2]!=code[2] and x[2]!=code[3]: po+=0 vo+=0 xo+=1 if x[3]==code[3]: po+=1 vo+=0 xo+=0 elif x[3] in code and x[3]!=code[3]: po+=0 vo+=1 xo+=0 elif x[3]!=code[0] and x[3]!=code[1] and x[3]!=code[2] and x[3]!=code[3]: po+=0 vo+=0 xo+=1 po=str(po) vo=str(vo) xo=str(xo) result='P='+po+','+'V='+vo+','+'X='+xo if result =='P=4,V=0,X=0': print(WINNING_MSG) else: print(' ',result) x=input("Turn #3 : ") po=0 vo=0 xo=0 if x[0]==code[0]: po+=1 vo+=0 xo+=0 elif x[0] in code and x[0]!=code[0]: po+=0 vo+=1 xo+=0 elif x[0]!=code[0] and x[0]!=code[1] and x[0]!=code[2] and x[0]!=code[3]: po+=0 vo+=0 xo+=1 if x[1]==code[1]: po+=1 vo+=0 xo+=0 elif x[1] in code and x[1]!=code[1]: po+=0 vo+=1 xo+=0 elif x[1]!=code[0] and x[1]!=code[1] and x[1]!=code[2] and x[1]!=code[3]: po+=0 vo+=0 xo+=1 if x[2]==code[2]: po+=1 vo+=0 xo+=0 elif x[2] in code and x[2]!=code[2]: po+=0 vo+=1 xo+=0 elif x[2]!=code[0] and x[2]!=code[1] and x[2]!=code[2] and x[2]!=code[3]: po+=0 vo+=0 xo+=1 if x[3]==code[3]: po+=1 vo+=0 xo+=0 elif x[3] in code and x[3]!=code[3]: po+=0 vo+=1 xo+=0 elif x[3]!=code[0] and x[3]!=code[1] and x[3]!=code[2] and x[3]!=code[3]: po+=0 vo+=0 xo+=1 po=str(po) vo=str(vo) xo=str(xo) result='P='+po+','+'V='+vo+','+'X='+xo if result =='P=4,V=0,X=0': print(WINNING_MSG) else: print(' ',result) x=input("Turn #4 : ") po=0 vo=0 xo=0 if x[0]==code[0]: po+=1 vo+=0 xo+=0 elif x[0] in code and x[0]!=code[0]: po+=0 vo+=1 xo+=0 elif x[0]!=code[0] and x[0]!=code[1] and x[0]!=code[2] and x[0]!=code[3]: po+=0 vo+=0 xo+=1 if x[1]==code[1]: po+=1 vo+=0 xo+=0 elif x[1] in code and x[1]!=code[1]: po+=0 vo+=1 xo+=0 elif x[1]!=code[0] and x[1]!=code[1] and x[1]!=code[2] and x[1]!=code[3]: po+=0 vo+=0 xo+=1 if x[2]==code[2]: po+=1 vo+=0 xo+=0 elif x[2] in code and x[2]!=code[2]: po+=0 vo+=1 xo+=0 elif x[2]!=code[0] and x[2]!=code[1] and x[2]!=code[2] and x[2]!=code[3]: po+=0 vo+=0 xo+=1 if x[3]==code[3]: po+=1 vo+=0 xo+=0 elif x[3] in code and x[3]!=code[3]: po+=0 vo+=1 xo+=0 elif x[3]!=code[0] and x[3]!=code[1] and x[3]!=code[2] and x[3]!=code[3]: po+=0 vo+=0 xo+=1 po=str(po) vo=str(vo) xo=str(xo) result='P='+po+','+'V='+vo+','+'X='+xo if result =='P=4,V=0,X=0': print(WINNING_MSG) else: print(' ',result) print(LOSING_MSG) print('The answer is',code) print('Please try again...') |
# 6231019521 (20.00) 20 (2021-02-13 19:32) a=input('Turn #1 : ') P=0 V=0 X=0 if a==code: print(WINNING_MSG) elif a[0]==code[0]: P+=1 if a[1]==code[1]: P+=1 if a[2]==code[2]: P+=1 if a[3]==code[3]: P+=1 if a[0] in code[1:]: V+=1 if a[1] in code[0]: V+=1 if a[1] in code[2:]: V+=1 if a[2] in code[:2]: V+=1 if a[2] in code[3]: V+=1 if a[3] in code[:3]: V+=1 if not a[0] in code: X+=1 if not a[1] in code: X+=1 if not a[2] in code: X+=1 if not a[3] in code: X+=1 if V>0 or X>0: print(' '+'P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) b=input('Turn #2 : ') P=0 V=0 X=0 if b==code: print(WINNING_MSG) elif b[0]==code[0]: P+=1 if b[1]==code[1]: P+=1 if b[2]==code[2]: P+=1 if b[3]==code[3]: P+=1 if b[0] in code[1:]: V+=1 if b[1] in code[0]: V+=1 if b[1] in code[2:]: V+=1 if b[2] in code[:2]: V+=1 if b[2] in code[3]: V+=1 if b[3] in code[:3]: V+=1 if not b[0] in code: X+=1 if not b[1] in code: X+=1 if not b[2] in code: X+=1 if not b[3] in code: X+=1 if V>0 or X>0: print(' '+'P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) c=input('Turn #3 : ') P=0 V=0 X=0 if c==code: print(WINNING_MSG) elif c[0]==code[0]: P+=1 if c[1]==code[1]: P+=1 if c[2]==code[2]: P+=1 if c[3]==code[3]: P+=1 if c[0] in code[1:]: V+=1 if c[1] in code[0]: V+=1 if c[1] in code[2:]: V+=1 if c[2] in code[:2]: V+=1 if c[2] in code[3]: V+=1 if c[3] in code[:3]: V+=1 if not c[0] in code: X+=1 if not c[1] in code: X+=1 if not c[2] in code: X+=1 if not c[3] in code: X+=1 if V>0 or X>0: print(' '+'P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) d=input('Turn #4 : ') P=0 V=0 X=0 if d==code: print(WINNING_MSG) elif d[0]==code[0]: P+=1 if d[1]==code[1]: P+=1 if d[2]==code[2]: P+=1 if d[3]==code[3]: P+=1 if d[0] in code[1:]: V+=1 if d[1] in code[0]: V+=1 if d[1] in code[2:]: V+=1 if d[2] in code[:2]: V+=1 if d[2] in code[3]: V+=1 if d[3] in code[:3]: V+=1 if not d[0] in code: X+=1 if not d[1] in code: X+=1 if not d[2] in code: X+=1 if not d[3] in code: X+=1 if V>0 or X>0: print(' '+'P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) print(LOSING_MSG) print('The answer is '+ code) print('Please try again...') |
# 6231205921 (20.00) 21 (2021-02-12 14:46) a = input("Turn #1 : ") p = 0 v = 0 x = 0 if a == code : print(WINNING_MSG) else : if a[0] == code[0] : p += 1 if a[1] == code[1] : p += 1 if a[2] == code[2] : p += 1 if a[3] == code[3] : p += 1 if a[0] in code : v += 1 if a[1] in code : v += 1 if a[2] in code : v += 1 if a[3] in code : v += 1 if a[0] not in code : x += 1 if a[1] not in code : x += 1 if a[2] not in code : x += 1 if a[3] not in code : x += 1 print(" P="+str(p)+",V="+str(v-p)+",X="+str(x)) b = input("Turn #2 : ") p = 0 v = 0 x = 0 if b == code : print(WINNING_MSG) else : if b[0] == code[0] : p += 1 if b[1] == code[1] : p += 1 if b[2] == code[2] : p += 1 if b[3] == code[3] : p += 1 if b[0] in code : v += 1 if b[1] in code : v += 1 if b[2] in code : v += 1 if b[3] in code : v += 1 if b[0] not in code : x += 1 if b[1] not in code : x += 1 if b[2] not in code : x += 1 if b[3] not in code : x += 1 print(" P="+str(p)+",V="+str(v-p)+",X="+str(x)) c = input("Turn #3 : ") p = 0 v = 0 x = 0 if c == code : print(WINNING_MSG) else : if c[0] == code[0] : p += 1 if c[1] == code[1] : p += 1 if c[2] == code[2] : p += 1 if c[3] == code[3] : p += 1 if c[0] in code : v += 1 if c[1] in code : v += 1 if c[2] in code : v += 1 if c[3] in code : v += 1 if c[0] not in code : x += 1 if c[1] not in code : x += 1 if c[2] not in code : x += 1 if c[3] not in code : x += 1 print(" P="+str(p)+",V="+str(v-p)+",X="+str(x)) d = input("Turn #4 : ") p = 0 v = 0 x = 0 if d == code : print(WINNING_MSG) else : if d[0] == code[0] : p += 1 if d[1] == code[1] : p += 1 if d[2] == code[2] : p += 1 if d[3] == code[3] : p += 1 if d[0] in code : v += 1 if d[1] in code : v += 1 if d[2] in code : v += 1 if d[3] in code : v += 1 if d[0] not in code : x += 1 if d[1] not in code : x += 1 if d[2] not in code : x += 1 if d[3] not in code : x += 1 print(" P="+str(p)+",V="+str(v-p)+",X="+str(x)) print(LOSING_MSG) print("The answer is",code) print("Please try again...") |
# 6231207121 (20.00) 22 (2021-02-12 23:08) k = 1 #k1------------------------------- guess = input("Turn #"+str(k)+" : ") if guess == code : print(WINNING_MSG) else : k += 1 # =====[check 1 start]===== P,V,X = 0,0,0 c1,c2,c3,c4 = code[0],code[1],code[2],code[3] g1,g2,g3,g4 = guess[0],guess[1],guess[2],guess[3] if c1 == g1 : P += 1 if c2 == g2 : P += 1 if c3 == g3 : P += 1 if c4 == g4 : P += 1 if "A" in code and "A" in guess : V += 1 if "B" in code and "B" in guess : V += 1 if "C" in code and "C" in guess : V += 1 if "D" in code and "D" in guess : V += 1 if "E" in code and "E" in guess : V += 1 if "F" in code and "F" in guess : V += 1 V = abs(V-P) X = 4-V-P print(" "+"P="+str(P)+",V="+str(V)+",X="+str(X)) # =====[check 1 stop]===== guess = input("Turn #"+str(k)+" : ") #k2------------------------------- if guess == code : print(WINNING_MSG) else : k += 1 # =====[check 2 start]===== P,V,X = 0,0,0 c1,c2,c3,c4 = code[0],code[1],code[2],code[3] g1,g2,g3,g4 = guess[0],guess[1],guess[2],guess[3] if c1 == g1 : P += 1 if c2 == g2 : P += 1 if c3 == g3 : P += 1 if c4 == g4 : P += 1 if "A" in code and "A" in guess : V += 1 if "B" in code and "B" in guess : V += 1 if "C" in code and "C" in guess : V += 1 if "D" in code and "D" in guess : V += 1 if "E" in code and "E" in guess : V += 1 if "F" in code and "F" in guess : V += 1 V = abs(V-P) X = 4-V-P print(" "+"P="+str(P)+",V="+str(V)+",X="+str(X)) # =====[check 2 stop]===== guess = input("Turn #"+str(k)+" : ") #k3------------------------------- if guess == code : print(WINNING_MSG) else : k += 1 # =====[check 3 start]===== P,V,X = 0,0,0 c1,c2,c3,c4 = code[0],code[1],code[2],code[3] g1,g2,g3,g4 = guess[0],guess[1],guess[2],guess[3] if c1 == g1 : P += 1 if c2 == g2 : P += 1 if c3 == g3 : P += 1 if c4 == g4 : P += 1 if "A" in code and "A" in guess : V += 1 if "B" in code and "B" in guess : V += 1 if "C" in code and "C" in guess : V += 1 if "D" in code and "D" in guess : V += 1 if "E" in code and "E" in guess : V += 1 if "F" in code and "F" in guess : V += 1 V = abs(V-P) X = 4-V-P print(" "+"P="+str(P)+",V="+str(V)+",X="+str(X)) # =====[check 3 stop]===== guess = input("Turn #"+str(k)+" : ") #k4------------------------------- if guess == code : print(WINNING_MSG) else : # =====[check 4 start]===== P,V,X = 0,0,0 c1,c2,c3,c4 = code[0],code[1],code[2],code[3] g1,g2,g3,g4 = guess[0],guess[1],guess[2],guess[3] if c1 == g1 : P += 1 if c2 == g2 : P += 1 if c3 == g3 : P += 1 if c4 == g4 : P += 1 if "A" in code and "A" in guess : V += 1 if "B" in code and "B" in guess : V += 1 if "C" in code and "C" in guess : V += 1 if "D" in code and "D" in guess : V += 1 if "E" in code and "E" in guess : V += 1 if "F" in code and "F" in guess : V += 1 V = abs(V-P) X = 4-V-P print(" "+"P="+str(P)+",V="+str(V)+",X="+str(X)) # =====[check 4 stop]===== print(LOSING_MSG) print("The answer is "+code) print("Please try again...") |
# 6231213921 (20.00) 23 (2021-02-15 00:54) print(code) print("Turn #1 :", end = " ") guess = input() win = 0 p = 0 v = 0 x = 0 if guess[0] in code: v += 1 if guess[1] in code: v += 1 if guess[2] in code: v += 1 if guess[3] in code: v += 1 if guess[0] == code[0]: p += 1 if guess[1] == code[1]: p += 1 if guess[2] == code[2]: p += 1 if guess[3] == code[3]: p += 1 v -= p x = 4-(p+v) if p == 4: print(WINNING_MSG) win = 1 else: print(" P="+str(p)+",V="+str(v)+",X="+str(x)) if (win==0): print("Turn #2 :", end = " ") guess = input() win = 0 p = 0 v = 0 x = 0 if guess[0] in code: v += 1 if guess[1] in code: v += 1 if guess[2] in code: v += 1 if guess[3] in code: v += 1 if guess[0] == code[0]: p += 1 if guess[1] == code[1]: p += 1 if guess[2] == code[2]: p += 1 if guess[3] == code[3]: p += 1 v -= p x = 4-(p+v) if p == 4: print(WINNING_MSG) win = 1 else: print(" P="+str(p)+",V="+str(v)+",X="+str(x)) if (win==0): print("Turn #3 :", end = " ") guess = input() win = 0 p = 0 v = 0 x = 0 if guess[0] in code: v += 1 if guess[1] in code: v += 1 if guess[2] in code: v += 1 if guess[3] in code: v += 1 if guess[0] == code[0]: p += 1 if guess[1] == code[1]: p += 1 if guess[2] == code[2]: p += 1 if guess[3] == code[3]: p += 1 v -= p x = 4-(p+v) if p == 4: print(WINNING_MSG) win = 1 else: print(" P="+str(p)+",V="+str(v)+",X="+str(x)) if (win==0): print("Turn #4 :", end = " ") guess = input() win = 0 p = 0 v = 0 x = 0 if guess[0] in code: v += 1 if guess[1] in code: v += 1 if guess[2] in code: v += 1 if guess[3] in code: v += 1 if guess[0] == code[0]: p += 1 if guess[1] == code[1]: p += 1 if guess[2] == code[2]: p += 1 if guess[3] == code[3]: p += 1 v -= p x = 4-(p+v) if p == 4: print(WINNING_MSG) win = 1 else: print(" P="+str(p)+",V="+str(v)+",X="+str(x)) if win==0: print(LOSING_MSG) print("The answer is "+code) print("Please try again...") |
# 6231214521 (17.40) 24 (2021-02-15 14:05) P = 0 V = 0 X = 0 a = input("Turn #1 : ") aa = len("Turn #1 : ") if a == code : print(WINNING_MSG) else: if a[0]==code[0]: P +=1 if a[1]==code[1]: P +=1 if a[2]==code[2]: P +=1 if a[3]==code[3]: P +=1 if a[0] in code and a[0]!= code[0]: V +=1 if a[1] in code and a[1]!= code[1]: V +=1 if a[2] in code and a[2]!= code[2]: V +=1 if a[3] in code and a[3]!= code[3]: V +=1 if a[0] not in code: X +=1 if a[1] not in code: X +=1 if a[2] not in code: X +=1 if a[3] not in code: X +=1 print(" "*aa+"P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) b = input("Turn #2 : ") P = 0 V = 0 X = 0 if b == code : print(WINNING_MSG) else: if b[0]==code[0]: P +=1 if b[1]==code[1]: P +=1 if b[2]==code[2]: P +=1 if b[3]==code[3]: P +=1 if b[0] in code and b[0]!= code[0]: V +=1 if b[1] in code and b[1]!= code[1]: V +=1 if b[2] in code and b[2]!= code[2]: V +=1 if b[3] in code and b[3]!= code[3]: V +=1 if b[0] not in code: X +=1 if b[1] not in code: X +=1 if b[2] not in code: X +=1 if b[3] not in code: X +=1 print(" "*aa+"P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) c = input("Turn #3 : ") P = 0 V = 0 X = 0 if c == code : print(WINNING_MSG) else: if c[0]==code[0]: P +=1 if c[1]==code[1]: P +=1 if c[2]==code[2]: P +=1 if c[3]==code[3]: P +=1 if c[0] in code and c[0]!= code[0]: V +=1 if c[1] in code and c[1]!= code[1]: V +=1 if c[2] in code and c[2]!= code[2]: V +=1 if c[3] in code and c[3]!= code[3]: V +=1 if c[0] not in code: X +=1 if c[1] not in code: X +=1 if c[2] not in code: X +=1 if c[3] not in code: X +=1 print(" "*aa+"P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) d = input("Turn #4 : ") P = 0 V = 0 X = 0 if d == code : print(WINNING_MSG) else: if d[0]==code[0]: P +=1 if d[1]==code[1]: P +=1 if d[2]==code[2]: P +=1 if d[3]==code[3]: P +=1 if d[0] in code and d[0]!= code[0]: V +=1 if d[1] in code and d[1]!= code[1]: V +=1 if d[2] in code and d[2]!= code[2]: V +=1 if d[3] in code and d[3]!= code[3]: V +=1 if d[0] not in code: X +=1 if d[1] not in code: X +=1 if d[2] not in code: X +=1 if d[3] not in code: X +=1 print(" "*aa+"P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) print(LOSING_MSG) print("The answer is"+" "+code) print("Please try again...") |
# 6231220221 (20.00) 25 (2021-02-14 20:17) print("Turn #1 :", end = " ") a = input() win = 0 p = 0 v = 0 x = 0 if a[0] in code: v += 1 if a[1] in code: v += 1 if a[2] in code: v += 1 if a[3] in code: v += 1 if a[0] == code[0]: p += 1 if a[1] == code[1]: p += 1 if a[2] == code[2]: p += 1 if a[3] == code[3]: p += 1 v -= p x = 4-(p+v) if p == 4: print(WINNING_MSG) win = 1 else: print(" P="+str(p)+",V="+str(v)+",X="+str(x)) if (win==0): print("Turn #2 :", end = " ") a = input() win = 0 p = 0 v = 0 x = 0 if a[0] in code: v += 1 if a[1] in code: v += 1 if a[2] in code: v += 1 if a[3] in code: v += 1 if a[0] == code[0]: p += 1 if a[1] == code[1]: p += 1 if a[2] == code[2]: p += 1 if a[3] == code[3]: p += 1 v -= p x = 4-(p+v) if p == 4: print(WINNING_MSG) win = 1 else: print(" P="+str(p)+",V="+str(v)+",X="+str(x)) if (win==0): print("Turn #3 :", end = " ") a = input() win = 0 p = 0 v = 0 x = 0 if a[0] in code: v += 1 if a[1] in code: v += 1 if a[2] in code: v += 1 if a[3] in code: v += 1 if a[0] == code[0]: p += 1 if a[1] == code[1]: p += 1 if a[2] == code[2]: p += 1 if a[3] == code[3]: p += 1 v -= p x = 4-(p+v) if p == 4: print(WINNING_MSG) win = 1 else: print(" P="+str(p)+",V="+str(v)+",X="+str(x)) if (win==0): print("Turn #4 :", end = " ") a = input() win = 0 p = 0 v = 0 x = 0 if a[0] in code: v += 1 if a[1] in code: v += 1 if a[2] in code: v += 1 if a[3] in code: v += 1 if a[0] == code[0]: p += 1 if a[1] == code[1]: p += 1 if a[2] == code[2]: p += 1 if a[3] == code[3]: p += 1 v -= p x = 4-(p+v) if p == 4: print(WINNING_MSG) win = 1 else: print(" P="+str(p)+",V="+str(v)+",X="+str(x)) if win==0: print(LOSING_MSG) print("The answer is "+code) print("Please try again...") |
# 6231222521 (20.00) 26 (2021-02-12 17:40) #print(code) g = input("Turn #1 : ").strip() p = 0 v = 0 x = 0 if g[0] in code : if g[0] == code[0] : p += 1 else : v += 1 else : x += 1 if g[1] in code : if g[1] == code[1] : p += 1 else : v += 1 else : x += 1 if g[2] in code : if g[2] == code[2] : p += 1 else : v += 1 else : x += 1 if g[3] in code : if g[3] == code[3] : p += 1 else : v += 1 else : x += 1 if p == 4 : print(WINNING_MSG) else : print("P="+str(p)+",V="+str(v)+",X="+str(x)) g = input("Turn #2 : ").strip() p = 0 v = 0 x = 0 if g[0] in code : if g[0] == code[0] : p += 1 else : v += 1 else : x += 1 if g[1] in code : if g[1] == code[1] : p += 1 else : v += 1 else : x += 1 if g[2] in code : if g[2] == code[2] : p += 1 else : v += 1 else : x += 1 if g[3] in code : if g[3] == code[3] : p += 1 else : v += 1 else : x += 1 if p == 4 : print(WINNING_MSG) else : print("P="+str(p)+",V="+str(v)+",X="+str(x)) g = input("Turn #3 : ").strip() p = 0 v = 0 x = 0 if g[0] in code : if g[0] == code[0] : p += 1 else : v += 1 else : x += 1 if g[1] in code : if g[1] == code[1] : p += 1 else : v += 1 else : x += 1 if g[2] in code : if g[2] == code[2] : p += 1 else : v += 1 else : x += 1 if g[3] in code : if g[3] == code[3] : p += 1 else : v += 1 else : x += 1 if p == 4 : print(WINNING_MSG) else : print("P="+str(p)+",V="+str(v)+",X="+str(x)) g = input("Turn #4 : ").strip() p = 0 v = 0 x = 0 if g[0] in code : if g[0] == code[0] : p += 1 else : v += 1 else : x += 1 if g[1] in code : if g[1] == code[1] : p += 1 else : v += 1 else : x += 1 if g[2] in code : if g[2] == code[2] : p += 1 else : v += 1 else : x += 1 if g[3] in code : if g[3] == code[3] : p += 1 else : v += 1 else : x += 1 if p == 4 : print(WINNING_MSG) else : print("P="+str(p)+",V="+str(v)+",X="+str(x)) print(LOSING_MSG) print("The answer is",code) print("Please try again...") |
# 6231223121 (17.40) 27 (2021-02-12 10:19) t1=input('Turn #1 : ') p1=0 v1=0 x1=0 if t1[0]==code[0]: p1+=1 elif t1[0] in code: v1+=1 else: x1+=1 if t1[1]==code[1]: p1+=1 elif t1[1] in code: v1+=1 else: x1+=1 if t1[2]==code[2]: p1+=1 elif t1[2] in code: v1+=1 else: x1+=1 if t1[3]==code[3]: p1+=1 elif t1[3] in code: v1+=1 else: x1+=1 if p1==4: print(WINNING_MSG) else: print(' ','P='+str(p1)+','+'V='+str(v1)+','+'X='+str(x1)) t2=input('Turn #2 : ') p2=0 v2=0 x2=0 if t2[0]==code[0]: p2+=1 elif t2[0] in code: v2+=1 else: x2+=1 if t2[1]==code[1]: p2+=1 elif t2[1] in code: v2+=1 else: x2+=1 if t2[2]==code[2]: p2+=1 elif t2[2] in code: v2+=1 else: x2+=1 if t2[3]==code[3]: p2+=1 elif t2[3] in code: v2+=1 else: x2+=1 if p2==4: print(WINNING_MSG) else: print(' ','P='+str(p2)+','+'V='+str(v2)+','+'X='+str(x2)) t3=input('Turn #3 : ') p3=0 v3=0 x3=0 if t3[0]==code[0]: p3+=1 elif t3[0] in code: v3+=1 else: x3+=1 if t3[1]==code[1]: p3+=1 elif t3[1] in code: v3+=1 else: x3+=1 if t3[2]==code[2]: p3+=1 elif t3[2] in code: v3+=1 else: x3+=1 if t3[3]==code[3]: p3+=1 elif t3[3] in code: v3+=1 else: x3+=1 if p3==4: print(WINNING_MSG) else: print(' ','P='+str(p3)+','+'V='+str(v3)+','+'X='+str(x3)) t4=input('Turn #4 : ') p4=0 v4=0 x4=0 if t4[0]==code[0]: p4+=1 elif t4[0] in code: v4+=1 else: x4+=1 if t4[1]==code[1]: p4+=1 elif t4[1] in code: v4+=1 else: x4+=1 if t4[2]==code[2]: p4+=1 elif t4[2] in code: v4+=1 else: x4+=1 if t4[3]==code[3]: p4+=1 elif t4[3] in code: v4+=1 else: x4+=1 if p4==4: print(WINNING_MSG) else: print(' ','P='+str(p1)+','+'V='+str(v1)+','+'X='+str(x1)) print(LOSING_MSG) print('The answer is',code) print('Please try again...') |
# 6231224821 (20.00) 28 (2021-02-15 20:33) T1 = input("Turn #1 : ") p = 0 v = 0 x = 0 if T1 == code : print(WINNING_MSG) else : if T1[0] == code[0] : p += 1 if T1[1] == code[1] : p += 1 if T1[2] == code[2] : p += 1 if T1[3] == code[3] : p += 1 if T1[0] in code : v += 1 if T1[1] in code : v += 1 if T1[2] in code : v += 1 if T1[3] in code : v += 1 if T1[0] not in code : x += 1 if T1[1] not in code : x += 1 if T1[2] not in code : x += 1 if T1[3] not in code : x += 1 print("P="+str(p)+",V="+str(v-p)+",X="+str(x)) T2 = input("Turn #2 : ") p = 0 v = 0 x = 0 if T2 == code : print(WINNING_MSG) else : if T2[0] == code[0] : p += 1 if T2[1] == code[1] : p += 1 if T2[2] == code[2] : p += 1 if T2[3] == code[3] : p += 1 if T2[0] in code : v += 1 if T2[1] in code : v += 1 if T2[2] in code : v += 1 if T2[3] in code : v += 1 if T2[0] not in code : x += 1 if T2[1] not in code : x += 1 if T2[2] not in code : x += 1 if T2[3] not in code : x += 1 print("P="+str(p)+",V="+str(v-p)+",X="+str(x)) T3 = input("Turn #3 : ") p = 0 v = 0 x = 0 if T3 == code : print(WINNING_MSG) else : if T3[0] == code[0] : p += 1 if T3[1] == code[1] : p += 1 if T3[2] == code[2] : p += 1 if T3[3] == code[3] : p += 1 if T3[0] in code : v += 1 if T3[1] in code : v += 1 if T3[2] in code : v += 1 if T3[3] in code : v += 1 if T3[0] not in code : x += 1 if T3[1] not in code : x += 1 if T3[2] not in code : x += 1 if T3[3] not in code : x += 1 print("P="+str(p)+",V="+str(v-p)+",X="+str(x)) T4 = input("Turn #4 : ") p = 0 v = 0 x = 0 if T4 == code : print(WINNING_MSG) else : if T4[0] == code[0] : p += 1 if T4[1] == code[1] : p += 1 if T4[2] == code[2] : p += 1 if T4[3] == code[3] : p += 1 if T4[0] in code : v += 1 if T4[1] in code : v += 1 if T4[2] in code : v += 1 if T4[3] in code : v += 1 if T4[0] not in code : x += 1 if T4[1] not in code : x += 1 if T4[2] not in code : x += 1 if T4[3] not in code : x += 1 print("P="+str(p)+",V="+str(v-p)+",X="+str(x)) print(LOSING_MSG) print("The answer is",code) print("Please try again...") |
# 6231510221 (20.00) 29 (2021-02-14 13:52) think = input("Turn #1 : ") count_P = 0 count_V = 0 count_X = 0 if think[0] in code[0]: count_P += 1 elif think[0] in code: count_V += 1 else: count_X += 1 if think[1] in code[1]: count_P += 1 elif think[1] in code: count_V += 1 else: count_X += 1 if think[2] in code[2]: count_P += 1 elif think[2] in code: count_V += 1 else: count_X += 1 if think[3] in code[3]: count_P += 1 elif think[3] in code: count_V += 1 else: count_X += 1 if count_P != 4: print(" "*10 + "P=" + str(count_P) + "," + "V=" + str(count_V) + "," + "X=" + str(count_X)) think = input("Turn #2 : ") count_P = 0 count_V = 0 count_X = 0 if think[0] in code[0]: count_P += 1 elif think[0] in code: count_V += 1 else: count_X += 1 if think[1] in code[1]: count_P += 1 elif think[1] in code: count_V += 1 else: count_X += 1 if think[2] in code[2]: count_P += 1 elif think[2] in code: count_V += 1 else: count_X += 1 if think[3] in code[3]: count_P += 1 elif think[3] in code: count_V += 1 else: count_X += 1 if count_P != 4: print(" "*10 + "P=" + str(count_P) + "," + "V=" + str(count_V) + "," + "X=" + str(count_X)) think = input("Turn #3 : ") count_P = 0 count_V = 0 count_X = 0 if think[0] in code[0]: count_P += 1 elif think[0] in code: count_V += 1 else: count_X += 1 if think[1] in code[1]: count_P += 1 elif think[1] in code: count_V += 1 else: count_X += 1 if think[2] in code[2]: count_P += 1 elif think[2] in code: count_V += 1 else: count_X += 1 if think[3] in code[3]: count_P += 1 elif think[3] in code: count_V += 1 else: count_X += 1 if count_P != 4: print(" "*10 + "P=" + str(count_P) + "," + "V=" + str(count_V) + "," + "X=" + str(count_X)) think = input("Turn #4 : ") count_P = 0 count_V = 0 count_X = 0 if think[0] in code[0]: count_P += 1 elif think[0] in code: count_V += 1 else: count_X += 1 if think[1] in code[1]: count_P += 1 elif think[1] in code: count_V += 1 else: count_X += 1 if think[2] in code[2]: count_P += 1 elif think[2] in code: count_V += 1 else: count_X += 1 if think[3] in code[3]: count_P += 1 elif think[3] in code: count_V += 1 else: count_X += 1 if count_P == 4: print(WINNING_MSG) else: print(" "*10 + "P=" + str(count_P) + "," + "V=" + str(count_V) + "," + "X=" + str(count_X)) print(LOSING_MSG) print("The answer is" ,code) print("Please try again...") |
# 6231511921 (20.00) 30 (2021-02-15 15:31) g = input("Turn #1 : ") iP = 0 iV = 0 if g[0] == code[0]: iP += 1 elif g[0] in code: iV += 1 if g[1] == code[1]: iP += 1 elif g[1] in code: iV += 1 if g[2] == code[2]: iP += 1 elif g[2] in code: iV += 1 if g[3] == code[3]: iP += 1 elif g[3] in code: iV += 1 iX = 4-(iP+iV) if iP != 4: print(" "*10+"P"+"="+str(iP)+","+"V"+"="+str(iV)+","+"X"+"="+str(iX)) g = input("Turn #2 : ") iP = 0 iV = 0 if g[0] == code[0]: iP += 1 elif g[0] in code: iV += 1 if g[1] == code[1]: iP += 1 elif g[1] in code: iV += 1 if g[2] == code[2]: iP += 1 elif g[2] in code: iV += 1 if g[3] == code[3]: iP += 1 elif g[3] in code: iV += 1 iX = 4-(iP+iV) if iP != 4: print(" "*10+"P"+"="+str(iP)+","+"V"+"="+str(iV)+","+"X"+"="+str(iX)) g = input("Turn #3 : ") iP = 0 iV = 0 if g[0] == code[0]: iP += 1 elif g[0] in code: iV += 1 if g[1] == code[1]: iP += 1 elif g[1] in code: iV += 1 if g[2] == code[2]: iP += 1 elif g[2] in code: iV += 1 if g[3] == code[3]: iP += 1 elif g[3] in code: iV += 1 iX = 4-(iP+iV) if iP != 4: print(" "*10+"P"+"="+str(iP)+","+"V"+"="+str(iV)+","+"X"+"="+str(iX)) g = input("Turn #4 : ") iP = 0 iV = 0 if g[0] == code[0]: iP += 1 elif g[0] in code: iV += 1 if g[1] == code[1]: iP += 1 elif g[1] in code: iV += 1 if g[2] == code[2]: iP += 1 elif g[2] in code: iV += 1 if g[3] == code[3]: iP += 1 elif g[3] in code: iV += 1 iX = 4-(iP+iV) if iP == 4: print(WINNING_MSG) else: print(" "*10+"P"+"="+str(iP)+","+"V"+"="+str(iV)+","+"X"+"="+str(iX)) print(LOSING_MSG) print("The "+"answer "+"is "+code) print("Please try again...") |
# 6231707621 (20.00) 31 (2021-02-11 15:49) p=0 v=0 x=0 b=False a=input("Turn #1 :"+" " ) if a[0]==code[0]: p+=1 elif a[0] in code: v+=1 if a[1]==code[1]: p+=1 elif a[1] in code: v+=1 if a[2]==code[2]: p+=1 elif a[2] in code: v+=1 if a[3]==code[3]: p+=1 elif a[3] in code: v+=1 x=4-p-v if a==code: b=True if b==True: print("Congratulations! You won the game.") else: print(" "*10+"P="+str(p)+",V="+str(v)+",X="+str(x)) p=0 v=0 x=0 b=False a=input("Turn #2 :"+" " ) if a[0]==code[0]: p+=1 elif a[0] in code: v+=1 if a[1]==code[1]: p+=1 elif a[1] in code: v+=1 if a[2]==code[2]: p+=1 elif a[2] in code: v+=1 if a[3]==code[3]: p+=1 elif a[3] in code: v+=1 x=4-p-v if a==code: b=True if b==True: print("Congratulations! You won the game.") else: print(" "*10+"P="+str(p)+",V="+str(v)+",X="+str(x)) p=0 v=0 x=0 b=False a=input("Turn #3 :"+" " ) if a[0]==code[0]: p+=1 elif a[0] in code: v+=1 if a[1]==code[1]: p+=1 elif a[1] in code: v+=1 if a[2]==code[2]: p+=1 elif a[2] in code: v+=1 if a[3]==code[3]: p+=1 elif a[3] in code: v+=1 x=4-p-v if a==code: b=True if b==True: print("Congratulations! You won the game.") else: print(" "*10+"P="+str(p)+",V="+str(v)+",X="+str(x)) p=0 v=0 x=0 b=False a=input("Turn #4 :"+" " ) if a[0]==code[0]: p+=1 elif a[0] in code: v+=1 if a[1]==code[1]: p+=1 elif a[1] in code: v+=1 if a[2]==code[2]: p+=1 elif a[2] in code: v+=1 if a[3]==code[3]: p+=1 elif a[3] in code: v+=1 x=4-p-v if a==code: b=True if b==True: print("Congratulations! You won the game.") else: print(" "*10+"P="+str(p)+",V="+str(v)+",X="+str(x)) print("Sorry! You just lost it.") print("The answer is"+" "+code) print("Please try again...") #--------------------------------------------------- |
# 6231709921 (20.00) 32 (2021-02-12 13:23) gues = input('Turn #1 : ') P = 0 V = 0 X = 0 if gues == code : print(WINNING_MSG) elif gues != code : if gues[0] == code[0] : P+=1 elif gues[0] in code : V+=1 elif gues[0] not in code and gues[0] != code[0]: X+=1 if gues[1] == code[1] : P+=1 elif gues[1] in code : V+=1 elif gues[1] not in code and gues[1] != code[1]: X+=1 if gues[2] == code[2] : P+=1 elif gues[2] in code : V+=1 elif gues[2] not in code and gues[2] != code[2]: X+=1 if gues[3] == code[3] : P+=1 elif gues[3] in code : V+=1 elif gues[3] not in code and gues[3] != code[3]: X+=1 print(' '*len('Turn #1 : ' )+'P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) gues = input('Turn #2 : ') P = 0 V = 0 X = 0 if gues == code : print(WINNING_MSG) elif gues != code : if gues[0] == code[0] : P+=1 elif gues[0] in code : V+=1 elif gues[0] not in code and gues[0] != code[0]: X+=1 if gues[1] == code[1] : P+=1 elif gues[1] in code : V+=1 elif gues[1] not in code and gues[1] != code[1]: X+=1 if gues[2] == code[2] : P+=1 elif gues[2] in code : V+=1 elif gues[2] not in code and gues[2] != code[2]: X+=1 if gues[3] == code[3] : P+=1 elif gues[3] in code : V+=1 elif gues[3] not in code and gues[3] != code[3]: X+=1 print(' '*len('Turn #2 : ' )+'P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) gues = input('Turn #3 : ') P = 0 V = 0 X = 0 if gues == code : print(WINNING_MSG) elif gues != code: if gues[0] == code[0] : P+=1 elif gues[0] in code : V+=1 elif gues[0] not in code and gues[0] != code[0]: X+=1 if gues[1] == code[1] : P+=1 elif gues[1] in code : V+=1 elif gues[1] not in code and gues[1] != code[1]: X+=1 if gues[2] == code[2] : P+=1 elif gues[2] in code : V+=1 elif gues[2] not in code and gues[2] != code[2]: X+=1 if gues[3] == code[3] : P+=1 elif gues[3] in code : V+=1 elif gues[3] not in code and gues[3] != code[3]: X+=1 print(' '*len('Turn #3 : ' )+'P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) gues = input('Turn #4 : ') P = 0 V = 0 X = 0 if gues == code : print(WINNING_MSG) elif gues != code: if gues[0] == code[0] : P+=1 elif gues[0] in code : V+=1 elif gues[0] not in code and gues[0] != code[0]: X+=1 if gues[1] == code[1] : P+=1 elif gues[1] in code : V+=1 elif gues[1] not in code and gues[1] != code[1]: X+=1 if gues[2] == code[2] : P+=1 elif gues[2] in code : V+=1 elif gues[2] not in code and gues[2] != code[2]: X+=1 if gues[3] == code[3] : P+=1 elif gues[3] in code : V+=1 elif gues[3] not in code and gues[3] != code[3]: X+=1 print(' '*len('Turn #4 : ' )+'P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) print(LOSING_MSG) print('The answer is '+code) print('Please try again...') |
# 6231718521 (0.00) 33 (2021-02-15 22:12) X=0 a1=input("Turn #1 : ") if a1==code: print(WINNING_MSG) else: if a1[0] ==code[0]: P+=1 elif a1[1] ==code[1]: P+=1 elif a1[2] ==code[2]: P+=1 elif a1[3] ==code[3]: P+=1 V=0 if a1[0] in code: V+=1 if a1[1] in code: V+=1 if a1[2] in code: V+=1 if a1[3] in code: V+=1 V=V-P X=4-V-P print("P="+str(P),"V="+str(V),"X="+str(X)) |
# 6330170421 (20.00) 34 (2021-02-11 21:29) n1 = code[0] n2 = code[1] n3 = code[2] n4 = code[3] t1 = input('Turn #1 : ') if t1 in code: print(WINNING_MSG) else: P = 0 V = 0 X = 0 x1 = t1[0] x2 = t1[1] x3 = t1[2] x4 = t1[3] if (x1==n1): P += 1 if (x2==n2): P += 1 if (x3==n3): P += 1 if (x4==n4): P += 1 if (x1==n2)or(x1==n3)or(x1==n4): V+=1 if (x2==n1)or(x2==n3)or(x2==n4): V+=1 if (x3==n1)or(x3==n2)or(x3==n4): V+=1 if (x4==n1)or(x4==n2)or(x4==n3): V+=1 if x1 not in code : X+=1 if x2 not in code : X+=1 if x3 not in code : X+=1 if x4 not in code : X+=1 print(' '+'P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) t2 = input('Turn #2 : ') if t2 in code: print(WINNING_MSG) else: P = 0 V = 0 X = 0 x1 = t2[0] x2 = t2[1] x3 = t2[2] x4 = t2[3] if (x1==n1): P += 1 if (x2==n2): P += 1 if (x3==n3): P += 1 if (x4==n4): P += 1 if (x1==n2)or(x1==n3)or(x1==n4): V+=1 if (x2==n1)or(x2==n3)or(x2==n4): V+=1 if (x3==n1)or(x3==n2)or(x3==n4): V+=1 if (x4==n1)or(x4==n2)or(x4==n3): V+=1 if x1 not in code : X+=1 if x2 not in code : X+=1 if x3 not in code : X+=1 if x4 not in code : X+=1 print(' '+'P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) t3 = input('Turn #3 : ') if t3 in code: print(WINNING_MSG) else: P = 0 V = 0 X = 0 x1 = t3[0] x2 = t3[1] x3 = t3[2] x4 = t3[3] if (x1==n1): P += 1 if (x2==n2): P += 1 if (x3==n3): P += 1 if (x4==n4): P += 1 if (x1==n2)or(x1==n3)or(x1==n4): V+=1 if (x2==n1)or(x2==n3)or(x2==n4): V+=1 if (x3==n1)or(x3==n2)or(x3==n4): V+=1 if (x4==n1)or(x4==n2)or(x4==n3): V+=1 if x1 not in code : X+=1 if x2 not in code : X+=1 if x3 not in code : X+=1 if x4 not in code : X+=1 print(' '+'P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) t4 = input('Turn #4 : ') if t4 in code: print(WINNING_MSG) else: P = 0 V = 0 X = 0 x1 = t2[0] x2 = t2[1] x3 = t2[2] x4 = t2[3] if (x1==n1): P += 1 if (x2==n2): P += 1 if (x3==n3): P += 1 if (x4==n4): P += 1 if (x1==n2)or(x1==n3)or(x1==n4): V+=1 if (x2==n1)or(x2==n3)or(x2==n4): V+=1 if (x3==n1)or(x3==n2)or(x3==n4): V+=1 if (x4==n1)or(x4==n2)or(x4==n3): V+=1 if x1 not in code : X+=1 if x2 not in code : X+=1 if x3 not in code : X+=1 if x4 not in code : X+=1 print(' '+'P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) print(LOSING_MSG) print('The answer is '+code) print('Please try again...') |
# 6330171021 (20.00) 35 (2021-02-13 02:14) code = ' '.join(code) code = code.split() x = ' '.join(input('Turn #1 : ')) x = x.split() P = 0 V = 0 X = 0 if x[0] in code: if x[0] == code[0]: P+=1 else: V+=1 else: X+=1 if x[1] in code: if x[1] == code[1]: P+=1 else: V+=1 else: X+=1 if x[2] in code: if x[2] == code[2]: P+=1 else: V+=1 else: X+=1 if x[3] in code: if x[3]==code[3]: P+=1 else: V+=1 else: X+=1 if P == 4: print(WINNING_MSG) else: print(' P='+str(P)+',V='+str(V)+',X='+str(X)) x = ' '.join(input('Turn #2 : ')) x = x.split() P = 0 V = 0 X = 0 if x[0] in code: if x[0] == code[0]: P+=1 else: V+=1 else: X+=1 if x[1] in code: if x[1] == code[1]: P+=1 else: V+=1 else: X+=1 if x[2] in code: if x[2] == code[2]: P+=1 else: V+=1 else: X+=1 if x[3] in code: if x[3]==code[3]: P+=1 else: V+=1 else: X+=1 if P == 4: print(WINNING_MSG) else: print(' P='+str(P)+',V='+str(V)+',X='+str(X)) x = ' '.join(input('Turn #3 : ')) x = x.split() P = 0 V = 0 X = 0 if x[0] in code: if x[0] == code[0]: P+=1 else: V+=1 else: X+=1 if x[1] in code: if x[1] == code[1]: P+=1 else: V+=1 else: X+=1 if x[2] in code: if x[2] == code[2]: P+=1 else: V+=1 else: X+=1 if x[3] in code: if x[3]==code[3]: P+=1 else: V+=1 else: X+=1 if P == 4: print(WINNING_MSG) else: print(' P='+str(P)+',V='+str(V)+',X='+str(X)) x = ' '.join(input('Turn #4 : ')) x = x.split() P = 0 V = 0 X = 0 if x[0] in code: if x[0] == code[0]: P+=1 else: V+=1 else: X+=1 if x[1] in code: if x[1] == code[1]: P+=1 else: V+=1 else: X+=1 if x[2] in code: if x[2] == code[2]: P+=1 else: V+=1 else: X+=1 if x[3] in code: if x[3]==code[3]: P+=1 else: V+=1 else: X+=1 if P == 4: print(WINNING_MSG) else: print(' P='+str(P)+',V='+str(V)+',X='+str(X)) print(LOSING_MSG) code = ''.join(map(str,code)) print('The answer is '+str(code)) print("Please try again...") |
# 6330172721 (20.00) 36 (2021-02-12 03:32) def chk_txt(b_txt,i_txt) : P,V,X = 0,0,0 if i_txt[0] in b_txt : if i_txt[0] == b_txt[0] : P+=1 else : V+=1 else : X+=1 if i_txt[1] in b_txt : if i_txt[1] == b_txt[1] : P+=1 else : V+=1 else : X+=1 if i_txt[2] in b_txt : if i_txt[2] == b_txt[2] : P+=1 else : V+=1 else : X+=1 if i_txt[3] in b_txt : if i_txt[3] == b_txt[3] : P+=1 else : V+=1 else : X+=1 return P,V,X txt=input("Turn #1 : ") P,V,X = chk_txt(code,txt) if P==4 : print(WINNING_MSG) else : print(" P="+str(P)+",V="+str(V)+",X="+str(X)) txt=input("Turn #2 : ") P,V,X = chk_txt(code,txt) if P==4 : print(WINNING_MSG) else : print(" P="+str(P)+",V="+str(V)+",X="+str(X)) txt=input("Turn #3 : ") P,V,X = chk_txt(code,txt) if P==4 : print(WINNING_MSG) else : print(" P="+str(P)+",V="+str(V)+",X="+str(X)) txt=input("Turn #4 : ") P,V,X = chk_txt(code,txt) if P==4 : print(WINNING_MSG) else : print(" P="+str(P)+",V="+str(V)+",X="+str(X)) print(LOSING_MSG) print("The answer is "+code) print("Please try again...") |
# 6330173321 (20.00) 37 (2021-02-12 20:41) a = input("Turn #1 : ") h = a if code[0] == h[0] : p0 = 1 else : p0 = 0 if code[1] == h[1] : p1 = 1 else : p1 = 0 if code[2] == h[2] : p2 = 1 else : p2 = 0 if code[3] == h[3] : p3 = 1 else : p3 = 0 if code[0] in h : v0 = 1 else : v0 = 0 if code[1] in h : v1 = 1 else : v1 = 0 if code[2] in h : v2 = 1 else : v2 = 0 if code[3] in h : v3 = 1 else : v3 = 0 P1 = p0+p1+p2+p3 V = v0+v1+v2+v3-P1 X = str(4-(P1+V)) if P1==4 : print(WINNING_MSG) P2=P3=P4=4 else : P1 = str(P1) V = str(V) print(" "+"P="+P1+",V="+V+",X="+X) if P1!=4 : b = input("Turn #2 : ") h = b if code[0] == h[0] : p0 = 1 else : p0 = 0 if code[1] == h[1] : p1 = 1 else : p1 = 0 if code[2] == h[2] : p2 = 1 else : p2 = 0 if code[3] == h[3] : p3 = 1 else : p3 = 0 if code[0] in h : v0 = 1 else : v0 = 0 if code[1] in h : v1 = 1 else : v1 = 0 if code[2] in h : v2 = 1 else : v2 = 0 if code[3] in h : v3 = 1 else : v3 = 0 P2 = p0+p1+p2+p3 V = v0+v1+v2+v3-P2 X = str(4-(P2+V)) if P2==4 : print(WINNING_MSG) P3=P4=4 else : P2 = str(P2) V = str(V) print(" "+"P="+P2+",V="+V+",X="+X) if P2!=4 : c = input("Turn #3 : ") h = c if code[0] == h[0] : p0 = 1 else : p0 = 0 if code[1] == h[1] : p1 = 1 else : p1 = 0 if code[2] == h[2] : p2 = 1 else : p2 = 0 if code[3] == h[3] : p3 = 1 else : p3 = 0 if code[0] in h : v0 = 1 else : v0 = 0 if code[1] in h : v1 = 1 else : v1 = 0 if code[2] in h : v2 = 1 else : v2 = 0 if code[3] in h : v3 = 1 else : v3 = 0 P3 = p0+p1+p2+p3 V = v0+v1+v2+v3-P3 X = str(4-(P3+V)) if P3==4 : print(WINNING_MSG) P4=4 else : P3 = str(P3) V = str(V) print(" "+"P="+P3+",V="+V+",X="+X) if P3!=4 : c = input("Turn #4 : ") h = c if code[0] == h[0] : p0 = 1 else : p0 = 0 if code[1] == h[1] : p1 = 1 else : p1 = 0 if code[2] == h[2] : p2 = 1 else : p2 = 0 if code[3] == h[3] : p3 = 1 else : p3 = 0 if code[0] in h : v0 = 1 else : v0 = 0 if code[1] in h : v1 = 1 else : v1 = 0 if code[2] in h : v2 = 1 else : v2 = 0 if code[3] in h : v3 = 1 else : v3 = 0 P4 = p0+p1+p2+p3 V = v0+v1+v2+v3-P4 X = str(4-(P4+V)) if P4==4 : print(WINNING_MSG) else : P4 = str(P4) V = str(V) print(" "+"P="+P4+",V="+V+",X="+X) print(LOSING_MSG) print("The answer is "+code) print("Please try again...") |
# 6330174021 (20.00) 38 (2021-02-12 16:01) #--------------------------------------------------- cngat = "Congratulations! You won the game." fail = "Sorry! You just lost it.\nThe answer is " + code + "\nPlease try again..." ans = input("Turn #1 : ") if ans == code: print(cngat) else: p = 0 p += code[0] == ans[0]; p += code[1] == ans[1]; p += code[2] == ans[2]; p += code[3] == ans[3] x = 0 x += ans[0] not in code; x += ans[1] not in code; x += ans[2] not in code; x += ans[3] not in code # same color then deduct by same minus and position v = 4-x # number of same color v -= p show = " "*len("Turn #1 : ") + "P=" + str(p) + ','+ "V=" + str(v)+ ','+ "X=" + str(x) print(show) ans = input("Turn #2 : ") if ans == code: print(cngat) else: p = 0 p += code[0] == ans[0]; p += code[1] == ans[1]; p += code[2] == ans[2]; p += code[3] == ans[3] x = 0 x += ans[0] not in code; x += ans[1] not in code; x += ans[2] not in code; x += ans[3] not in code # same color then deduct by same minus and position v = 4-x # number of same color v -= p show = " "*len("Turn #1 : ") + "P=" + str(p) + ','+ "V=" + str(v)+ ','+ "X=" + str(x) print(show) ans = input("Turn #3 : ") if ans == code: print(cngat) else: p = 0 p += code[0] == ans[0]; p += code[1] == ans[1]; p += code[2] == ans[2]; p += code[3] == ans[3] x = 0 x += ans[0] not in code; x += ans[1] not in code; x += ans[2] not in code; x += ans[3] not in code # same color then deduct by same minus and position v = 4-x # number of same color v -= p show = " "*len("Turn #1 : ") + "P=" + str(p) + ','+ "V=" + str(v)+ ','+ "X=" + str(x) print(show) ans = input("Turn #4 : ") if ans == code: print(cngat) else: p = 0 p += code[0] == ans[0]; p += code[1] == ans[1]; p += code[2] == ans[2]; p += code[3] == ans[3] x = 0 x += ans[0] not in code; x += ans[1] not in code; x += ans[2] not in code; x += ans[3] not in code # same color then deduct by same minus and position v = 4-x # number of same color v -= p show = " "*len("Turn #1 : ") + "P=" + str(p) + ','+ "V=" + str(v)+ ','+ "X=" + str(x) print(show) print(fail) |
# 6330176221 (20.00) 39 (2021-02-12 14:21) w = input('Turn #1 : ') p = 0 v = 0 x = 0 if w[0] == code[0] : p += 1 if w[1] == code[1] : p += 1 if w[2] == code[2] : p += 1 if w[3] == code[3] : p += 1 if w[0] == code[1] : v += 1 if w[0] == code[2] : v += 1 if w[0] == code[3] : v += 1 if w[1] == code[0] : v += 1 if w[1] == code[2] : v += 1 if w[1] == code[3] : v += 1 if w[2] == code[0] : v += 1 if w[2] == code[1] : v += 1 if w[2] == code[3] : v += 1 if w[3] == code[0] : v += 1 if w[3] == code[1] : v += 1 if w[3] == code[2] : v += 1 if w[0] not in code : x += 1 if w[1] not in code : x += 1 if w[2] not in code : x += 1 if w[3] not in code : x += 1 P = str(p) V = str(v) X = str(x) if p == 4 : print(WINNING_MSG) else : print(' '*10 + 'P=' +P +',' +'V=' +V+','+'X=' +X) if p == 4 : pass else : w = input('Turn #2 : ') p = 0 v = 0 x = 0 if w[0] == code[0] : p += 1 if w[1] == code[1] : p += 1 if w[2] == code[2] : p += 1 if w[3] == code[3] : p += 1 if w[0] == code[1] : v += 1 if w[0] == code[2] : v += 1 if w[0] == code[3] : v += 1 if w[1] == code[0] : v += 1 if w[1] == code[2] : v += 1 if w[1] == code[3] : v += 1 if w[2] == code[0] : v += 1 if w[2] == code[1] : v += 1 if w[2] == code[3] : v += 1 if w[3] == code[0] : v += 1 if w[3] == code[1] : v += 1 if w[3] == code[2] : v += 1 if w[0] not in code : x += 1 if w[1] not in code : x += 1 if w[2] not in code : x += 1 if w[3] not in code : x += 1 P = str(p) V = str(v) X = str(x) if p == 4 : print(WINNING_MSG) else : print(' '*10 + 'P=' +P +',' +'V=' +V+','+'X=' +X) if p == 4 : pass else : w = input('Turn #3 : ') p = 0 v = 0 x = 0 if w[0] == code[0] : p += 1 if w[1] == code[1] : p += 1 if w[2] == code[2] : p += 1 if w[3] == code[3] : p += 1 if w[0] == code[1] : v += 1 if w[0] == code[2] : v += 1 if w[0] == code[3] : v += 1 if w[1] == code[0] : v += 1 if w[1] == code[2] : v += 1 if w[1] == code[3] : v += 1 if w[2] == code[0] : v += 1 if w[2] == code[1] : v += 1 if w[2] == code[3] : v += 1 if w[3] == code[0] : v += 1 if w[3] == code[1] : v += 1 if w[3] == code[2] : v += 1 if w[0] not in code : x += 1 if w[1] not in code : x += 1 if w[2] not in code : x += 1 if w[3] not in code : x += 1 P = str(p) V = str(v) X = str(x) if p == 4 : print(WINNING_MSG) else : print(' '*10 + 'P=' +P +',' +'V=' +V+','+'X=' +X) if p == 4 : pass else : w = input('Turn #4 : ') p = 0 v = 0 x = 0 if w[0] == code[0] : p += 1 if w[1] == code[1] : p += 1 if w[2] == code[2] : p += 1 if w[3] == code[3] : p += 1 if w[0] == code[1] : v += 1 if w[0] == code[2] : v += 1 if w[0] == code[3] : v += 1 if w[1] == code[0] : v += 1 if w[1] == code[2] : v += 1 if w[1] == code[3] : v += 1 if w[2] == code[0] : v += 1 if w[2] == code[1] : v += 1 if w[2] == code[3] : v += 1 if w[3] == code[0] : v += 1 if w[3] == code[1] : v += 1 if w[3] == code[2] : v += 1 if w[0] not in code : x += 1 if w[1] not in code : x += 1 if w[2] not in code : x += 1 if w[3] not in code : x += 1 P = str(p) V = str(v) X = str(x) if p == 4 : print(WINNING_MSG) else : print(' '*10 + 'P=' +P +',' +'V=' +V+','+'X=' +X) print(LOSING_MSG) print('The answer is' , code) print('Please try again...') |
# 6330177921 (20.00) 40 (2021-02-14 01:02) P,V,X = 0,0,0 x = input("Turn #1 : ") if x[0] == code [0]: P += 1 elif x[0] in code: V += 1 else: X += 1 if x[1] == code [1]: P += 1 elif x[1] in code: V += 1 else: X += 1 if x[2] == code [2]: P += 1 elif x[2] in code: V += 1 else: X += 1 if x[3] == code [3]: P += 1 elif x[3] in code: V += 1 else: X += 1 if P == 4: print("Congratulations! You won the game.") else: print(" P="+str(P)+",V="+str(V)+",X="+str(X)) x = input("Turn #2 : ") P,V,X = 0,0,0 if x[0] == code [0]: P += 1 elif x[0] in code: V += 1 else: X += 1 if x[1] == code [1]: P += 1 elif x[1] in code: V += 1 else: X += 1 if x[2] == code [2]: P += 1 elif x[2] in code: V += 1 else: X += 1 if x[3] == code [3]: P += 1 elif x[3] in code: V += 1 else: X += 1 if P == 4: print("Congratulations! You won the game.") else: print(" P="+str(P)+",V="+str(V)+",X="+str(X)) x = input("Turn #3 : ") P,V,X = 0,0,0 if x[0] == code [0]: P += 1 elif x[0] in code: V += 1 else: X += 1 if x[1] == code [1]: P += 1 elif x[1] in code: V += 1 else: X += 1 if x[2] == code [2]: P += 1 elif x[2] in code: V += 1 else: X += 1 if x[3] == code [3]: P += 1 elif x[3] in code: V += 1 else: X += 1 if P == 4: print("Congratulations! You won the game.") else: print(" P="+str(P)+",V="+str(V)+",X="+str(X)) x = input("Turn #4 : ") P,V,X = 0,0,0 if x[0] == code [0]: P += 1 elif x[0] in code: V += 1 else: X += 1 if x[1] == code [1]: P += 1 elif x[1] in code: V += 1 else: X += 1 if x[2] == code [2]: P += 1 elif x[2] in code: V += 1 else: X += 1 if x[3] == code [3]: P += 1 elif x[3] in code: V += 1 else: X += 1 if P == 4: print("Congratulations! You won the game.") else: print(" P="+str(P)+",V="+str(V)+",X="+str(X)) print("Sorry! You just lost it.") print("The answer is",code) print("Please try again...") |
# 6330178521 (20.00) 41 (2021-02-13 16:37) a = list(code) a1 = a[0] a2 = a[1] a3 = a[2] a4 = a[3] z = input('Turn #1 : ') y = list(z) y1 = y[0] y2 = y[1] y3 = y[2] y4 = y[3] if y1 == a1: n = 1 else: n=0 if y2 == a2: n +=1 if y3 == a3: n +=1 if y4 == a4: n +=1 if y1 in a and y1!=a1: m=1 else: m=0 if y2 in a and y2!=a2: m +=1 if y3 in a and y3!=a3: m +=1 if y4 in a and y4!=a4: m +=1 k=4-(m+n) if n==4: print(WINNING_MSG) else: print(' '+'P='+str(n)+',V='+str(m)+',X='+str(k)) z = input('Turn #2 : ') y = list(z) y1 = y[0] y2 = y[1] y3 = y[2] y4 = y[3] if y1 == a1: n = 1 else: n=0 if y2 == a2: n +=1 if y3 == a3: n +=1 if y4 == a4: n +=1 if y1 in a and y1!=a1: m=1 else: m=0 if y2 in a and y2!=a2: m +=1 if y3 in a and y3!=a3: m +=1 if y4 in a and y4!=a4: m +=1 k=4-(m+n) if n==4: print(WINNING_MSG) else: print(' '+'P='+str(n)+',V='+str(m)+',X='+str(k)) z = input('Turn #3 : ') y = list(z) y1 = y[0] y2 = y[1] y3 = y[2] y4 = y[3] if y1 == a1: n = 1 else: n=0 if y2 == a2: n +=1 if y3 == a3: n +=1 if y4 == a4: n +=1 if y1 in a and y1!=a1: m=1 else: m=0 if y2 in a and y2!=a2: m +=1 if y3 in a and y3!=a3: m +=1 if y4 in a and y4!=a4: m +=1 k=4-(m+n) if n==4: print(WINNING_MSG) else: print(' '+'P='+str(n)+',V='+str(m)+',X='+str(k)) z = input('Turn #4 : ') y = list(z) y1 = y[0] y2 = y[1] y3 = y[2] y4 = y[3] if y1 == a1: n = 1 else: n=0 if y2 == a2: n +=1 if y3 == a3: n +=1 if y4 == a4: n +=1 if y1 in a and y1!=a1: m=1 else: m=0 if y2 in a and y2!=a2: m +=1 if y3 in a and y3!=a3: m +=1 if y4 in a and y4!=a4: m +=1 k=4-(m+n) if n==4: print(WINNING_MSG) else: print(' '+'P='+str(n)+',V='+str(m)+',X='+str(k)) print(LOSING_MSG) print('The answer is', code) print('Please try again...') |
# 6330179121 (19.11) 42 (2021-02-11 22:08) s = str(input('Turn #1 : ')) P = 0 ; V = 0 ; X = 0 if s[0] == code[0] : P+=1 if s[1] == code[1] : P+=1 if s[2] == code[2] : P+=1 if s[3] == code[3] : P+=1 if s[0] in code : V+=1 if s[1] in code : V+=1 if s[2] in code : V+=1 if s[3] in code : V+=1 V = V-P X = 4-V-P print('P='+str(P)+',V='+str(V)+',X='+str(X)) #check if P == 4 : print(WINNING_MSG) else : s = str(input('Turn #2 : ')) P = 0 ; V = 0 ; X = 0 if s[0] == code[0] : P+=1 if s[1] == code[1] : P+=1 if s[2] == code[2] : P+=1 if s[3] == code[3] : P+=1 if s[0] in code : V+=1 if s[1] in code : V+=1 if s[2] in code : V+=1 if s[3] in code : V+=1 V = V-P X = 4-V-P print('P='+str(P)+',V='+str(V)+',X='+str(X)) if P == 4 : print(WINNING_MSG) else : s = str(input('Turn #3 : ')) P = 0 ; V = 0 ; X = 0 if s[0] == code[0] : P+=1 if s[1] == code[1] : P+=1 if s[2] == code[2] : P+=1 if s[3] == code[3] : P+=1 if s[0] in code : V+=1 if s[1] in code : V+=1 if s[2] in code : V+=1 if s[3] in code : V+=1 V = V-P X = 4-V-P print('P='+str(P)+',V='+str(V)+',X='+str(X)) if P == 4 : print(WINNING_MSG) else : s = str(input('Turn #4 : ')) P = 0 ; V = 0 ; X = 0 if s[0] == code[0] : P+=1 if s[1] == code[1] : P+=1 if s[2] == code[2] : P+=1 if s[3] == code[3] : P+=1 if s[0] in code : V+=1 if s[1] in code : V+=1 if s[2] in code : V+=1 if s[3] in code : V+=1 V = V-P X = 4-V-P print('P='+str(P)+',V='+str(V)+',X='+str(X)) if P == 4 : print(WINNING_MSG) else : print(LOSING_MSG) print('The answer is',code) print('Please try again...') |
# 6330180721 (20.00) 43 (2021-02-11 10:03) ans1 = input("Turn #1 : ") n1 = 0; m1 = 0 if ans1 == code: print(WINNING_MSG) else: if ans1[0] == code[0]: n1 += 1 elif ans1[0] in code: m1 += 1 if ans1[1] == code[1]: n1 += 1 elif ans1[1] in code: m1 += 1 if ans1[2] == code[2]: n1 += 1 elif ans1[2] in code: m1 += 1 if ans1[3] == code[3]: n1 += 1 elif ans1[3] in code: m1 += 1 k1 = 4 - n1 - m1 print(" P="+str(n1)+",V="+str(m1)+",X="+str(k1)) ans2 = input("Turn #2 : ") n2 = 0; m2 = 0 if ans2 == code: print(WINNING_MSG) else: if ans2[0] == code[0]: n2 += 1 elif ans2[0] in code: m2 += 1 if ans2[1] == code[1]: n2 += 1 elif ans2[1] in code: m2 += 1 if ans2[2] == code[2]: n2 += 1 elif ans2[2] in code: m2 += 1 if ans2[3] == code[3]: n2 += 1 elif ans2[3] in code: m2 += 1 k2 = 4 - n2 - m2 print(" P="+str(n2)+",V="+str(m2)+",X="+str(k2)) ans3 = input("Turn #3 : ") n3 = 0; m3 = 0 if ans3 == code: print(WINNING_MSG) else: if ans3[0] == code[0]: n3 += 1 elif ans3[0] in code: m3 += 1 if ans3[1] == code[1]: n3 += 1 elif ans3[1] in code: m3 += 1 if ans3[2] == code[2]: n3 += 1 elif ans3[2] in code: m3 += 1 if ans3[3] == code[3]: n3 += 1 elif ans3[3] in code: m3 += 1 k3 = 4 - n3 - m3 print(" P="+str(n3)+",V="+str(m3)+",X="+str(k3)) ans4 = input("Turn #4 : ") n4 = 0; m4 = 0 if ans4 == code: print(WINNING_MSG) else: if ans4[0] == code[0]: n4 += 1 elif ans4[0] in code: m4 += 1 if ans4[1] == code[1]: n4 += 1 elif ans4[1] in code: m4 += 1 if ans4[2] == code[2]: n4 += 1 elif ans4[2] in code: m4 += 1 if ans4[3] == code[3]: n4 += 1 elif ans4[3] in code: m4 += 1 k4 = 4 - n4 - m4 print(" P="+str(n4)+",V="+str(m4)+",X="+str(k4)) print(LOSING_MSG) print("The answer is",code) print("Please try again...") |
# 6330181321 (20.00) 44 (2021-02-11 23:15) g=input('Turn #1 : ') #1 p=0 if g[0]== code[0]: p+=1 if g[1]== code[1]: p+=1 if g[2]== code[2]: p+=1 if g[3]== code[3]: p+=1 v=0 if g[0] in code: v+=1 if g[1] in code: v+=1 if g[2] in code: v+=1 if g[3] in code: v+=1 v=v-p x=4-(p+v) if p==4 : print('Congratulations! You won the game.') else: print(" "+"P="+str(p)+','+'V='+str(v)+','+"X="+str(x)) g=input('Turn #2 : ') #2 p=0 if g[0]== code[0]: p+=1 if g[1]== code[1]: p+=1 if g[2]== code[2]: p+=1 if g[3]== code[3]: p+=1 v=0 if g[0] in code: v+=1 if g[1] in code: v+=1 if g[2] in code: v+=1 if g[3] in code: v+=1 v=v-p x=4-(p+v) if p==4 : print('Congratulations! You won the game.') else: print(" "+"P="+str(p)+','+'V='+str(v)+','+"X="+str(x)) g=input('Turn #3 : ') #3 p=0 if g[0]== code[0]: p+=1 if g[1]== code[1]: p+=1 if g[2]== code[2]: p+=1 if g[3]== code[3]: p+=1 v=0 if g[0] in code: v+=1 if g[1] in code: v+=1 if g[2] in code: v+=1 if g[3] in code: v+=1 v=v-p x=4-(p+v) if p==4 : print('Congratulations! You won the game.') else: print(" "+"P="+str(p)+','+'V='+str(v)+','+"X="+str(x)) g=input('Turn #4 : ') #4 p=0 if g[0]== code[0]: p+=1 if g[1]== code[1]: p+=1 if g[2]== code[2]: p+=1 if g[3]== code[3]: p+=1 v=0 if g[0] in code: v+=1 if g[1] in code: v+=1 if g[2] in code: v+=1 if g[3] in code: v+=1 v=v-p x=4-(p+v) if p==4 : print('Congratulations! You won the game.') else: print(" "+"P="+str(p)+','+'V='+str(v)+','+"X="+str(x)) print('Sorry! You just lost it.') print('The answer is',code) print('Please try again...') |
# 6330182021 (20.00) 45 (2021-02-14 18:33) first = input("Turn #1 : ") P=0 V=0 X=0 if first[0] == code[0]: P=1 else: if first[0] in code: V=1 else: V=0 if first[1] == code[1]: P+=1 else: P=P if first[1] in code: V+=1 if first[2] == code[2]: P+=1 else: P=P if first[2] in code: V+=1 if first[3] == code[3]: P+=1 else: P=P if first[3] in code: V+=1 X = 4-(P+V) if first==code: print("Congratulations! You won the game.") else: print(" "*10+"P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) sec = input("Turn #2 : ") P=0 V=0 if sec[0] == code[0]: P=1 else: P=0 if sec[0] in code: V=1 else: V=0 if sec[1] == code[1]: P+=1 else: if sec[1] in code: V+=1 if sec[2] == code[2]: P+=1 else: if sec[2] in code: V+=1 if sec[3] == code[3]: P+=1 else: if sec[3] in code: V+=1 else: V=V X = 4-(P+V) if sec==code: print("Congratulations! You won the game.") else: print(" "*10+"P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) T = input("Turn #3 : ") P=0 V=0 if T[0] == code[0]: P=1 else: P=0 if T[0] in code: V=1 if T[1] == code[1]: P+=1 else: if T[1] in code: V+=1 if T[2] == code[2]: P+=1 else: if T[2] in code: V+=1 if T[3] == code[3]: P+=1 else: if T[3] in code: V+=1 else: V=V X = 4-(P+V) if T==code: print("Congratulations! You won the game.") else: print(" "*10+"P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) fo = input("Turn #4 : ") P=0 V=0 if fo[0] == code[0]: P=1 else: P=0 if fo[0] in code: V=1 else: V=0 if fo[1] == code[1]: P+=1 else: if fo[1] in code: V+=1 if fo[2] == code[2]: P+=1 else: if fo[2] in code: V+=1 if fo[3] == code[3]: P+=1 else: if fo[3] in code: V+=1 X = 4-(P+V) if fo==code: print("Congratulations! You won the game.") else: print(" "*10+"P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) print("Sorry! You just lost it.") print("The answer is "+code) print("Please try again...") |
# 6330183621 (20.00) 46 (2021-02-11 13:45) result=False turn=1 while result==False and turn<=4: z='Turn #'+str(turn)+' : ' y=input(z) p=0 v=0 for n in range(4): if y[n]==code[n]: p+=1 else: pass for e in range(4): if y[e] in code: v+=1 else: pass v-=p x=4-p-v if p==4: result=True else: result=False s=' '*len(z)+'P='+str(p)+',V='+str(v)+',X='+str(x) print(s) turn+=1 if result==True: print(WINNING_MSG) else: print(LOSING_MSG) print('The answer is',code) print('Please try again...') |
# 6330184221 (20.00) 47 (2021-02-13 17:17) a = input("Turn #1 : ") P = 0 V = 0 X = 0 if a[0] in code : if a[0] == code[0] : P += 1 else : V += 1 else : X += 1 if a[1] in code : if a[1] == code[1] : P += 1 else : V += 1 else : X += 1 if a[2] in code : if a[2] == code[2] : P += 1 else : V += 1 else : X += 1 if a[3] in code : if a[3] == code[3] : P += 1 else : V += 1 else : X += 1 if P == 4 : print(WINNING_MSG) else : print(" "*10+"P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) a = input("Turn #2 : ") P = 0 V = 0 X = 0 if a[0] in code : if a[0] == code[0] : P += 1 else : V += 1 else : X += 1 if a[1] in code : if a[1] == code[1] : P += 1 else : V += 1 else : X += 1 if a[2] in code : if a[2] == code[2] : P += 1 else : V += 1 else : X += 1 if a[3] in code : if a[3] == code[3] : P += 1 else : V += 1 else : X += 1 if P == 4 : print(WINNING_MSG) else : print(" "*10+"P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) a = input("Turn #3 : ") P = 0 V = 0 X = 0 if a[0] in code : if a[0] == code[0] : P += 1 else : V += 1 else : X += 1 if a[1] in code : if a[1] == code[1] : P += 1 else : V += 1 else : X += 1 if a[2] in code : if a[2] == code[2] : P += 1 else : V += 1 else : X += 1 if a[3] in code : if a[3] == code[3] : P += 1 else : V += 1 else : X += 1 if P == 4 : print(WINNING_MSG) else : print(" "*10+"P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) a = input("Turn #4 : ") P = 0 V = 0 X = 0 if a[0] in code : if a[0] == code[0] : P += 1 else : V += 1 else : X += 1 if a[1] in code : if a[1] == code[1] : P += 1 else : V += 1 else : X += 1 if a[2] in code : if a[2] == code[2] : P += 1 else : V += 1 else : X += 1 if a[3] in code : if a[3] == code[3] : P += 1 else : V += 1 else : X += 1 if P == 4 : print(WINNING_MSG) else : print(" "*10+"P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) print(LOSING_MSG) print("The answer is"," "+code) print("Please try again...") |
# 6330185921 (17.50) 48 (2021-02-13 12:38) # to exit the code print(code) [e,f,g,h] =[code[0:1],code[1:2],code[2:3],code[3:]] l=input('turn #1 : ') [a,b,c,d] = [l[0:1],l[1:2],l[2:3],l[3:]] p=0 v=0 x=0 if a==e: p = p+1 if b==f: p = p+1 if c==g: p = p+1 if d==h: p = p+1 if a in code: v=v+1 if b in code: v=v+1 if c in code: v=v+1 if d in code: v=v+1 v=v-p x = 4-(v+p) if p==4: print(WINNING_MSG) else : print(' P='+str(p)+','+'V='+str(v)+','+'X='+str(x)) l =input('turn #2 : ') [a,b,c,d] = [l[0:1],l[1:2],l[2:3],l[3:]] v=0 p=0 x=0 if a==e: p = p+1 if b==f: p = p+1 if c==g: p = p+1 if d==h: p = p+1 if a in code: v=v+1 if b in code: v=v+1 if c in code: v=v+1 if d in code: v=v+1 v=v-p x = 4-(v+p) if p==4: print(WINNING_MSG) else : print(' P='+str(p)+','+'V='+str(v)+','+'X='+str(x)) l =input('turn #3 : ') [a,b,c,d] = [l[0:1],l[1:2],l[2:3],l[3:]] p=0 v=0 x=0 if a==e: p = p+1 if b==f: p = p+1 if c==g: p = p+1 if d==h: p = p+1 if a in code: v=v+1 if b in code: v=v+1 if c in code: v=v+1 if d in code: v=v+1 v=v-p x = 4-(v+p) if p==4: print(WINNING_MSG) else : print(' P='+str(p)+','+'V='+str(v)+','+'X='+str(x)) l= input('turn #4 : ') [a,b,c,d] = [l[0:1],l[1:2],l[2:3],l[3:]] p=0 v=0 x=0 if a==e: p = p+1 if b==f: p = p+1 if c==g: p = p+1 if d==h: p = p+1 if a in code: v=v+1 if b in code: v=v+1 if c in code: v=v+1 if d in code: v=v+1 v=v-p x = 4-(v+p) if p==4: print(WINNING_MSG) else : print(' P='+str(p)+','+'V='+str(v)+','+'X='+str(x)) print(LOSING_MSG) print('The answer is',code) print('Please try again...') |
# 6330186521 (20.00) 49 (2021-02-14 17:35) c = input('Turn #1 : ') v = 0 p = 0 x = 4 if c == code: print(WINNING_MSG) if c[0] == code[0]: p +=1 if c[1] == code[1]: p+=1 if c[2] == code[2]: p+=1 if c[3] == code[3]: p+=1 if c[0] == code[1] or c[0] == code[2] or c[0] == code[3]: v+=1 if c[1] == code[2] or c[1] == code[3] or c[1] == code[0]: v+=1 if c[2] == code[1] or c[2] == code[0] or c[2] == code[3]: v+=1 if c[3] == code[1] or c[3] == code[2] or c[3] == code[0]: v+=1 x = x - v - p if p != 4: print(' P='+str(p)+',V='+str(v)+',X='+str(x)) c = input('Turn #2 : ') p = 0 v = 0 x = 4 if c == code: print(WINNING_MSG) if c[0] == code[0]: p +=1 if c[1] == code[1]: p+=1 if c[2] == code[2]: p+=1 if c[3] == code[3]: p+=1 if c[0] == code[1] or c[0] == code[2] or c[0] == code[3]: v+=1 if c[1] == code[2] or c[1] == code[3] or c[1] == code[0]: v+=1 if c[2] == code[1] or c[2] == code[0] or c[2] == code[3]: v+=1 if c[3] == code[1] or c[3] == code[2] or c[3] == code[0]: v+=1 x = x - v - p if p != 4: print(' P='+str(p)+',V='+str(v)+',X='+str(x)) c = input('Turn #3 : ') p = 0 v = 0 x = 4 if c == code: print(WINNING_MSG) if c[0] == code[0]: p +=1 if c[1] == code[1]: p+=1 if c[2] == code[2]: p+=1 if c[3] == code[3]: p+=1 if c[0] == code[1] or c[0] == code[2] or c[0] == code[3]: v+=1 if c[1] == code[2] or c[1] == code[3] or c[1] == code[0]: v+=1 if c[2] == code[1] or c[2] == code[0] or c[2] == code[3]: v+=1 if c[3] == code[1] or c[3] == code[2] or c[3] == code[0]: v+=1 x = x - v - p if p != 4: print(' P='+str(p)+',V='+str(v)+',X='+str(x)) c = input('Turn #4 : ') p = 0 v = 0 x = 4 if c == code: print(WINNING_MSG) if c[0] == code[0]: p +=1 if c[1] == code[1]: p+=1 if c[2] == code[2]: p+=1 if c[3] == code[3]: p+=1 if c[0] == code[1] or c[0] == code[2] or c[0] == code[3]: v+=1 if c[1] == code[2] or c[1] == code[3] or c[1] == code[0]: v+=1 if c[2] == code[1] or c[2] == code[0] or c[2] == code[3]: v+=1 if c[3] == code[1] or c[3] == code[2] or c[3] == code[0]: v+=1 x = x - v - p if p != 4: print(' P='+str(p)+',V='+str(v)+',X='+str(x)) print(LOSING_MSG) print('The answer is ' + code) print('Please try again...') |
# 6330187121 (20.00) 50 (2021-02-14 00:46) # Turn 1 ----------------------------------------------- P = 0 V = 0 X = 0 ANS1 = input('Turn #1 : ') if code[0] == ANS1[0]: P += 1 if code[1] == ANS1[1]: P += 1 if code[2] == ANS1[2]: P += 1 if code[3] == ANS1[3]: P += 1 if ANS1[0] in code : V += 1 if ANS1[1] in code : V += 1 if ANS1[2] in code : V += 1 if ANS1[3] in code : V += 1 if not ANS1[0] in code: X += 1 if not ANS1[1] in code: X += 1 if not ANS1[2] in code: X += 1 if not ANS1[3] in code: X += 1 V = V - P if P == 4: print(WINNING_MSG) else: print(' '* 10+'P='+str(P)+',V='+str(V)+',X='+str(X)) # Turn 2 ----------------------------------------------- P = 0 V = 0 X = 0 ANS1 = input('Turn #2 : ') if code[0] == ANS1[0]: P += 1 if code[1] == ANS1[1]: P += 1 if code[2] == ANS1[2]: P += 1 if code[3] == ANS1[3]: P += 1 if ANS1[0] in code : V += 1 if ANS1[1] in code : V += 1 if ANS1[2] in code : V += 1 if ANS1[3] in code : V += 1 if not ANS1[0] in code: X += 1 if not ANS1[1] in code: X += 1 if not ANS1[2] in code: X += 1 if not ANS1[3] in code: X += 1 V = V - P if P == 4: print(WINNING_MSG) else: print(' '* 10+'P='+str(P)+',V='+str(V)+',X='+str(X)) # Turn 3 ----------------------------------------------- P = 0 V = 0 X = 0 ANS1 = input('Turn #3 : ') if code[0] == ANS1[0]: P += 1 if code[1] == ANS1[1]: P += 1 if code[2] == ANS1[2]: P += 1 if code[3] == ANS1[3]: P += 1 if ANS1[0] in code : V += 1 if ANS1[1] in code : V += 1 if ANS1[2] in code : V += 1 if ANS1[3] in code : V += 1 if not ANS1[0] in code: X += 1 if not ANS1[1] in code: X += 1 if not ANS1[2] in code: X += 1 if not ANS1[3] in code: X += 1 V = V - P if P == 4: print(WINNING_MSG) else: print(' '* 10+'P='+str(P)+',V='+str(V)+',X='+str(X)) # Turn 4 ----------------------------------------------- P = 0 V = 0 X = 0 ANS1 = input('Turn #4 : ') if code[0] == ANS1[0]: P += 1 if code[1] == ANS1[1]: P += 1 if code[2] == ANS1[2]: P += 1 if code[3] == ANS1[3]: P += 1 if ANS1[0] in code : V += 1 if ANS1[1] in code : V += 1 if ANS1[2] in code : V += 1 if ANS1[3] in code : V += 1 if not ANS1[0] in code: X += 1 if not ANS1[1] in code: X += 1 if not ANS1[2] in code: X += 1 if not ANS1[3] in code: X += 1 V = V - P if P == 4: print(WINNING_MSG) else: print(' '* 10+'P='+str(P)+',V='+str(V)+',X='+str(X)) print(LOSING_MSG) print('The answer is '+ code) print('Please try again...') |
# 6330188821 (13.99) 51 (2021-02-15 22:53) z = input("Turn #1 : ") if z==code :print(WINNING_MSG) else: p = 0 v = 0 if z[0]==code[0]:p+=1 elif z[0]==code[1]:v+=1 elif z[0]==code[2]:v+=1 elif z[0]==code[3]:v+=1 if z[1]==code[1]:p+=1 elif z[1]==code[0]:v+=1 elif z[1]==code[2]:v+=1 elif z[1]==code[3]:v+=1 if z[2]==code[2]:p+=1 elif z[2]==code[0]:v+=1 elif z[2]==code[1]:v+=1 elif z[2]==code[3]:v+=1 if z[3]==code[3]:p+=1 elif z[3]==code[0]:v+=1 elif z[3]==code[1]:v+=1 elif z[3]==code[2]:v+=1 x = 4-p-v print(" " + "p=" + str(p) + "," + "v=" + str(v) + "," + "x=" + str(x)) z = input("Turn #2 : ") if z==code :print(WINNING_MSG) else: p = 0 v = 0 if z[0]==code[0]:p+=1 elif z[0]==code[1]:v+=1 elif z[0]==code[2]:v+=1 elif z[0]==code[3]:v+=1 if z[1]==code[1]:p+=1 elif z[1]==code[0]:v+=1 elif z[1]==code[2]:v+=1 elif z[1]==code[3]:v+=1 if z[2]==code[2]:p+=1 elif z[2]==code[0]:v+=1 elif z[2]==code[1]:v+=1 elif z[2]==code[3]:v+=1 if z[3]==code[3]:p+=1 elif z[3]==code[0]:v+=1 elif z[3]==code[1]:v+=1 elif z[3]==code[2]:v+=1 x = 4-p-v print(" " + "p=" + str(p) + "," + "v=" + str(v) + "," + "x=" + str(x)) z = input("Turn #3 : ") if z==code :print(WINNING_MSG) else: p = 0 v = 0 if z[0]==code[0]:p+=1 elif z[0]==code[1]:v+=1 elif z[0]==code[2]:v+=1 elif z[0]==code[3]:v+=1 if z[1]==code[1]:p+=1 elif z[1]==code[0]:v+=1 elif z[1]==code[2]:v+=1 elif z[1]==code[3]:v+=1 if z[2]==code[2]:p+=1 elif z[2]==code[0]:v+=1 elif z[2]==code[1]:v+=1 elif z[2]==code[3]:v+=1 if z[3]==code[3]:p+=1 elif z[3]==code[0]:v+=1 elif z[3]==code[1]:v+=1 elif z[3]==code[2]:v+=1 x = 4-p-v print(" " + "p=" + str(p) + "," + "v=" + str(v) + "," + "x=" + str(x)) z = input("Turn #4 : ") if z==code :print(WINNING_MSG) else: p = 0 v = 0 if z[0]==code[0]:p+=1 elif z[0]==code[1]:v+=1 elif z[0]==code[2]:v+=1 elif z[0]==code[3]:v+=1 if z[1]==code[1]:p+=1 elif z[1]==code[0]:v+=1 elif z[1]==code[2]:v+=1 elif z[1]==code[3]:v+=1 if z[2]==code[2]:p+=1 elif z[2]==code[0]:v+=1 elif z[2]==code[1]:v+=1 elif z[2]==code[3]:v+=1 if z[3]==code[3]:p+=1 elif z[3]==code[0]:v+=1 elif z[3]==code[1]:v+=1 elif z[3]==code[2]:v+=1 x = 4-p-v print(" " + "p=" + str(p) + "," + "v=" + str(v) + "," + "x=" + str(x)) print(LOSING_MSG) print("The answer is" + " " + code) print("Please try again...") |
# 6330189421 (20.00) 52 (2021-02-12 22:47) x=[code[0],code[1],code[2],code[3]] i=input("Turn #1 : ") y=[i[0],i[1],i[2],i[3]] p=0 v=0 if code == i: print('Congratulations! You won the game.') if y[0] == x[0] : p+=1 elif y[0] in x: v+=1 if y[1] == x[1] : p+=1 elif y[1] in x: v+=1 if y[2] == x[2] : p+=1 elif y[2] in x: v+=1 if y[3] == x[3] : p+=1 elif y[3] in x: v+=1 if not (code==i): print(" "+"P="+str(p)+",V="+str(v)+",X="+str(4-p-v)) i=input("Turn #2 : ") y=[i[0],i[1],i[2],i[3]] p=0 v=0 if code == i: print('Congratulations! You won the game.') if y[0] == x[0] : p+=1 elif y[0] in x: v+=1 if y[1] == x[1] : p+=1 elif y[1] in x: v+=1 if y[2] == x[2] : p+=1 elif y[2] in x: v+=1 if y[3] == x[3] : p+=1 elif y[3] in x: v+=1 if not (code==i): print(" "+"P="+str(p)+",V="+str(v)+",X="+str(4-p-v)) i=input("Turn #3 : ") y=[i[0],i[1],i[2],i[3]] p=0 v=0 if code == i: print('Congratulations! You won the game.') if y[0] == x[0] : p+=1 elif y[0] in x: v+=1 if y[1] == x[1] : p+=1 elif y[1] in x: v+=1 if y[2] == x[2] : p+=1 elif y[2] in x: v+=1 if y[3] == x[3] : p+=1 elif y[3] in x: v+=1 if not (code==i): print(" "+"P="+str(p)+",V="+str(v)+",X="+str(4-p-v)) i=input("Turn #4 : ") y=[i[0],i[1],i[2],i[3]] p=0 v=0 if code == i: print('Congratulations! You won the game.') if y[0] == x[0] : p+=1 elif y[0] in x: v+=1 if y[1] == x[1] : p+=1 elif y[1] in x: v+=1 if y[2] == x[2] : p+=1 elif y[2] in x: v+=1 if y[3] == x[3] : p+=1 elif y[3] in x: v+=1 if not (code==i): print(" "+"P="+str(p)+",V="+str(v)+",X="+str(4-p-v)) print("Sorry! You just lost it.") print('The answer is ',code) print('Please try again...') |
# 6330190021 (20.00) 53 (2021-02-14 22:47) N_turn = 0 P = 0 V = 0 X = 0 N_turn += 1 code_p = input("Turn #"+str(N_turn)+" : ",) if code_p == code : print(WINNING_MSG) N_turn = 5 else: if code_p[0] == code[0] : P += 1 else: if code_p[0] in code : V += 1 else: X += 1 if code_p[1] == code[1] : P += 1 else: if code_p[1] in code : V += 1 else: X += 1 if code_p[2] == code[2] : P += 1 else: if code_p[2] in code : V += 1 else: X += 1 if code_p[3] == code[3] : P += 1 else: if code_p[3] in code : V += 1 else: X += 1 print(" "+"P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) P = 0 V = 0 X = 0 if N_turn < 5 : #round 2 N_turn += 1 code_p = input("Turn #"+str(N_turn)+" : ",) if code_p == code : print(WINNING_MSG) N_turn = 5 else: if code_p[0] == code[0] : P += 1 else: if code_p[0] in code : V += 1 else: X += 1 if code_p[1] == code[1] : P += 1 else: if code_p[1] in code : V += 1 else: X += 1 if code_p[2] == code[2] : P += 1 else: if code_p[2] in code : V += 1 else: X += 1 if code_p[3] == code[3] : P += 1 else: if code_p[3] in code : V += 1 else: X += 1 print(" "+"P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) P = 0 V = 0 X = 0 if N_turn < 5 : #round 3 N_turn += 1 code_p = input("Turn #"+str(N_turn)+" : ",) if code_p == code : print(WINNING_MSG) N_turn = 5 else: if code_p[0] == code[0] : P += 1 else: if code_p[0] in code : V += 1 else: X += 1 if code_p[1] == code[1] : P += 1 else: if code_p[1] in code : V += 1 else: X += 1 if code_p[2] == code[2] : P += 1 else: if code_p[2] in code : V += 1 else: X += 1 if code_p[3] == code[3] : P += 1 else: if code_p[3] in code : V += 1 else: X += 1 print(" "+"P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) P = 0 V = 0 X = 0 if N_turn < 5 : #round 4 #last round N_turn += 1 code_p = input("Turn #"+str(N_turn)+" : ",) if code_p == code : print(WINNING_MSG) N_turn = 5 else: if code_p[0] == code[0] : P += 1 else: if code_p[0] in code : V += 1 else: X += 1 if code_p[1] == code[1] : P += 1 else: if code_p[1] in code : V += 1 else: X += 1 if code_p[2] == code[2] : P += 1 else: if code_p[2] in code : V += 1 else: X += 1 if code_p[3] == code[3] : P += 1 else: if code_p[3] in code : V += 1 else: X += 1 print(" "+"P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) if N_turn == 4 : print(LOSING_MSG) print("The answer is ",code) print("Please try again...") |
# 6330191621 (16.83) 54 (2021-02-14 19:42) def findp(code, ans): p = 0 if code[0] == ans[0]: p = p+1 if code[1] == ans[1]: p = p+1 if code[2] == ans[2]: p = p+1 if code[3] == ans[3]: p = p+1 return p def findv(code, ans): v = 0 if code[0] != ans[0]: if ans[0] == code[1]: v = v+1 elif ans[0] == code[2]: v = v+1 elif ans[0] == code[3]: v = v+1 if code[1] != ans[1]: if ans[1] == code[0]: v = v+1 elif ans[1] == code[2]: v = v+1 elif ans[1] == code[3]: v = v+1 if code[2] != ans[2]: if ans[2] == code[0]: v = v+1 elif ans[2] == code[1]: v = v+1 elif ans[2] == code[3]: v = v+1 if code[3] != ans[3]: if ans[3] == code[0]: v = v+1 elif ans[3] == code[1]: v = v+1 elif ans[3] == code[2]: v = v+1 return v def findx(code, ans): x = 0 if code[0] != ans[0]: if code[0] != ans[1]: if code[0] != ans[2]: if code[0] != ans[3]: x = x+1 if code[1] != ans[0]: if code[1] != ans[1]: if code[1] != ans[2]: if code[1] != ans[3]: x = x+1 if code[2] != ans[0]: if code[2] != ans[1]: if code[2] != ans[2]: if code[2] != ans[3]: x = x+1 if code[3] != ans[0]: if code[3] != ans[1]: if code[3] != ans[2]: if code[3] != ans[3]: x = x+1 return x #round 1 r1 = input("Turn #1 : ") print(' P=' + str(findp(code, r1)) + ',' + 'V=' + str(findv(code, r1)) + ',X=' + str(findx(code, r1))) if code[0] == r1[0] and r1[1] == code[1] and code[2] == r1[2] and code[3] == r1[3]: print(WINNING_MSG) quit() #round 2 r2 = input("Turn #2 : ") print(' P=' + str(findp(code, r2)) + ',' + 'V=' + str(findv(code, r2)) + ',X=' + str(findx(code, r2))) if code[0] == r2[0] and r2[1] == code[1] and code[2] == r2[2] and code[3] == r2[3]: print(WINNING_MSG) quit() #round 3 r3 = input("Turn #3 : ") print(' P=' + str(findp(code, r3)) + ',' + 'V=' + str(findv(code, r3)) + ',X=' + str(findx(code, r3))) if code[0] == r3[0] and r3[1] == code[1] and code[2] == r3[2] and code[3] == r3[3]: print(WINNING_MSG) quit() #round 4 r4 = input("Turn #4 : ") print(' P=' + str(findp(code, r4)) + ',' + 'V=' + str(findv(code, r4)) + ',X=' + str(findx(code, r4))) if code[0] == r4[0] and r4[1] == code[1] and code[2] == r4[2] and code[3] == r4[3]: print(WINNING_MSG) quit() if not code[0] == r4[0] and r4[1] == code[1] and code[2] == r4[2] and code[3] == r4[3]: print(LOSING_MSG) print('The answer is', code) print('please try again...') |
# 6330192221 (20.00) 55 (2021-02-15 14:43) P=0 V=0 X=0 a=input("Turn #1 : ") if a[0] in code: V+=1 if a[0]==code[0]: V-=1 P+=1 if a[1] in code: V+=1 if a[1]==code[1]: V-=1 P+=1 if a[2] in code: V+=1 if a[2]==code[2]: V-=1 P+=1 if a[3] in code: V+=1 if a[3]==code[3]: V-=1 P+=1 X=4-(P+V) if P!=4: print(" "+"P="+str(P)+",V="+str(V)+",X="+str(X)) if P==4: print(WINNING_MSG) exit() a=input("Turn #2 : ") P=0 V=0 X=0 if a[0] in code: V+=1 if a[0]==code[0]: V-=1 P+=1 if a[1] in code: V+=1 if a[1]==code[1]: V-=1 P+=1 if a[2] in code: V+=1 if a[2]==code[2]: V-=1 P+=1 if a[3] in code: V+=1 if a[3]==code[3]: V-=1 P+=1 X=4-(P+V) if P!=4: print(" "+"P="+str(P)+",V="+str(V)+",X="+str(X)) if P==4: print(WINNING_MSG) exit() a=input("Turn #3 : ") P=0 V=0 X=0 if a[0] in code: V+=1 if a[0]==code[0]: V-=1 P+=1 if a[1] in code: V+=1 if a[1]==code[1]: V-=1 P+=1 if a[2] in code: V+=1 if a[2]==code[2]: V-=1 P+=1 if a[3] in code: V+=1 if a[3]==code[3]: V-=1 P+=1 X=4-(P+V) if P!=4: print(" "+"P="+str(P)+",V="+str(V)+",X="+str(X)) if P==4: print(WINNING_MSG) exit() a=input("Turn #4 : ") P=0 V=0 X=0 if a[0] in code: V+=1 if a[0]==code[0]: V-=1 P+=1 if a[1] in code: V+=1 if a[1]==code[1]: V-=1 P+=1 if a[2] in code: V+=1 if a[2]==code[2]: V-=1 P+=1 if a[3] in code: V+=1 if a[3]==code[3]: V-=1 P+=1 X=4-(P+V) if P!=4: print(" "+"P="+str(P)+",V="+str(V)+",X="+str(X)) print(LOSING_MSG) print("The answer is ",code) print("Please try again...") if P==4: print(WINNING_MSG) exit() |
# 6330193921 (20.00) 56 (2021-02-14 10:07) print("Turn #1 :", end=" ") guess = input() listcode = [code[0],code[1],code[2],code[3]] P = int() V = int() X = int() if guess != code: if guess[0] == code[0]: P += 1 if guess[1] == code[1]: P += 1 if guess[2] == code[2]: P += 1 if guess[3] == code[3]: P += 1 # if guess[0] in listcode: V += 1 if guess[1] in listcode: V += 1 if guess[2] in listcode: V += 1 if guess[3] in listcode: V += 1 # V -= P X = 4-P-V print(" P="+str(P)+",V="+str(V)+",X="+str(X)) print("Turn #2 :", end=" ") if guess != code: guess = input() if guess != code: P = int() V = int() X = int() if guess[0] == code[0]: P += 1 if guess[1] == code[1]: P += 1 if guess[2] == code[2]: P += 1 if guess[3] == code[3]: P += 1 # if guess[0] in listcode: V += 1 if guess[1] in listcode: V += 1 if guess[2] in listcode: V += 1 if guess[3] in listcode: V += 1 # V -= P X = 4-P-V print(" P="+str(P)+",V="+str(V)+",X="+str(X)) print("Turn #3 :", end=" ") if guess != code: guess = input() if guess != code: P = int() V = int() X = int() if guess[0] == code[0]: P += 1 if guess[1] == code[1]: P += 1 if guess[2] == code[2]: P += 1 if guess[3] == code[3]: P += 1 # if guess[0] in listcode: V += 1 if guess[1] in listcode: V += 1 if guess[2] in listcode: V += 1 if guess[3] in listcode: V += 1 # V -= P X = 4-P-V print(" P="+str(P)+",V="+str(V)+",X="+str(X)) print("Turn #4 :", end=" ") if guess != code: guess = input() if guess != code: P = int() V = int() X = int() if guess[0] == code[0]: P += 1 if guess[1] == code[1]: P += 1 if guess[2] == code[2]: P += 1 if guess[3] == code[3]: P += 1 # if guess[0] in listcode: V += 1 if guess[1] in listcode: V += 1 if guess[2] in listcode: V += 1 if guess[3] in listcode: V += 1 # V -= P X = 4-P-V print(" P="+str(P)+",V="+str(V)+",X="+str(X)) print("Sorry! You just lost it.") print("The answer is "+code) print("Please try again...") else: print("Congratulations! You won the game.") else: print("Congratulations! You won the game.") else: print("Congratulations! You won the game.") else: print("Congratulations! You won the game.") |
# 6330194521 (18.61) 57 (2021-02-14 21:48) def check_p(t1,code): P = 0 for i in range(0,4): if t1[0] == code[0]: P += 1 t1 = t1[1:] code = code[1:] elif t1[0] != code[0]: t1 = t1[1:] code = code[1:] return P def check_v(t1,code): V = 0 for j in range(0,4): if t1[j] in code and t1[j] != code[j]: V += 1 return V def check_x(t1,code): X = 0 for k in range(0,4): if t1[k] not in code: X +=1 return X r = 1 while r < 5: t1 = input(f"Turn #{r} : ") if t1 != code: r += 1 print("P =",check_p(t1,code) ,"V =",check_v(t1,code) ,"X =",check_x(t1,code)) if r >= 5: print(LOSING_MSG) print(f"The answer is {code}") print("Please try again...") break elif t1 == code: print(WINNING_MSG) break |
# 6330197421 (20.00) 58 (2021-02-13 22:22) P = 0 V = 0 X = 0 guess = input("Turn #1 : ",) if guess[0] == code[0]: P += 1 elif guess[0] in code: V += 1 else: X += 1 if guess[1] == code[1]: P += 1 elif guess[1] in code: V += 1 else: X += 1 if guess[2] == code[2]: P += 1 elif guess[2] in code: V += 1 else: X += 1 if guess[3] == code[3]: P += 1 elif guess[3] in code: V += 1 else: X += 1 if P == 4: print("Congratulations! You won the game.") else: print(" "*10+"P="+str(P)+",V="+str(V)+",X="+str(X)) if P != 4: P = 0 V = 0 X = 0 guess = input("Turn #2 : ",) if guess[0] == code[0]: P += 1 elif guess[0] in code: V += 1 else: X += 1 if guess[1] == code[1]: P += 1 elif guess[1] in code: V += 1 else: X += 1 if guess[2] == code[2]: P += 1 elif guess[2] in code: V += 1 else: X += 1 if guess[3] == code[3]: P += 1 elif guess[3] in code: V += 1 else: X += 1 if P == 4: print("Congratulations! You won the game.") else: print(" "*10+"P="+str(P)+",V="+str(V)+",X="+str(X)) if P != 4: P = 0 V = 0 X = 0 guess = input("Turn #3 : ",) if guess[0] == code[0]: P += 1 elif guess[0] in code: V += 1 else: X += 1 if guess[1] == code[1]: P += 1 elif guess[1] in code: V += 1 else: X += 1 if guess[2] == code[2]: P += 1 elif guess[2] in code: V += 1 else: X += 1 if guess[3] == code[3]: P += 1 elif guess[3] in code: V += 1 else: X += 1 if P == 4: print("Congratulations! You won the game.") else: print(" "*10+"P="+str(P)+",V="+str(V)+",X="+str(X)) if P != 4: P = 0 V = 0 X = 0 guess = input("Turn #4 : ",) if guess[0] == code[0]: P += 1 elif guess[0] in code: V += 1 else: X += 1 if guess[1] == code[1]: P += 1 elif guess[1] in code: V += 1 else: X += 1 if guess[2] == code[2]: P += 1 elif guess[2] in code: V += 1 else: X += 1 if guess[3] == code[3]: P += 1 elif guess[3] in code: V += 1 else: X += 1 if P == 4: print("Congratulations! You won the game.") else: print(" "*10+"P="+str(P)+",V="+str(V)+",X="+str(X)) print("Sorry! You just lost it.") print("The answer is", code) print("Please try again...") |
# 6330198021 (17.11) 59 (2021-02-14 15:53) sol = input() print('Turn #1 : ' + sol) if sol[0] == code[0] and sol[1] == code[1] \ and sol[2] == code[2] and sol[3] == code[3] : print(WINNING_MSG) elif sol[0] == code[0] and sol[1] == code[1] \ and sol[2] == code[2] and sol[3] != code[3] : print(' P=3,V=0,X=1') elif sol[0] == code[0] and sol[1] == code[1] \ and sol[2] != code[2] and sol[3] == code[3] : print(' P=3,V=0,X=1') elif sol[0] == code[0] and sol[1] != code[1] \ and sol[2] == code[2] and sol[3] == code[3] : print(' P=3,V=0,X=1') elif sol[0] != code[0] and sol[1] == code[1] \ and sol[2] == code[2] and sol[3] == code[3] : print(' P=3,V=0,X=1') elif sol[0] == code[0] and sol[1] == code[1] \ and sol[2] in code and sol[3] in code : print(' P=2,V=2,X=0') elif sol[0] == code[0] and sol[1] in code \ and sol[2] in code and sol[3] == code[3] : print(' P=2,V=2,X=0') elif sol[0] in code and sol[1] in code \ and sol[2] == code[2] and sol[3] == code[3] : print(' P=2,V=2,X=0') elif sol[0] in code and sol[1] == code[1] \ and sol[2] == code[2] and sol[3] in code : print(' P=2,V=2,X=0') elif sol[0] in code and sol[1] == code[1] \ and sol[2] in code and sol[3] == code[3] : print(' P=2,V=2,X=0') elif sol[0] == code[0] and sol[1] in code \ and sol[2] == code[2] and sol[3] in code : print(' P=2,V=2,X=0') elif sol[0] == code[0] and sol[1] == code[1] \ and sol[2] in code and sol[3] not in code : print(' P=2,V=1,X=1') elif sol[0] == code[0] and sol[1] == code[1] \ and sol[2] not in code and sol[3] in code : print(' P=2,V=1,X=1') elif sol[0] == code[0] and sol[1] in code \ and sol[2] == code[2] and sol[3] not in code : print(' P=2,V=1,X=1') elif sol[0] == code[0] and sol[1] not in code \ and sol[2] == code[2] and sol[3] in code : print(' P=2,V=1,X=1') elif sol[0] == code[0] and sol[1] in code \ and sol[2] not in code and sol[3] == code[3] : print(' P=2,V=1,X=1') elif sol[0] == code[0] and sol[1] not in code \ and sol[2] in code and sol[3] == code[3] : print(' P=2,V=1,X=1') elif sol[0] in code and sol[1] == code[1] \ and sol[2] == code[2] and sol[3] not in code : print(' P=2,V=1,X=1') elif sol[0] not in code and sol[1] == code[1] \ and sol[2] == code[2] and sol[3] in code : print(' P=2,V=1,X=1') elif sol[0] in code and sol[1] == code[1] \ and sol[2] not in code and sol[3] == code[3] : print(' P=2,V=1,X=1') elif sol[0] not in code and sol[1] == code[1] \ and sol[2] in code and sol[3] == code[3] : print(' P=2,V=1,X=1') elif sol[0] in code and sol[1] not in code \ and sol[2] == code[2] and sol[3] == code[3] : print(' P=2,V=1,X=1') elif sol[0] not in code and sol[1] in code \ and sol[2] == code[2] and sol[3] == code[3] : print(' P=2,V=1,X=1') elif sol[0] == code[0] and sol[1] == code[1] \ and sol[2] not in code and sol[3] not in code : print(' P=2,V=0,X=2') elif sol[0] == code[0] and sol[1] not in code \ and sol[2] == code[2] and sol[3] not in code : print(' P=2,V=0,X=2') elif sol[0] == code[0] and sol[1] not in code \ and sol[2] not in code and sol[3] == code[3] : print(' P=2,V=0,X=2') elif sol[0] not in code and sol[1] == code[1] \ and sol[2] == code[2] and sol[3] not in code : print(' P=2,V=0,X=2') elif sol[0] not in code and sol[1] == code[1] \ and sol[2] not in code and sol[3] == code[3] : print(' P=2,V=0,X=2') elif sol[0] not in code and sol[1] not in code \ and sol[2] == code[2] and sol[3] == code[3] : print(' P=2,V=0,X=2') elif sol[0] == code[0] and sol[1] in code \ and sol[2] in code and sol[3] in code : print(' P=1,V=3,X=0') elif sol[0] in code and sol[1] == code[1] \ and sol[2] in code and sol[3] in code : print(' P=1,V=3,X=0') elif sol[0] in code and sol[1] in code \ and sol[2] == code[2] and sol[3] in code : print(' P=1,V=3,X=0') elif sol[0] in code and sol[1] in code \ and sol[2] in code and sol[3] == code[3] : print(' P=1,V=3,X=0') elif sol[0] == code[0] and sol[1] in code \ and sol[2] in code and sol[3] not in code : print(' P=1,V=2,X=1') elif sol[0] == code[0] and sol[1] in code \ and sol[2] not in code and sol[3] in code : print(' P=1,V=2,X=1') elif sol[0] == code[0] and sol[1] not in code \ and sol[2] in code and sol[3] in code : print(' P=1,V=2,X=1') elif sol[0] in code and sol[1] == code[1] \ and sol[2] in code and sol[3] not in code : print(' P=1,V=2,X=1') elif sol[0] in code and sol[1] == code[1] \ and sol[2] not in code and sol[3] in code : print(' P=1,V=2,X=1') elif sol[0] not in code and sol[1] == code[1] \ and sol[2] in code and sol[3] in code : print(' P=1,V=2,X=1') elif sol[0] in code and sol[1] in code \ and sol[2] == code[2] and sol[3] not in code : print(' P=1,V=2,X=1') elif sol[0] in code and sol[1] not in code \ and sol[2] == code[2] and sol[3] in code : print(' P=1,V=2,X=1') elif sol[0] not in code and sol[1] in code \ and sol[2] == code[2] and sol[3] in code : print(' P=1,V=2,X=1') elif sol[0] in code and sol[1] in code \ and sol[2] not in code and sol[3] == code[3] : print(' P=1,V=2,X=1') elif sol[0] in code and sol[1] not in code \ and sol[2] in code and sol[3] == code[3] : print(' P=1,V=2,X=1') elif sol[0] not in code and sol[1] in code \ and sol[2] in code and sol[3] == code[3] : print(' P=1,V=2,X=1') elif sol[0] == code[0] and sol[1] in code \ and sol[2] not in code and sol[3] not in code : print(' P=1,V=1,X=2') elif sol[0] == code[0] and sol[1] not in code \ and sol[2] in code and sol[3] not in code : print(' P=1,V=1,X=2') elif sol[0] == code[0] and sol[1] not in code \ and sol[2] not in code and sol[3] in code : print(' P=1,V=1,X=2') elif sol[0] in code and sol[1] == code[1] \ and sol[2] not in code and sol[3] not in code : print(' P=1,V=1,X=2') elif sol[0] not in code and sol[1] == code[1] \ and sol[2] in code and sol[3] not in code : print(' P=1,V=1,X=2') elif sol[0] not in code and sol[1] == code[1] \ and sol[2] not in code and sol[3] in code : print(' P=1,V=1,X=2') elif sol[0] in code and sol[1] not in code \ and sol[2] == code[2] and sol[3] not in code : print(' P=1,V=1,X=2') elif sol[0] not in code and sol[1] in code \ and sol[2] == code[2] and sol[3] not in code : print(' P=1,V=1,X=2') elif sol[0] not in code and sol[1] not in code \ and sol[2] == code[2] and sol[3] in code : print(' P=1,V=1,X=2') elif sol[0] in code and sol[1] not in code \ and sol[2] not in code and sol[3] == code[3] : print(' P=1,V=1,X=2') elif sol[0] not in code and sol[1] in code \ and sol[2] not in code and sol[3] == code[3] : print(' P=1,V=1,X=2') elif sol[0] not in code and sol[1] not in code \ and sol[2] in code and sol[3] == code[3] : print(' P=1,V=1,X=2') elif sol[0] == code[0] and sol[1] not in code \ and sol[2] not in code and sol[3] not in code : print(' P=1,V=0,X=3') elif sol[0] not in code and sol[1] == code[1] \ and sol[2] not in code and sol[3] not in code : print(' P=1,V=0,X=3') elif sol[0] not in code and sol[1] not in code \ and sol[2] == code[2] and sol[3] not in code : print(' P=1,V=0,X=3') elif sol[0] not in code and sol[1] not in code \ and sol[2] not in code and sol[3] == code[3] : print(' P=1,V=0,X=3') elif sol[0] not in code and sol[1] not in code \ and sol[2] not in code and sol[3] not in code : print(' P=0,V=0,X=4') elif sol[0] in code and sol[1] not in code \ and sol[2] not in code and sol[3] not in code : print(' P=0,V=1,X=3') elif sol[0] not in code and sol[1] in code \ and sol[2] not in code and sol[3] not in code : print(' P=0,V=1,X=3') elif sol[0] not in code and sol[1] not in code \ and sol[2] in code and sol[3] not in code : print(' P=0,V=1,X=3') elif sol[0] not in code and sol[1] not in code \ and sol[2] not in code and sol[3] in code : print(' P=0,V=1,X=3') elif sol[0] in code and sol[1] in code \ and sol[2] not in code and sol[3] not in code : print(' P=0,V=2,X=2') elif sol[0] in code and sol[1] not in code \ and sol[2] in code and sol[3] not in code : print(' P=0,V=2,X=2') elif sol[0] in code and sol[1] not in code \ and sol[2] not in code and sol[3] in code : print(' P=0,V=2,X=2') elif sol[0] not in code and sol[1] in code \ and sol[2] in code and sol[3] not in code : print(' P=0,V=2,X=2') elif sol[0] not in code and sol[1] in code \ and sol[2] not in code and sol[3] in code : print(' P=0,V=2,X=2') elif sol[0] not in code and sol[1] not in code \ and sol[2] in code and sol[3] in code : print(' P=0,V=2,X=2') elif sol[0] not in code and sol[1] in code \ and sol[2] in code and sol[3] in code : print(' P=0,V=3,X=1') elif sol[0] in code and sol[1] not in code \ and sol[2] in code and sol[3] in code : print(' P=0,V=3,X=1') elif sol[0] in code and sol[1] in code \ and sol[2] not in code and sol[3] in code : print(' P=0,V=3,X=1') elif sol[0] in code and sol[1] in code \ and sol[2] in code and sol[3] not in code : print(' P=0,V=3,X=1') elif sol[0] in code and sol[1] in code \ and sol[2] in code and sol[3] in code : print(' P=0,V=4,X=0') tol = input() print('Turn #2 : ' + tol) if tol[0] == code[0] and tol[1] == code[1] \ and tol[2] == code[2] and tol[3] == code[3] : print(WINNING_MSG) elif tol[0] == code[0] and tol[1] == code[1] \ and tol[2] == code[2] and tol[3] != code[3] : print(' P=3,V=0,X=1') elif tol[0] == code[0] and tol[1] == code[1] \ and tol[2] != code[2] and tol[3] == code[3] : print(' P=3,V=0,X=1') elif tol[0] == code[0] and tol[1] != code[1] \ and tol[2] == code[2] and tol[3] == code[3] : print(' P=3,V=0,X=1') elif tol[0] != code[0] and tol[1] == code[1] \ and tol[2] == code[2] and tol[3] == code[3] : print(' P=3,V=0,X=1') elif tol[0] == code[0] and tol[1] == code[1] \ and tol[2] in code and tol[3] in code : print(' P=2,V=2,X=0') elif tol[0] == code[0] and tol[1] in code \ and tol[2] in code and tol[3] == code[3] : print(' P=2,V=2,X=0') elif tol[0] in code and tol[1] in code \ and tol[2] == code[2] and tol[3] == code[3] : print(' P=2,V=2,X=0') elif tol[0] in code and tol[1] == code[1] \ and tol[2] == code[2] and tol[3] in code : print(' P=2,V=2,X=0') elif tol[0] in code and tol[1] == code[1] \ and tol[2] in code and tol[3] == code[3] : print(' P=2,V=2,X=0') elif tol[0] == code[0] and tol[1] in code \ and tol[2] == code[2] and tol[3] in code : print(' P=2,V=2,X=0') elif tol[0] == code[0] and tol[1] == code[1] \ and tol[2] in code and tol[3] not in code : print(' P=2,V=1,X=1') elif tol[0] == code[0] and tol[1] == code[1] \ and tol[2] not in code and tol[3] in code : print(' P=2,V=1,X=1') elif tol[0] == code[0] and tol[1] in code \ and tol[2] == code[2] and tol[3] not in code : print(' P=2,V=1,X=1') elif tol[0] == code[0] and tol[1] not in code \ and tol[2] == code[2] and tol[3] in code : print(' P=2,V=1,X=1') elif tol[0] == code[0] and tol[1] in code \ and tol[2] not in code and tol[3] == code[3] : print(' P=2,V=1,X=1') elif tol[0] == code[0] and tol[1] not in code \ and tol[2] in code and tol[3] == code[3] : print(' P=2,V=1,X=1') elif tol[0] in code and tol[1] == code[1] \ and tol[2] == code[2] and tol[3] not in code : print(' P=2,V=1,X=1') elif tol[0] not in code and tol[1] == code[1] \ and tol[2] == code[2] and tol[3] in code : print(' P=2,V=1,X=1') elif tol[0] in code and tol[1] == code[1] \ and tol[2] not in code and tol[3] == code[3] : print(' P=2,V=1,X=1') elif tol[0] not in code and tol[1] == code[1] \ and tol[2] in code and tol[3] == code[3] : print(' P=2,V=1,X=1') elif tol[0] in code and tol[1] not in code \ and tol[2] == code[2] and tol[3] == code[3] : print(' P=2,V=1,X=1') elif tol[0] not in code and tol[1] in code \ and tol[2] == code[2] and tol[3] == code[3] : print(' P=2,V=1,X=1') elif tol[0] == code[0] and tol[1] == code[1] \ and tol[2] not in code and tol[3] not in code : print(' P=2,V=0,X=2') elif tol[0] == code[0] and tol[1] not in code \ and tol[2] == code[2] and tol[3] not in code : print(' P=2,V=0,X=2') elif tol[0] == code[0] and tol[1] not in code \ and tol[2] not in code and tol[3] == code[3] : print(' P=2,V=0,X=2') elif tol[0] not in code and tol[1] == code[1] \ and tol[2] == code[2] and tol[3] not in code : print(' P=2,V=0,X=2') elif tol[0] not in code and tol[1] == code[1] \ and tol[2] not in code and tol[3] == code[3] : print(' P=2,V=0,X=2') elif tol[0] not in code and tol[1] not in code \ and tol[2] == code[2] and tol[3] == code[3] : print(' P=2,V=0,X=2') elif tol[0] == code[0] and tol[1] in code \ and tol[2] in code and tol[3] in code : print(' P=1,V=3,X=0') elif tol[0] in code and tol[1] == code[1] \ and tol[2] in code and tol[3] in code : print(' P=1,V=3,X=0') elif tol[0] in code and tol[1] in code \ and tol[2] == code[2] and tol[3] in code : print(' P=1,V=3,X=0') elif tol[0] in code and tol[1] in code \ and tol[2] in code and tol[3] == code[3] : print(' P=1,V=3,X=0') elif tol[0] == code[0] and tol[1] in code \ and tol[2] in code and tol[3] not in code : print(' P=1,V=2,X=1') elif tol[0] == code[0] and tol[1] in code \ and tol[2] not in code and tol[3] in code : print(' P=1,V=2,X=1') elif tol[0] == code[0] and tol[1] not in code \ and tol[2] in code and tol[3] in code : print(' P=1,V=2,X=1') elif tol[0] in code and tol[1] == code[1] \ and tol[2] in code and tol[3] not in code : print(' P=1,V=2,X=1') elif tol[0] in code and tol[1] == code[1] \ and tol[2] not in code and tol[3] in code : print(' P=1,V=2,X=1') elif tol[0] not in code and tol[1] == code[1] \ and tol[2] in code and tol[3] in code : print(' P=1,V=2,X=1') elif tol[0] in code and tol[1] in code \ and tol[2] == code[2] and tol[3] not in code : print(' P=1,V=2,X=1') elif tol[0] in code and tol[1] not in code \ and tol[2] == code[2] and tol[3] in code : print(' P=1,V=2,X=1') elif tol[0] not in code and tol[1] in code \ and tol[2] == code[2] and tol[3] in code : print(' P=1,V=2,X=1') elif tol[0] in code and tol[1] in code \ and tol[2] not in code and tol[3] == code[3] : print(' P=1,V=2,X=1') elif tol[0] in code and tol[1] not in code \ and tol[2] in code and tol[3] == code[3] : print(' P=1,V=2,X=1') elif tol[0] not in code and tol[1] in code \ and tol[2] in code and tol[3] == code[3] : print(' P=1,V=2,X=1') elif tol[0] == code[0] and tol[1] in code \ and tol[2] not in code and tol[3] not in code : print(' P=1,V=1,X=2') elif tol[0] == code[0] and tol[1] not in code \ and tol[2] in code and tol[3] not in code : print(' P=1,V=1,X=2') elif tol[0] == code[0] and tol[1] not in code \ and tol[2] not in code and tol[3] in code : print(' P=1,V=1,X=2') elif tol[0] in code and tol[1] == code[1] \ and tol[2] not in code and tol[3] not in code : print(' P=1,V=1,X=2') elif tol[0] not in code and tol[1] == code[1] \ and tol[2] in code and tol[3] not in code : print(' P=1,V=1,X=2') elif tol[0] not in code and tol[1] == code[1] \ and tol[2] not in code and tol[3] in code : print(' P=1,V=1,X=2') elif tol[0] in code and tol[1] not in code \ and tol[2] == code[2] and tol[3] not in code : print(' P=1,V=1,X=2') elif tol[0] not in code and tol[1] in code \ and tol[2] == code[2] and tol[3] not in code : print(' P=1,V=1,X=2') elif tol[0] not in code and tol[1] not in code \ and tol[2] == code[2] and tol[3] in code : print(' P=1,V=1,X=2') elif tol[0] in code and tol[1] not in code \ and tol[2] not in code and tol[3] == code[3] : print(' P=1,V=1,X=2') elif tol[0] not in code and tol[1] in code \ and tol[2] not in code and tol[3] == code[3] : print(' P=1,V=1,X=2') elif tol[0] not in code and tol[1] not in code \ and tol[2] in code and tol[3] == code[3] : print(' P=1,V=1,X=2') elif tol[0] == code[0] and tol[1] not in code \ and tol[2] not in code and tol[3] not in code : print(' P=1,V=0,X=3') elif tol[0] not in code and tol[1] == code[1] \ and tol[2] not in code and tol[3] not in code : print(' P=1,V=0,X=3') elif tol[0] not in code and tol[1] not in code \ and tol[2] == code[2] and tol[3] not in code : print(' P=1,V=0,X=3') elif tol[0] not in code and tol[1] not in code \ and tol[2] not in code and tol[3] == code[3] : print(' P=1,V=0,X=3') elif tol[0] not in code and tol[1] not in code \ and tol[2] not in code and tol[3] not in code : print(' P=0,V=0,X=4') elif tol[0] in code and tol[1] not in code \ and tol[2] not in code and tol[3] not in code : print(' P=0,V=1,X=3') elif tol[0] not in code and tol[1] in code \ and tol[2] not in code and tol[3] not in code : print(' P=0,V=1,X=3') elif tol[0] not in code and tol[1] not in code \ and tol[2] in code and tol[3] not in code : print(' P=0,V=1,X=3') elif tol[0] not in code and tol[1] not in code \ and tol[2] not in code and tol[3] in code : print(' P=0,V=1,X=3') elif tol[0] in code and tol[1] in code \ and tol[2] not in code and tol[3] not in code : print(' P=0,V=2,X=2') elif tol[0] in code and tol[1] not in code \ and tol[2] in code and tol[3] not in code : print(' P=0,V=2,X=2') elif tol[0] in code and tol[1] not in code \ and tol[2] not in code and tol[3] in code : print(' P=0,V=2,X=2') elif tol[0] not in code and tol[1] in code \ and tol[2] in code and tol[3] not in code : print(' P=0,V=2,X=2') elif tol[0] not in code and tol[1] in code \ and tol[2] not in code and tol[3] in code : print(' P=0,V=2,X=2') elif tol[0] not in code and tol[1] not in code \ and tol[2] in code and tol[3] in code : print(' P=0,V=2,X=2') elif tol[0] not in code and tol[1] in code \ and tol[2] in code and tol[3] in code : print(' P=0,V=3,X=1') elif tol[0] in code and tol[1] not in code \ and tol[2] in code and tol[3] in code : print(' P=0,V=3,X=1') elif tol[0] in code and tol[1] in code \ and tol[2] not in code and tol[3] in code : print(' P=0,V=3,X=1') elif tol[0] in code and tol[1] in code \ and tol[2] in code and tol[3] not in code : print(' P=0,V=3,X=1') elif tol[0] in code and tol[1] in code \ and tol[2] in code and tol[3] in code : print(' P=0,V=4,X=0') uol = input() print('Turn #3 : ' + uol) if uol[0] == code[0] and uol[1] == code[1] \ and uol[2] == code[2] and uol[3] == code[3] : print(WINNING_MSG) elif uol[0] == code[0] and uol[1] == code[1] \ and uol[2] == code[2] and uol[3] != code[3] : print(' P=3,V=0,X=1') elif uol[0] == code[0] and uol[1] == code[1] \ and uol[2] != code[2] and uol[3] == code[3] : print(' P=3,V=0,X=1') elif uol[0] == code[0] and uol[1] != code[1] \ and uol[2] == code[2] and uol[3] == code[3] : print(' P=3,V=0,X=1') elif uol[0] != code[0] and uol[1] == code[1] \ and uol[2] == code[2] and uol[3] == code[3] : print(' P=3,V=0,X=1') elif uol[0] == code[0] and uol[1] == code[1] \ and uol[2] in code and uol[3] in code : print(' P=2,V=2,X=0') elif uol[0] == code[0] and uol[1] in code \ and uol[2] in code and uol[3] == code[3] : print(' P=2,V=2,X=0') elif uol[0] in code and uol[1] in code \ and uol[2] == code[2] and uol[3] == code[3] : print(' P=2,V=2,X=0') elif uol[0] in code and uol[1] == code[1] \ and uol[2] == code[2] and uol[3] in code : print(' P=2,V=2,X=0') elif uol[0] in code and uol[1] == code[1] \ and uol[2] in code and uol[3] == code[3] : print(' P=2,V=2,X=0') elif uol[0] == code[0] and uol[1] in code \ and uol[2] == code[2] and uol[3] in code : print(' P=2,V=2,X=0') elif uol[0] == code[0] and uol[1] == code[1] \ and uol[2] in code and uol[3] not in code : print(' P=2,V=1,X=1') elif uol[0] == code[0] and uol[1] == code[1] \ and uol[2] not in code and uol[3] in code : print(' P=2,V=1,X=1') elif uol[0] == code[0] and uol[1] in code \ and uol[2] == code[2] and uol[3] not in code : print(' P=2,V=1,X=1') elif uol[0] == code[0] and uol[1] not in code \ and uol[2] == code[2] and uol[3] in code : print(' P=2,V=1,X=1') elif uol[0] == code[0] and uol[1] in code \ and uol[2] not in code and uol[3] == code[3] : print(' P=2,V=1,X=1') elif uol[0] == code[0] and uol[1] not in code \ and uol[2] in code and uol[3] == code[3] : print(' P=2,V=1,X=1') elif uol[0] in code and uol[1] == code[1] \ and uol[2] == code[2] and uol[3] not in code : print(' P=2,V=1,X=1') elif uol[0] not in code and uol[1] == code[1] \ and uol[2] == code[2] and uol[3] in code : print(' P=2,V=1,X=1') elif uol[0] in code and uol[1] == code[1] \ and uol[2] not in code and uol[3] == code[3] : print(' P=2,V=1,X=1') elif uol[0] not in code and uol[1] == code[1] \ and uol[2] in code and uol[3] == code[3] : print(' P=2,V=1,X=1') elif uol[0] in code and uol[1] not in code \ and uol[2] == code[2] and uol[3] == code[3] : print(' P=2,V=1,X=1') elif uol[0] not in code and uol[1] in code \ and uol[2] == code[2] and uol[3] == code[3] : print(' P=2,V=1,X=1') elif uol[0] == code[0] and uol[1] == code[1] \ and uol[2] not in code and uol[3] not in code : print(' P=2,V=0,X=2') elif uol[0] == code[0] and uol[1] not in code \ and uol[2] == code[2] and uol[3] not in code : print(' P=2,V=0,X=2') elif uol[0] == code[0] and uol[1] not in code \ and uol[2] not in code and uol[3] == code[3] : print(' P=2,V=0,X=2') elif uol[0] not in code and uol[1] == code[1] \ and uol[2] == code[2] and uol[3] not in code : print(' P=2,V=0,X=2') elif uol[0] not in code and uol[1] == code[1] \ and uol[2] not in code and uol[3] == code[3] : print(' P=2,V=0,X=2') elif uol[0] not in code and uol[1] not in code \ and uol[2] == code[2] and uol[3] == code[3] : print(' P=2,V=0,X=2') elif uol[0] == code[0] and uol[1] in code \ and uol[2] in code and uol[3] in code : print(' P=1,V=3,X=0') elif uol[0] in code and uol[1] == code[1] \ and uol[2] in code and uol[3] in code : print(' P=1,V=3,X=0') elif uol[0] in code and uol[1] in code \ and uol[2] == code[2] and uol[3] in code : print(' P=1,V=3,X=0') elif uol[0] in code and uol[1] in code \ and uol[2] in code and uol[3] == code[3] : print(' P=1,V=3,X=0') elif uol[0] == code[0] and uol[1] in code \ and uol[2] in code and uol[3] not in code : print(' P=1,V=2,X=1') elif uol[0] == code[0] and uol[1] in code \ and uol[2] not in code and uol[3] in code : print(' P=1,V=2,X=1') elif uol[0] == code[0] and uol[1] not in code \ and uol[2] in code and uol[3] in code : print(' P=1,V=2,X=1') elif uol[0] in code and uol[1] == code[1] \ and uol[2] in code and uol[3] not in code : print(' P=1,V=2,X=1') elif uol[0] in code and uol[1] == code[1] \ and uol[2] not in code and uol[3] in code : print(' P=1,V=2,X=1') elif uol[0] not in code and uol[1] == code[1] \ and uol[2] in code and uol[3] in code : print(' P=1,V=2,X=1') elif uol[0] in code and uol[1] in code \ and uol[2] == code[2] and uol[3] not in code : print(' P=1,V=2,X=1') elif uol[0] in code and uol[1] not in code \ and uol[2] == code[2] and uol[3] in code : print(' P=1,V=2,X=1') elif uol[0] not in code and uol[1] in code \ and uol[2] == code[2] and uol[3] in code : print(' P=1,V=2,X=1') elif uol[0] in code and uol[1] in code \ and uol[2] not in code and uol[3] == code[3] : print(' P=1,V=2,X=1') elif uol[0] in code and uol[1] not in code \ and uol[2] in code and uol[3] == code[3] : print(' P=1,V=2,X=1') elif uol[0] not in code and uol[1] in code \ and uol[2] in code and uol[3] == code[3] : print(' P=1,V=2,X=1') elif uol[0] == code[0] and uol[1] in code \ and uol[2] not in code and uol[3] not in code : print(' P=1,V=1,X=2') elif uol[0] == code[0] and uol[1] not in code \ and uol[2] in code and uol[3] not in code : print(' P=1,V=1,X=2') elif uol[0] == code[0] and uol[1] not in code \ and uol[2] not in code and uol[3] in code : print(' P=1,V=1,X=2') elif uol[0] in code and uol[1] == code[1] \ and uol[2] not in code and uol[3] not in code : print(' P=1,V=1,X=2') elif uol[0] not in code and uol[1] == code[1] \ and uol[2] in code and uol[3] not in code : print(' P=1,V=1,X=2') elif uol[0] not in code and uol[1] == code[1] \ and uol[2] not in code and uol[3] in code : print(' P=1,V=1,X=2') elif uol[0] in code and uol[1] not in code \ and uol[2] == code[2] and uol[3] not in code : print(' P=1,V=1,X=2') elif uol[0] not in code and uol[1] in code \ and uol[2] == code[2] and uol[3] not in code : print(' P=1,V=1,X=2') elif uol[0] not in code and uol[1] not in code \ and uol[2] == code[2] and uol[3] in code : print(' P=1,V=1,X=2') elif uol[0] in code and uol[1] not in code \ and uol[2] not in code and uol[3] == code[3] : print(' P=1,V=1,X=2') elif uol[0] not in code and uol[1] in code \ and uol[2] not in code and uol[3] == code[3] : print(' P=1,V=1,X=2') elif uol[0] not in code and uol[1] not in code \ and uol[2] in code and uol[3] == code[3] : print(' P=1,V=1,X=2') elif uol[0] == code[0] and uol[1] not in code \ and uol[2] not in code and uol[3] not in code : print(' P=1,V=0,X=3') elif uol[0] not in code and uol[1] == code[1] \ and uol[2] not in code and uol[3] not in code : print(' P=1,V=0,X=3') elif uol[0] not in code and uol[1] not in code \ and uol[2] == code[2] and uol[3] not in code : print(' P=1,V=0,X=3') elif uol[0] not in code and uol[1] not in code \ and uol[2] not in code and uol[3] == code[3] : print(' P=1,V=0,X=3') elif uol[0] not in code and uol[1] not in code \ and uol[2] not in code and uol[3] not in code : print(' P=0,V=0,X=4') elif uol[0] in code and uol[1] not in code \ and uol[2] not in code and uol[3] not in code : print(' P=0,V=1,X=3') elif uol[0] not in code and uol[1] in code \ and uol[2] not in code and uol[3] not in code : print(' P=0,V=1,X=3') elif uol[0] not in code and uol[1] not in code \ and uol[2] in code and uol[3] not in code : print(' P=0,V=1,X=3') elif uol[0] not in code and uol[1] not in code \ and uol[2] not in code and uol[3] in code : print(' P=0,V=1,X=3') elif uol[0] in code and uol[1] in code \ and uol[2] not in code and uol[3] not in code : print(' P=0,V=2,X=2') elif uol[0] in code and uol[1] not in code \ and uol[2] in code and uol[3] not in code : print(' P=0,V=2,X=2') elif uol[0] in code and uol[1] not in code \ and uol[2] not in code and uol[3] in code : print(' P=0,V=2,X=2') elif uol[0] not in code and uol[1] in code \ and uol[2] in code and uol[3] not in code : print(' P=0,V=2,X=2') elif uol[0] not in code and uol[1] in code \ and uol[2] not in code and uol[3] in code : print(' P=0,V=2,X=2') elif uol[0] not in code and uol[1] not in code \ and uol[2] in code and uol[3] in code : print(' P=0,V=2,X=2') elif uol[0] not in code and uol[1] in code \ and uol[2] in code and uol[3] in code : print(' P=0,V=3,X=1') elif uol[0] in code and uol[1] not in code \ and uol[2] in code and uol[3] in code : print(' P=0,V=3,X=1') elif uol[0] in code and uol[1] in code \ and uol[2] not in code and uol[3] in code : print(' P=0,V=3,X=1') elif uol[0] in code and uol[1] in code \ and uol[2] in code and uol[3] not in code : print(' P=0,V=3,X=1') elif uol[0] in code and uol[1] in code \ and uol[2] in code and uol[3] in code : print(' P=0,V=4,X=0') vol = input() print('Turn #4 : ' + vol) if vol[0] == code[0] and vol[1] == code[1] \ and vol[2] == code[2] and vol[3] == code[3] : print(WINNING_MSG) else : if vol[0] == code[0] and vol[1] == code[1] \ and vol[2] == code[2] and vol[3] != code[3] : print(' P=3,V=0,X=1') elif vol[0] == code[0] and vol[1] == code[1] \ and vol[2] != code[2] and vol[3] == code[3] : print(' P=3,V=0,X=1') elif vol[0] == code[0] and vol[1] != code[1] \ and vol[2] == code[2] and vol[3] == code[3] : print(' P=3,V=0,X=1') elif vol[0] != code[0] and vol[1] == code[1] \ and vol[2] == code[2] and vol[3] == code[3] : print(' P=3,V=0,X=1') elif vol[0] == code[0] and vol[1] == code[1] \ and vol[2] in code and vol[3] in code : print(' P=2,V=2,X=0') elif vol[0] == code[0] and vol[1] in code \ and vol[2] in code and vol[3] == code[3] : print(' P=2,V=2,X=0') elif vol[0] in code and vol[1] in code \ and vol[2] == code[2] and vol[3] == code[3] : print(' P=2,V=2,X=0') elif vol[0] in code and vol[1] == code[1] \ and vol[2] == code[2] and vol[3] in code : print(' P=2,V=2,X=0') elif vol[0] in code and vol[1] == code[1] \ and vol[2] in code and vol[3] == code[3] : print(' P=2,V=2,X=0') elif vol[0] == code[0] and vol[1] in code \ and vol[2] == code[2] and vol[3] in code : print(' P=2,V=2,X=0') elif vol[0] == code[0] and vol[1] == code[1] \ and vol[2] in code and vol[3] not in code : print(' P=2,V=1,X=1') elif vol[0] == code[0] and vol[1] == code[1] \ and vol[2] not in code and vol[3] in code : print(' P=2,V=1,X=1') elif vol[0] == code[0] and vol[1] in code \ and vol[2] == code[2] and vol[3] not in code : print(' P=2,V=1,X=1') elif vol[0] == code[0] and vol[1] not in code \ and vol[2] == code[2] and vol[3] in code : print(' P=2,V=1,X=1') elif vol[0] == code[0] and vol[1] in code \ and vol[2] not in code and vol[3] == code[3] : print(' P=2,V=1,X=1') elif vol[0] == code[0] and vol[1] not in code \ and vol[2] in code and vol[3] == code[3] : print(' P=2,V=1,X=1') elif vol[0] in code and vol[1] == code[1] \ and vol[2] == code[2] and vol[3] not in code : print(' P=2,V=1,X=1') elif vol[0] not in code and vol[1] == code[1] \ and vol[2] == code[2] and vol[3] in code : print(' P=2,V=1,X=1') elif vol[0] in code and vol[1] == code[1] \ and vol[2] not in code and vol[3] == code[3] : print(' P=2,V=1,X=1') elif vol[0] not in code and vol[1] == code[1] \ and vol[2] in code and vol[3] == code[3] : print(' P=2,V=1,X=1') elif vol[0] in code and vol[1] not in code \ and vol[2] == code[2] and vol[3] == code[3] : print(' P=2,V=1,X=1') elif vol[0] not in code and vol[1] in code \ and vol[2] == code[2] and vol[3] == code[3] : print(' P=2,V=1,X=1') elif vol[0] == code[0] and vol[1] == code[1] \ and vol[2] not in code and vol[3] not in code : print(' P=2,V=0,X=2') elif vol[0] == code[0] and vol[1] not in code \ and vol[2] == code[2] and vol[3] not in code : print(' P=2,V=0,X=2') elif vol[0] == code[0] and vol[1] not in code \ and vol[2] not in code and vol[3] == code[3] : print(' P=2,V=0,X=2') elif vol[0] not in code and vol[1] == code[1] \ and vol[2] == code[2] and vol[3] not in code : print(' P=2,V=0,X=2') elif vol[0] not in code and vol[1] == code[1] \ and vol[2] not in code and vol[3] == code[3] : print(' P=2,V=0,X=2') elif vol[0] not in code and vol[1] not in code \ and vol[2] == code[2] and vol[3] == code[3] : print(' P=2,V=0,X=2') elif vol[0] == code[0] and vol[1] in code \ and vol[2] in code and vol[3] in code : print(' P=1,V=3,X=0') elif vol[0] in code and vol[1] == code[1] \ and vol[2] in code and vol[3] in code : print(' P=1,V=3,X=0') elif vol[0] in code and vol[1] in code \ and vol[2] == code[2] and vol[3] in code : print(' P=1,V=3,X=0') elif vol[0] in code and vol[1] in code \ and vol[2] in code and vol[3] == code[3] : print(' P=1,V=3,X=0') elif vol[0] == code[0] and vol[1] in code \ and vol[2] in code and vol[3] not in code : print(' P=1,V=2,X=1') elif vol[0] == code[0] and vol[1] in code \ and vol[2] not in code and vol[3] in code : print(' P=1,V=2,X=1') elif vol[0] == code[0] and vol[1] not in code \ and vol[2] in code and vol[3] in code : print(' P=1,V=2,X=1') elif vol[0] in code and vol[1] == code[1] \ and vol[2] in code and vol[3] not in code : print(' P=1,V=2,X=1') elif vol[0] in code and vol[1] == code[1] \ and vol[2] not in code and vol[3] in code : print(' P=1,V=2,X=1') elif vol[0] not in code and vol[1] == code[1] \ and vol[2] in code and vol[3] in code : print(' P=1,V=2,X=1') elif vol[0] in code and vol[1] in code \ and vol[2] == code[2] and vol[3] not in code : print(' P=1,V=2,X=1') elif vol[0] in code and vol[1] not in code \ and vol[2] == code[2] and vol[3] in code : print(' P=1,V=2,X=1') elif vol[0] not in code and vol[1] in code \ and vol[2] == code[2] and vol[3] in code : print(' P=1,V=2,X=1') elif vol[0] in code and vol[1] in code \ and vol[2] not in code and vol[3] == code[3] : print(' P=1,V=2,X=1') elif vol[0] in code and vol[1] not in code \ and vol[2] in code and vol[3] == code[3] : print(' P=1,V=2,X=1') elif vol[0] not in code and vol[1] in code \ and vol[2] in code and vol[3] == code[3] : print(' P=1,V=2,X=1') elif vol[0] == code[0] and vol[1] in code \ and vol[2] not in code and vol[3] not in code : print(' P=1,V=1,X=2') elif vol[0] == code[0] and vol[1] not in code \ and vol[2] in code and vol[3] not in code : print(' P=1,V=1,X=2') elif vol[0] == code[0] and vol[1] not in code \ and vol[2] not in code and vol[3] in code : print(' P=1,V=1,X=2') elif vol[0] in code and vol[1] == code[1] \ and vol[2] not in code and vol[3] not in code : print(' P=1,V=1,X=2') elif vol[0] not in code and vol[1] == code[1] \ and vol[2] in code and vol[3] not in code : print(' P=1,V=1,X=2') elif vol[0] not in code and vol[1] == code[1] \ and vol[2] not in code and vol[3] in code : print(' P=1,V=1,X=2') elif vol[0] in code and vol[1] not in code \ and vol[2] == code[2] and vol[3] not in code : print(' P=1,V=1,X=2') elif vol[0] not in code and vol[1] in code \ and vol[2] == code[2] and vol[3] not in code : print(' P=1,V=1,X=2') elif vol[0] not in code and vol[1] not in code \ and vol[2] == code[2] and vol[3] in code : print(' P=1,V=1,X=2') elif vol[0] in code and vol[1] not in code \ and vol[2] not in code and vol[3] == code[3] : print(' P=1,V=1,X=2') elif vol[0] not in code and vol[1] in code \ and vol[2] not in code and vol[3] == code[3] : print(' P=1,V=1,X=2') elif vol[0] not in code and vol[1] not in code \ and vol[2] in code and vol[3] == code[3] : print(' P=1,V=1,X=2') elif vol[0] == code[0] and vol[1] not in code \ and vol[2] not in code and vol[3] not in code : print(' P=1,V=0,X=3') elif vol[0] not in code and vol[1] == code[1] \ and vol[2] not in code and vol[3] not in code : print(' P=1,V=0,X=3') elif vol[0] not in code and vol[1] not in code \ and vol[2] == code[2] and vol[3] not in code : print(' P=1,V=0,X=3') elif vol[0] not in code and vol[1] not in code \ and vol[2] not in code and vol[3] == code[3] : print(' P=1,V=0,X=3') elif vol[0] not in code and vol[1] not in code \ and vol[2] not in code and vol[3] not in code : print(' P=0,V=0,X=4') elif vol[0] in code and vol[1] not in code \ and vol[2] not in code and vol[3] not in code : print(' P=0,V=1,X=3') elif vol[0] not in code and vol[1] in code \ and vol[2] not in code and vol[3] not in code : print(' P=0,V=1,X=3') elif vol[0] not in code and vol[1] not in code \ and vol[2] in code and vol[3] not in code : print(' P=0,V=1,X=3') elif vol[0] not in code and vol[1] not in code \ and vol[2] not in code and vol[3] in code : print(' P=0,V=1,X=3') elif vol[0] in code and vol[1] in code \ and vol[2] not in code and vol[3] not in code : print(' P=0,V=2,X=2') elif vol[0] in code and vol[1] not in code \ and vol[2] in code and vol[3] not in code : print(' P=0,V=2,X=2') elif vol[0] in code and vol[1] not in code \ and vol[2] not in code and vol[3] in code : print(' P=0,V=2,X=2') elif vol[0] not in code and vol[1] in code \ and vol[2] in code and vol[3] not in code : print(' P=0,V=2,X=2') elif vol[0] not in code and vol[1] in code \ and vol[2] not in code and vol[3] in code : print(' P=0,V=2,X=2') elif vol[0] not in code and vol[1] not in code \ and vol[2] in code and vol[3] in code : print(' P=0,V=2,X=2') elif vol[0] not in code and vol[1] in code \ and vol[2] in code and vol[3] in code : print(' P=0,V=3,X=1') elif vol[0] in code and vol[1] not in code \ and vol[2] in code and vol[3] in code : print(' P=0,V=3,X=1') elif vol[0] in code and vol[1] in code \ and vol[2] not in code and vol[3] in code : print(' P=0,V=3,X=1') elif vol[0] in code and vol[1] in code \ and vol[2] in code and vol[3] not in code : print(' P=0,V=3,X=1') elif vol[0] in code and vol[1] in code \ and vol[2] in code and vol[3] in code : print(' P=0,V=4,X=0') print(LOSING_MSG) print('The answer is ' + code ) print('Please try agian...') |
# 6330199721 (19.97) 60 (2021-02-13 15:43) x = input('Turn #1 : ') if x == code: print(WINNING_MSG) else: a = 0 b = 0 if x[0] == code[0]: a += 1 else: if x[0] == code[1] or x[0] == code[2] or x[0] == code[3]: b += 1 if x[1] == code[1]: a += 1 else: if x[1] == code[0] or x[1] == code[2] or x[1] == code[3]: b += 1 if x[2] == code[2]: a += 1 else: if x[2] == code[1] or x[2] == code[0] or x[2] == code[3]: b += 1 if x[3] == code[3]: a += 1 else: if x[3] == code[1] or x[3] == code[2] or x[3] == code[0]: b += 1 c = 4 -a-b print(' P='+str(a)+',V='+str(b)+',X='+str(c)) if x != code: x = input('Turn #2 : ') if x == code:print(WINNING_MSG) else: a = 0 b = 0 if x[0] == code[0]: a += 1 else: if x[0] == code[1] or x[0] == code[2] or x[0] == code[3]: b += 1 if x[1] == code[1]: a += 1 else: if x[1] == code[0] or x[1] == code[2] or x[1] == code[3]: b += 1 if x[2] == code[2]: a += 1 else: if x[2] == code[1] or x[2] == code[0] or x[2] == code[3]: b += 1 if x[3] == code[3]: a += 1 else: if x[3] == code[1] or x[3] == code[2] or x[3] == code[0]: b += 1 c = 4 -a-b print(' P='+str(a)+',V='+str(b)+',X='+str(c)) if x != code: x = input('Turn #3 : ') if x == code:print(WINNING_MSG) else: a = 0 b = 0 if x[0] == code[0]: a += 1 else: if x[0] == code[1] or x[0] == code[2] or x[0] == code[3]: b += 1 if x[1] == code[1]: a += 1 else: if x[1] == code[0] or x[1] == code[2] or x[1] == code[3]: b += 1 if x[2] == code[2]: a += 1 else: if x[2] == code[1] or x[2] == code[0] or x[2] == code[3]: b += 1 if x[3] == code[3]: a += 1 else: if x[3] == code[1] or x[3] == code[2] or x[3] == code[0]: b += 1 c = 4 -a-b print(' P='+str(a)+',V='+str(b)+',X='+str(c)) if x != code: x = input('Turn # 4: ') if x == code:print(WINNING_MSG) else: a = 0 b = 0 if x[0] == code[0]: a += 1 else: if x[0] == code[1] or x[0] == code[2] or x[0] == code[3]: b += 1 if x[1] == code[1]: a += 1 else: if x[1] == code[0] or x[1] == code[2] or x[1] == code[3]: b += 1 if x[2] == code[2]: a += 1 else: if x[2] == code[1] or x[2] == code[0] or x[2] == code[3]: b += 1 if x[3] == code[3]: a += 1 else: if x[3] == code[1] or x[3] == code[2] or x[3] == code[0]: b += 1 c = 4 -a-b print(' P='+str(a)+',V='+str(b)+',X='+str(c)) print(LOSING_MSG) print('The answer is ',code) print('Please try again...') |
# 6330200621 (20.00) 61 (2021-02-12 01:03) guess = input('Turn #1 : ') P = 0 V = 0 X = 0 if guess == code : print(WINNING_MSG) else : if guess[0]==code[0]: P +=1 if guess[1]==code[1]: P +=1 if guess[2]==code[2]: P +=1 if guess[3]==code[3]: P +=1 if guess[0]==code[1] or guess[0]==code[2] or guess[0]==code[3]: V +=1 if guess[1]==code[0] or guess[1]==code[2] or guess[1]==code[3]: V +=1 if guess[2]==code[0] or guess[2]==code[1] or guess[2]==code[3]: V +=1 if guess[3]==code[0] or guess[3]==code[1] or guess[3]==code[2]: V +=1 X = 4-P-V print(' '*9,'P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) guess = input('Turn #2 : ') P = 0 V = 0 X = 0 if guess == code : print(WINNING_MSG) else : if guess[0]==code[0]: P +=1 if guess[1]==code[1]: P +=1 if guess[2]==code[2]: P +=1 if guess[3]==code[3]: P +=1 if guess[0]==code[1] or guess[0]==code[2] or guess[0]==code[3]: V +=1 if guess[1]==code[0] or guess[1]==code[2] or guess[1]==code[3]: V +=1 if guess[2]==code[0] or guess[2]==code[1] or guess[2]==code[3]: V +=1 if guess[3]==code[0] or guess[3]==code[1] or guess[3]==code[2]: V +=1 X = 4-P-V print(' '*9,'P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) guess = input('Turn #3 : ') P = 0 V = 0 X = 0 if guess == code : print(WINNING_MSG) else : if guess[0]==code[0]: P +=1 if guess[1]==code[1]: P +=1 if guess[2]==code[2]: P +=1 if guess[3]==code[3]: P +=1 if guess[0]==code[1] or guess[0]==code[2] or guess[0]==code[3]: V +=1 if guess[1]==code[0] or guess[1]==code[2] or guess[1]==code[3]: V +=1 if guess[2]==code[0] or guess[2]==code[1] or guess[2]==code[3]: V +=1 if guess[3]==code[0] or guess[3]==code[1] or guess[3]==code[2]: V +=1 X = 4-P-V print(' '*9,'P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) guess = input('Turn #4 : ') P = 0 V = 0 X = 0 if guess == code : print(WINNING_MSG) else : if guess[0]==code[0]: P +=1 if guess[1]==code[1]: P +=1 if guess[2]==code[2]: P +=1 if guess[3]==code[3]: P +=1 if guess[0]==code[1] or guess[0]==code[2] or guess[0]==code[3]: V +=1 if guess[1]==code[0] or guess[1]==code[2] or guess[1]==code[3]: V +=1 if guess[2]==code[0] or guess[2]==code[1] or guess[2]==code[3]: V +=1 if guess[3]==code[0] or guess[3]==code[1] or guess[3]==code[2]: V +=1 X = 4-P-V print(' '*9,'P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) print(LOSING_MSG) print('The answer is ', code) print('Please try again...') |
# 6330201221 (20.00) 62 (2021-02-15 01:59) print("Turn #1 :", end=" ") player = input() if not(player == code): p =int() p1 = int() p2 = int() p3 = int() p4 = int() if player[0]==code[0]: p1 += int(1) else : p1 += int(0) if player[1]==code[1]: p2 += int(1) else : p2 += int(0) if player[2]==code[2]: p3 += int(1) else : p3 += int(0) if player[3]==code[3]: p4 += int(1) else : p4 += int(0) playerpall = int(p1 + p2 + p3 +p4) v =int() v1 = int() v2 = int() v3 = int() v4 = int() if player[0] in code: v1 += int(1) else : v1 += int(0) if player[1] in code: v2 += int(1) else : v2 += int(0) if player[2]in code: v3 += int(1) else : v3 += int(0) if player[3] in code: v4 += int(1) else : v4 += int(0) playervall = int(v1 + v2 + v3 +v4) playervall -= playerpall x = 4-playerpall-playervall print(" P="+str(playerpall)+",V="+str(playervall)+",X="+str(x)) print("Turn #2 :", end=" ") if not(player == code): player = input() if not(player == code): p =int() p1 = int() p2 = int() p3 = int() p4 = int() if player[0]==code[0]: p1 += int(1) else : p1 += int(0) if player[1]==code[1]: p2 += int(1) else : p2 += int(0) if player[2]==code[2]: p3 += int(1) else : p3 += int(0) if player[3]==code[3]: p4 += int(1) else : p4 += int(0) playerpall = int(p1 + p2 + p3 +p4) v =int() v1 = int() v2 = int() v3 = int() v4 = int() if player[0] in code: v1 += int(1) else : v1 += int(0) if player[1] in code: v2 += int(1) else : v2 += int(0) if player[2]in code: v3 += int(1) else : v3 += int(0) if player[3] in code: v4 += int(1) else : v4 += int(0) playervall = int(v1 + v2 + v3 +v4) playervall -= playerpall x = 4-playerpall-playervall print(" P="+str(playerpall)+",V="+str(playervall)+",X="+str(x)) print("Turn #3 :", end=" ") if not(player == code): player = input() if not(player == code): p =int() p1 = int() p2 = int() p3 = int() p4 = int() if player[0]==code[0]: p1 += int(1) else : p1 += int(0) if player[1]==code[1]: p2 += int(1) else : p2 += int(0) if player[2]==code[2]: p3 += int(1) else : p3 += int(0) if player[3]==code[3]: p4 += int(1) else : p4 += int(0) playerpall = int(p1 + p2 + p3 +p4) v =int() v1 = int() v2 = int() v3 = int() v4 = int() if player[0] in code: v1 += int(1) else : v1 += int(0) if player[1] in code: v2 += int(1) else : v2 += int(0) if player[2]in code: v3 += int(1) else : v3 += int(0) if player[3] in code: v4 += int(1) else : v4 += int(0) playervall = int(v1 + v2 + v3 +v4) playervall -= playerpall x = 4-playerpall-playervall print(" P="+str(playerpall)+",V="+str(playervall)+",X="+str(x)) print("Turn #4 :", end=" ") if not(player == code): player = input() if not(player == code): p =int() p1 = int() p2 = int() p3 = int() p4 = int() if player[0]==code[0]: p1 += int(1) else : p1 += int(0) if player[1]==code[1]: p2 += int(1) else : p2 += int(0) if player[2]==code[2]: p3 += int(1) else : p3 += int(0) if player[3]==code[3]: p4 += int(1) else : p4 += int(0) playerpall = int(p1 + p2 + p3 +p4) v =int() v1 = int() v2 = int() v3 = int() v4 = int() if player[0] in code: v1 += int(1) else : v1 += int(0) if player[1] in code: v2 += int(1) else : v2 += int(0) if player[2]in code: v3 += int(1) else : v3 += int(0) if player[3] in code: v4 += int(1) else : v4 += int(0) playervall = int(v1 + v2 + v3 +v4) playervall -= playerpall x = 4-playerpall-playervall print(" P="+str(playerpall)+",V="+str(playervall)+",X="+str(x)) print(LOSING_MSG) print("The answer is "+code) print("Please try again...") else: print(WINNING_MSG) else: print(WINNING_MSG) else: print(WINNING_MSG) else: print(WINNING_MSG) |
# 6330202921 (20.00) 63 (2021-02-15 21:48) K= input('Turn #1 : ') P=0 V=0 X=0 if K != code : if K[0] == code[0] : P += 1 if K[1] == code[1] : P += 1 if K[2] == code[2] : P += 1 if K[3] == code[3] : P += 1 if K[0] in code and K[0] != code[0]: V += 1 if K[1] in code and K[1] != code[1]: V += 1 if K[2] in code and K[2] != code[2]: V += 1 if K[3] in code and K[3] != code[3]: V += 1 if K[0] not in code : X += 1 if K[1] not in code : X += 1 if K[2] not in code : X += 1 if K[3] not in code : X += 1 P=str(P) V=str(V) X=str(X) print(" "+"P" + "=" + P + "," + "V" + "=" + V + "," + "X" + "=" + X) K= input('Turn #2 : ') P=0 V=0 X=0 if K != code : if K[0] == code[0] : P += 1 if K[1] == code[1] : P += 1 if K[2] == code[2] : P += 1 if K[3] == code[3] : P += 1 if K[0] in code and K[0] != code[0]: V += 1 if K[1] in code and K[1] != code[1]: V += 1 if K[2] in code and K[2] != code[2]: V += 1 if K[3] in code and K[3] != code[3]: V += 1 if K[0] not in code : X += 1 if K[1] not in code : X += 1 if K[2] not in code : X += 1 if K[3] not in code : X += 1 P=str(P) V=str(V) X=str(X) print(" "+"P" + "=" + P + "," + "V" + "=" + V + "," + "X" + "=" + X) K= input('Turn #3 : ') P=0 V=0 X=0 if K != code : if K[0] == code[0] : P += 1 if K[1] == code[1] : P += 1 if K[2] == code[2] : P += 1 if K[3] == code[3] : P += 1 if K[0] in code and K[0] != code[0]: V += 1 if K[1] in code and K[1] != code[1]: V += 1 if K[2] in code and K[2] != code[2]: V += 1 if K[3] in code and K[3] != code[3]: V += 1 if K[0] not in code : X += 1 if K[1] not in code : X += 1 if K[2] not in code : X += 1 if K[3] not in code : X += 1 P=str(P) V=str(V) X=str(X) print(" "+"P" + "=" + P + "," + "V" + "=" + V + "," + "X" + "=" + X) K= input('Turn #4 : ') P=0 V=0 X=0 if K != code : if K[0] == code[0] : P += 1 if K[1] == code[1] : P += 1 if K[2] == code[2] : P += 1 if K[3] == code[3] : P += 1 if K[0] in code and K[0] != code[0]: V += 1 if K[1] in code and K[1] != code[1]: V += 1 if K[2] in code and K[2] != code[2]: V += 1 if K[3] in code and K[3] != code[3]: V += 1 if K[0] not in code : X += 1 if K[1] not in code : X += 1 if K[2] not in code : X += 1 if K[3] not in code : X += 1 P=str(P) V=str(V) X=str(X) print(" "+"P" + "=" + P + "," + "V" + "=" + V + "," + "X" + "=" + X) print(LOSING_MSG) print('The answer is'+' '+code) print('Please try again...') else : print(WINNING_MSG) else : print(WINNING_MSG) else : print(WINNING_MSG) else : print(WINNING_MSG) |
# 6330203521 (20.00) 64 (2021-02-11 12:01) l = len("Turn #1 : ") g1 = input("Turn #1 : ") P,V = 0,0 if g1 != code : q1,q2,q3,q4 = 0,0,0,0 a1,a2,a3,a4 = 0,0,0,0 if (code[0] == g1[0]) : a1 = 1 q1 = 1 if (code[1] == g1[1]) : a2 = 1 q2 = 1 if (code[2] == g1[2]) : a3 = 1 q3 = 1 if (code[3] == g1[3]) : a4 = 1 q4 = 1 P = a1+a2+a3+a4 b1,b2,b3,b4 = 0,0,0,0 if (code[0] in g1)and q1 == 0 : b1 = 1 if (code[1] in g1)and q2 == 0 : b2 = 1 if (code[2] in g1)and q3 == 0 : b3 = 1 if (code[3] in g1)and q4 == 0 : b4 = 1 V = b1+b2+b3+b4 print(" "*(l)+"P="+str(P)+","+"V="+str(V)+","+"X="+str(4-P-V)) g2 = input("Turn #2 : ") if g2 != code : q1,q2,q3,q4 = 0,0,0,0 a1,a2,a3,a4 = 0,0,0,0 if (code[0] == g2[0]) : a1 = 1 q1 = 1 if (code[1] == g2[1]) : a2 = 1 q2 = 1 if (code[2] == g2[2]) : a3 = 1 q3 = 1 if (code[3] == g2[3]) : a4 = 1 q4 = 1 P = a1+a2+a3+a4 b1,b2,b3,b4 = 0,0,0,0 if (code[0] in g2)and q1 == 0 : b1 = 1 if (code[1] in g2)and q2 == 0 : b2 = 1 if (code[2] in g2)and q3 == 0 : b3 = 1 if (code[3] in g2)and q4 == 0 : b4 = 1 V = b1+b2+b3+b4 print(" "*(l)+"P="+str(P)+","+"V="+str(V)+","+"X="+str(4-P-V)) g3 = input("Turn #3 : ") if g3 != code : q1,q2,q3,q4 = 0,0,0,0 a1,a2,a3,a4 = 0,0,0,0 if (code[0] == g3[0]) : a1 = 1 q1 = 1 if (code[1] == g3[1]) : a2 = 1 q2 = 1 if (code[2] == g3[2]) : a3 = 1 q3 = 1 if (code[3] == g3[3]) : a4 = 1 q4 = 1 P = a1+a2+a3+a4 b1,b2,b3,b4 = 0,0,0,0 if (code[0] in g3)and q1 == 0 : b1 = 1 if (code[1] in g3)and q2 == 0 : b2 = 1 if (code[2] in g3)and q3 == 0 : b3 = 1 if (code[3] in g3)and q4 == 0 : b4 = 1 V = b1+b2+b3+b4 print(" "*(l)+"P="+str(P)+","+"V="+str(V)+","+"X="+str(4-P-V)) g4 = input("Turn #4 : ") if g4 != code : q1,q2,q3,q4 = 0,0,0,0 a1,a2,a3,a4 = 0,0,0,0 if (code[0] == g4[0]) : a1 = 1 q1 = 1 if (code[1] == g4[1]) : a2 = 1 q2 = 1 if (code[2] == g4[2]) : a3 = 1 q3 = 1 if (code[3] == g4[3]) : a4 = 1 q4 = 1 P = a1+a2+a3+a4 b1,b2,b3,b4 = 0,0,0,0 if (code[0] in g4)and q1 == 0 : b1 = 1 if (code[1] in g4)and q2 == 0 : b2 = 1 if (code[2] in g4)and q3 == 0 : b3 = 1 if (code[3] in g4)and q4 == 0 : b4 = 1 V = b1+b2+b3+b4 print(" "*(l)+"P="+str(P)+","+"V="+str(V)+","+"X="+str(4-P-V)) print(LOSING_MSG) print("The answer is "+code) print("Please try again...") else : print(WINNING_MSG) else : print(WINNING_MSG) else : print(WINNING_MSG) else : print(WINNING_MSG) |
# 6330205821 (19.43) 65 (2021-02-15 13:55) P1=0 V1=0 X1=0 P2=0 V2=0 X2=0 P3=0 V3=0 X3=0 P4=0 V4=0 X4=0 x=input('Turn #1 : ') if x[0] in code: if x[0] == code[0]: P1+=1 else: V1+=1 else: X1 += 1 if x[1] in code: if x[1] == code[1]: P1+=1 else: V1+=1 else: X1 +=1 if x[2] in code: if x[2] == code[2]: P1+=1 else: V1+=1 else: X1 +=1 if x[3] in code: if x[3] == code[3]: P1+=1 else: V1+=1 else: X1 +=1 if x == code: print(WINNING_MSG) else: print(' '+'P='+str(P1)+','+'V='+str(V1)+','+'X='+str(X1)) y = input('Turn #2 : ') if y[0] in code: if y[0] == code[0]: P2+=1 else: V2+=1 else: X2 += 1 if y[1] in code: if y[1] == code[1]: P2+=1 else: V2+=1 else: X2 +=1 if y[2] in code: if y[2] == code[2]: P2+=1 else: V2+=1 else: X2 +=1 if y[3] in code: if y[3] == code[3]: P2+=1 else: V2+=1 else: X2 +=1 if y == code: print(WINNING_MSG) else: print(' '+'P='+str(P2)+','+'V='+str(V2)+','+'X='+str(X2)) z = input('Turn #3 : ') if z[0] in code: if z[0] == code[0]: P3+=1 else: V3+=1 else: X3 += 1 if z[1] in code: if z[1] == code[1]: P3+=1 else: V3+=1 else: X3 +=1 if z[2] in code: if z[2] == code[2]: P3+=1 else: V3+=1 else: X3 +=1 if z[3] in code: if z[3] == code[3]: P3+=1 else: V3+=1 else: X3 +=1 if z == code: print(WINNING_MSG) else: print(' '+'P='+str(P3)+','+'V='+str(V3)+','+'X='+str(X3)) i=input('Turn #4 : ') if i[0] in code: if i[0] == code[0]: P4+=1 else: V4+=1 else: X3 += 1 if i[1] in code: if i[1] == code[1]: P4+=1 else: V4+=1 else: X4 +=1 if i[2] in code: if i[2] == code[2]: P4+=1 else: V4+=1 else: X4 +=1 if i[3] in code: if i[3] == code[3]: P4+=1 else: V4+=1 else: X4 +=1 if i == code: print(WINNING_MSG) else: print(' '+'P='+str(P4)+','+'V='+str(V4)+','+'X='+str(X4)) print(LOSING_MSG) print('The answer is ',code) print('Please try again...') |
# 6330206421 (20.00) 66 (2021-02-13 22:10) guess = input('Turn #1 : ') if (guess == code): print(WINNING_MSG) else : All = 0 half = 0 wrong = 0 cut=[] cut[:0]=guess check=[] check[:0]=code if (cut[0] == check[0]): All = All + 1 if (cut[1] == check[1]): All = All + 1 if (cut[2] == check[2]): All = All + 1 if (cut[3] == check[3]): All = All + 1 if (cut[0] > check[0] or cut[0] < check[0] ): if cut[0] in check : half = half + 1 else: wrong = wrong + 1 if (cut[1] > check[1] or cut[1] < check[1] ): if cut[1] in check : half = half + 1 else: wrong = wrong + 1 if (cut[2] > check[2] or cut[2] < check[2] ): if cut[2] in check : half = half + 1 else: wrong = wrong + 1 if (cut[3] > check[3] or cut[3] < check[3] ): if cut[3] in check : half = half + 1 else: wrong = wrong + 1 X=str(All) Y=str(half) Z=str(wrong) print(" "+"P="+X+","+"V="+Y+","+"X="+Z) All = 0 half = 0 wrong = 0 guess = input('Turn #2 : ') if (guess == code): print(WINNING_MSG) else : cut=[] cut[:0]=guess check=[] check[:0]=code if (cut[0] == check[0]): All = All + 1 if (cut[1] == check[1]): All = All + 1 if (cut[2] == check[2]): All = All + 1 if (cut[3] == check[3]): All = All + 1 if (cut[0] > check[0] or cut[0] < check[0] ): if cut[0] in check : half = half + 1 else: wrong = wrong + 1 if (cut[1] > check[1] or cut[1] < check[1] ): if cut[1] in check : half = half + 1 else: wrong = wrong + 1 if (cut[2] > check[2] or cut[2] < check[2] ): if cut[2] in check : half = half + 1 else: wrong = wrong + 1 if (cut[3] > check[3] or cut[3] < check[3] ): if cut[3] in check : half = half + 1 else: wrong = wrong + 1 X=str(All) Y=str(half) Z=str(wrong) print(" "+"P="+X+","+"V="+Y+","+"X="+Z) All = 0 half = 0 wrong = 0 guess = input('Turn #3 : ') if (guess == code): print(WINNING_MSG) else : cut=[] cut[:0]=guess check=[] check[:0]=code if (cut[0] == check[0]): All = All + 1 if (cut[1] == check[1]): All = All + 1 if (cut[2] == check[2]): All = All + 1 if (cut[3] == check[3]): All = All + 1 if (cut[0] > check[0] or cut[0] < check[0] ): if cut[0] in check : half = half + 1 else: wrong = wrong + 1 if (cut[1] > check[1] or cut[1] < check[1] ): if cut[1] in check : half = half + 1 else: wrong = wrong + 1 if (cut[2] > check[2] or cut[2] < check[2] ): if cut[2] in check : half = half + 1 else: wrong = wrong + 1 if (cut[3] > check[3] or cut[3] < check[3] ): if cut[3] in check : half = half + 1 else: wrong = wrong + 1 X=str(All) Y=str(half) Z=str(wrong) print(" "+"P="+X+","+"V="+Y+","+"X="+Z) All = 0 half = 0 wrong = 0 guess = input('Turn #4 : ') if (guess == code): print(WINNING_MSG) else : cut=[] cut[:0]=guess check=[] check[:0]=code if (cut[0] == check[0]): All = All + 1 if (cut[1] == check[1]): All = All + 1 if (cut[2] == check[2]): All = All + 1 if (cut[3] == check[3]): All = All + 1 if (cut[0] > check[0] or cut[0] < check[0] ): if cut[0] in check : half = half + 1 else: wrong = wrong + 1 if (cut[1] > check[1] or cut[1] < check[1] ): if cut[1] in check : half = half + 1 else: wrong = wrong + 1 if (cut[2] > check[2] or cut[2] < check[2] ): if cut[2] in check : half = half + 1 else: wrong = wrong + 1 if (cut[3] > check[3] or cut[3] < check[3] ): if cut[3] in check : half = half + 1 else: wrong = wrong + 1 X=str(All) Y=str(half) Z=str(wrong) print(" "+"P="+X+","+"V="+Y+","+"X="+Z) print(LOSING_MSG) print("The answer is ",code ) print("Please try again...") |
# 6330207021 (17.76) 67 (2021-02-15 22:53) P=0 V=0 T1=input() print ('Turn #1 : ' + T1) if T1[0] == code[0]: P += 1 else : if T1[0] == code[1]: V+=1 if T1[0] == code[2]: V+=1 if T1[0] == code[3]: V+=1 if T1[1] == code[1]: P += 1 else : if T1[1] == code[0]: V+=1 if T1[1] == code[2]: V+=1 if T1[1] == code[3]: V+=1 if T1[2] == code[2]: P += 1 else : if T1[2] == code[1]: V+=1 if T1[2] == code[0]: V+=1 if T1[2] == code[3]: V+=1 if T1[3] == code[3]: P += 1 else : if T1[3] == code[1]: V+=1 if T1[3] == code[2]: V+=1 if T1[3] == code[0]: V+=1 X=4-P-V if P==4: print(WINNING_MSG) else : print('P=', P, 'V=' , V ,'X=',X) P=0 V=0 T2=input() print ('Turn #2 : ' + T2) if T2[0] == code[0]: P += 1 else : if T2[0] == code[1]: V+=1 if T2[0] == code[2]: V+=1 if T2[0] == code[3]: V+=1 if T2[1] == code[1]: P += 1 else : if T2[1] == code[0]: V+=1 if T2[1] == code[2]: V+=1 if T2[1] == code[3]: V+=1 if T2[2] == code[2]: P += 1 else : if T2[2] == code[1]: V+=1 if T2[2] == code[0]: V+=1 if T2[2] == code[3]: V+=1 if T2[3] == code[3]: P += 1 else : if T2[3] == code[1]: V+=1 if T2[3] == code[2]: V+=1 if T2[3] == code[0]: V+=1 X=4-P-V if P==4: print(WINNING_MSG) else: print('P=', P, 'V=' , V ,'X=',X) P=0 V=0 T3=input() print ('Turn #3 : ' + T3) if T3[0] == code[0]: P += 1 else : if T3[0] == code[1]: V+=1 if T3[0] == code[2]: V+=1 if T3[0] == code[3]: V+=1 if T3[1] == code[1]: P += 1 else : if T3[1] == code[0]: V+=1 if T3[1] == code[2]: V+=1 if T3[1] == code[3]: V+=1 if T3[2] == code[2]: P += 1 else : if T3[2] == code[1]: V+=1 if T3[2] == code[0]: V+=1 if T3[2] == code[3]: V+=1 if T3[3] == code[3]: P += 1 else : if T3[3] == code[1]: V+=1 if T3[3] == code[2]: V+=1 if T3[3] == code[0]: V+=1 X=4-P-V if P==4: print(WINNING_MSG) else: print('P=', P, 'V=' , V ,'X=',X) P=0 V=0 T4=input() print ('Turn #4 : ' + T4) if T4[0] == code[0]: P += 1 else : if T4[0] == code[1]: V+=1 if T4[0] == code[2]: V+=1 if T4[0] == code[3]: V+=1 if T4[1] == code[1]: P += 1 else : if T4[1] == code[0]: V+=1 if T4[1] == code[2]: V+=1 if T4[1] == code[3]: V+=1 if T4[2] == code[2]: P += 1 else : if T4[2] == code[1]: V+=1 if T4[2] == code[0]: V+=1 if T4[2] == code[3]: V+=1 if T4[3] == code[3]: P += 1 else : if T4[3] == code[1]: V+=1 if T4[3] == code[2]: V+=1 if T4[3] == code[0]: V+=1 X=4-P-V if P==4: print(WINNING_MSG) else: print('P=', P, 'V=' , V ,'X=',X) print(LOSING_MSG) print('The answer is ',code) print('Please try again...') |
# 6330208721 (20.00) 68 (2021-02-12 22:10) # --------------------------------------------------- guess = input("Turn #1 : ") p = 0 v = 0 x = 0 if guess[0] == code[0]: p += 1 elif guess[0] in code: v += 1 else: x += 1 if guess[1] == code[1]: p += 1 elif guess[1] in code: v += 1 else: x += 1 if guess[2] == code[2]: p += 1 elif guess[2] in code: v += 1 else: x += 1 if guess[3] == code[3]: p += 1 elif guess[3] in code: v += 1 else: x += 1 if guess == code: print(WINNING_MSG) else: print(" "*10 + "P=" + str(p) + "," + "V=" + str(v) + "," + "X=" + str(x)) guess = input("Turn #2 : ") p = 0 v = 0 x = 0 if guess[0] == code[0]: p += 1 elif guess[0] in code: v += 1 else: x += 1 if guess[1] == code[1]: p += 1 elif guess[1] in code: v += 1 else: x += 1 if guess[2] == code[2]: p += 1 elif guess[2] in code: v += 1 else: x += 1 if guess[3] == code[3]: p += 1 elif guess[3] in code: v += 1 else: x += 1 if guess == code: print(WINNING_MSG) else: print(" "*10 + "P=" + str(p) + "," + "V=" + str(v) + "," + "X=" + str(x)) guess = input("Turn #3 : ") p = 0 v = 0 x = 0 if guess[0] == code[0]: p += 1 elif guess[0] in code: v += 1 else: x += 1 if guess[1] == code[1]: p += 1 elif guess[1] in code: v += 1 else: x += 1 if guess[2] == code[2]: p += 1 elif guess[2] in code: v += 1 else: x += 1 if guess[3] == code[3]: p += 1 elif guess[3] in code: v += 1 else: x += 1 if guess == code: print(WINNING_MSG) else: print(" "*10 + "P=" + str(p) + "," + "V=" + str(v) + "," + "X=" + str(x)) guess = input("Turn #4 : ") p = 0 v = 0 x = 0 if guess[0] == code[0]: p += 1 elif guess[0] in code: v += 1 else: x += 1 if guess[1] == code[1]: p += 1 elif guess[1] in code: v += 1 else: x += 1 if guess[2] == code[2]: p += 1 elif guess[2] in code: v += 1 else: x += 1 if guess[3] == code[3]: p += 1 elif guess[3] in code: v += 1 else: x += 1 if guess == code: print(WINNING_MSG) else: print(" "*10 + "P=" + str(p) + "," + "V=" + str(v) + "," + "X=" + str(x)) print(LOSING_MSG) print("The answer is", code) print("Please try again" + "." * 3) |
# 6330209321 (20.00) 69 (2021-02-15 00:58) guess=input("Turn #1 : ") if guess[0]== code[0] : P=1 V=0 X=0 elif guess[0] in code: P=0 V=1 X=0 else: P=0 V=0 X=1 #------------------------------------------------- if guess[1]== code[1] : P+=1 elif guess[1] in code: P+=0 V+=1 else: P+=0 V+=0 X+=1 #--------------------------------------------- if guess[2]== code[2] : P+=1 elif guess[2] in code: P+=0 V+=1 else: P+=0 V+=0 X+=1 #--------------------------------------------- if guess[3]== code[3] : P+=1 elif guess[3] in code: P+=0 V+=1 else: P+=0 V+=0 X+=1 result1=("P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) if P==4: print(WINNING_MSG) else: print(" "+result1) P=0 V=0 X=0 #------Turn2-------------------------------------------------------------- guess=input("Turn #2 : ") if guess[0]== code[0] : P=1 V=0 X=0 elif guess[0] in code: P=0 V=1 X=0 else: P=0 V=0 X=1 #------------------------------------------------- if guess[1]== code[1] : P+=1 elif guess[1] in code: P+=0 V+=1 else: P+=0 V+=0 X+=1 #--------------------------------------------- if guess[2]== code[2] : P+=1 elif guess[2] in code: P+=0 V+=1 else: P+=0 V+=0 X+=1 #--------------------------------------------- if guess[3]== code[3] : P+=1 elif guess[3] in code: P+=0 V+=1 else: P+=0 V+=0 X+=1 result2=("P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) if P==4: print(WINNING_MSG) else: print(" "+result2) P=0 V=0 X=0 #-----Turn3--------------------------------------------------------------- guess=input("Turn #3 : ") if guess[0]== code[0] : P=1 V=0 X=0 elif guess[0] in code: P=0 V=1 X=0 else: P=0 V=0 X=1 #------------------------------------------------- if guess[1]== code[1] : P+=1 elif guess[1] in code: P+=0 V+=1 else: P+=0 V+=0 X+=1 #--------------------------------------------- if guess[2]== code[2] : P+=1 elif guess[2] in code: P+=0 V+=1 else: P+=0 V+=0 X+=1 #--------------------------------------------- if guess[3]== code[3] : P+=1 elif guess[3] in code: P+=0 V+=1 else: P+=0 V+=0 X+=1 result3=("P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) if P==4: print(WINNING_MSG) else: print(" "+result3) P=0 V=0 X=0 #---------Turn4----------------------------------------------------------------- guess=input("Turn #4 : ") if guess[0]== code[0] : P=1 V=0 X=0 elif guess[0] in code: P=0 V=1 X=0 else: P=0 V=0 X=1 #------------------------------------------------- if guess[1]== code[1] : P+=1 elif guess[1] in code: P+=0 V+=1 else: P+=0 V+=0 X+=1 #--------------------------------------------- if guess[2]== code[2] : P+=1 elif guess[2] in code: P+=0 V+=1 else: P+=0 V+=0 X+=1 #--------------------------------------------- if guess[3]== code[3] : P+=1 elif guess[3] in code: P+=0 V+=1 else: P+=0 V+=0 X+=1 result4=("P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) if P==4: print(WINNING_MSG) else: print(" "+result4) print(LOSING_MSG) print("The answer is",code) print("Please try again...") |
# 6330210921 (20.00) 70 (2021-02-11 10:52) #Turn1################################################# print("Turn #1 : ",end = "") code_input = input() if(code_input != code) : count_P,count_V,count_X = 0,0,0 if(code_input[0] in code) : if(code_input[0] in code[0]) : count_P += 1 elif(code_input[0] in code[1] or \ code_input[0] in code[2] or \ code_input[0] in code[3]) : count_V += 1 else : count_X += 1 if(code_input[1] in code) : if(code_input[1] in code[1]) : count_P += 1 elif(code_input[1] in code[0] or \ code_input[1] in code[2] or \ code_input[1] in code[3]) : count_V += 1 else : count_X += 1 if(code_input[2] in code) : if(code_input[2] in code[2]) : count_P += 1 elif(code_input[2] in code[0] or \ code_input[2] in code[1] or \ code_input[2] in code[3]) : count_V += 1 else : count_X += 1 if(code_input[3] in code) : if(code_input[3] in code[3]) : count_P += 1 elif(code_input[3] in code[0] or \ code_input[3] in code[1] or \ code_input[3] in code[2]) : count_V += 1 else : count_X += 1 print(10*" "+"P="+str(count_P)+",V="+str(count_V) \ +",X="+str(count_X)) ####################################################### #Turn2################################################# print("Turn #2 : ",end = "") code_input = input() if(code_input != code) : count_P,count_V,count_X = 0,0,0 if(code_input[0] in code) : if(code_input[0] in code[0]) : count_P += 1 elif(code_input[0] in code[1] or \ code_input[0] in code[2] or \ code_input[0] in code[3]) : count_V += 1 else : count_X += 1 if(code_input[1] in code) : if(code_input[1] in code[1]) : count_P += 1 elif(code_input[1] in code[0] or \ code_input[1] in code[2] or \ code_input[1] in code[3]) : count_V += 1 else : count_X += 1 if(code_input[2] in code) : if(code_input[2] in code[2]) : count_P += 1 elif(code_input[2] in code[0] or \ code_input[2] in code[1] or \ code_input[2] in code[3]) : count_V += 1 else : count_X += 1 if(code_input[3] in code) : if(code_input[3] in code[3]) : count_P += 1 elif(code_input[3] in code[0] or \ code_input[3] in code[1] or \ code_input[3] in code[2]) : count_V += 1 else : count_X += 1 print(10*" "+"P="+str(count_P)+",V="+str(count_V) \ +",X="+str(count_X)) ####################################################### #Turn3################################################# print("Turn #3 : ",end = "") code_input = input() if(code_input != code) : count_P,count_V,count_X = 0,0,0 if(code_input[0] in code) : if(code_input[0] in code[0]) : count_P += 1 elif(code_input[0] in code[1] or \ code_input[0] in code[2] or \ code_input[0] in code[3]) : count_V += 1 else : count_X += 1 if(code_input[1] in code) : if(code_input[1] in code[1]) : count_P += 1 elif(code_input[1] in code[0] or \ code_input[1] in code[2] or \ code_input[1] in code[3]) : count_V += 1 else : count_X += 1 if(code_input[2] in code) : if(code_input[2] in code[2]) : count_P += 1 elif(code_input[2] in code[0] or \ code_input[2] in code[1] or \ code_input[2] in code[3]) : count_V += 1 else : count_X += 1 if(code_input[3] in code) : if(code_input[3] in code[3]) : count_P += 1 elif(code_input[3] in code[0] or \ code_input[3] in code[1] or \ code_input[3] in code[2]) : count_V += 1 else : count_X += 1 print(10*" "+"P="+str(count_P)+",V="+str(count_V) \ +",X="+str(count_X)) ####################################################### #Turn4################################################# print("Turn #4 : ",end = "") code_input = input() if(code_input != code) : count_P,count_V,count_X = 0,0,0 if(code_input[0] in code) : if(code_input[0] in code[0]) : count_P += 1 elif(code_input[0] in code[1] or \ code_input[0] in code[2] or \ code_input[0] in code[3]) : count_V += 1 else : count_X += 1 if(code_input[1] in code) : if(code_input[1] in code[1]) : count_P += 1 elif(code_input[1] in code[0] or \ code_input[1] in code[2] or \ code_input[1] in code[3]) : count_V += 1 else : count_X += 1 if(code_input[2] in code) : if(code_input[2] in code[2]) : count_P += 1 elif(code_input[2] in code[0] or \ code_input[2] in code[1] or \ code_input[2] in code[3]) : count_V += 1 else : count_X += 1 if(code_input[3] in code) : if(code_input[3] in code[3]) : count_P += 1 elif(code_input[3] in code[0] or \ code_input[3] in code[1] or \ code_input[3] in code[2]) : count_V += 1 else : count_X += 1 print(10*" "+"P="+str(count_P)+",V="+str(count_V) \ +",X="+str(count_X)) else : print("Congratulations! You won the game.") else : print("Congratulations! You won the game.") else : print("Congratulations! You won the game.") else : print("Congratulations! You won the game.") if(code_input != code) : print("Sorry! You just lost it.") print("The answer is "+code) print("Please try again...") |
# 6330211521 (10.37) 71 (2021-02-13 16:54) t1 = str(input()) if t1 == code : print("Turn #1 :", t1) print(WINNING_MSG) else : print("Turn #1 :", t1) if t1[0] == code[0] : P = 1 else : P = 0 if t1[1] == code[1] : P += 1 else : P += 0 if t1[2] == code[2] : P += 1 else : P += 0 if t1[3] == code[3] : P += 1 else : P += 0 if "A" not in code : X = 1 else : X = 0 if "B" not in code : X += 1 else : X += 0 if "C" not in code : X += 1 else : X += 0 if "D" not in code : X += 1 else : X += 0 if "E" not in code : X += 1 else : X += 0 if "F" not in code : X += 1 else : X += 0 V = str(4 - P - X) P = str(P) X = str(X) print("\t ", "P="+P+",V="+V+",X="+X) t2 = str(input()) if t2 == code : print("Turn #2 :", t2) print(WINNING_MSG) else : print("Turn #2 :", t2) if t2[0] == code[0] : P = 1 else : P = 0 if t2[1] == code[1] : P += 1 else : P += 0 if t2[2] == code[2] : P += 1 else : P += 0 if t2[3] == code[3] : P += 1 else : P += 0 if "A" not in code : X = 1 else : X = 0 if "B" not in code : X += 1 else : X += 0 if "C" not in code : X += 1 else : X += 0 if "D" not in code : X += 1 else : X += 0 if "E" not in code : X += 1 else : X += 0 if "F" not in code : X += 1 else : X += 0 V = str(4 - P - X) P = str(P) X = str(X) print("\t ", "P="+P+",V="+V+",X="+X) t3 = str(input()) if t3 == code : print("Turn #3 :", t3) print(WINNING_MSG) else : print("Turn #3 :", t3) if t3[0] == code[0] : P = 1 else : P = 0 if t3[1] == code[1] : P += 1 else : P += 0 if t3[2] == code[2] : P += 1 else : P += 0 if t3[3] == code[3] : P += 1 else : P += 0 if "A" not in code : X = 1 else : X = 0 if "B" not in code : X += 1 else : X += 0 if "C" not in code : X += 1 else : X += 0 if "D" not in code : X += 1 else : X += 0 if "E" not in code : X += 1 else : X += 0 if "F" not in code : X += 1 else : X += 0 V = str(4 - P - X) P = str(P) X = str(X) print("\t ", "P="+P+",V="+V+",X="+X) t4 = str(input()) if t4 == code : print("Turn #4 :", t4) print(WINNING_MSG) else : print("Turn #4 :", t4) if t4[0] == code[0] : P = 1 else : P = 0 if t4[1] == code[1] : P += 1 else : P += 0 if t4[2] == code[2] : P += 1 else : P += 0 if t4[3] == code[3] : P += 1 else : P += 0 if "A" not in code : X = 1 else : X = 0 if "B" not in code : X += 1 else : X += 0 if "C" not in code : X += 1 else : X += 0 if "D" not in code : X += 1 else : X += 0 if "E" not in code : X += 1 else : X += 0 if "F" not in code : X += 1 else : X += 0 V = str(4 - P - X) P = str(P) X = str(X) print("\t ", "P="+P+",V="+V+",X="+X) print(LOSING_MSG) print("The answer is", code) print("Please try again...") |
# 6330212121 (20.00) 72 (2021-02-12 13:45) p,v,x = 0,0,0 x=input('Turn #1 : ') if x[0]== code[0]: p+=1 if x[1]== code[1]: p+=1 if x[2]== code[2]: p+=1 if x[3]== code[3]: p+=1 if x[0]==code[0] or x[0]==code[1] or x[0]==code[2] or x[0]==code[3]: v+=1 if x[1]==code[0] or x[1]==code[1] or x[1]==code[2] or x[1]==code[3]: v+=1 if x[2]==code[0] or x[2]==code[1] or x[2]==code[2] or x[2]==code[3]: v+=1 if x[3]==code[0] or x[3]==code[1] or x[3]==code[2] or x[3]==code[3]: v+=1 v=v-p x=4-(p+v) if p==4: print(WINNING_MSG) else: print(' '*10+f'P={p},V={v},X={x}') p,v,x = 0,0,0 x=input('Turn #2 : ') if x[0]== code[0]: p+=1 if x[1]== code[1]: p+=1 if x[2]== code[2]: p+=1 if x[3]== code[3]: p+=1 if x[0]==code[0] or x[0]==code[1] or x[0]==code[2] or x[0]==code[3]: v+=1 if x[1]==code[0] or x[1]==code[1] or x[1]==code[2] or x[1]==code[3]: v+=1 if x[2]==code[0] or x[2]==code[1] or x[2]==code[2] or x[2]==code[3]: v+=1 if x[3]==code[0] or x[3]==code[1] or x[3]==code[2] or x[3]==code[3]: v+=1 v=v-p x=4-(p+v) if p==4: print(WINNING_MSG) else: print(' '*10+f'P={p},V={v},X={x}') p,v,x = 0,0,0 x=input('Turn #3 : ') if x[0]== code[0]: p+=1 if x[1]== code[1]: p+=1 if x[2]== code[2]: p+=1 if x[3]== code[3]: p+=1 if x[0]==code[0] or x[0]==code[1] or x[0]==code[2] or x[0]==code[3]: v+=1 if x[1]==code[0] or x[1]==code[1] or x[1]==code[2] or x[1]==code[3]: v+=1 if x[2]==code[0] or x[2]==code[1] or x[2]==code[2] or x[2]==code[3]: v+=1 if x[3]==code[0] or x[3]==code[1] or x[3]==code[2] or x[3]==code[3]: v+=1 v=v-p x=4-(p+v) if p==4: print(WINNING_MSG) else: print(' '*10+f'P={p},V={v},X={x}') p,v,x = 0,0,0 x=input('Turn #4 : ') if x[0]== code[0]: p+=1 if x[1]== code[1]: p+=1 if x[2]== code[2]: p+=1 if x[3]== code[3]: p+=1 if x[0]==code[0] or x[0]==code[1] or x[0]==code[2] or x[0]==code[3]: v+=1 if x[1]==code[0] or x[1]==code[1] or x[1]==code[2] or x[1]==code[3]: v+=1 if x[2]==code[0] or x[2]==code[1] or x[2]==code[2] or x[2]==code[3]: v+=1 if x[3]==code[0] or x[3]==code[1] or x[3]==code[2] or x[3]==code[3]: v+=1 v=v-p x=4-(p+v) if p==4: print(WINNING_MSG) else: print(' '*10+f'P={p},V={v},X={x}') print(LOSING_MSG) print(f'The answer is {code}') print('Please try again...') |
# 6330213821 (17.37) 73 (2021-02-14 18:32) t1 = input("Turn #1 : ") P = 0 V = 0 if t1[0] == code[0] : P = 1 else : P = 0 if t1[0] in code : V = 1 else : V = 0 if t1[1] == code [1] : P = P + 1 else : P = P if t1[1] in code : V = V + 1 else : V = V if t1[2] == code [2] : P = P + 1 else : P = P if t1[2] in code : V = V + 1 else : V = V if t1[3] == code [3] : P = P + 1 else : P = P if t1[3] in code : V = V + 1 else : V = V if P == 4: X = 4 - P V = 0 V = str(V) else : X = 4 - (P + V) V = str(V) if P == 4 : print ("Congratulations! You won the game.") else : P = str(P) X = str(X) print (" "+"P="+P+", "+"V="+V+", "+"X="+X) t2 = input("Turn #2 : ") P2 = 0 V2 = 0 if t2[0] == code[0] : P2 = 1 else : P2 = 0 if t2[0] in code : V2 = 1 else : V2 = 0 if t2[1] == code [1] : P2 = P2 + 1 else : P2 = P2 if t2[1] in code : V2 = V2 + 1 else : V2 = V2 if t2[2] == code [2] : P2 = P2 + 1 else : P2 = P2 if t2[2] in code : V2 = V2 + 1 else : V2 = V2 if t2[3] == code [3] : P2 = P2 + 1 else : P2 = P2 if t2[3] in code : V2 = V2 + 1 else : V2 = V2 if P2 == 4: X2 = 4 - P2 V2 = 0 V2 = str(V2) else : X2 = 4 - (P2 + V2) V2 = str(V2) if P2 == 4 : print ("Congratulations! You won the game.") else : P2 = str(P2) X2 = str(X2) print (" "+"P="+P2+", "+"V="+V2+", "+"X="+X2) t3 = input("Turn #3 : ") P3 = 0 V3 = 0 if t3[0] == code[0] : P3 = 1 else : P3 = 0 if t3[0] in code : V3 = 1 else : V3 = 0 if t3[1] == code [1] : P3 = P3 + 1 else : P3 = P3 if t3[1] in code : V3 = V3 + 1 else : V2 = V2 if t3[2] == code [2] : P3 = P3 + 1 else : P3 = P3 if t3[2] in code : V3 = V3 + 1 else : V3 = V3 if t3[3] == code [3] : P3 = P3 + 1 else : P3 = P3 if t3[3] in code : V3 = V3 + 1 else : V3 = V3 if P3 == 4: X3 = 4 - P3 V3 = 0 V3 = str(V3) else : X3 = 4 - (P3 + V3) V3 = str(V3) if P3 == 4 : print ("Congratulations! You won the game.") else : P3 = str(P3) X3 = str(X3) print (" "+"P="+P3+", "+"V="+V3+", "+"X="+X3) t4 = input("Turn #4 : ") P4 = 0 V4 = 0 if t4[0] == code[0] : P4 = 1 else : P4 = 0 if t4[0] in code : V4 = 1 else : V4 = 0 if t4[1] == code [1] : P4 = P4 + 1 else : P4 = P4 if t4[1] in code : V4 = V4 + 1 else : V4 = V4 if t4[2] == code [2] : P4 = P4 + 1 else : P4 = P4 if t4[2] in code : V4 = V4 + 1 else : V4 = V4 if t4[3] == code [3] : P4 = P4 + 1 else : P4 = P4 if t4[3] in code : V4 = V4 + 1 else : V4 = V4 if P4 == 4: X4 = 4 - P4 V4 = 0 V4 = str(V4) else : X4 = 4 - (P4 + V4) V4 = str(V4) if P4 == 4 : print ("Congratulations! You won the game.") else : print("Sorry! You just lost it.") print("The answer is "+code) print("Please try again...") |
# 6330214421 (20.00) 74 (2021-02-12 20:24) a = input("Turn #1 : ") P = 0 if a[0]==code[0]: P += 1 if a[1]==code[1]: P += 1 if a[2]==code[2]: P += 1 if a[3]==code[3]: P += 1 else : P += 0 V = 0 a_1 = a[0]+" "+a[1]+" "+a[2]+" "+a[3] a_2 = a_1.split() code_1 = code[0]+" "+code[1]+" "+code[2]+" "+code[3] code_2 = code_1.split() if a_2[0] in code_2: V += 1 if a_2[1] in code_2: V += 1 if a_2[2] in code_2: V += 1 if a_2[3] in code_2: V += 1 else : V += 0 V_new = V-P X = 4-V if P == 4: print(WINNING_MSG) else : print(" "+"P="+str(P)+","+"V="+str(V_new)+","+"X="+str(X)) b = input("Turn #2 : ") P = 0 if b[0]==code[0]: P += 1 if b[1]==code[1]: P += 1 if b[2]==code[2]: P += 1 if b[3]==code[3]: P += 1 else : P += 0 V = 0 b_1 = b[0]+" "+b[1]+" "+b[2]+" "+b[3] b_2 = b_1.split() code_1 = code[0]+" "+code[1]+" "+code[2]+" "+code[3] code_2 = code_1.split() if b_2[0] in code_2: V += 1 if b_2[1] in code_2: V += 1 if b_2[2] in code_2: V += 1 if b_2[3] in code_2: V += 1 else : V += 0 V_new = V-P X = 4-V if P == 4: print(WINNING_MSG) else : print(" "+"P="+str(P)+","+"V="+str(V_new)+","+"X="+str(X)) c = input("Turn #3 : ") P = 0 if c[0]==code[0]: P += 1 if c[1]==code[1]: P += 1 if c[2]==code[2]: P += 1 if c[3]==code[3]: P += 1 else : P += 0 V = 0 c_1 = c[0]+" "+c[1]+" "+c[2]+" "+c[3] c_2 = c_1.split() code_1 = code[0]+" "+code[1]+" "+code[2]+" "+code[3] code_2 = code_1.split() if c_2[0] in code_2: V += 1 if c_2[1] in code_2: V += 1 if c_2[2] in code_2: V += 1 if c_2[3] in code_2: V += 1 else : V += 0 V_new = V-P X = 4-V if P == 4: print(WINNING_MSG) else: print(" "+"P="+str(P)+","+"V="+str(V_new)+","+"X="+str(X)) d = input("Turn #4 : ") P = 0 if d[0]==code[0]: P += 1 if d[1]==code[1]: P += 1 if d[2]==code[2]: P += 1 if d[3]==code[3]: P += 1 else : P += 0 V = 0 d_1 = d[0]+" "+d[1]+" "+d[2]+" "+d[3] d_2 = d_1.split() code_1 = code[0]+" "+code[1]+" "+code[2]+" "+code[3] code_2 = code_1.split() if d_2[0] in code_2: V += 1 if d_2[1] in code_2: V += 1 if d_2[2] in code_2: V += 1 if d_2[3] in code_2: V += 1 else : V += 0 V_new = V-P X = 4-V if P == 4: print(WINNING_MSG) else: print(" "+"P="+str(P)+","+"V="+str(V_new)+","+"X="+str(X)) print(LOSING_MSG) print("The answer is "+code) print("Please try again...") |
# 6330215021 (20.00) 75 (2021-02-13 03:37) x = input("Turn #1 : ") P = 0 V = 0 X = 0 if x[0] == code[0]: P += 1 if x[1] == code[1]: P += 1 if x[2] == code[2]: P += 1 if x[3] == code[3]: P += 1 if x[0] in code: V += 1 if x[1] in code: V += 1 if x[2] in code: V += 1 if x[3] in code: V += 1 V = V-P X = 4-(P+V) if P == 4: print(WINNING_MSG) else: print(" "*10+"P="+str(P)+",V="+str(V)+",X="+str(X)) x = input("Turn #2 : ") P = 0 V = 0 X = 0 if x[0] == code[0]: P += 1 if x[1] == code[1]: P += 1 if x[2] == code[2]: P += 1 if x[3] == code[3]: P += 1 if x[0] in code: V += 1 if x[1] in code: V += 1 if x[2] in code: V += 1 if x[3] in code: V += 1 V = V-P X = 4-(P+V) if P == 4: print(WINNING_MSG) else: print(" "*10+"P="+str(P)+",V="+str(V)+",X="+str(X)) x = input("Turn #3 : ") P = 0 V = 0 X = 0 if x[0] == code[0]: P += 1 if x[1] == code[1]: P += 1 if x[2] == code[2]: P += 1 if x[3] == code[3]: P += 1 if x[0] in code: V += 1 if x[1] in code: V += 1 if x[2] in code: V += 1 if x[3] in code: V += 1 V = V-P X = 4-(P+V) if P == 4: print(WINNING_MSG) else: print(" "*10+"P="+str(P)+",V="+str(V)+",X="+str(X)) x = input("Turn #4 : ") P = 0 V = 0 X = 0 if x[0] == code[0]: P += 1 if x[1] == code[1]: P += 1 if x[2] == code[2]: P += 1 if x[3] == code[3]: P += 1 if x[0] in code: V += 1 if x[1] in code: V += 1 if x[2] in code: V += 1 if x[3] in code: V += 1 V = V-P X = 4-(P+V) if P == 4: print(WINNING_MSG) else: print(" "*10+"P="+str(P)+",V="+str(V)+",X="+str(X)) print(LOSING_MSG) print("The answer is " + code) print("Please try again...") |
# 6330216721 (20.00) 76 (2021-02-12 04:21) from re import compile reg = compile(r"(\w)(?=\w{3}\1)") s = " "*len("Turn #1 : ") print("Turn #1 : ", end="") guess = input() if guess == code: print(WINNING_MSG) exit() P = len(reg.findall(guess + code)) V = len(set(code).intersection(set(guess))) - P X = 4-(P+V) print(s+"P={},V={},X={}".format(P, V, X)) print("Turn #2 : ", end="") guess = input() if guess == code: print(WINNING_MSG) exit() P = len(reg.findall(guess + code)) V = len(set(code).intersection(set(guess))) - P X = 4-(P+V) print(s+"P={},V={},X={}".format(P, V, X)) print("Turn #3 : ", end="") guess = input() if guess == code: print(WINNING_MSG) exit() P = len(reg.findall(guess + code)) V = len(set(code).intersection(set(guess))) - P X = 4-(P+V) print(s+"P={},V={},X={}".format(P, V, X)) print("Turn #4 : ", end="") guess = input() if guess == code: print(WINNING_MSG) exit() P = len(reg.findall(guess + code)) V = len(set(code).intersection(set(guess))) - P X = 4-(P+V) print(s+"P={},V={},X={}".format(P, V, X)) print(LOSING_MSG) print("The answer is {}".format(code)) print("Please try again...") |
# 6330217321 (20.00) 77 (2021-02-11 22:40) print("Turn #1 : ",end="") a1=input() p=0 if a1[0]==code[0]: p=p+1 if a1[1]==code[1]: p=p+1 if a1[2]==code[2]: p=p+1 if a1[3]==code[3]: p=p+1 v=0 if a1[0]==code[1] or a1[0]==code[2] or a1[0]==code[3]: v=v+1 if a1[1]==code[0] or a1[1]==code[2] or a1[1]==code[3]: v=v+1 if a1[2]==code[0] or a1[2]==code[1] or a1[2]==code[3]: v=v+1 if a1[3]==code[0] or a1[3]==code[1] or a1[3]==code[2]: v=v+1 x=4-p-v if a1==code: print(WINNING_MSG) else: print(" "*10+"P="+str(p)+",V="+str(v)+",X="+str(x)) print("Turn #2 : ",end="") a2=input() if a2==code: print(WINNING_MSG) else: p=0 if a2[0]==code[0]: p=p+1 if a2[1]==code[1]: p=p+1 if a2[2]==code[2]: p=p+1 if a2[3]==code[3]: p=p+1 v=0 if a2[0]==code[1] or a2[0]==code[2] or a2[0]==code[3]: v=v+1 if a2[1]==code[0] or a2[1]==code[2] or a2[1]==code[3]: v=v+1 if a2[2]==code[0] or a2[2]==code[1] or a2[2]==code[3]: v=v+1 if a2[3]==code[0] or a2[3]==code[1] or a2[3]==code[2]: v=v+1 x=4-p-v print(" "*10+"P="+str(p)+",V="+str(v)+",X="+str(x)) print("Turn #3 : ",end="") a3=input() if a3==code: print(WINNING_MSG) else: p=0 if a3[0]==code[0]: p=p+1 if a3[1]==code[1]: p=p+1 if a3[2]==code[2]: p=p+1 if a3[3]==code[3]: p=p+1 v=0 if a3[0]==code[1] or a3[0]==code[2] or a3[0]==code[3]: v=v+1 if a3[1]==code[0] or a3[1]==code[2] or a3[1]==code[3]: v=v+1 if a3[2]==code[0] or a3[2]==code[1] or a3[2]==code[3]: v=v+1 if a3[3]==code[0] or a3[3]==code[1] or a3[3]==code[2]: v=v+1 x=4-p-v print(" "*10+"P="+str(p)+",V="+str(v)+",X="+str(x)) print("Turn #4 : ",end="") a4=input() if a4==code: print(WINNING_MSG) else: p=0 if a4[0]==code[0]: p=p+1 if a4[1]==code[1]: p=p+1 if a4[2]==code[2]: p=p+1 if a4[3]==code[3]: p=p+1 v=0 if a4[0]==code[1] or a4[0]==code[2] or a4[0]==code[3]: v=v+1 if a4[1]==code[0] or a4[1]==code[2] or a4[1]==code[3]: v=v+1 if a4[2]==code[0] or a4[2]==code[1] or a4[2]==code[3]: v=v+1 if a4[3]==code[0] or a4[3]==code[1] or a4[3]==code[2]: v=v+1 x=4-p-v print(" "*10+"P="+str(p)+",V="+str(v)+",X="+str(x)) print(LOSING_MSG) print("The answer is "+code) print("Please try again...") |
# 6330219621 (20.00) 78 (2021-02-13 12:33) #print(code) P = 0 V = 0 X = 0 d = input('Turn #1 : ') if d != code : if d[0] == code[0] : P += 1 elif d[0] in code : V += 1 else : X += 1 if d[1] == code[1] : P += 1 elif d[1] in code : V += 1 else : X += 1 if d[2] == code[2] : P += 1 elif d[2] in code : V += 1 else : X += 1 if d[3] == code[3] : P += 1 elif d[3] in code : V += 1 else : X += 1 print("\t P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) P = 0 V = 0 X = 0 d = input('Turn #2 : ') if d != code : if d[0] == code[0] : P += 1 elif d[0] in code : V += 1 else : X += 1 if d[1] == code[1] : P += 1 elif d[1] in code : V += 1 else : X += 1 if d[2] == code[2] : P += 1 elif d[2] in code : V += 1 else : X += 1 if d[3] == code[3] : P += 1 elif d[3] in code : V += 1 else : X += 1 print("\t P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) P = 0 V = 0 X = 0 d = input('Turn #3 : ') if d != code : if d[0] == code[0] : P += 1 elif d[0] in code : V += 1 else : X += 1 if d[1] == code[1] : P += 1 elif d[1] in code : V += 1 else : X += 1 if d[2] == code[2] : P += 1 elif d[2] in code : V += 1 else : X += 1 if d[3] == code[3] : P += 1 elif d[3] in code : V += 1 else : X += 1 print("\t P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) P = 0 V = 0 X = 0 d = input('Turn #4 : ') if d != code : if d[0] == code[0] : P += 1 elif d[0] in code : V += 1 else : X += 1 if d[1] == code[1] : P += 1 elif d[1] in code : V += 1 else : X += 1 if d[2] == code[2] : P += 1 elif d[2] in code : V += 1 else : X += 1 if d[3] == code[3] : P += 1 elif d[3] in code : V += 1 else : X += 1 print("\t P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) print(LOSING_MSG) print('The answer is',code) print('Please try again...') else : print(WINNING_MSG) else : print(WINNING_MSG) else : print(WINNING_MSG) else : print(WINNING_MSG) |
# 6330221821 (20.00) 79 (2021-02-13 19:58) c = list(code) # 1st try w = list(input('Turn #1 : ')) if c == w: print(WINNING_MSG) else: p,v,x = 0,0,0 #check p if w[0] == c[0]: p += 1 if w[1] == c[1]: p += 1 if w[2] == c[2]: p += 1 if w[3] == c[3]: p += 1 #check v if w[0] in c and w[0] != c[0]: v += 1 if w[1] in c and w[1] != c[1] : v += 1 if w[2] in c and w[2] != c[2] : v += 1 if w[3] in c and w[3] != c[3] : v += 1 #check x if w[0] not in c: x += 1 if w[1] not in c: x += 1 if w[2] not in c: x += 1 if w[3] not in c: x += 1 print(' P='+str(p)+','+'V='+str(v)+','+'X='+str(x)) # 2nd try w = list(input('Turn #2 : ')) if c == w: print(WINNING_MSG) else: p,v,x = 0,0,0 #check p if w[0] == c[0]: p += 1 if w[1] == c[1]: p += 1 if w[2] == c[2]: p += 1 if w[3] == c[3]: p += 1 #check v if w[0] in c and w[0] != c[0]: v += 1 if w[1] in c and w[1] != c[1] : v += 1 if w[2] in c and w[2] != c[2] : v += 1 if w[3] in c and w[3] != c[3] : v += 1 #check x if w[0] not in c: x += 1 if w[1] not in c: x += 1 if w[2] not in c: x += 1 if w[3] not in c: x += 1 print(' P='+str(p)+','+'V='+str(v)+','+'X='+str(x)) # 3rd try w = list(input('Turn #3 : ')) if c == w: print(WINNING_MSG) else: p,v,x = 0,0,0 #check p if w[0] == c[0]: p += 1 if w[1] == c[1]: p += 1 if w[2] == c[2]: p += 1 if w[3] == c[3]: p += 1 #check v if w[0] in c and w[0] != c[0]: v += 1 if w[1] in c and w[1] != c[1] : v += 1 if w[2] in c and w[2] != c[2] : v += 1 if w[3] in c and w[3] != c[3] : v += 1 #check x if w[0] not in c: x += 1 if w[1] not in c: x += 1 if w[2] not in c: x += 1 if w[3] not in c: x += 1 print(' P='+str(p)+','+'V='+str(v)+','+'X='+str(x)) # 4th(final) try w = list(input('Turn #4 : ')) if c == w: print(WINNING_MSG) else: p,v,x = 0,0,0 #check p if w[0] == c[0]: p += 1 if w[1] == c[1]: p += 1 if w[2] == c[2]: p += 1 if w[3] == c[3]: p += 1 #check v if w[0] in c and w[0] != c[0]: v += 1 if w[1] in c and w[1] != c[1] : v += 1 if w[2] in c and w[2] != c[2] : v += 1 if w[3] in c and w[3] != c[3] : v += 1 #check x if w[0] not in c: x += 1 if w[1] not in c: x += 1 if w[2] not in c: x += 1 if w[3] not in c: x += 1 print(' P='+str(p)+','+'V='+str(v)+','+'X='+str(x)) print(LOSING_MSG) print('The answer is ', code) print("Please try again"+'.'*3 ) |
# 6330222421 (17.37) 80 (2021-02-12 12:20) code1 = code[0]; code2 = code[1]; code3 = code[2]; code4 = code[3] # 1st play in1 = input("Turn #1 : ") a = in1[0]; b = in1[1]; c = in1[2]; d = in1[3] if code1 == a : pa = 1 else : pa = 0 if code2 == b : pb = 1 else : pb = 0 if code3 == c : pc = 1 else : pc = 0 if code4 == d : pd = 1 else : pd = 0 P1 = pa + pb + pc + pd if code1 == a : va = 0 else : if code1 == b or code1 == c or code1 == d : va = 1 else : va = 0 if code2 == b : vb = 0 else : if code2 == a or code2 == c or code2 == d : vb = 1 else : vb = 0 if code3 == c : vc = 0 else : if code3 == a or code3 == b or code3 == d : vc = 1 else : vc = 0 if code4 == d : vd = 0 else : if code4 == a or code4 == b or code4 == c : vd = 1 else : vd = 0 V1 = va + vb + vc + vd X1 = str(len(code)-P1-V1) if P1 == 4 : print(WINNING_MSG) else : print(" "+"P="+str(P1)+","+"V="+str(V1)+","+"X="+str(X1)) #---------- # 2nd play in2 = input("Turn #2 : ") a = in2[0]; b = in2[1]; c = in2[2]; d = in2[3] if code1 == a : pa = 1 else : pa = 0 if code2 == b : pb = 1 else : pb = 0 if code3 == c : pc = 1 else : pc = 0 if code4 == d : pd = 1 else : pd = 0 P1 = pa + pb + pc + pd if code1 == a : va = 0 else : if code1 == b or code1 == c or code1 == d : va = 1 else : va = 0 if code2 == b : vb = 0 else : if code2 == a or code2 == c or code2 == d : vb = 1 else : vb = 0 if code3 == c : vc = 0 else : if code3 == a or code3 == b or code3 == d : vc = 1 else : vc = 0 if code4 == d : vd = 0 else : if code4 == a or code4 == b or code4 == c : vd = 1 else : vd = 0 V1 = va + vb + vc + vd X1 = str(len(code)-P1-V1) if P1 == 4 : print(WINNING_MSG) else : print(" "+"P="+str(P1)+","+"V="+str(V1)+","+"X="+str(X1)) #---------- # 3rd play in3 = input("Turn #3 : ") a = in3[0]; b = in3[1]; c = in3[2]; d = in3[3] if code1 == a : pa = 1 else : pa = 0 if code2 == b : pb = 1 else : pb = 0 if code3 == c : pc = 1 else : pc = 0 if code4 == d : pd = 1 else : pd = 0 P1 = pa + pb + pc + pd if code1 == a : va = 0 else : if code1 == b or code1 == c or code1 == d : va = 1 else : va = 0 if code2 == b : vb = 0 else : if code2 == a or code2 == c or code2 == d : vb = 1 else : vb = 0 if code3 == c : vc = 0 else : if code3 == a or code3 == b or code3 == d : vc = 1 else : vc = 0 if code4 == d : vd = 0 else : if code4 == a or code4 == b or code4 == c : vd = 1 else : vd = 0 V1 = va + vb + vc + vd X1 = str(len(code)-P1-V1) if P1 == 4 : print(WINNING_MSG) else : print(" "+"P="+str(P1)+","+"V="+str(V1)+","+"X="+str(X1)) #---------- # 4th play in4 = input("Turn #4 : ") a = in4[0]; b = in4[1]; c = in4[2]; d = in4[3] if code1 == a : pa = 1 else : pa = 0 if code2 == b : pb = 1 else : pb = 0 if code3 == c : pc = 1 else : pc = 0 if code4 == d : pd = 1 else : pd = 0 P1 = pa + pb + pc + pd if code1 == a : va = 0 else : if code1 == b or code1 == c or code1 == d : va = 1 else : va = 0 if code2 == b : vb = 0 else : if code2 == a or code2 == c or code2 == d : vb = 1 else : vb = 0 if code3 == c : vc = 0 else : if code3 == a or code3 == b or code3 == d : vc = 1 else : vc = 0 if code4 == d : vd = 0 else : if code4 == a or code4 == b or code4 == c : vd = 1 else : vd = 0 V1 = va + vb + vc + vd X1 = str(len(code)-P1-V1) if P1 == 4 : print(WINNING_MSG) else : print(LOSING_MSG) print("The answer is " +str(code)) print("Please try again...") |
# 6330223021 (20.00) 81 (2021-02-12 09:34) P = 0; V = 0; X = 0 decode = input('Turn #1 : ') if decode[0] == code[0] : P += 1 elif decode[0] in code : V += 1 else : X += 1 if decode[1] == code[1] : P += 1 elif decode[1] in code : V += 1 else : X += 1 if decode[2] == code[2] : P += 1 elif decode[2] in code : V += 1 else : X += 1 if decode[3] == code[3] : P += 1 elif decode[3] in code : V += 1 else : X += 1 if P == 4 : print(WINNING_MSG) if P != 4 : print(' '+' '+'P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) P = 0; V = 0; X = 0 decode = input('Turn #2 : ') if decode[0] == code[0] : P += 1 elif decode[0] in code : V += 1 else : X += 1 if decode[1] == code[1] : P += 1 elif decode[1] in code : V += 1 else : X += 1 if decode[2] == code[2] : P += 1 elif decode[2] in code : V += 1 else : X += 1 if decode[3] == code[3] : P += 1 elif decode[3] in code : V += 1 else : X += 1 if P == 4 : print(WINNING_MSG) if P != 4 : print(' '+' '+'P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) P = 0; V = 0; X = 0 decode = input('Turn #3 : ') if decode[0] == code[0] : P += 1 elif decode[0] in code : V += 1 else : X += 1 if decode[1] == code[1] : P += 1 elif decode[1] in code : V += 1 else : X += 1 if decode[2] == code[2] : P += 1 elif decode[2] in code : V += 1 else : X += 1 if decode[3] == code[3] : P += 1 elif decode[3] in code : V += 1 else : X += 1 if P == 4 : print(WINNING_MSG) if P != 4 : print(' '+' '+'P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) P = 0; V = 0; X = 0 decode = input('Turn #4 : ') if decode[0] == code[0] : P += 1 elif decode[0] in code : V += 1 else : X += 1 if decode[1] == code[1] : P += 1 elif decode[1] in code : V += 1 else : X += 1 if decode[2] == code[2] : P += 1 elif decode[2] in code : V += 1 else : X += 1 if decode[3] == code[3] : P += 1 elif decode[3] in code : V += 1 else : X += 1 if P == 4 : print(WINNING_MSG) if P != 4 : print(' '+' '+'P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) print(LOSING_MSG) print('The answer is ', code) print('Please try again...') |
# 6330224721 (20.00) 82 (2021-02-13 21:19) print(code) p = 0 v = 0 x = 0 if p != 4: your1 = input("Turn #1 : ") if your1[0] in code: v += 1 if your1[0] == code[0]: p += 1 v -= 1 else: x += 1 if your1[1] in code: v += 1 if your1[1] == code[1]: p += 1 v -= 1 else: x += 1 if your1[2] in code: v += 1 if your1[2] == code[2]: p += 1 v -= 1 else: x += 1 if your1[3] in code: v += 1 if your1[3] == code[3]: p += 1 v -= 1 else: x += 1 if p != 4: print(" P="+str(p)+","+"V="+str(v)+","+"X="+str(x)) if p != 4: your2 = input("Turn #2 : ") p = 0 v = 0 x = 0 if your2[0] in code: v += 1 if your2[0] == code[0]: p += 1 v -= 1 else: x += 1 if your2[1] in code: v += 1 if your2[1] == code[1]: p += 1 v -= 1 else: x += 1 if your2[2] in code: v += 1 if your2[2] == code[2]: p += 1 v -= 1 else: x += 1 if your2[3] in code: v += 1 if your2[3] == code[3]: p += 1 v -= 1 else: x += 1 if p != 4: print(" P="+str(p)+","+"V="+str(v)+","+"X="+str(x)) if p != 4: your3 = input("Turn #3 : ") p = 0 v = 0 x = 0 if your3[0] in code: v += 1 if your3[0] == code[0]: p += 1 v -= 1 else: x += 1 if your3[1] in code: v += 1 if your3[1] == code[1]: p += 1 v -= 1 else: x += 1 if your3[2] in code: v += 1 if your3[2] == code[2]: p += 1 v -= 1 else: x += 1 if your3[3] in code: v += 1 if your3[3] == code[3]: p += 1 v -= 1 else: x += 1 if p != 4: print(" P="+str(p)+","+"V="+str(v)+","+"X="+str(x)) if p != 4: your4 = input("Turn #4 : ") p = 0 v = 0 x = 0 if your4[0] in code: v += 1 if your4[0] == code[0]: p += 1 v -= 1 else: x += 1 if your4[1] in code: v += 1 if your4[1] == code[1]: p += 1 v -= 1 else: x += 1 if your4[2] in code: v += 1 if your4[2] == code[2]: p += 1 v -= 1 else: x += 1 if your4[3] in code: v += 1 if your4[3] == code[3]: p += 1 v -= 1 else: x += 1 if p != 4: print(" P="+str(p)+","+"V="+str(v)+","+"X="+str(x)) print("Sorry! You just lost it.") print("The answer is "+code) print("Please try again...") if p == 4: print("Congratulations! You won the game.") |
# 6330225321 (18.00) 83 (2021-02-14 00:43) a = input('Turn #1 : ') a1,a2,a3,a4 = a[0],a[1],a[2],a[3] c1,c2,c3,c4 = code[0],code[1],code[2],code[3] p1,p2,p3,p4 = 0,0,0,0 v1,v2,v3,v4 = 0,0,0,0 if a1==c1 and a2==c2 and a3==c3 and a4==c4 : print("Congratulations! You won the game.") else : if a1==c1 : p1=1 if a2==c2 : p2=1 if a3==c3 : p3=1 if a4==c4 : p4=1 if a1 in code and not a1 ==c1 : v1 = 1 if a2 in code and not a2 ==c2 : v2 = 1 if a3 in code and not a3 ==c3 : v3 = 1 if a4 in code and not a4 ==c4 : v4 = 1 P = p1+p2+p3+p4 V = v1+v2+v3+v4 X = 4-V-P print(' '+'P'+'='+str(P)+','+'V'+'='+str(V)+','+'X'+'='+str(X)) a = input('Turn #2 : ') a1,a2,a3,a4 = a[0],a[1],a[2],a[3] c1,c2,c3,c4 = code[0],code[1],code[2],code[3] p1,p2,p3,p4 = 0,0,0,0 v1,v2,v3,v4 = 0,0,0,0 if a1==c1 and a2==c2 and a3==c3 and a4==c4 : print("Congratulations! You won the game.") else : if a1==c1 : p1=1 if a2==c2 : p2=1 if a3==c3 : p3=1 if a4==c4 : p4=1 if a1 in code and not a1 ==c1 : v1 = 1 if a2 in code and not a2 ==c2 : v2 = 1 if a3 in code and not a3 ==c3 : v3 = 1 if a4 in code and not a4 ==c4 : v4 = 1 P = p1+p2+p3+p4 V = v1+v2+v3+v4 X = 4-V-P print(' '+'P'+'='+str(P)+','+'V'+'='+str(V)+','+'X'+'='+str(X)) a = input('Turn #3 : ') a1,a2,a3,a4 = a[0],a[1],a[2],a[3] c1,c2,c3,c4 = code[0],code[1],code[2],code[3] p1,p2,p3,p4 = 0,0,0,0 v1,v2,v3,v4 = 0,0,0,0 if a1==c1 and a2==c2 and a3==c3 and a4==c4 : print("Congratulations! You won the game.") else : if a1==c1 : p1=1 if a2==c2 : p2=1 if a3==c3 : p3=1 if a4==c4 : p4=1 if a1 in code and not a1 ==c1 : v1 = 1 if a2 in code and not a2 ==c2 : v2 = 1 if a3 in code and not a3 ==c3 : v3 = 1 if a4 in code and not a4 ==c4 : v4 = 1 P = p1+p2+p3+p4 V = v1+v2+v3+v4 X = 4-V-P print(' '+'P'+'='+str(P)+','+'V'+'='+str(V)+','+'X'+'='+str(X)) a = input('Turn #4 : ') a1,a2,a3,a4 = a[0],a[1],a[2],a[3] c1,c2,c3,c4 = code[0],code[1],code[2],code[3] if a1==c1 and a2==c2 and a3==c3 and a4==c4 : print("Congratulations! You won the game.") else : if a1==c1 : p1=1 if a2==c2 : p2=1 if a3==c3 : p3=1 if a4==c4 : p4=1 if a1 in code and not a1 ==c1 : v1 = 1 if a2 in code and not a2 ==c2 : v2 = 1 if a3 in code and not a3 ==c3 : v3 = 1 if a4 in code and not a4 ==c4 : v4 = 1 P = p1+p2+p3+p4 V = v1+v2+v3+v4 X = 4-V-P print(' '+'P'+'='+str(P)+','+'V'+'='+str(V)+','+'X'+'='+str(X)) print('Sorry! You just lost it.') print('The answer is' , code) print('Please try again...') |
# 6330226021 (20.00) 84 (2021-02-14 01:14) t1 = input('Turn #1 : ') np1 = 0 nv1 = 0 if t1 == code: print(WINNING_MSG) else: if t1[0] in code : if t1[0] == code[0]: np1 += 1 else: nv1 += 1 if t1[1] in code : if t1[1] == code[1]: np1 += 1 else: nv1 += 1 if t1[2] in code : if t1[2] == code[2]: np1 += 1 else: nv1 += 1 if t1[3] in code : if t1[3] == code[3]: np1 += 1 else: nv1 += 1 nx1 = 4-np1-nv1 print(' P='+str(np1)+',V='+str(nv1)+',X='+str(nx1)) #1 ended--------------------------------------------------- t2 = input('Turn #2 : ') np2 = 0 nv2 = 0 if t2 == code: print(WINNING_MSG) else: if t2[0] in code : if t2[0] == code[0]: np2 += 1 else: nv2 += 1 if t2[1] in code : if t2[1] == code[1]: np2 += 1 else: nv2 += 1 if t2[2] in code : if t2[2] == code[2]: np2 += 1 else: nv2 += 1 if t2[3] in code : if t2[3] == code[3]: np2 += 1 else: nv2 += 1 nx2 = 4-np2-nv2 print(' P='+str(np2)+',V='+str(nv2)+',X='+str(nx2)) #2 ended--------------------------------------------------- t3 = input('Turn #3 : ') np3 = 0 nv3 = 0 if t3 == code: print(WINNING_MSG) else: if t3[0] in code : if t3[0] == code[0]: np3 += 1 else: nv3 += 1 if t3[1] in code : if t3[1] == code[1]: np3 += 1 else: nv3 += 1 if t3[2] in code : if t3[2] == code[2]: np3 += 1 else: nv3 += 1 if t3[3] in code : if t3[3] == code[3]: np3 += 1 else: nv3 += 1 nx3 = 4-np3-nv3 print(' P='+str(np3)+',V='+str(nv3)+',X='+str(nx3)) #3 ended--------------------------------------------------- t4 = input('Turn #4 : ') np4 = 0 nv4 = 0 if t4 == code: print(WINNING_MSG) else: if t4[0] in code : if t4[0] == code[0]: np4 += 1 else: nv4 += 1 if t4[1] in code : if t4[1] == code[1]: np4 += 1 else: nv4 += 1 if t4[2] in code : if t4[2] == code[2]: np4 += 1 else: nv4 += 1 if t4[3] in code : if t4[3] == code[3]: np4 += 1 else: nv4 += 1 nx4 = 4-np4-nv4 print(' P='+str(np4)+',V='+str(nv4)+',X='+str(nx4)) print(LOSING_MSG) print('The answer is '+code) print('Please try again...') #Game ended--------------------------------------------------- |
# 6330227621 (20.00) 85 (2021-02-13 22:47) #.....................TURN#1............................ print ('Turn #1 :',end=" ") z=input() p=0 v=0 x=0 if z[0] not in code: x=x+1 if z[1] not in code: x=x+1 if z[2] not in code: x=x+1 if z[3] not in code: x=x+1 if z[0]==code[0]: p=p+1 if z[1]==code[1]: p=p+1 if z[2]==code[2]: p=p+1 if z[3]==code[3]: p=p+1 #.........................TURN#2................................................ if p!=4: v=4-x-p print(' P='+str(p)+',V='+str(v)+',X='+str(x)) print ('Turn #2 :',end=" ") z=input() p=0 v=0 x=0 if z[0] not in code: x=x+1 if z[1] not in code: x=x+1 if z[2] not in code: x=x+1 if z[3] not in code: x=x+1 if z[0]==code[0]: p=p+1 if z[1]==code[1]: p=p+1 if z[2]==code[2]: p=p+1 if z[3]==code[3]: p=p+1 #.........................TURN#3............................... if p!=4: v=4-x-p print(' P='+str(p)+',V='+str(v)+',X='+str(x)) print ('Turn #3 :',end=" ") z=input() p=0 v=0 x=0 if z[0] not in code: x=x+1 if z[1] not in code: x=x+1 if z[2] not in code: x=x+1 if z[3] not in code: x=x+1 if z[0]==code[0]: p=p+1 if z[1]==code[1]: p=p+1 if z[2]==code[2]: p=p+1 if z[3]==code[3]: p=p+1 #..........................TURN#4............................. if p!=4: v=4-x-p print(' P='+str(p)+',V='+str(v)+',X='+str(x)) print ('Turn #4 :',end=" ") z=input() p=0 v=0 x=0 if z[0] not in code: x=x+1 if z[1] not in code: x=x+1 if z[2] not in code: x=x+1 if z[3] not in code: x=x+1 if z[0]==code[0]: p=p+1 if z[1]==code[1]: p=p+1 if z[2]==code[2]: p=p+1 if z[3]==code[3]: p=p+1 #..........................WIN/LOST............................ if p!=4: v=4-x-p print(' P='+str(p)+',V='+str(v)+',X='+str(x)) print('Sorry! You just lost it.') print('The answer is '+code) print('Please try again...') else: print('Congratulations! You won the game.') else: print('Congratulations! You won the game.') else: print('Congratulations! You won the game.') else: print('Congratulations! You won the game.') |
# 6330228221 (17.37) 86 (2021-02-12 18:48) p,v,x = 0,0,4 mycode1 = input("Turn #1 : ") if mycode1[0] in code: x-=1 if mycode1[1] in code: x-=1 if mycode1[2] in code: x-=1 if mycode1[3] in code: x-=1 if mycode1[0] == code[0]: p+=1 elif mycode1[0] in code: v+=1 if mycode1[1] == code[1]: p+=1 elif mycode1[1] in code: v+=1 if mycode1[2] == code[2]: p+=1 elif mycode1[2] in code: v+=1 if mycode1[3] == code[3]: p+=1 elif mycode1[3] in code: v+=1 if p ==4 and v == 0 and x == 0 : print(WINNING_MSG) else : print(' '+"P="+str(p) + ',' + 'V='+str(v) + ',' + 'X='+str(x)) #++++++++++++++++++++++++++++++end at round1+++++++++++++++++++++++++++++++++++ p,v,x = 0,0,4 mycode2 = input("Turn #2 : ") if mycode2[0] in code: x-=1 if mycode2[1] in code: x-=1 if mycode2[2] in code: x-=1 if mycode2[3] in code: x-=1 if mycode2[0] == code[0]: p+=1 elif mycode2[0] in code: v+=1 if mycode2[1] == code[1]: p+=1 elif mycode2[1] in code: v+=1 if mycode2[2] == code[2]: p+=1 elif mycode2[2] in code: v+=1 if mycode2[3] == code[3]: p+=1 elif mycode2[3] in code: v+=1 if p == 4 and v == 0 and x == 0 : print(WINNING_MSG) else : print(' '+"P="+str(p) + ',' + 'V='+str(v) + ',' + 'X='+str(x)) #++++++++++++++++++++++++++++++end at round2+++++++++++++++++++++++++++++++++++ p,v,x = 0,0,4 mycode3 = input("Turn #3 : ") if mycode3[0] in code: x-=1 if mycode3[1] in code: x-=1 if mycode3[2] in code: x-=1 if mycode3[3] in code: x-=1 if mycode3[0] == code[0]: p+=1 elif mycode3[0] in code: v+=1 if mycode3[1] == code[1]: p+=1 elif mycode3[1] in code: v+=1 if mycode3[2] == code[2]: p+=1 elif mycode3[2] in code: v+=1 if mycode3[3] == code[3]: p+=1 elif mycode3[3] in code: v+=1 if p == 4 and v == 0 and x == 0 : print(WINNING_MSG) else : print(' '+"P="+str(p) + ',' + 'V='+str(v) + ',' + 'X='+str(x)) #++++++++++++++++++++++++++++++end at round3+++++++++++++++++++++++++++++++++++ p,v,x = 0,0,4 mycode3 = input("Turn #3 : ") if mycode3[0] in code: x-=1 if mycode3[1] in code: x-=1 if mycode3[2] in code: x-=1 if mycode3[3] in code: x-=1 if mycode3[0] == code[0]: p+=1 elif mycode3[0] in code: v+=1 if mycode3[1] == code[1]: p+=1 elif mycode3[1] in code: v+=1 if mycode3[2] == code[2]: p+=1 elif mycode3[2] in code: v+=1 if mycode3[3] == code[3]: p+=1 elif mycode3[3] in code: v+=1 if p == 4 and v == 0 and x == 0 : print(WINNING_MSG) else : print(' '+"P="+str(p) + ',' + 'V='+str(v) + ',' + 'X='+str(x)) print(LOSING_MSG) print("The answer is ",code) print("Please try again...") |
# 6330229921 (14.77) 87 (2021-02-14 22:21) a = input('Turn #1 : ') P = 0 V = 0 X = 0 if a[0] == code[0]: P += 1 if a[1] == code[1]: P += 1 if a[2] == code[2]: P += 1 if a[3] == code[3]: P += 1 if a[0] in code and a[0] != code[0]: V += 1 if a[1] in code and a[1] != code[1]: V += 1 if a[2] in code and a[2] != code[2]: V += 1 if a[3] in code and a[3] != code[3]: V += 1 if P == 4: print(WINNING_MSG) else: print(' '+'P='+str(P)+','+'V='+str(V)+','+'X='+str(4-P-V)) a = input('Turn #2 : ') P = 0 V = 0 X = 0 if a[0] == code[0]: P += 1 if a[1] == code[1]: P += 1 if a[2] == code[2]: P += 1 if a[3] == code[3]: P += 1 if a[0] in code and a[0] != code[0]: V += 1 if a[1] in code and a[1] != code[1]: V += 1 if a[2] in code and a[2] != code[2]: V += 1 if a[3] in code and a[3] != code[3]: V += 1 if P == 4: print(WINNING_MSG) else: print(' '+'P='+str(P)+','+'V='+str(V)+','+'X='+str(4-P-V)) a = input('Turn #3 : ') P = 0 V = 0 X = 0 if a[0] == code[0]: P += 1 if a[1] == code[1]: P += 1 if a[2] == code[2]: P += 1 if a[3] == code[3]: P += 1 if a[0] in code and a[0] != code[0]: V += 1 if a[1] in code and a[1] != code[1]: V += 1 if a[2] in code and a[2] != code[2]: V += 1 if a[3] in code and a[3] != code[3]: V += 1 if P == 4: print(WINNING_MSG) else: print(' '+'P='+str(P)+','+'V='+str(V)+','+'X='+str(4-P-V)) a = input('Turn #4 : ') P = 0 V = 0 X = 0 if a[0] == code[0]: P += 1 if a[1] == code[1]: P += 1 if a[2] == code[2]: P += 1 if a[3] == code[3]: P += 1 if a[0] in code and a[0] != code[0]: V += 1 if a[1] in code and a[1] != code[1]: V += 1 if a[2] in code and a[2] != code[2]: V += 1 if a[3] in code and a[3] != code[3]: V += 1 if P == 4: print(WINNING_MSG) else: print(LOSING_MSG) print('The answer is ', code) print('Please try again...') |
# 6330230421 (20.00) 88 (2021-02-11 11:36) P,V,X = 0,0,0 guess_code = input('Turn '+'#1'+' : ') text_guess = 'Turn '+'#1'+' : ' if guess_code[0] == code[0]: P += 1 if guess_code[1] == code[1]: P += 1 if guess_code[2] == code[2]: P += 1 if guess_code[3] == code[3]: P += 1 if guess_code[0] in code[1:]: V += 1 if guess_code[1] in code[0]+code[2:]: V += 1 if guess_code[2] in code[:2]+code[3]: V += 1 if guess_code[3] in code[:3]: V += 1 if not guess_code[0] in code: X += 1 if not guess_code[1] in code: X += 1 if not guess_code[2] in code: X += 1 if not guess_code[3] in code: X += 1 if guess_code == code: print(WINNING_MSG) else : print((" "*len(text_guess))+"P="+str(P)+','+"V="+str(V)+','+"X="+str(X)) P,V,X = 0,0,0 guess_code = input('Turn '+'#2'+' : ') if guess_code[0] == code[0]: P += 1 if guess_code[1] == code[1]: P += 1 if guess_code[2] == code[2]: P += 1 if guess_code[3] == code[3]: P += 1 if guess_code[0] in code[1:]: V += 1 if guess_code[1] in code[0]+code[2:]: V += 1 if guess_code[2] in code[:2]+code[3]: V += 1 if guess_code[3] in code[:3]: V += 1 if not guess_code[0] in code: X += 1 if not guess_code[1] in code: X += 1 if not guess_code[2] in code: X += 1 if not guess_code[3] in code: X += 1 if guess_code == code: print(WINNING_MSG) else : print((" "*len(text_guess))+"P="+str(P)+','+"V="+str(V)+','+"X="+str(X)) P,V,X = 0,0,0 guess_code = input('Turn '+'#3'+' : ') if guess_code[0] == code[0]: P += 1 if guess_code[1] == code[1]: P += 1 if guess_code[2] == code[2]: P += 1 if guess_code[3] == code[3]: P += 1 if guess_code[0] in code[1:]: V += 1 if guess_code[1] in code[0]+code[2:]: V += 1 if guess_code[2] in code[:2]+code[3]: V += 1 if guess_code[3] in code[:3]: V += 1 if not guess_code[0] in code: X += 1 if not guess_code[1] in code: X += 1 if not guess_code[2] in code: X += 1 if not guess_code[3] in code: X += 1 if guess_code == code: print(WINNING_MSG) else : print((" "*len(text_guess))+"P="+str(P)+','+"V="+str(V)+','+"X="+str(X)) P,V,X = 0,0,0 guess_code = input('Turn '+'#4'+' : ') if guess_code[0] == code[0]: P += 1 if guess_code[1] == code[1]: P += 1 if guess_code[2] == code[2]: P += 1 if guess_code[3] == code[3]: P += 1 if guess_code[0] in code[1:]: V += 1 if guess_code[1] in code[0]+code[2:]: V += 1 if guess_code[2] in code[:2]+code[3]: V += 1 if guess_code[3] in code[:3]: V += 1 if not guess_code[0] in code: X += 1 if not guess_code[1] in code: X += 1 if not guess_code[2] in code: X += 1 if not guess_code[3] in code: X += 1 if guess_code == code: print(WINNING_MSG) else : print((" "*len(text_guess))+"P="+str(P)+','+"V="+str(V)+','+"X="+str(X)) print(LOSING_MSG) print("The answer is "+code) print("Please try again...") |
# 6330232721 (20.00) 89 (2021-02-13 01:49) a=input('Turn #1 : ') P,V,X=0,0,0 if a[0]==code[0]: P+=1 if a[1]==code[1]: P+=1 if a[2]==code[2]: P+=1 if a[3]==code[3]: P+=1 if P==4: print(WINNING_MSG) exit() if a[0] in code: V+=1 if a[1] in code: V+=1 if a[2] in code: V+=1 if a[3] in code: V+=1 V=V-P X=4-(P+V) print(' '*10+'P='+str(P)+',V='+str(V)+',X='+str(X)) a=input('Turn #2 : ') P,V,X=0,0,0 if a[0]==code[0]: P+=1 if a[1]==code[1]: P+=1 if a[2]==code[2]: P+=1 if a[3]==code[3]: P+=1 if P==4: print(WINNING_MSG) exit() if a[0] in code: V+=1 if a[1] in code: V+=1 if a[2] in code: V+=1 if a[3] in code: V+=1 V=V-P X=4-(P+V) print(' '*10+'P='+str(P)+',V='+str(V)+',X='+str(X)) a=input('Turn #3 : ') P,V,X=0,0,0 if a[0]==code[0]: P+=1 if a[1]==code[1]: P+=1 if a[2]==code[2]: P+=1 if a[3]==code[3]: P+=1 if P==4: print(WINNING_MSG) exit() if a[0] in code: V+=1 if a[1] in code: V+=1 if a[2] in code: V+=1 if a[3] in code: V+=1 V=V-P X=4-(P+V) print(' '*10+'P='+str(P)+',V='+str(V)+',X='+str(X)) a=input('Turn #4 : ') P,V,X=0,0,0 if a[0]==code[0]: P+=1 if a[1]==code[1]: P+=1 if a[2]==code[2]: P+=1 if a[3]==code[3]: P+=1 if P==4: print(WINNING_MSG) exit() if a[0] in code: V+=1 if a[1] in code: V+=1 if a[2] in code: V+=1 if a[3] in code: V+=1 V=V-P X=4-(P+V) print(' '*10+'P='+str(P)+',V='+str(V)+',X='+str(X)) if P!=4: print(LOSING_MSG) print('The answer is '+code) print('Please try again...') |
# 6330233321 (20.00) 90 (2021-02-13 23:22) I = input("Turn #1 : ",) if I == code: print(WINNING_MSG) else: p = 0 if I[0] == code[0]: p += 1 if I[1] == code[1]: p += 1 if I[2] == code[2]: p += 1 if I[3] == code[3]: p += 1 v = 0 if I[0] in code: v += 1 if I[1] in code: v += 1 if I[2] in code: v += 1 if I[3] in code: v += 1 v -= p x = 4-p-v print(" P="+str(p)+",V="+str(v)+",X="+str(x)) I = input("Turn #2 : ",) if I == code: print(WINNING_MSG) else: p = 0 if I[0] == code[0]: p += 1 if I[1] == code[1]: p += 1 if I[2] == code[2]: p += 1 if I[3] == code[3]: p += 1 v = 0 if I[0] in code: v += 1 if I[1] in code: v += 1 if I[2] in code: v += 1 if I[3] in code: v += 1 v -= p x = 4-p-v print(" P="+str(p)+",V="+str(v)+",X="+str(x)) I = input("Turn #3 : ",) if I == code: print(WINNING_MSG) else: p = 0 if I[0] == code[0]: p += 1 if I[1] == code[1]: p += 1 if I[2] == code[2]: p += 1 if I[3] == code[3]: p += 1 v = 0 if I[0] in code: v += 1 if I[1] in code: v += 1 if I[2] in code: v += 1 if I[3] in code: v += 1 v -= p x = 4-p-v print(" P="+str(p)+",V="+str(v)+",X="+str(x)) I = input("Turn #4 : ",) if I == code: print(WINNING_MSG) else: p = 0 if I[0] == code[0]: p += 1 if I[1] == code[1]: p += 1 if I[2] == code[2]: p += 1 if I[3] == code[3]: p += 1 v = 0 if I[0] in code: v += 1 if I[1] in code: v += 1 if I[2] in code: v += 1 if I[3] in code: v += 1 v -= p x = 4-p-v print(" P="+str(p)+",V="+str(v)+",X="+str(x)) print(LOSING_MSG) print("The answer is",code) print("Please try again...") |
# 6330234021 (17.23) 91 (2021-02-13 16:54) x = input() if x == code : print(WINNING_MSG) else: P = V = X = 0 if x[0] == code[0] : P += 1 else : P += 0 if x[1] == code[1] : P += 1 else : P += 0 if x[2] == code[2] : P += 1 else : P += 0 if x[3] == code[3] : P += 1 else : P += 0 if x[0] in code and x[0] != code[0] : V += 1 else : V += 0 if x[1] in code and x[1] != code[1] : V += 1 else : V += 0 if x[2] in code and x[2] != code[2] : V += 1 else : V += 0 if x[3] in code and x[3] != code[3] : V += 1 else : V += 0 if x[0] not in code : X += 1 else : X += 0 if x[1] not in code : X += 1 else : X += 0 if x[2] not in code : X += 1 else : X += 0 if x[3] not in code : X += 1 else : X += 0 print("Turn #1 :",x) print(" P="+str(P)+",V="+str(V)+",X="+str(X)) #----------------------------------------------------------- y = input() if y == code : print(WINNING_MSG) else: P = V = X = 0 if y[0] == code[0] : P += 1 else : P += 0 if y[1] == code[1] : P += 1 else : P += 0 if y[2] == code[2] : P += 1 else : P += 0 if y[3] == code[3] : P += 1 else : P += 0 if y[0] in code and y[0] != code[0] : V += 1 else : V += 0 if y[1] in code and y[1] != code[1] : V += 1 else : V += 0 if y[2] in code and y[2] != code[2] : V += 1 else : V += 0 if y[3] in code and y[3] != code[3] : V += 1 else : V += 0 if y[0] not in code : X += 1 else : X += 0 if y[1] not in code : X += 1 else : X += 0 if y[2] not in code : X += 1 else : X += 0 if y[3] not in code : X += 1 else : X += 0 print("Turn #2 :",y) print(" P="+str(P)+",V="+str(V)+",X="+str(X)) #----------------------------------------------------------- m = input() if m == code : print(WINNING_MSG) else: P = V = X = 0 if m[0] == code[0] : P += 1 else : P += 0 if m[1] == code[1] : P += 1 else : P += 0 if m[2] == code[2] : P += 1 else : P += 0 if m[3] == code[3] : P += 1 else : P += 0 if m[0] in code and m[0] != code[0] : V += 1 else : V += 0 if m[1] in code and m[1] != code[1] : V += 1 else : V += 0 if m[2] in code and m[2] != code[2] : V += 1 else : V += 0 if m[3] in code and m[3] != code[3] : V += 1 else : V += 0 if m[0] not in code : X += 1 else : X += 0 if m[1] not in code : X += 1 else : X += 0 if m[2] not in code : X += 1 else : X += 0 if m[3] not in code : X += 1 else : X += 0 print("Turn #3 :",m) print(" P="+str(P)+",V="+str(V)+",X="+str(X)) #--------------------------------------------------------------- n = input() if n == code : print(WINNING_MSG) else: P = V = X = 0 if n[0] == code[0] : P += 1 else : P += 0 if n[1] == code[1] : P += 1 else : P += 0 if n[2] == code[2] : P += 1 else : P += 0 if n[3] == code[3] : P += 1 else : P += 0 if n[0] in code and n[0] != code[0] : V += 1 else : V += 0 if n[1] in code and n[1] != code[1] : V += 1 else : V += 0 if n[2] in code and n[2] != code[2] : V += 1 else : V += 0 if n[3] in code and n[3] != code[3] : V += 1 else : V += 0 if n[0] not in code : X += 1 else : X += 0 if n[1] not in code : X += 1 else : X += 0 if n[2] not in code : X += 1 else : X += 0 if n[3] not in code : X += 1 else : X += 0 print("Turn #4 :",n) print(" P="+str(P)+",V="+str(V)+",X="+str(X)) print(LOSING_MSG) print('The answer is ',code) print('Please try again...') |
# 6330235621 (20.00) 92 (2021-02-15 18:07) a = input("Turn #1 : ") P = 0 if a[0]==code[0] : P+=1 if a[1]==code[1] : P+=1 if a[2]==code[2] : P+=1 if a[3]==code[3] : P+=1 X = 0 if a[0] not in code : X+=1 if a[1] not in code : X+=1 if a[2] not in code : X+=1 if a[3] not in code : X+=1 V = 4-P-X if P==4 : print(WINNING_MSG) else : print(" P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) a = input("Turn #2 : ") P = 0 if a[0]==code[0] : P+=1 if a[1]==code[1] : P+=1 if a[2]==code[2] : P+=1 if a[3]==code[3] : P+=1 X = 0 if a[0] not in code : X+=1 if a[1] not in code : X+=1 if a[2] not in code : X+=1 if a[3] not in code : X+=1 V = 4-P-X if P==4 : print(WINNING_MSG) else : print(" P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) a = input("Turn #3 : ") P = 0 if a[0]==code[0] : P+=1 if a[1]==code[1] : P+=1 if a[2]==code[2] : P+=1 if a[3]==code[3] : P+=1 X = 0 if a[0] not in code : X+=1 if a[1] not in code : X+=1 if a[2] not in code : X+=1 if a[3] not in code : X+=1 V = 4-P-X if P==4 : print(WINNING_MSG) else : print(" P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) a = input("Turn #4 : ") P = 0 if a[0]==code[0] : P+=1 if a[1]==code[1] : P+=1 if a[2]==code[2] : P+=1 if a[3]==code[3] : P+=1 X = 0 if a[0] not in code : X+=1 if a[1] not in code : X+=1 if a[2] not in code : X+=1 if a[3] not in code : X+=1 V = 4-P-X if P==4 : print(WINNING_MSG) else : print(" P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) print(LOSING_MSG) print("The answer is"+" "+code) print("Please try again...") |
# 6330236221 (20.00) 93 (2021-02-12 18:29) t = input("Turn #1 :"" " ) X = 0 P = 0 V = 0 k = 0 if t[0] in code : if t[0] == code[0] : P+=1 if t[0] == code[1]: V+=1 if t[0] == code[2]: V+=1 if t[0] == code[3]: V+=1 else : X += 1 if t[1] in code : if t[1] == code[0] : V+=1 if t[1] == code[1]: P+=1 if t[1] == code[2]: V+=1 if t[1] == code[3]: V+=1 else: X += 1 if t[2] in code : if t[2] == code[0] : V+=1 if t[2] == code[1]: V+=1 if t[2] == code[2]: P+=1 if t[2] == code[3]: V+=1 else: X += 1 if t[3] in code : if t[3] == code[0] : V+=1 if t[3] == code[1]: V+=1 if t[3] == code[2]: V+=1 if t[3] == code[3]: P+=1 else: X += 1 k += 1 if P==4 and V==0 and X == 0 : print(WINNING_MSG) k +=4 else: print(" " *10+"P" + "=" + str(P) + "," +"V"+"="+str(V)+","+"X"+"="+str(X)) if k <= 4 : t =input("Turn #2 :"" " ) X = 0 P = 0 V = 0 if t[0] in code : if t[0] == code[0] : P+=1 if t[0] == code[1]: V+=1 if t[0] == code[2]: V+=1 if t[0] == code[3]: V+=1 else : X += 1 if t[1] in code : if t[1] == code[0] : V+=1 if t[1] == code[1]: P+=1 if t[1] == code[2]: V+=1 if t[1] == code[3]: V+=1 else: X += 1 if t[2] in code : if t[2] == code[0] : V+=1 if t[2] == code[1]: V+=1 if t[2] == code[2]: P+=1 if t[2] == code[3]: V+=1 else: X += 1 if t[3] in code : if t[3] == code[0] : V+=1 if t[3] == code[1]: V+=1 if t[3] == code[2]: V+=1 if t[3] == code[3]: P+=1 else: X += 1 k += 1 if P==4 and V==0 and X == 0 : print(WINNING_MSG) k+=4 else: print(" " *10+"P" + "=" + str(P) + "," +"V"+"="+str(V)+","+"X"+"="+str(X)) if k <= 4 : t = input("Turn #3 :"" " ) X = 0 P = 0 V = 0 if t[0] in code : if t[0] == code[0] : P+=1 if t[0] == code[1]: V+=1 if t[0] == code[2]: V+=1 if t[0] == code[3]: V+=1 else : X += 1 if t[1] in code : if t[1] == code[0] : V+=1 if t[1] == code[1]: P+=1 if t[1] == code[2]: V+=1 if t[1] == code[3]: V+=1 else: X += 1 if t[2] in code : if t[2] == code[0] : V+=1 if t[2] == code[1]: V+=1 if t[2] == code[2]: P+=1 if t[2] == code[3]: V+=1 else: X += 1 if t[3] in code : if t[3] == code[0] : V+=1 if t[3] == code[1]: V+=1 if t[3] == code[2]: V+=1 if t[3] == code[3]: P+=1 else: X += 1 k += 1 if P==4 and V==0 and X == 0 : print(WINNING_MSG) k +=4 else: print(" " *10+"P" + "=" + str(P) + "," +"V"+"="+str(V)+","+"X"+"="+str(X)) if k <= 4 : t = input("Turn #4 :"" " ) X = 0 P = 0 V = 0 if t[0] in code : if t[0] == code[0] : P+=1 if t[0] == code[1]: V+=1 if t[0] == code[2]: V+=1 if t[0] == code[3]: V+=1 else : X += 1 if t[1] in code : if t[1] == code[0] : V+=1 if t[1] == code[1]: P+=1 if t[1] == code[2]: V+=1 if t[1] == code[3]: V+=1 else: X += 1 if t[2] in code : if t[2] == code[0] : V+=1 if t[2] == code[1]: V+=1 if t[2] == code[2]: P+=1 if t[2] == code[3]: V+=1 else: X += 1 if t[3] in code : if t[3] == code[0] : V+=1 if t[3] == code[1]: V+=1 if t[3] == code[2]: V+=1 if t[3] == code[3]: P+=1 else: X += 1 k += 1 if P==4 and V==0 and X == 0 : print(WINNING_MSG) else: print(" " *10+"P" + "=" + str(P) + "," +"V"+"="+str(V)+","+"X"+"="+str(X)) print(LOSING_MSG) print("The answer is", str(code)) print("Please try again...") |
# 6330238521 (20.00) 94 (2021-02-14 23:28) def split(word) : return list(word) one = ("Turn #1 : " + str()) Turn1 = input(one) Turn1 = split(Turn1) code = split(code) p = 0 v = 0 x = 0 if Turn1[0] == code[0] : p += 1 elif Turn1[0] in code: v += 1 else : x = x+1 if Turn1[1] == code[1] : p += 1 elif Turn1[1] in code: v += 1 else : x = x+1 if Turn1[2] == code[2] : p += 1 elif Turn1[2] in code: v += 1 else : x = x+1 if Turn1[3] == code[3] : p += 1 elif Turn1[3] in code: v += 1 else : x = x+1 if p == 4: print(WINNING_MSG) else: print(" P="+str(p)+",V="+str(v)+",X="+str(x)) two = ("Turn #2 : " + str()) Turn2 = input(two) Turn2 = split(Turn2) code = split(code) p = 0 v = 0 x = 0 if Turn2[0] == code[0] : p += 1 elif Turn2[0] in code: v += 1 else : x = x+1 if Turn2[1] == code[1] : p += 1 elif Turn2[1] in code: v += 1 else : x = x+1 if Turn2[2] == code[2] : p += 1 elif Turn2[2] in code: v += 1 else : x = x+1 if Turn2[3] == code[3] : p += 1 elif Turn2[3] in code: v += 1 else : x = x+1 if p == 4: print(WINNING_MSG) else: print(" P="+str(p)+",V="+str(v)+",X="+str(x)) three = ("Turn #3 : " + str()) Turn3 = input(three) Turn3 = split(Turn3) code = split(code) p = 0 v = 0 x = 0 if Turn3[0] == code[0] : p += 1 elif Turn3[0] in code: v += 1 else : x = x+1 if Turn3[1] == code[1] : p += 1 elif Turn3[1] in code: v += 1 else : x = x+1 if Turn3[2] == code[2] : p += 1 elif Turn3[2] in code: v += 1 else : x = x+1 if Turn3[3] == code[3] : p += 1 elif Turn3[3] in code: v += 1 else : x = x+1 if p == 4: print(WINNING_MSG) else: print(" P="+str(p)+",V="+str(v)+",X="+str(x)) four = ("Turn #4 : " + str()) Turn4 = input(four) Turn4 = split(Turn4) code = split(code) p = 0 v = 0 x = 0 if Turn4[0] == code[0] : p += 1 elif Turn4[0] in code: v += 1 else : x = x+1 if Turn4[1] == code[1] : p += 1 elif Turn4[1] in code: v += 1 else : x = x+1 if Turn4[2] == code[2] : p += 1 elif Turn4[2] in code: v += 1 else : x = x+1 if Turn4[3] == code[3] : p += 1 elif Turn4[3] in code: v += 1 else : x = x+1 if p == 4: print(WINNING_MSG) else: print(" P="+str(p)+",V="+str(v)+",X="+str(x)) print(LOSING_MSG) x = ''.join(code) print("The answer is ",x) print("Please try again...") |
# 6330239121 (16.23) 95 (2021-02-12 22:01) x = input("Turn #1 : ") P = 0 V = 0 X = 0 if x[::] == code : print (WINNING_MSG) else: if x[0] == code[0]: P += 1 else: if x[0] == code[1] or x[0] == code[2] or x[0] == code[3]: V += 1 else: X += 1 if x[1] == code[1]: P += 1 else: if x[1] == code[0] or x[1] == code[1] or x[1] == code[2]: V +=1 else: X += 1 if x[2] == code[2]: P += 1 else: if x[2] == code[0] or x[2] == code[1] or x[2] == code[3]: V +=1 else: X += 1 if x[3] == code[3]: P += 1 else: if x[3] == code[0] or x[3] == code[1] or x[3] == code[2]: V +=1 else: X += 1 print (" " + "P=" + str(P) + "," + "V=" + str(V) + "," + "X=" + str(X)) x = input("Turn #2 : ") P = 0 V = 0 X = 0 if x[::] == code : print (WINNING_MSG) else: if x[0] == code[0]: P += 1 else: if x[0] == code[1] or x[0] == code[2] or x[0] == code[3]: V += 1 else: X += 1 if x[1] == code[1]: P += 1 else: if x[1] == code[0] or x[1] == code[1] or x[1] == code[2]: V +=1 else: X += 1 if x[2] == code[2]: P += 1 else: if x[2] == code[0] or x[2] == code[1] or x[2] == code[3]: V +=1 else: X += 1 if x[3] == code[3]: P += 1 else: if x[3] == code[0] or x[3] == code[1] or x[3] == code[2]: V +=1 else: X += 1 print (" " + "P=" + str(P) + "," + "V=" + str(V) + "," + "X=" + str(X)) x = input("Turn #3 : ") P = 0 V = 0 X = 0 if x[::] == code : print (WINNING_MSG) else: if x[0] == code[0]: P += 1 else: if x[0] == code[1] or x[0] == code[2] or x[0] == code[3]: V += 1 else: X += 1 if x[1] == code[1]: P += 1 else: if x[1] == code[0] or x[1] == code[1] or x[1] == code[2]: V +=1 else: X += 1 if x[2] == code[2]: P += 1 else: if x[2] == code[0] or x[2] == code[1] or x[2] == code[3]: V +=1 else: X += 1 if x[3] == code[3]: P += 1 else: if x[3] == code[0] or x[3] == code[1] or x[3] == code[2]: V +=1 else: X += 1 print (" " + "P=" + str(P) + "," + "V=" + str(V) + "," + "X=" + str(X)) x = input("Turn #4 : ") if x[::] == code : print (WINNING_MSG) else: print (LOSING_MSG) print ("The answer is " + code) print ("Please try again...") |
# 6330240721 (18.61) 96 (2021-02-12 12:50) V = 0 P = 0 X = 0 a = input('Turn #1 : ') if code[0] == a[0]: P += 1 if code[1] == a[1]: P += 1 if code[2] == a[2]: P += 1 if code[3] == a[3]: P += 1 if a[0] in code and code[0] != a[0]: V +=1 if a[1] in code and code[1] != a[1]: V +=1 if a[2] in code and code[2] != a[2]: V +=1 if a[3] in code and code[3] != a[3]: V +=1 if a[0] not in code : X +=1 if a[1] not in code : X +=1 if a[2] not in code : X +=1 if a[3] not in code : X +=1 if P!=4 : print(' ' * len('Turn #1 : ') + 'P' + '=' + str(P), 'V' + '=' + str(V), 'X' + '=' + str(X)) V = 0 P = 0 X = 0 a = input('Turn #2 : ') if code[0] == a[0]: P += 1 if code[1] == a[1]: P += 1 if code[2] == a[2]: P += 1 if code[3] == a[3]: P += 1 if a[0] in code and code[0] != a[0]: V += 1 if a[1] in code and code[1] != a[1]: V += 1 if a[2] in code and code[2] != a[2]: V += 1 if a[3] in code and code[3] != a[3]: V += 1 if a[0] not in code: X += 1 if a[1] not in code: X += 1 if a[2] not in code: X += 1 if a[3] not in code: X += 1 if P!= 4: print(' ' * len('Turn #2 : ') + 'P' + '=' + str(P), 'V' + '=' + str(V), 'X' + '=' + str(X)) V = 0 P = 0 X = 0 a = input('Turn #3 : ') if code[0] == a[0]: P += 1 if code[1] == a[1]: P += 1 if code[2] == a[2]: P += 1 if code[3] == a[3]: P += 1 if a[0] in code and code[0] != a[0]: V += 1 if a[1] in code and code[1] != a[1]: V += 1 if a[2] in code and code[2] != a[2]: V += 1 if a[3] in code and code[3] != a[3]: V += 1 if a[0] not in code: X += 1 if a[1] not in code: X += 1 if a[2] not in code: X += 1 if a[3] not in code: X += 1 if P!= 4: print(' ' * len('Turn #3 : ') + 'P' + '=' + str(P), 'V' + '=' + str(V), 'X' + '=' + str(X)) V = 0 P = 0 X = 0 a = input('Turn #4 : ') if code[0] == a[0]: P += 1 if code[1] == a[1]: P += 1 if code[2] == a[2]: P += 1 if code[3] == a[3]: P += 1 if a[0] in code and code[0] != a[0]: V += 1 if a[1] in code and code[1] != a[1]: V += 1 if a[2] in code and code[2] != a[2]: V += 1 if a[3] in code and code[3] != a[3]: V += 1 if a[0] not in code: X += 1 if a[1] not in code: X += 1 if a[2] not in code: X += 1 if a[3] not in code: X += 1 if P == 4 : print(WINNING_MSG) if P != 4 : print(' ' * len('Turn #4 : ') + 'P' + '=' + str(P), 'V' + '=' + str(V), 'X' + '=' + str(X)) print(LOSING_MSG) print('The answer is'+' '+code) print('Please try again...') |
# 6330241321 (20.00) 97 (2021-02-14 04:03) print(code) x = input("Turn #1 : ") P1 = 0 V1 = 0 X1 = 0 if x[0] == code[0] : P1 += 1 if x[1] == code[1] : P1 += 1 if x[2] == code[2] : P1 += 1 if x[3] == code[3] : P1 += 1 if (x[0] in code) and (x[0] != code[0]) : V1 += 1 if (x[1] in code) and (x[1] != code[1]) : V1 += 1 if (x[2] in code) and (x[2] != code[2]) : V1 += 1 if (x[3] in code) and (x[3] != code[3]) : V1 += 1 if x[0] not in code : X1 +=1 if x[1] not in code : X1 +=1 if x[2] not in code : X1 +=1 if x[3] not in code : X1 +=1 if P1 == 4 : print(WINNING_MSG) else : print(" "*10+"P="+str(P1)+","+"V="+str(V1)+","+"X="+str(X1)) x = input("Turn #2 : ") P1 = 0 V1 = 0 X1 = 0 if x[0] == code[0] : P1 += 1 if x[1] == code[1] : P1 += 1 if x[2] == code[2] : P1 += 1 if x[3] == code[3] : P1 += 1 if (x[0] in code) and (x[0] != code[0]) : V1 += 1 if (x[1] in code) and (x[1] != code[1]) : V1 += 1 if (x[2] in code) and (x[2] != code[2]) : V1 += 1 if (x[3] in code) and (x[3] != code[3]) : V1 += 1 if x[0] not in code : X1 +=1 if x[1] not in code : X1 +=1 if x[2] not in code : X1 +=1 if x[3] not in code : X1 +=1 if P1 == 4 : print(WINNING_MSG) else : print(" "*10+"P="+str(P1)+","+"V="+str(V1)+","+"X="+str(X1)) x = input("Turn #3 : ") P1 = 0 V1 = 0 X1 = 0 if x[0] == code[0] : P1 += 1 if x[1] == code[1] : P1 += 1 if x[2] == code[2] : P1 += 1 if x[3] == code[3] : P1 += 1 if (x[0] in code) and (x[0] != code[0]) : V1 += 1 if (x[1] in code) and (x[1] != code[1]) : V1 += 1 if (x[2] in code) and (x[2] != code[2]) : V1 += 1 if (x[3] in code) and (x[3] != code[3]) : V1 += 1 if x[0] not in code : X1 +=1 if x[1] not in code : X1 +=1 if x[2] not in code : X1 +=1 if x[3] not in code : X1 +=1 if P1 == 4 : print(WINNING_MSG) else : print(" "*10+"P="+str(P1)+","+"V="+str(V1)+","+"X="+str(X1)) x = input("Turn #4 : ") P1 = 0 V1 = 0 X1 = 0 if x[0] == code[0] : P1 += 1 if x[1] == code[1] : P1 += 1 if x[2] == code[2] : P1 += 1 if x[3] == code[3] : P1 += 1 if (x[0] in code) and (x[0] != code[0]) : V1 += 1 if (x[1] in code) and (x[1] != code[1]) : V1 += 1 if (x[2] in code) and (x[2] != code[2]) : V1 += 1 if (x[3] in code) and (x[3] != code[3]) : V1 += 1 if x[0] not in code : X1 +=1 if x[1] not in code : X1 +=1 if x[2] not in code : X1 +=1 if x[3] not in code : X1 +=1 if P1 == 4 : print(WINNING_MSG) else : print(" "*10+"P="+str(P1)+","+"V="+str(V1)+","+"X="+str(X1)) print(LOSING_MSG) print("The answer is "+code) print("Please try again...") |
# 6330242021 (20.00) 98 (2021-02-14 01:37) print('Turn #1 :',end=' ') guess=input() a=0; b=0; c=0 if guess[0]==code[0]: a+=1 if guess[1]==code[1]: a+=1 if guess[2]==code[2]: a+=1 if guess[3]==code[3]: a+=1 if guess[0] not in code: c+=1 if guess[1] not in code: c+=1 if guess[2] not in code: c+=1 if guess[3] not in code: c+=1 if a!=4: b=4-(a+c) print(' P='+str(a)+',V='+str(b)+',X='+str(c)) print('Turn #2 :',end=' ') guess=input() a=0; b=0; c=0 if guess[0]==code[0]: a+=1 if guess[1]==code[1]: a+=1 if guess[2]==code[2]: a+=1 if guess[3]==code[3]: a+=1 if guess[0] not in code: c+=1 if guess[1] not in code: c+=1 if guess[2] not in code: c+=1 if guess[3] not in code: c+=1 if a!=4: b=4-(a+c) print(' P='+str(a)+',V='+str(b)+',X='+str(c)) print('Turn #3 :',end=' ') guess=input() a=0; b=0; c=0 if guess[0]==code[0]: a+=1 if guess[1]==code[1]: a+=1 if guess[2]==code[2]: a+=1 if guess[3]==code[3]: a+=1 if guess[0] not in code: c+=1 if guess[1] not in code: c+=1 if guess[2] not in code: c+=1 if guess[3] not in code: c+=1 if a!=4: b=4-(a+c) print(' P='+str(a)+',V='+str(b)+',X='+str(c)) print('Turn #4 :',end=' ') guess=input() a=0; b=0; c=0 if guess[0]==code[0]: a+=1 if guess[1]==code[1]: a+=1 if guess[2]==code[2]: a+=1 if guess[3]==code[3]: a+=1 if guess[0] not in code: c+=1 if guess[1] not in code: c+=1 if guess[2] not in code: c+=1 if guess[3] not in code: c+=1 if a!=4: b=4-(a+c) print(' P='+str(a)+',V='+str(b)+',X='+str(c)) print(LOSING_MSG) print('The answer is '+code) print('Please try again...') else: print(WINNING_MSG) else: print(WINNING_MSG) else: print(WINNING_MSG) else: print(WINNING_MSG) |
# 6330243621 (19.20) 99 (2021-02-13 16:08) t = input('Turn #1 : ') if t == code : print(WINNING_MSG) elif t[0] in code or t[1] in code or t[2] in code or t[3] in code : if t[0] == code[0] : if t[1] == code[1] : if t[2] == code[2] : print(' '*10+'P=3,V=0,X=1') elif t[3] == code[3] : print(' '*10+'P=3,V=0,X=1') elif t[2] in code and t[3] in code : print(' '*10+'P=2,V=2,X=0') elif t[2] in code or t[3] in code : print(' '*10+'P=2,V=1,X=1') else : print(' '*10+'P=2,V=0,X=2') elif t[2] == code[2] : if t[3] == code[3] : print(' '*10+'P=3,V=0,X=1') elif t[1] in code and t[3] in code : print(' '*10+'P=2,V=2,X=0') elif t[1] in code or t[3] in code : print(' '*10+'P=2,V=1,X=1') else : print(' '*10+'P=2,V=0,X=2') elif t[3] == code[3] : if t[1] in code and t[2] in code : print(' '*10+'P=2,V=2,X=0') elif t[1] in code or t[2] in code : print(' '*10+'P=2,V=1,X=1') else : print(' '*10+'P=2,V=0,X=2') elif t[2] in code and t[1] in code and t[3] in code : print(' '*10+'P=1,V=3,X=0') elif t[1] in code and t[2] in code : print(' '*10+'P=1,V=2,X=1') elif t[3] in code and t[2] in code : print(' '*10+'P=1,V=2,X=1') elif t[1] in code and t[3] in code : print(' '*10+'P=1,V=2,X=1') elif t[1] in code : print(' '*10+'P=1,V=1,X=2') elif t[2] in code : print(' '*10+'P=1,V=1,X=2') elif t[3] in code : print(' '*10+'P=1,V=1,X=2') elif t[1] == code[1] : if t[2] == code[2] : if t[3] == code[3] : print(' '*10+'P=3,V=0,X=1') elif t[0] in code and t[3] in code : print(' '*10+'P=2,V=2,X=0') elif t[0] in code or t[3] in code : print(' '*10+'P=2,V=1,X=1') elif t[3] == code[3] : if t[0] in code and t[2] in code : print(' '*10+'P=2,V=2,X=0') elif t[0] in code or t[2] in code : print(' '*10+'P=2,V=1,X=1') elif t[2] in code and t[0] in code and t[3] in code : print(' '*10+'P=1,V=3,X=0') elif t[2] in code and t[3] in code : print(' '*10+'P=1,V=2,X=1') elif t[1] in code and t[3] in code : print(' '*10+'P=1,V=2,X=1') elif t[0] in code and t[3] in code : print(' '*10+'P=1,V=2,X=1') elif t[0] in code : print(' '*10+'P=1,V=1,X=2') elif t[2] in code : print(' '*10+'P=1,V=1,X=2') elif t[3] in code : print(' '*10+'P=1,V=1,X=2') elif t[2] == code[2] : if t[3] == code[3] : if t[0] in code and t[1] in code : print(' '*10+'P=2,V=2,X=0') elif t[0] in code or t[1] in code : print(' '*10+'P=2,V=1,X=1') else : print(' '*10+'P=2,V=0,X=2') elif t[0] in code and t[1] in code and t[3] in code : print(' '*10+'P=1,V=3,X=0') elif t[0] in code and t[3] in code : print(' '*10+'P=1,V=2,X=1') elif t[1] in code and t[3] in code : print(' '*10+'P=1,V=2,X=1') elif t[0] in code and t[1] in code : print(' '*10+'P=1,V=2,X=1') elif t[0] in code : print(' '*10+'P=1,V=1,X=2') elif t[1] in code : print(' '*10+'P=1,V=1,X=2') elif t[3] in code : print(' '*10+'P=1,V=1,X=2') elif t[3] == code[3] : if t[0] in code and t[1] in code and t[2] in code : print(' '*10+'P=1,V=3,X=0') elif t[0] in code and t[1] in code : print(' '*10+'P=1,V=2,X=1') elif t[1] in code and t[2] in code : print(' '*10+'P=1,V=2,X=1') elif t[0] in code and t[2] in code : print(' '*10+'P=1,V=2,X=1') elif t[0] in code : print(' '*10+'P=1,V=1,X=2') elif t[2] in code : print(' '*10+'P=1,V=1,X=2') elif t[1] in code : print(' '*10+'P=1,V=1,X=2') elif t[0] in code and t[1] in code and t[2] in code and t[3] in code : print(' '*10+'P=0,V=4,X=0') elif t[0] in code and t[1] in code and t[2] in code : print(' '*10+'P=0,V=3,X=1') elif t[0] in code and t[1] in code and t[3] in code : print(' '*10+'P=0,V=3,X=1') elif t[3] in code and t[1] in code and t[2] in code : print(' '*10+'P=0,V=3,X=1') elif t[3] in code and t[0] in code and t[2] in code : print(' '*10+'P=0,V=3,X=1') elif t[0] in code and t[1] in code : print(' '*10+'P=0,V=2,X=2') elif t[0] in code and t[2] in code : print(' '*10+'P=0,V=2,X=2') elif t[0] in code and t[3] in code : print(' '*10+'P=0,V=2,X=2') elif t[1] in code and t[2] in code : print(' '*10+'P=0,V=2,X=2') elif t[1] in code and t[3] in code : print(' '*10+'P=0,V=2,X=2') elif t[2] in code and t[3] in code : print(' '*10+'P=0,V=2,X=2') t = input('Turn #2 : ') if t == code : print(WINNING_MSG) elif t[0] in code or t[1] in code or t[2] in code or t[3] in code : if t[0] == code[0] : if t[1] == code[1] : if t[2] == code[2] : print(' '*10+'P=3,V=0,X=1') elif t[3] == code[3] : print(' '*10+'P=3,V=0,X=1') elif t[2] in code and t[3] in code : print(' '*10+'P=2,V=2,X=0') elif t[2] in code or t[3] in code : print(' '*10+'P=2,V=1,X=1') else : print(' '*10+'P=2,V=0,X=2') elif t[2] == code[2] : if t[3] == code[3] : print(' '*10+'P=3,V=0,X=1') elif t[1] in code and t[3] in code : print(' '*10+'P=2,V=2,X=0') elif t[1] in code or t[3] in code : print(' '*10+'P=2,V=1,X=1') else : print(' '*10+'P=2,V=0,X=2') elif t[3] == code[3] : if t[1] in code and t[2] in code : print(' '*10+'P=2,V=2,X=0') elif t[1] in code or t[2] in code : print(' '*10+'P=2,V=1,X=1') else : print(' '*10+'P=2,V=0,X=2') elif t[2] in code and t[1] in code and t[3] in code : print(' '*10+'P=1,V=3,X=0') elif t[1] in code and t[2] in code : print(' '*10+'P=1,V=2,X=1') elif t[3] in code and t[2] in code : print(' '*10+'P=1,V=2,X=1') elif t[1] in code and t[3] in code : print(' '*10+'P=1,V=2,X=1') elif t[1] in code : print(' '*10+'P=1,V=1,X=2') elif t[2] in code : print(' '*10+'P=1,V=1,X=2') elif t[3] in code : print(' '*10+'P=1,V=1,X=2') elif t[1] == code[1] : if t[2] == code[2] : if t[3] == code[3] : print(' '*10+'P=3,V=0,X=1') elif t[0] in code and t[3] in code : print(' '*10+'P=2,V=2,X=0') elif t[0] in code or t[3] in code : print(' '*10+'P=2,V=1,X=1') elif t[3] == code[3] : if t[0] in code and t[2] in code : print(' '*10+'P=2,V=2,X=0') elif t[0] in code or t[2] in code : print(' '*10+'P=2,V=1,X=1') elif t[2] in code and t[0] in code and t[3] in code : print(' '*10+'P=1,V=3,X=0') elif t[2] in code and t[3] in code : print(' '*10+'P=1,V=2,X=1') elif t[1] in code and t[3] in code : print(' '*10+'P=1,V=2,X=1') elif t[0] in code and t[3] in code : print(' '*10+'P=1,V=2,X=1') elif t[0] in code : print(' '*10+'P=1,V=1,X=2') elif t[2] in code : print(' '*10+'P=1,V=1,X=2') elif t[3] in code : print(' '*10+'P=1,V=1,X=2') elif t[2] == code[2] : if t[3] == code[3] : if t[0] in code and t[1] in code : print(' '*10+'P=2,V=2,X=0') elif t[0] in code or t[1] in code : print(' '*10+'P=2,V=1,X=1') else : print(' '*10+'P=2,V=0,X=2') elif t[0] in code and t[1] in code and t[3] in code : print(' '*10+'P=1,V=3,X=0') elif t[0] in code and t[3] in code : print(' '*10+'P=1,V=2,X=1') elif t[1] in code and t[3] in code : print(' '*10+'P=1,V=2,X=1') elif t[0] in code and t[1] in code : print(' '*10+'P=1,V=2,X=1') elif t[0] in code : print(' '*10+'P=1,V=1,X=2') elif t[1] in code : print(' '*10+'P=1,V=1,X=2') elif t[3] in code : print(' '*10+'P=1,V=1,X=2') elif t[3] == code[3] : if t[0] in code and t[1] in code and t[2] in code : print(' '*10+'P=1,V=3,X=0') elif t[0] in code and t[1] in code : print(' '*10+'P=1,V=2,X=1') elif t[1] in code and t[2] in code : print(' '*10+'P=1,V=2,X=1') elif t[0] in code and t[2] in code : print(' '*10+'P=1,V=2,X=1') elif t[0] in code : print(' '*10+'P=1,V=1,X=2') elif t[2] in code : print(' '*10+'P=1,V=1,X=2') elif t[1] in code : print(' '*10+'P=1,V=1,X=2') elif t[0] in code and t[1] in code and t[2] in code and t[3] in code : print(' '*10+'P=0,V=4,X=0') elif t[0] in code and t[1] in code and t[2] in code : print(' '*10+'P=0,V=3,X=1') elif t[0] in code and t[1] in code and t[3] in code : print(' '*10+'P=0,V=3,X=1') elif t[3] in code and t[1] in code and t[2] in code : print(' '*10+'P=0,V=3,X=1') elif t[3] in code and t[0] in code and t[2] in code : print(' '*10+'P=0,V=3,X=1') elif t[0] in code and t[1] in code : print(' '*10+'P=0,V=2,X=2') elif t[0] in code and t[2] in code : print(' '*10+'P=0,V=2,X=2') elif t[0] in code and t[3] in code : print(' '*10+'P=0,V=2,X=2') elif t[1] in code and t[2] in code : print(' '*10+'P=0,V=2,X=2') elif t[1] in code and t[3] in code : print(' '*10+'P=0,V=2,X=2') elif t[2] in code and t[3] in code : print(' '*10+'P=0,V=2,X=2') t = input('Turn #3 : ') if t == code : print(WINNING_MSG) elif t[0] in code or t[1] in code or t[2] in code or t[3] in code : if t[0] == code[0] : if t[1] == code[1] : if t[2] == code[2] : print(' '*10+'P=3,V=0,X=1') elif t[3] == code[3] : print(' '*10+'P=3,V=0,X=1') elif t[2] in code and t[3] in code : print(' '*10+'P=2,V=2,X=0') elif t[2] in code or t[3] in code : print(' '*10+'P=2,V=1,X=1') else : print(' '*10+'P=2,V=0,X=2') elif t[2] == code[2] : if t[3] == code[3] : print(' '*10+'P=3,V=0,X=1') elif t[1] in code and t[3] in code : print(' '*10+'P=2,V=2,X=0') elif t[1] in code or t[3] in code : print(' '*10+'P=2,V=1,X=1') else : print(' '*10+'P=2,V=0,X=2') elif t[3] == code[3] : if t[1] in code and t[2] in code : print(' '*10+'P=2,V=2,X=0') elif t[1] in code or t[2] in code : print(' '*10+'P=2,V=1,X=1') else : print(' '*10+'P=2,V=0,X=2') elif t[2] in code and t[1] in code and t[3] in code : print(' '*10+'P=1,V=3,X=0') elif t[1] in code and t[2] in code : print(' '*10+'P=1,V=2,X=1') elif t[3] in code and t[2] in code : print(' '*10+'P=1,V=2,X=1') elif t[1] in code and t[3] in code : print(' '*10+'P=1,V=2,X=1') elif t[1] in code : print(' '*10+'P=1,V=1,X=2') elif t[2] in code : print(' '*10+'P=1,V=1,X=2') elif t[3] in code : print(' '*10+'P=1,V=1,X=2') elif t[1] == code[1] : if t[2] == code[2] : if t[3] == code[3] : print(' '*10+'P=3,V=0,X=1') elif t[0] in code and t[3] in code : print(' '*10+'P=2,V=2,X=0') elif t[0] in code or t[3] in code : print(' '*10+'P=2,V=1,X=1') elif t[3] == code[3] : if t[0] in code and t[2] in code : print(' '*10+'P=2,V=2,X=0') elif t[0] in code or t[2] in code : print(' '*10+'P=2,V=1,X=1') elif t[2] in code and t[0] in code and t[3] in code : print(' '*10+'P=1,V=3,X=0') elif t[2] in code and t[3] in code : print(' '*10+'P=1,V=2,X=1') elif t[1] in code and t[3] in code : print(' '*10+'P=1,V=2,X=1') elif t[0] in code and t[3] in code : print(' '*10+'P=1,V=2,X=1') elif t[0] in code : print(' '*10+'P=1,V=1,X=2') elif t[2] in code : print(' '*10+'P=1,V=1,X=2') elif t[3] in code : print(' '*10+'P=1,V=1,X=2') elif t[2] == code[2] : if t[3] == code[3] : if t[0] in code and t[1] in code : print(' '*10+'P=2,V=2,X=0') elif t[0] in code or t[1] in code : print(' '*10+'P=2,V=1,X=1') else : print(' '*10+'P=2,V=0,X=2') elif t[0] in code and t[1] in code and t[3] in code : print(' '*10+'P=1,V=3,X=0') elif t[0] in code and t[3] in code : print(' '*10+'P=1,V=2,X=1') elif t[1] in code and t[3] in code : print(' '*10+'P=1,V=2,X=1') elif t[0] in code and t[1] in code : print(' '*10+'P=1,V=2,X=1') elif t[0] in code : print(' '*10+'P=1,V=1,X=2') elif t[1] in code : print(' '*10+'P=1,V=1,X=2') elif t[3] in code : print(' '*10+'P=1,V=1,X=2') elif t[3] == code[3] : if t[0] in code and t[1] in code and t[2] in code : print(' '*10+'P=1,V=3,X=0') elif t[0] in code and t[1] in code : print(' '*10+'P=1,V=2,X=1') elif t[1] in code and t[2] in code : print(' '*10+'P=1,V=2,X=1') elif t[0] in code and t[2] in code : print(' '*10+'P=1,V=2,X=1') elif t[0] in code : print(' '*10+'P=1,V=1,X=2') elif t[2] in code : print(' '*10+'P=1,V=1,X=2') elif t[1] in code : print(' '*10+'P=1,V=1,X=2') elif t[0] in code and t[1] in code and t[2] in code and t[3] in code : print(' '*10+'P=0,V=4,X=0') elif t[0] in code and t[1] in code and t[2] in code : print(' '*10+'P=0,V=3,X=1') elif t[0] in code and t[1] in code and t[3] in code : print(' '*10+'P=0,V=3,X=1') elif t[3] in code and t[1] in code and t[2] in code : print(' '*10+'P=0,V=3,X=1') elif t[3] in code and t[0] in code and t[2] in code : print(' '*10+'P=0,V=3,X=1') elif t[0] in code and t[1] in code : print(' '*10+'P=0,V=2,X=2') elif t[0] in code and t[2] in code : print(' '*10+'P=0,V=2,X=2') elif t[0] in code and t[3] in code : print(' '*10+'P=0,V=2,X=2') elif t[1] in code and t[2] in code : print(' '*10+'P=0,V=2,X=2') elif t[1] in code and t[3] in code : print(' '*10+'P=0,V=2,X=2') elif t[2] in code and t[3] in code : print(' '*10+'P=0,V=2,X=2') t = input('Turn #4 : ') if t == code : print(WINNING_MSG) elif t[0] in code or t[1] in code or t[2] in code or t[3] in code : if t[0] == code[0] : if t[1] == code[1] : if t[2] == code[2] : print(' '*10+'P=3,V=0,X=1') elif t[3] == code[3] : print(' '*10+'P=3,V=0,X=1') elif t[2] in code and t[3] in code : print(' '*10+'P=2,V=2,X=0') elif t[2] in code or t[3] in code : print(' '*10+'P=2,V=1,X=1') else : print(' '*10+'P=2,V=0,X=2') elif t[2] == code[2] : if t[3] == code[3] : print(' '*10+'P=3,V=0,X=1') elif t[1] in code and t[3] in code : print(' '*10+'P=2,V=2,X=0') elif t[1] in code or t[3] in code : print(' '*10+'P=2,V=1,X=1') else : print(' '*10+'P=2,V=0,X=2') elif t[3] == code[3] : if t[1] in code and t[2] in code : print(' '*10+'P=2,V=2,X=0') elif t[1] in code or t[2] in code : print(' '*10+'P=2,V=1,X=1') else : print(' '*10+'P=2,V=0,X=2') elif t[2] in code and t[1] in code and t[3] in code : print(' '*10+'P=1,V=3,X=0') elif t[1] in code and t[2] in code : print(' '*10+'P=1,V=2,X=1') elif t[3] in code and t[2] in code : print(' '*10+'P=1,V=2,X=1') elif t[1] in code and t[3] in code : print(' '*10+'P=1,V=2,X=1') elif t[1] in code : print(' '*10+'P=1,V=1,X=2') elif t[2] in code : print(' '*10+'P=1,V=1,X=2') elif t[3] in code : print(' '*10+'P=1,V=1,X=2') elif t[1] == code[1] : if t[2] == code[2] : if t[3] == code[3] : print(' '*10+'P=3,V=0,X=1') elif t[0] in code and t[3] in code : print(' '*10+'P=2,V=2,X=0') elif t[0] in code or t[3] in code : print(' '*10+'P=2,V=1,X=1') elif t[3] == code[3] : if t[0] in code and t[2] in code : print(' '*10+'P=2,V=2,X=0') elif t[0] in code or t[2] in code : print(' '*10+'P=2,V=1,X=1') elif t[2] in code and t[0] in code and t[3] in code : print(' '*10+'P=1,V=3,X=0') elif t[2] in code and t[3] in code : print(' '*10+'P=1,V=2,X=1') elif t[1] in code and t[3] in code : print(' '*10+'P=1,V=2,X=1') elif t[0] in code and t[3] in code : print(' '*10+'P=1,V=2,X=1') elif t[0] in code : print(' '*10+'P=1,V=1,X=2') elif t[2] in code : print(' '*10+'P=1,V=1,X=2') elif t[3] in code : print(' '*10+'P=1,V=1,X=2') elif t[2] == code[2] : if t[3] == code[3] : if t[0] in code and t[1] in code : print(' '*10+'P=2,V=2,X=0') elif t[0] in code or t[1] in code : print(' '*10+'P=2,V=1,X=1') else : print(' '*10+'P=2,V=0,X=2') elif t[0] in code and t[1] in code and t[3] in code : print(' '*10+'P=1,V=3,X=0') elif t[0] in code and t[3] in code : print(' '*10+'P=1,V=2,X=1') elif t[1] in code and t[3] in code : print(' '*10+'P=1,V=2,X=1') elif t[0] in code and t[1] in code : print(' '*10+'P=1,V=2,X=1') elif t[0] in code : print(' '*10+'P=1,V=1,X=2') elif t[1] in code : print(' '*10+'P=1,V=1,X=2') elif t[3] in code : print(' '*10+'P=1,V=1,X=2') elif t[3] == code[3] : if t[0] in code and t[1] in code and t[2] in code : print(' '*10+'P=1,V=3,X=0') elif t[0] in code and t[1] in code : print(' '*10+'P=1,V=2,X=1') elif t[1] in code and t[2] in code : print(' '*10+'P=1,V=2,X=1') elif t[0] in code and t[2] in code : print(' '*10+'P=1,V=2,X=1') elif t[0] in code : print(' '*10+'P=1,V=1,X=2') elif t[2] in code : print(' '*10+'P=1,V=1,X=2') elif t[1] in code : print(' '*10+'P=1,V=1,X=2') elif t[0] in code and t[1] in code and t[2] in code and t[3] in code : print(' '*10+'P=0,V=4,X=0') elif t[0] in code and t[1] in code and t[2] in code : print(' '*10+'P=0,V=3,X=1') elif t[0] in code and t[1] in code and t[3] in code : print(' '*10+'P=0,V=3,X=1') elif t[3] in code and t[1] in code and t[2] in code : print(' '*10+'P=0,V=3,X=1') elif t[3] in code and t[0] in code and t[2] in code : print(' '*10+'P=0,V=3,X=1') elif t[0] in code and t[1] in code : print(' '*10+'P=0,V=2,X=2') elif t[0] in code and t[2] in code : print(' '*10+'P=0,V=2,X=2') elif t[0] in code and t[3] in code : print(' '*10+'P=0,V=2,X=2') elif t[1] in code and t[2] in code : print(' '*10+'P=0,V=2,X=2') elif t[1] in code and t[3] in code : print(' '*10+'P=0,V=2,X=2') elif t[2] in code and t[3] in code : print(' '*10+'P=0,V=2,X=2') print('Sorry! You just lost it.') print('The answer is', code) print('Please try again...') |
# 6330245921 (20.00) 100 (2021-02-13 21:19) ft = input("Turn #1 : ",) P = 0 V = 0 X = 0 if ft[0] == code[0] : P+=1 if ft[1] == code[1] : P+=1 if ft[2] == code[2] : P+=1 if ft[3] == code[3] : P+=1 if ft[0] in code : V+=1 if ft[1] in code : V+=1 if ft[2] in code : V+=1 if ft[3] in code : V+=1 if ft[0] not in code : X+=1 if ft[1] not in code : X+=1 if ft[2] not in code : X+=1 if ft[3] not in code : X+=1 if P ==4 : print(WINNING_MSG) else : print(" "+"P="+str(P)+","+"V="+str(int(V-P))+","+"X="+str(X)) ft = input("Turn #2 : ",) P = 0 V = 0 X = 0 if ft[0] == code[0] : P+=1 if ft[1] == code[1] : P+=1 if ft[2] == code[2] : P+=1 if ft[3] == code[3] : P+=1 if ft[0] in code : V+=1 if ft[1] in code : V+=1 if ft[2] in code : V+=1 if ft[3] in code : V+=1 if ft[0] not in code : X+=1 if ft[1] not in code : X+=1 if ft[2] not in code : X+=1 if ft[3] not in code : X+=1 if P ==4 : print(WINNING_MSG) else : print(" "+"P="+str(P)+","+"V="+str(int(V-P))+","+"X="+str(X)) ft = input("Turn #3 : ",) P = 0 V = 0 X = 0 if ft[0] == code[0] : P+=1 if ft[1] == code[1] : P+=1 if ft[2] == code[2] : P+=1 if ft[3] == code[3] : P+=1 if ft[0] in code : V+=1 if ft[1] in code : V+=1 if ft[2] in code : V+=1 if ft[3] in code : V+=1 if ft[0] not in code : X+=1 if ft[1] not in code : X+=1 if ft[2] not in code : X+=1 if ft[3] not in code : X+=1 if P ==4 : print(WINNING_MSG) else : print(" "+"P="+str(P)+","+"V="+str(int(V-P))+","+"X="+str(X)) ft = input("Turn #4 : ",) P = 0 V = 0 X = 0 if ft[0] == code[0] : P+=1 if ft[1] == code[1] : P+=1 if ft[2] == code[2] : P+=1 if ft[3] == code[3] : P+=1 if ft[0] in code : V+=1 if ft[1] in code : V+=1 if ft[2] in code : V+=1 if ft[3] in code : V+=1 if ft[0] not in code : X+=1 if ft[1] not in code : X+=1 if ft[2] not in code : X+=1 if ft[3] not in code : X+=1 if P ==4 : print(WINNING_MSG) else : print(" "+"P="+str(P)+","+"V="+str(int(V-P))+","+"X="+str(X)) print(LOSING_MSG) print("The answer is "+str(code)) print("Please try again...") |
# 6330246521 (20.00) 101 (2021-02-15 13:54) #Turn1 ans = input("Turn #1 : ") if ans == code: #correct print(WINNING_MSG) else: if (ans[0] == code[0] and ans[1] == code[1] and ans[2] == code[2]) or \ (ans[0] == code[0] and ans[1] == code[1] and ans[3] == code[3]) or \ (ans[0] == code[0] and ans[2] == code[2] and ans[3] == code[3]) or \ (ans[1] == code[1] and ans[2] == code[2] and ans[3] == code[3]): #ตรง3 ผิด1 P = 3 V = 0 X = 1 elif (ans[0] == code[0] and ans[1] == code[1]) or \ (ans[0] == code[0] and ans[2] == code[2]) or \ (ans[0] == code[0] and ans[3] == code[3]) or \ (ans[1] == code[1] and ans[2] == code[2]) or \ (ans[1] == code[1] and ans[3] == code[3]) or \ (ans[2] == code[2] and ans[3] == code[3]): #ตรง2 P = 2 if ans[0] in code and ans[1] in code and ans[2] in code and ans[3] in code: #ตรง2 สี2 V = 2 X = 0 elif (ans[0] in code and ans[1] in code and ans[2] in code) or \ (ans[0] in code and ans[1] in code and ans[3] in code) or \ (ans[0] in code and ans[2] in code and ans[3] in code) or \ (ans[1] in code and ans[2] in code and ans[3] in code): #ตรง2 สี1 ผิด1 V = 1 X = 1 else: #ตรง2 ผิด2 V = 0 X = 2 elif ans[0] != code[0] and ans[1] != code[1] and ans[2] != code[2] and ans[3] != code[3]: #ไม่ตรงเลย P = 0 if ans[0] in code and ans[1] in code and ans[2] in code and ans[3] in code: #ไม่ตรงเลย สี4 V = 4 X = 0 elif ans[0] not in code and ans[1] not in code and ans[2] not in code and ans[3] not in code: #ผิดทั้งหมด V = 0 X = 4 elif (ans[0] in code and ans[1] in code and ans[2] in code) or \ (ans[0] in code and ans[1] in code and ans[3] in code) or \ (ans[0] in code and ans[2] in code and ans[3] in code) or \ (ans[1] in code and ans[2] in code and ans[3] in code): #ไม่ตรงเลย สี3 ผิด1 V = 3 X = 1 elif (ans[0] in code and ans[1] in code) or \ (ans[0] in code and ans[2] in code) or \ (ans[0] in code and ans[3] in code) or \ (ans[1] in code and ans[2] in code) or \ (ans[1] in code and ans[3] in code) or \ (ans[2] in code and ans[3] in code): #ไม่ตรงเลย สี2 ผิด2 V = 2 X = 2 else: #ไม่ตรงเลย สี1 ผิด3 V = 1 X = 3 else: #ตรง1 P = 1 if ans[0] in code and ans[1] in code and ans[2] in code and ans[3] in code: #ตรง1 สี3 V = 3 X = 0 elif (ans[0] in code and ans[1] in code and ans[2] in code) or \ (ans[0] in code and ans[1] in code and ans[3] in code) or \ (ans[0] in code and ans[2] in code and ans[3] in code) or \ (ans[1] in code and ans[2] in code and ans[3] in code): #ตรง1 สี2 ผิด1 V = 2 X = 1 elif (ans[0] in code and ans[1] in code) or \ (ans[0] in code and ans[2] in code) or \ (ans[0] in code and ans[3] in code) or \ (ans[1] in code and ans[2] in code) or \ (ans[1] in code and ans[3] in code) or \ (ans[2] in code and ans[3] in code): #ตรง1 สี1 ผิด2 V = 1 X = 2 else: #ตรง1 ผิด3 V = 0 X = 3 print(" P=" + str(P) + ",V=" + str(V) + ",X=" + str(X)) #Turn2 ans = input("Turn #2 : ") if ans == code: #correct print(WINNING_MSG) else: if (ans[0] == code[0] and ans[1] == code[1] and ans[2] == code[2]) or \ (ans[0] == code[0] and ans[1] == code[1] and ans[3] == code[3]) or \ (ans[0] == code[0] and ans[2] == code[2] and ans[3] == code[3]) or \ (ans[1] == code[1] and ans[2] == code[2] and ans[3] == code[3]): #ตรง3 ผิด1 P = 3 V = 0 X = 1 elif (ans[0] == code[0] and ans[1] == code[1]) or \ (ans[0] == code[0] and ans[2] == code[2]) or \ (ans[0] == code[0] and ans[3] == code[3]) or \ (ans[1] == code[1] and ans[2] == code[2]) or \ (ans[1] == code[1] and ans[3] == code[3]) or \ (ans[2] == code[2] and ans[3] == code[3]): #ตรง2 P = 2 if ans[0] in code and ans[1] in code and ans[2] in code and ans[3] in code: #ตรง2 สี2 V = 2 X = 0 elif (ans[0] in code and ans[1] in code and ans[2] in code) or \ (ans[0] in code and ans[1] in code and ans[3] in code) or \ (ans[0] in code and ans[2] in code and ans[3] in code) or \ (ans[1] in code and ans[2] in code and ans[3] in code): #ตรง2 สี1 ผิด1 V = 1 X = 1 else: #ตรง2 ผิด2 V = 0 X = 2 elif ans[0] != code[0] and ans[1] != code[1] and ans[2] != code[2] and ans[3] != code[3]: #ไม่ตรงเลย P = 0 if ans[0] in code and ans[1] in code and ans[2] in code and ans[3] in code: #ไม่ตรงเลย สี4 V = 4 X = 0 elif ans[0] not in code and ans[1] not in code and ans[2] not in code and ans[3] not in code: #ผิดทั้งหมด V = 0 X = 4 elif (ans[0] in code and ans[1] in code and ans[2] in code) or \ (ans[0] in code and ans[1] in code and ans[3] in code) or \ (ans[0] in code and ans[2] in code and ans[3] in code) or \ (ans[1] in code and ans[2] in code and ans[3] in code): #ไม่ตรงเลย สี3 ผิด1 V = 3 X = 1 elif (ans[0] in code and ans[1] in code) or \ (ans[0] in code and ans[2] in code) or \ (ans[0] in code and ans[3] in code) or \ (ans[1] in code and ans[2] in code) or \ (ans[1] in code and ans[3] in code) or \ (ans[2] in code and ans[3] in code): #ไม่ตรงเลย สี2 ผิด2 V = 2 X = 2 else: #ไม่ตรงเลย สี1 ผิด3 V = 1 X = 3 else: #ตรง1 P = 1 if ans[0] in code and ans[1] in code and ans[2] in code and ans[3] in code: #ตรง1 สี3 V = 3 X = 0 elif (ans[0] in code and ans[1] in code and ans[2] in code) or \ (ans[0] in code and ans[1] in code and ans[3] in code) or \ (ans[0] in code and ans[2] in code and ans[3] in code) or \ (ans[1] in code and ans[2] in code and ans[3] in code): #ตรง1 สี2 ผิด1 V = 2 X = 1 elif (ans[0] in code and ans[1] in code) or \ (ans[0] in code and ans[2] in code) or \ (ans[0] in code and ans[3] in code) or \ (ans[1] in code and ans[2] in code) or \ (ans[1] in code and ans[3] in code) or \ (ans[2] in code and ans[3] in code): #ตรง1 สี1 ผิด2 V = 1 X = 2 else: #ตรง1 ผิด3 V = 0 X = 3 print(" P=" + str(P) + ",V=" + str(V) + ",X=" + str(X)) #Turn3 ans = input("Turn #3 : ") if ans == code: #correct print(WINNING_MSG) else: if (ans[0] == code[0] and ans[1] == code[1] and ans[2] == code[2]) or \ (ans[0] == code[0] and ans[1] == code[1] and ans[3] == code[3]) or \ (ans[0] == code[0] and ans[2] == code[2] and ans[3] == code[3]) or \ (ans[1] == code[1] and ans[2] == code[2] and ans[3] == code[3]): #ตรง3 ผิด1 P = 3 V = 0 X = 1 elif (ans[0] == code[0] and ans[1] == code[1]) or \ (ans[0] == code[0] and ans[2] == code[2]) or \ (ans[0] == code[0] and ans[3] == code[3]) or \ (ans[1] == code[1] and ans[2] == code[2]) or \ (ans[1] == code[1] and ans[3] == code[3]) or \ (ans[2] == code[2] and ans[3] == code[3]): #ตรง2 P = 2 if ans[0] in code and ans[1] in code and ans[2] in code and ans[3] in code: #ตรง2 สี2 V = 2 X = 0 elif (ans[0] in code and ans[1] in code and ans[2] in code) or \ (ans[0] in code and ans[1] in code and ans[3] in code) or \ (ans[0] in code and ans[2] in code and ans[3] in code) or \ (ans[1] in code and ans[2] in code and ans[3] in code): #ตรง2 สี1 ผิด1 V = 1 X = 1 else: #ตรง2 ผิด2 V = 0 X = 2 elif ans[0] != code[0] and ans[1] != code[1] and ans[2] != code[2] and ans[3] != code[3]: #ไม่ตรงเลย P = 0 if ans[0] in code and ans[1] in code and ans[2] in code and ans[3] in code: #ไม่ตรงเลย สี4 V = 4 X = 0 elif ans[0] not in code and ans[1] not in code and ans[2] not in code and ans[3] not in code: #ผิดทั้งหมด V = 0 X = 4 elif (ans[0] in code and ans[1] in code and ans[2] in code) or \ (ans[0] in code and ans[1] in code and ans[3] in code) or \ (ans[0] in code and ans[2] in code and ans[3] in code) or \ (ans[1] in code and ans[2] in code and ans[3] in code): #ไม่ตรงเลย สี3 ผิด1 V = 3 X = 1 elif (ans[0] in code and ans[1] in code) or \ (ans[0] in code and ans[2] in code) or \ (ans[0] in code and ans[3] in code) or \ (ans[1] in code and ans[2] in code) or \ (ans[1] in code and ans[3] in code) or \ (ans[2] in code and ans[3] in code): #ไม่ตรงเลย สี2 ผิด2 V = 2 X = 2 else: #ไม่ตรงเลย สี1 ผิด3 V = 1 X = 3 else: #ตรง1 P = 1 if ans[0] in code and ans[1] in code and ans[2] in code and ans[3] in code: #ตรง1 สี3 V = 3 X = 0 elif (ans[0] in code and ans[1] in code and ans[2] in code) or \ (ans[0] in code and ans[1] in code and ans[3] in code) or \ (ans[0] in code and ans[2] in code and ans[3] in code) or \ (ans[1] in code and ans[2] in code and ans[3] in code): #ตรง1 สี2 ผิด1 V = 2 X = 1 elif (ans[0] in code and ans[1] in code) or \ (ans[0] in code and ans[2] in code) or \ (ans[0] in code and ans[3] in code) or \ (ans[1] in code and ans[2] in code) or \ (ans[1] in code and ans[3] in code) or \ (ans[2] in code and ans[3] in code): #ตรง1 สี1 ผิด2 V = 1 X = 2 else: #ตรง1 ผิด3 V = 0 X = 3 print(" P=" + str(P) + ",V=" + str(V) + ",X=" + str(X)) #Turn4 ans = input("Turn #4 : ") if ans == code: #correct print(WINNING_MSG) else: if (ans[0] == code[0] and ans[1] == code[1] and ans[2] == code[2]) or \ (ans[0] == code[0] and ans[1] == code[1] and ans[3] == code[3]) or \ (ans[0] == code[0] and ans[2] == code[2] and ans[3] == code[3]) or \ (ans[1] == code[1] and ans[2] == code[2] and ans[3] == code[3]): #ตรง3 ผิด1 P = 3 V = 0 X = 1 elif (ans[0] == code[0] and ans[1] == code[1]) or \ (ans[0] == code[0] and ans[2] == code[2]) or \ (ans[0] == code[0] and ans[3] == code[3]) or \ (ans[1] == code[1] and ans[2] == code[2]) or \ (ans[1] == code[1] and ans[3] == code[3]) or \ (ans[2] == code[2] and ans[3] == code[3]): #ตรง2 P = 2 if ans[0] in code and ans[1] in code and ans[2] in code and ans[3] in code: #ตรง2 สี2 V = 2 X = 0 elif (ans[0] in code and ans[1] in code and ans[2] in code) or \ (ans[0] in code and ans[1] in code and ans[3] in code) or \ (ans[0] in code and ans[2] in code and ans[3] in code) or \ (ans[1] in code and ans[2] in code and ans[3] in code): #ตรง2 สี1 ผิด1 V = 1 X = 1 else: #ตรง2 ผิด2 V = 0 X = 2 elif ans[0] != code[0] and ans[1] != code[1] and ans[2] != code[2] and ans[3] != code[3]: #ไม่ตรงเลย P = 0 if ans[0] in code and ans[1] in code and ans[2] in code and ans[3] in code: #ไม่ตรงเลย สี4 V = 4 X = 0 elif ans[0] not in code and ans[1] not in code and ans[2] not in code and ans[3] not in code: #ผิดทั้งหมด V = 0 X = 4 elif (ans[0] in code and ans[1] in code and ans[2] in code) or \ (ans[0] in code and ans[1] in code and ans[3] in code) or \ (ans[0] in code and ans[2] in code and ans[3] in code) or \ (ans[1] in code and ans[2] in code and ans[3] in code): #ไม่ตรงเลย สี3 ผิด1 V = 3 X = 1 elif (ans[0] in code and ans[1] in code) or \ (ans[0] in code and ans[2] in code) or \ (ans[0] in code and ans[3] in code) or \ (ans[1] in code and ans[2] in code) or \ (ans[1] in code and ans[3] in code) or \ (ans[2] in code and ans[3] in code): #ไม่ตรงเลย สี2 ผิด2 V = 2 X = 2 else: #ไม่ตรงเลย สี1 ผิด3 V = 1 X = 3 else: #ตรง1 P = 1 if ans[0] in code and ans[1] in code and ans[2] in code and ans[3] in code: #ตรง1 สี3 V = 3 X = 0 elif (ans[0] in code and ans[1] in code and ans[2] in code) or \ (ans[0] in code and ans[1] in code and ans[3] in code) or \ (ans[0] in code and ans[2] in code and ans[3] in code) or \ (ans[1] in code and ans[2] in code and ans[3] in code): #ตรง1 สี2 ผิด1 V = 2 X = 1 elif (ans[0] in code and ans[1] in code) or \ (ans[0] in code and ans[2] in code) or \ (ans[0] in code and ans[3] in code) or \ (ans[1] in code and ans[2] in code) or \ (ans[1] in code and ans[3] in code) or \ (ans[2] in code and ans[3] in code): #ตรง1 สี1 ผิด2 V = 1 X = 2 else: #ตรง1 ผิด3 V = 0 X = 3 print(" P=" + str(P) + ",V=" + str(V) + ",X=" + str(X)) print(LOSING_MSG) print("The answer is ", code) print("Please try again...") |
# 6330247121 (15.24) 102 (2021-02-15 14:00) c = input("Turn #1 : ") p = 0 v = 0 x = 0 a0 = code[0] a1 = code[1] a2 = code[2] a3 = code[3] b0 = c[0] b1 = c[1] b2 = c[2] b3 = c[3] if a0 == b0 : p+=1 elif a0 == b1 or a0 == b2 or a0 ==b3 : v+=1 else : x+=1 if a1 == b1 : p+=1 elif a1 == b2 or a1 == b0 or a1 ==b3 : v+=1 else : x+=1 if a2 == b2 : p+=1 elif a2 == b0 or a2 == b1 or a2 == b3 : v+=1 else : x+=1 if a3 == b3 : p+=1 elif a3 == b1 or a0 == b2 or a0 ==b0 : v+=1 else : x+=1 if c== code : print("Congratulations! You won the game.") else : print(" "+"P="+str(p)+","+"V="+str(v)+",""X="+str(x)) #turn 2 d = input("Turn #2 : ") p = 0 v = 0 x = 0 a0 = code[0] a1 = code[1] a2 = code[2] a3 = code[3] b0 = d[0] b1 = d[1] b2 = d[2] b3 = d[3] if a0 == b0 : p+=1 elif a0 == b1 or a0 == b2 or a0 ==b3 : v+=1 else : x+=1 if a1 == b1 : p+=1 elif a1 == b2 or a1 == b0 or a1 ==b3 : v+=1 else : x+=1 if a2 == b2 : p+=1 elif a2 == b0 or a2 == b1 or a2 == b3 : v+=1 else : x+=1 if a3 == b3 : p+=1 elif a3 == b1 or a0 == b2 or a0 ==b0 : v+=1 else : x+=1 if d== code : print("Congratulations! You won the game.") else : print(" ""P="+str(p)+","+"V="+str(v)+",""X="+str(x)) exit #turn 3 e = input("Turn #3 : ") p = 0 v = 0 x = 0 a0 = code[0] a1 = code[1] a2 = code[2] a3 = code[3] b0 = e[0] b1 = e[1] b2 = e[2] b3 = e[3] if a0 == b0 : p+=1 elif a0 == b1 or a0 == b2 or a0 ==b3 : v+=1 else : x+=1 if a1 == b1 : p+=1 elif a1 == b2 or a1 == b0 or a1 ==b3 : v+=1 else : x+=1 if a2 == b2 : p+=1 elif a2 == b0 or a2 == b1 or a2 == b3 : v+=1 else : x+=1 if a3 == b3 : p+=1 elif a3 == b1 or a0 == b2 or a0 ==b0 : v+=1 else : x+=1 if e== code : print("Congratulations! You won the game.") else : print(" ""P="+str(p)+","+"V="+str(v)+",""X="+str(x)) exit #turn 4 g = input("Turn #4 : ") p = 0 v = 0 x = 0 a0 = code[0] a1 = code[1] a2 = code[2] a3 = code[3] b0 = g[0] b1 = g[1] b2 = g[2] b3 = g[3] if a0 == b0 : p+=1 elif a0 == b1 or a0 == b2 or a0 ==b3 : v+=1 else : x+=1 if a1 == b1 : p+=1 elif a1 == b2 or a1 == b0 or a1 ==b3 : v+=1 else : x+=1 if a2 == b2 : p+=1 elif a2 == b0 or a2 == b1 or a2 == b3 : v+=1 else : x+=1 if a3 == b3 : p+=1 elif a3 == b1 or a0 == b2 or a0 ==b0 : v+=1 else : x+=1 if g== code : print("Congratulations! You won the game.") else : print(" ""P="+str(p)+","+"V="+str(v)+",""X="+str(x)) print("Sorry! You just lost it.") print("The answer is "+str(code)) print("Please try again...") |
# 6330248821 (19.90) 103 (2021-02-15 02:48) guess=input('Turn #1 :') if guess == code: print(WINNING_MSG) else: p = 0 if guess[0] == code[0]: p =p+1 if guess[1] == code[1]: p =p+1 if guess[2] == code[2]: p =p+1 if guess[3] == code[3]: p =p+1 v = 0 if (guess[0] == code[1]) or (guess[0] == code[2]) or (guess[0] == code[3]): v =v+1 if (guess[1] == code[0]) or (guess[1] == code[2]) or (guess[1] == code[3]): v =v+1 if (guess[2] == code[0]) or (guess[2] == code[1]) or (guess[2] == code[3]): v =v+1 if (guess[3] == code[0]) or (guess[3] == code[1]) or (guess[3] == code[2]): v =v+1 x= 4-(p+v) print(' ','P='+str(p)+',V='+str(v)+',X='+str(x)) guess=input('Turn #2 :') if guess == code: print(WINNING_MSG) else: p = 0 if guess[0] == code[0]: p =p+1 if guess[1] == code[1]: p =p+1 if guess[2] == code[2]: p =p+1 if guess[3] == code[3]: p =p+1 v = 0 if (guess[0] == code[1]) or (guess[0] == code[2]) or (guess[0] == code[3]): v =v+1 if (guess[1] == code[0]) or (guess[1] == code[2]) or (guess[1] == code[3]): v =v+1 if (guess[2] == code[0]) or (guess[2] == code[1]) or (guess[2] == code[3]): v =v+1 if (guess[3] == code[0]) or (guess[3] == code[1]) or (guess[3] == code[2]): v =v+1 x= 4-(p+v) print(' ','P='+str(p)+',V='+str(v)+',X='+str(x)) guess=input('Turn #3 :') if guess == code: print(WINNING_MSG) else: p = 0 if guess[0] == code[0]: p =p+1 if guess[1] == code[1]: p =p+1 if guess[2] == code[2]: p =p+1 if guess[3] == code[3]: p =p+1 v = 0 if (guess[0] == code[1]) or (guess[0] == code[2]) or (guess[0] == code[3]): v =v+1 if (guess[1] == code[0]) or (guess[1] == code[2]) or (guess[1] == code[3]): v =v+1 if (guess[2] == code[0]) or (guess[2] == code[1]) or (guess[2] == code[3]): v =v+1 if (guess[3] == code[0]) or (guess[3] == code[1]) or (guess[3] == code[2]): v =v+1 x= 4-(p+v) print(' ','P='+str(p)+',V='+str(v)+',X='+str(x)) guess=input('Turn #4 :') if guess == code: print(WINNING_MSG) else: p = 0 if guess[0] == code[0]: p =p+1 if guess[1] == code[1]: p =p+1 if guess[2] == code[2]: p =p+1 if guess[3] == code[3]: p =p+1 v = 0 if (guess[0] == code[1]) or (guess[0] == code[2]) or (guess[0] == code[3]): v =v+1 if (guess[1] == code[0]) or (guess[1] == code[2]) or (guess[1] == code[3]): v =v+1 if (guess[2] == code[0]) or (guess[2] == code[1]) or (guess[2] == code[3]): v =v+1 if (guess[3] == code[0]) or (guess[3] == code[1]) or (guess[3] == code[2]): v =v+1 x= 4-(p+v) print(' ','P='+str(p)+',V='+str(v)+',X='+str(x)) print(LOSING_MSG) print('The answer is ' + code) print('Please try again...') |
# 6330249421 (20.00) 104 (2021-02-12 22:04) p=0 v=0 i1=input("Turn #1 : ") if i1[0]==code[0]: p+=1 if i1[1]==code[1]: p+=1 if i1[2]==code[2]: p+=1 if i1[3]==code[3]: p+=1 if i1[0] in code: v+=1 if i1[1] in code: v+=1 if i1[2] in code: v+=1 if i1[3] in code: v+=1 v=v-p x=4-p-v if p==4: print("Congratulations! You won the game.") else : print(" P="+str(p)+",V="+str(v)+",X="+str(x)) #จบพาร์ท1 #เริ่มพาร์ท2 p=0 v=0 i2=input("Turn #2 : ") if i2[0]==code[0]: p+=1 if i2[1]==code[1]: p+=1 if i2[2]==code[2]: p+=1 if i2[3]==code[3]: p+=1 if i2[0] in code: v+=1 if i2[1] in code: v+=1 if i2[2] in code: v+=1 if i2[3] in code: v+=1 v=v-p x=4-p-v if p==4: print("Congratulations! You won the game.") else : print(" P="+str(p)+",V="+str(v)+",X="+str(x)) #จบพาร์ท2 #เริ่มพาร์ท3 p=0 v=0 i3=input("Turn #3 : ") if i3[0]==code[0]: p+=1 if i3[1]==code[1]: p+=1 if i3[2]==code[2]: p+=1 if i3[3]==code[3]: p+=1 if i3[0] in code: v+=1 if i3[1] in code: v+=1 if i3[2] in code: v+=1 if i3[3] in code: v+=1 v=v-p x=4-p-v if p==4: print("Congratulations! You won the game.") else : print(" P="+str(p)+",V="+str(v)+",X="+str(x)) #จบพาร์ท3 #เริ่มพาร์ท4 p=0 v=0 i4=input("Turn #4 : ") if i4[0]==code[0]: p+=1 if i4[1]==code[1]: p+=1 if i4[2]==code[2]: p+=1 if i4[3]==code[3]: p+=1 if i4[0] in code: v+=1 if i4[1] in code: v+=1 if i4[2] in code: v+=1 if i4[3] in code: v+=1 v=v-p x=4-p-v if p==4: print("Congratulations! You won the game.") else : print(" P="+str(p)+",V="+str(v)+",X="+str(x)) print("Sorry! You just lost it.") print("The answer is ",code) print("Please try again...") |
# 6330250021 (20.00) 105 (2021-02-14 16:42) g=input('Turn #1 : ') if g==code: print(WINNING_MSG) else: p=0 v=0 if g[0]==code[0]: p+=1 if g[1]==code[1]: p+=1 if g[2]==code[2]: p+=1 if g[3]==code[3]: p+=1 if g[0] in code: v+=1 if g[1] in code: v+=1 if g[2] in code: v+=1 if g[3] in code: v+=1 v-=p x=4-v-p print(' '*10+'P='+str(p)+',V='+str(v)+',X='+str(x)) g=input('Turn #2 : ') if g==code: print(WINNING_MSG) else: p=0 v=0 if g[0]==code[0]: p+=1 if g[1]==code[1]: p+=1 if g[2]==code[2]: p+=1 if g[3]==code[3]: p+=1 if g[0] in code: v+=1 if g[1] in code: v+=1 if g[2] in code: v+=1 if g[3] in code: v+=1 v-=p x=4-v-p print(' '*10+'P='+str(p)+',V='+str(v)+',X='+str(x)) g=input('Turn #3 : ') if g==code: print(WINNING_MSG) else: p=0 v=0 if g[0]==code[0]: p+=1 if g[1]==code[1]: p+=1 if g[2]==code[2]: p+=1 if g[3]==code[3]: p+=1 if g[0] in code: v+=1 if g[1] in code: v+=1 if g[2] in code: v+=1 if g[3] in code: v+=1 v-=p x=4-v-p print(' '*10+'P='+str(p)+',V='+str(v)+',X='+str(x)) g=input('Turn #4 : ') if g==code: print(WINNING_MSG) else: p=0 v=0 if g[0]==code[0]: p+=1 if g[1]==code[1]: p+=1 if g[2]==code[2]: p+=1 if g[3]==code[3]: p+=1 if g[0] in code: v+=1 if g[1] in code: v+=1 if g[2] in code: v+=1 if g[3] in code: v+=1 v-=p x=4-v-p print(' '*10+'P='+str(p)+',V='+str(v)+',X='+str(x)) print(LOSING_MSG) print('The answer is',code) print('Please try again...') |
# 6330251621 (20.00) 106 (2021-02-15 22:04) codeX = [code[0],code[1],code[2],code[3]] name = input('Turn #1 : ') a = name a = [a[0],a[1],a[2],a[3]] P0=0 P1=0 P2=0 P3=0 V0=0 V1=0 V2=0 V3=0 X0=0 X1=0 X2=0 X3=0 if a==codeX: print(WINNING_MSG) else: if a[0] in codeX: if a[0] == codeX[0]: P0=1 else: V0=1 else:X0=1 if a[1] in codeX: if a[1] == codeX[1]: P1=1 else: V1=1 else:X1=1 if a[2] in codeX: if a[2] == codeX[2]: P2=1 else: V2=1 else:X2=1 if a[3] in codeX: if a[3] == codeX[3]: P3=1 else: V3=1 else:X3=1 print(" "+"P="+str(P0+P1+P2+P3)+",V="+str(V0+V1+V2+V3)+",X="+str(X0+X1+X2+X3)) name = input('Turn #2 : ') a = name a = [a[0],a[1],a[2],a[3]] P0=0 P1=0 P2=0 P3=0 V0=0 V1=0 V2=0 V3=0 X0=0 X1=0 X2=0 X3=0 if a==codeX: print(WINNING_MSG) else: if a[0] in codeX: if a[0] == codeX[0]: P0=1 else: V0=1 else:X0=1 if a[1] in codeX: if a[1]==codeX[1]: P1=1 else: V1=1 else:X1=1 if a[2] in codeX: if a[2]==codeX[2]:P2=1 else: V2=1 else:X2=1 if a[3] in codeX: if a[3] == codeX[3]: P3=1 else: V3=1 else:X3=1 print(" "+"P="+str(P0+P1+P2+P3)+",V="+str(V0+V1+V2+V3)+",X="+str(X0+X1+X2+X3)) name = input('Turn #3 : ') a = name a = [a[0],a[1],a[2],a[3]] P0=0 P1=0 P2=0 P3=0 V0=0 V1=0 V2=0 V3=0 X0=0 X1=0 X2=0 X3=0 if a==codeX: print(WINNING_MSG) else: if a[0] in codeX: if a[0] == codeX[0]: P0=1 else: V0=1 else:X0=1 if a[1] in codeX: if a[1] == codeX[1]: P1=1 else: V1=1 else:X1=1 if a[2] in codeX: if a[2] == codeX[2]: P2=1 else: V2=1 else:X2=1 if a[3] in codeX: if a[3] == codeX[3]: P3=1 else: V3=1 else:X3=1 print(" "+"P="+str(P0+P1+P2+P3)+",V="+str(V0+V1+V2+V3)+",X="+str(X0+X1+X2+X3)) name = input('Turn #4 : ') a = name a = [a[0],a[1],a[2],a[3]] P0=0 P1=0 P2=0 P3=0 V0=0 V1=0 V2=0 V3=0 X0=0 X1=0 X2=0 X3=0 if a==codeX: print(WINNING_MSG) else: if a[0] in codeX: if a[0] == codeX[0]: P0=1 else: V0=1 else:X0=1 if a[1] in codeX: if a[1] == codeX[1]: P1=1 else: V1=1 else:X1=1 if a[2] in codeX: if a[2] == codeX[2]: P2=1 else: V2=1 else:X2=1 if a[3] in codeX: if a[3] == codeX[3]: P3=1 else: V3=1 else:X3=1 print(" "+"P="+str(P0+P1+P2+P3)+",V="+str(V0+V1+V2+V3)+",X="+str(X0+X1+X2+X3)) print('Sorry! You just lost it.') print('The answer is',code) print("Please"+" try again...") |
# 6330252221 (20.00) 107 (2021-02-15 15:53) x=input("Turn #1 : ") x1=x[0] x2=x[1] x3=x[2] x4=x[3] P=0 V=0 X=0 if x1==code[0]: P+=1 if x2==code[1]: P+=1 if x3==code[2]: P+=1 if x4==code[3]: P+=1 if x1 in code and not x1==code[0]: V+=1 if x2 in code and not x2==code[1]: V+=1 if x3 in code and not x3==code[2]: V+=1 if x4 in code and not x4==code[3]: V+=1 if x1 not in code: X+=1 if x2 not in code: X+=1 if x3 not in code: X+=1 if x4 not in code: X+=1 if P==4: print("Congratulations! You won the game.") else: print(" "+"P="+str(P)+",V="+str(V)+",X="+str(X)) x=input("Turn #2 : ") x1=x[0] x2=x[1] x3=x[2] x4=x[3] P=0 V=0 X=0 if x1==code[0]: P+=1 if x2==code[1]: P+=1 if x3==code[2]: P+=1 if x4==code[3]: P+=1 if x1 in code and not x1==code[0]: V+=1 if x2 in code and not x2==code[1]: V+=1 if x3 in code and not x3==code[2]: V+=1 if x4 in code and not x4==code[3]: V+=1 if x1 not in code: X+=1 if x2 not in code: X+=1 if x3 not in code: X+=1 if x4 not in code: X+=1 if P==4: print("Congratulations! You won the game.") else: print(" "+"P="+str(P)+",V="+str(V)+",X="+str(X)) x=input("Turn #3 : ") x1=x[0] x2=x[1] x3=x[2] x4=x[3] P=0 V=0 X=0 if x1==code[0]: P+=1 if x2==code[1]: P+=1 if x3==code[2]: P+=1 if x4==code[3]: P+=1 if x1 in code and not x1==code[0]: V+=1 if x2 in code and not x2==code[1]: V+=1 if x3 in code and not x3==code[2]: V+=1 if x4 in code and not x4==code[3]: V+=1 if x1 not in code: X+=1 if x2 not in code: X+=1 if x3 not in code: X+=1 if x4 not in code: X+=1 if P==4: print("Congratulations! You won the game.") else: print(" "+"P="+str(P)+",V="+str(V)+",X="+str(X)) x=input("Turn #4 : ") x1=x[0] x2=x[1] x3=x[2] x4=x[3] P=0 V=0 X=0 if x1==code[0]: P+=1 if x2==code[1]: P+=1 if x3==code[2]: P+=1 if x4==code[3]: P+=1 if x1 in code and not x1==code[0]: V+=1 if x2 in code and not x2==code[1]: V+=1 if x3 in code and not x3==code[2]: V+=1 if x4 in code and not x4==code[3]: V+=1 if x1 not in code: X+=1 if x2 not in code: X+=1 if x3 not in code: X+=1 if x4 not in code: X+=1 if P==4: print("Congratulations! You won the game.") else: print(" "+"P="+str(P)+",V="+str(V)+",X="+str(X)) print("Sorry! You just lost it.") print("The answer is "+code) print("Please try again...") |
# 6330253921 (20.00) 108 (2021-02-11 22:07) na1 = str(input('Turn #1 : ')) P1 = 0 V1 = 0 X1 = 0 if na1[0] in code: if na1[0] == code[0]: P1 = P1+1 else: V1 = V1+1 else: X1 = X1+1 if na1[1] in code: if na1[1] == code[1]: P1 = P1+1 else: V1 = V1+1 else: X1 = X1+1 if na1[2] in code: if na1[2] == code[2]: P1 = P1+1 else: V1 = V1+1 else: X1 = X1+1 if na1[3] in code: if na1[3] == code[3]: P1 = P1+1 else: V1 = V1+1 else: X1 = X1+1 if P1!=4: print(' '*10+'P='+str(P1)+','+'V='+str(V1)+','+'X='+str(X1)) na2 = str(input('Turn #2 : ')) P2 = 0 V2 = 0 X2 = 0 if na2[0] in code: if na2[0] == code[0]: P2 = P2+1 else: V2 = V2+1 else: X2 = X2+1 if na2[1] in code: if na2[1] == code[1]: P2 = P2+1 else: V2 = V2+1 else: X2 = X2+1 if na2[2] in code: if na2[2] == code[2]: P2 = P2+1 else: V2 = V2+1 else: X2 = X2+1 if na2[3] in code: if na2[3] == code[3]: P2 = P2+1 else: V2 = V2+1 else: X2 = X2+1 if P2!=4: print(' '*10+'P='+str(P2)+','+'V='+str(V2)+','+'X='+str(X2)) na3 = str(input('Turn #3 : ')) P3 = 0 V3 = 0 X3 = 0 if na3[0] in code: if na3[0] == code[0]: P3 = P3+1 else: V3 = V3+1 else: X3 = X3+1 if na3[1] in code: if na3[1] == code[1]: P3 = P3+1 else: V3 = V3+1 else: X3 = X3+1 if na3[2] in code: if na3[2] == code[2]: P3 = P3+1 else: V3 = V3+1 else: X3 = X3+1 if na3[3] in code: if na3[3] == code[3]: P3 = P3+1 else: V3 = V3+1 else: X3 = X3+1 if P3!=4: print(' '*10+'P='+str(P3)+','+'V='+str(V3)+','+'X='+str(X3)) na4 = str(input('Turn #4 : ')) P4 = 0 V4 = 0 X4 = 0 if na4[0] in code: if na4[0] == code[0]: P4 = P4+1 else: V4 = V4+1 else: X4 = X4+1 if na4[1] in code: if na4[1] == code[1]: P4 = P4+1 else: V4 = V4+1 else: X4 = X4+1 if na4[2] in code: if na4[2] == code[2]: P4 = P4+1 else: V4 = V4+1 else: X4 = X4+1 if na4[3] in code: if na4[3] == code[3]: P4 = P4+1 else: V4 = V4+1 else: X4 = X4+1 if P4!=4: print(' '*10+'P='+str(P4)+','+'V='+str(V4)+','+'X='+str(X4)) print(LOSING_MSG) print('The answer is '+code) print('Please try again...') else: print(WINNING_MSG) else: print(WINNING_MSG) else: print(WINNING_MSG) else: print(WINNING_MSG) |
# 6330254521 (17.40) 109 (2021-02-12 01:20) def Check_code(guess_code,code): p=0 v=0 x=0 if guess_code[0] == code[0]: p+=1 elif guess_code[0] == code[1]: v+=1 elif guess_code[0] == code[2]: v+=1 elif guess_code[0] == code[3]: v+=1 else: x+=1 if guess_code[1] == code[0]: v+=1 elif guess_code[1] == code[1]: p+=1 elif guess_code[1] == code[2]: v+=1 elif guess_code[1] == code[3]: v+=1 else: x+=1 if guess_code[2] == code[0]: v+=1 elif guess_code[2] == code[1]: v+=1 elif guess_code[2] == code[2]: p+=1 elif guess_code[2] == code[3]: v+=1 else: x+=1 if guess_code[3] == code[0]: v+=1 elif guess_code[3] == code[1]: v+=1 elif guess_code[3] == code[2]: v+=1 elif guess_code[3] == code[3]: p+=1 else: x+=1 return p,v,x Input =input("Turn #1 : ") P=0 V=0 X=0 z = Check_code(Input,code) P+=int(z[0]) V+=int(z[1]) X+=int(z[2]) if P==4: print(WINNING_MSG) else: print(" "+"P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) Input =input("Turn #2 : ") P=0 V=0 X=0 z = Check_code(Input,code) P+=int(z[0]) V+=int(z[1]) X+=int(z[2]) if P==4: print(WINNING_MSG) else: print(" "+"P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) Input =input("Turn #3 : ") P=0 V=0 X=0 z = Check_code(Input,code) P+=int(z[0]) V+=int(z[1]) X+=int(z[2]) if P==4: print(WINNING_MSG) else: print(" "+"P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) Input =input("Turn #4 : ") P=0 V=0 X=0 z = Check_code(Input,code) P+=int(z[0]) V+=int(z[1]) X+=int(z[2]) if P==4: print(WINNING_MSG) else: print(" "+"P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) print(LOSING_MSG) print("The answer is ",code) print("Please try again...") |
# 6330255121 (17.14) 110 (2021-02-15 21:43) insert = input("turn #1 : ") if insert == code : print(WINNING_MSG) else: p=0 if insert[0] == code[0] : p=p+1 if insert[1] == code[1] : p=p+1 if insert[2] == code[2] : p=p+1 if insert[3] == code[3] : p=p+1 v=0 if insert[0] == code[1] or insert[0] == code[2] or insert[0] == code[3] : v=v+1 if insert[1] == code[0] or insert[1] == code[2] or insert[1] == code[3] : v=v+1 if insert[2] == code[0] or insert[2] == code[1] or insert[2] == code[3] : v=v+1 if insert[3] == code[0] or insert[3] == code[1] or insert[3] == code[2] : v=v+1 x=0 if not code[0] in insert : x=x+1 if not code[1] in insert : x=x+1 if not code[2] in insert : x=x+1 if not code[3] in insert : x=x+1 print(" "+"p="+ str(p)+","+"v="+ str(v)+","+"x="+ str(x)) #---------------------------------------------------------------------------------------------- insert = input("turn #2 : ") if insert == code : print(WINNING_MSG) else: p=0 if insert[0] == code[0] : p=p+1 if insert[1] == code[1] : p=p+1 if insert[2] == code[2] : p=p+1 if insert[3] == code[3] : p=p+1 v=0 if insert[0] == code[1] or insert[0] == code[2] or insert[0] == code[3] : v=v+1 if insert[1] == code[0] or insert[1] == code[2] or insert[1] == code[3] : v=v+1 if insert[2] == code[0] or insert[2] == code[1] or insert[2] == code[3] : v=v+1 if insert[3] == code[0] or insert[3] == code[1] or insert[3] == code[2] : v=v+1 x=0 if not code[0] in insert : x=x+1 if not code[1] in insert : x=x+1 if not code[2] in insert : x=x+1 if not code[3] in insert : x=x+1 print(" "+"p="+ str(p)+","+"v="+ str(v)+","+"x="+ str(x)) #---------------------------------------------------------------------------------------------- insert = input("turn #3 : ") if insert == code : print(WINNING_MSG) else: p=0 if insert[0] == code[0] : p=p+1 if insert[1] == code[1] : p=p+1 if insert[2] == code[2] : p=p+1 if insert[3] == code[3] : p=p+1 v=0 if insert[0] == code[1] or insert[0] == code[2] or insert[0] == code[3] : v=v+1 if insert[1] == code[0] or insert[1] == code[2] or insert[1] == code[3] : v=v+1 if insert[2] == code[0] or insert[2] == code[1] or insert[2] == code[3] : v=v+1 if insert[3] == code[0] or insert[3] == code[1] or insert[3] == code[2] : v=v+1 x=0 if not code[0] in insert : x=x+1 if not code[1] in insert : x=x+1 if not code[2] in insert : x=x+1 if not code[3] in insert : x=x+1 print(" "+"p="+ str(p)+","+"v="+ str(v)+","+"x="+ str(x)) #---------------------------------------------------------------------------------------------- insert = input("turn #4 : ") if insert == code : print(WINNING_MSG) else: p=0 if insert[0] == code[0] : p=p+1 if insert[1] == code[1] : p=p+1 if insert[2] == code[2] : p=p+1 if insert[3] == code[3] : p=p+1 v=0 if insert[0] == code[1] or insert[0] == code[2] or insert[0] == code[3] : v=v+1 if insert[1] == code[0] or insert[1] == code[2] or insert[1] == code[3] : v=v+1 if insert[2] == code[0] or insert[2] == code[1] or insert[2] == code[3] : v=v+1 if insert[3] == code[0] or insert[3] == code[1] or insert[3] == code[2] : v=v+1 x=0 if not code[0] in insert : x=x+1 if not code[1] in insert : x=x+1 if not code[2] in insert : x=x+1 if not code[3] in insert : x=x+1 print(" "+"p="+ str(p)+","+"v="+ str(v)+","+"x="+ str(x)) print(LOSING_MSG) print("The answer is "+code) print("Please try again...") |
# 6330256821 (17.37) 111 (2021-02-15 19:16) g=input("Turn #1 : ") p=0 v=0 y=0 x=0 if g==code : print("Congratulations! You won the game.") else : if g[0]==code[0]: p+=1 if g[1]==code[1] : p+=1 if g[2]==code[2] : p+=1 if g[3]==code[3] : p+=1 if g[0] not in code[:] : x+=1 if g[1] not in code[:] : x+=1 if g[2] not in code[:] : x+=1 if g[3] not in code[:] : x+=1 if g[0] in code [:] : y+=1 if g[1] in code [:] : y+=1 if g[2] in code [:] : y+=1 if g[3] in code [:] : y+=1 v=y-p print ("P="+str(p)+",V="+str(v)+",X="+str(x)) d=input("Turn #2 : ") p=0 v=0 y=0 x=0 if d==code : print("Congratulations! You won the game.") else : if d[0]==code[0]: p+=1 if d[1]==code[1] : p+=1 if d[2]==code[2] : p+=1 if d[3]==code[3] : p+=1 if d[0] not in code[:] : x+=1 if d[1] not in code[:] : x+=1 if d[2] not in code[:] : x+=1 if d[3] not in code[:] : x+=1 if d[0] in code [:] : y+=1 if d[1] in code [:] : y+=1 if d[2] in code [:] : y+=1 if d[3] in code [:] : y+=1 v=y-p print ("P="+str(p)+",V="+str(v)+",X="+str(x)) c=input("Turn #3 : ") p=0 v=0 y=0 x=0 if c==code : print("Congratulations! You won the game.") else : if c[0]==code[0]: p+=1 if c[1]==code[1] : p+=1 if c[2]==code[2] : p+=1 if c[3]==code[3] : p+=1 if c[0] not in code[:] : x+=1 if c[1] not in code[:] : x+=1 if c[2] not in code[:] : x+=1 if c[3] not in code[:] : x+=1 if c[0] in code [:] : y+=1 if c[1] in code [:] : y+=1 if c[2] in code [:] : y+=1 if c[3] in code [:] : y+=1 v=y-p print ("P="+str(p)+",V="+str(v)+",X="+str(x)) e=input("Turn #4 : ") if e==code : print("Congratulations! You won the game.") else : print (LOSING_MSG) print ("The answer is"+" "+str(code)) print("Please try again...") |
# 6330257421 (20.00) 112 (2021-02-14 21:04) p=0 a=input('Turn #1 : ') if(p!=4): p=0 v=0 if(a[0]==code[0]): p=p+1 elif(a[0] in code): v=v+1 if(a[1]==code[1]): p=p+1 elif(a[1] in code): v=v+1 if(a[2]==code[2]): p=p+1 elif(a[2] in code): v=v+1 if(a[3]==code[3]): p=p+1 elif(a[3] in code): v=v+1 if(p==4): print('Congratulations! You won the game.') else: print(' '*10+'P='+str(p)+',V='+str(v)+',X='+str(4-p-v)) if(p!=4): a=input('Turn #2 : ') p=0 v=0 if(a[0]==code[0]): p=p+1 elif(a[0] in code): v=v+1 if(a[1]==code[1]): p=p+1 elif(a[1] in code): v=v+1 if(a[2]==code[2]): p=p+1 elif(a[2] in code): v=v+1 if(a[3]==code[3]): p=p+1 elif(a[3] in code): v=v+1 if(p==4): print('Congratulations! You won the game.') else: print(' '*10+'P='+str(p)+',V='+str(v)+',X='+str(4-p-v)) if(p!=4): a=input('Turn #3 : ') p=0 v=0 if(a[0]==code[0]): p=p+1 elif(a[0] in code): v=v+1 if(a[1]==code[1]): p=p+1 elif(a[1] in code): v=v+1 if(a[2]==code[2]): p=p+1 elif(a[2] in code): v=v+1 if(a[3]==code[3]): p=p+1 elif(a[3] in code): v=v+1 if(p==4): print('Congratulations! You won the game.') else: print(' '*10+'P='+str(p)+',V='+str(v)+',X='+str(4-p-v)) if(p!=4): a=input('Turn #4 : ') p=0 v=0 if(a[0]==code[0]): p=p+1 elif(a[0] in code): v=v+1 if(a[1]==code[1]): p=p+1 elif(a[1] in code): v=v+1 if(a[2]==code[2]): p=p+1 elif(a[2] in code): v=v+1 if(a[3]==code[3]): p=p+1 elif(a[3] in code): v=v+1 if(p==4): print('Congratulations! You won the game.') else: print(' '*10+'P='+str(p)+',V='+str(v)+',X='+str(4-p-v)) if(p!=4): print('Sorry! You just lost it.') print('The answer is ',code) print('Please try again...') |
# 6330258021 (20.00) 113 (2021-02-11 12:05) codel = list(code) w = False g = list(input('Turn #1 : ')) if g == codel : print(WINNING_MSG) w = True else : P,V = 0,0 if g[0] == codel[0] : P += 1 if g[1] == codel[1] : P += 1 if g[2] == codel[2] : P += 1 if g[3] == codel[3] : P += 1 if g[0] in codel : V += 1 if g[1] in codel : V += 1 if g[2] in codel : V += 1 if g[3] in codel : V += 1 V -= P X = 4-P-V print(' '*10+'P='+str(P)+',V='+str(V)+',X='+str(X)) if not w : g = list(input('Turn #2 : ')) if g == codel : print(WINNING_MSG) w = True else : P,V = 0,0 if g[0] == codel[0] : P += 1 if g[1] == codel[1] : P += 1 if g[2] == codel[2] : P += 1 if g[3] == codel[3] : P += 1 if g[0] in codel : V += 1 if g[1] in codel : V += 1 if g[2] in codel : V += 1 if g[3] in codel : V += 1 V -= P X = 4-P-V print(' '*10+'P='+str(P)+',V='+str(V)+',X='+str(X)) if not w : g = list(input('Turn #3 : ')) if g == codel : print(WINNING_MSG) w = True else : P,V = 0,0 if g[0] == codel[0] : P += 1 if g[1] == codel[1] : P += 1 if g[2] == codel[2] : P += 1 if g[3] == codel[3] : P += 1 if g[0] in codel : V += 1 if g[1] in codel : V += 1 if g[2] in codel : V += 1 if g[3] in codel : V += 1 V -= P X = 4-P-V print(' '*10+'P='+str(P)+',V='+str(V)+',X='+str(X)) if not w : g = list(input('Turn #4 : ')) if g == codel : print(WINNING_MSG) w = True else : P,V = 0,0 if g[0] == codel[0] : P += 1 if g[1] == codel[1] : P += 1 if g[2] == codel[2] : P += 1 if g[3] == codel[3] : P += 1 if g[0] in codel : V += 1 if g[1] in codel : V += 1 if g[2] in codel : V += 1 if g[3] in codel : V += 1 V -= P X = 4-P-V print(' '*10+'P='+str(P)+',V='+str(V)+',X='+str(X)) print(LOSING_MSG) print('The answer is ',code) print('Please try again...') |
# 6330259721 (14.93) 114 (2021-02-11 13:34) code1 = input("Turn #1 : ") p = 0 v = 0 x = 4 if code[0] == code1[0] : p += 1 x -= 1 if code[1] == code1[1] : p += 1 x -= 1 if code[2] == code1[2] : p += 1 x -= 1 if code[3] == code1[3] : p += 1 x -= 1 if code1[0] in code and code1[0] != code[0] : v += 1 x -= 1 if code1[1] in code and code1[1] != code[1] : v += 1 x -= 1 if code1[2] in code and code1[2] != code[2] : v += 1 x -= 1 if code1[3] in code and code1[3] != code[3] : v += 1 x -= 1 if p == 4 : print(WINNING_MSG) if p != 4 : print(" " + "p=" + str(p) + "," + "v=" + str(v)+ "," + "x=" + str(x) ) code2 = input("Turn #2 : ") p = 0 v = 0 x = 4 if code[0] == code2[0] : p += 1 x -= 1 if code[1] == code2[1] : p += 1 x -= 1 if code[2] == code2[2] : p += 1 x -= 1 if code[3] == code2[3] : p += 1 x -= 1 if code2[0] in code and code2[0] != code[0] : v += 1 x -= 1 if code2[1] in code and code2[1] != code[1] : v += 1 x -= 1 if code2[2] in code and code2[2] != code[2] : v += 1 x -= 1 if code2[3] in code and code2[3] != code[3] : v += 1 x -= 1 if p == 4 : print(WINNING_MSG) if p != 4 : print(" " + "p=" + str(p) + "," + "v=" + str(v) + "," + "x=" + str(x) ) code3 = input("Turn #3 : ") p = 0 v = 0 x = 4 if code[0] == code3[0] : p += 1 x -= 1 if code[1] == code3[1] : p += 1 x -= 1 if code[2] == code3[2] : p += 1 x -= 1 if code[3] == code3[3] : p += 1 x -= 1 if code3[0] in code and code3[0] != code[0] : v += 1 x -= 1 if code3[1] in code and code3[1] != code[1] : v += 1 x -= 1 if code3[2] in code and code3[2] != code[2] : v += 1 x -= 1 if code3[3] in code and code3[3] != code[3] : v += 1 x -= 1 if p == 4 : print(WINNING_MSG) if p != 4 : print(" " + "p=" + str(p) + "," + "v=" + str(v) + "," + "x=" + str(x) ) code4 = input("Turn #4 : ") p = 0 v = 0 x = 4 if code[0] == code4[0] : p += 1 x -= 1 if code[1] == code4[1] : p += 1 x -= 1 if code[2] == code4[2] : p += 1 x -= 1 if code[3] == code4[3] : p += 1 x -= 1 if code4[0] in code and code4[0] != code[0] : v += 1 x -= 1 if code4[1] in code and code4[1] != code[1] : v += 1 x -= 1 if code4[2] in code and code4[2] != code[2] : v += 1 x -= 1 if code4[3] in code and code4[3] != code[3] : v += 1 x -= 1 if p == 4 : print(WINNING_MSG) if p != 4 : print(LOSING_MSG) print("The answer is " + code ) print("Please try again...") |
# 6330260221 (20.00) 115 (2021-02-12 21:58) p = 0 v = 0 x = 0 a = input('Turn #1 : ') if a == code: print(WINNING_MSG) elif a[0]or a[1]or a[2]or a[3] == code[0]or code[1]or code[2]or code[3]: if a[0] == code[0]:p = p+1 if a[1] == code[1]:p = p+1 if a[2] == code[2]: p = p+1 if a[3] == code[3]: p = p+1 if a[0] in code:v = v+1 if a[1] in code: v = v+1 if a[2] in code: v = v+1 if a[3] in code: v = v+1 if a[0]or a[1]or a[2]or a[3]!= code[0]or code[1]or code[2]or code[3]:x = 4-v print(' '+'P='+str(p)+','+'V='+str(v-p)+','+'X='+str(x)) p = 0 v = 0 x = 0 b = input('Turn #2 : ') if b == code: print(WINNING_MSG) elif b[0]or b[1]or b[2]or b[3]== code[0]or code[1]or code[2]or code[3]: if b[0] == code[0]: p = p + 1 if b[1] == code[1]: p = p + 1 if b[2] == code[2]: p = p + 1 if b[3] == code[3]: p = p + 1 if b[0] in code: v = v + 1 if b[1] in code: v = v + 1 if b[2] in code: v = v + 1 if b[3] in code: v = v + 1 if b[0]or b[1]or b[2]or b[3]!= code[0]or code[1]or code[2]or code[3]:x = 4-v print(' '+'P='+str(p)+','+'V='+str(v-p)+','+'X='+str(x)) p = 0 v = 0 x = 0 c = input('Turn #3 : ') if c == code: print(WINNING_MSG) elif c[0]or c[1]or c[2]or c[3]== code[0]or code[1]or code[2]or code[3]: if c[0] == code[0]: p = p + 1 if c[1] == code[1]: p = p + 1 if c[2] == code[2]: p = p + 1 if c[3] == code[3]: p = p + 1 if c[0] in code: v = v + 1 if c[1] in code: v = v + 1 if c[2] in code: v = v + 1 if c[3] in code: v = v + 1 if c[0]or c[1]or c[2]or a[3]!= code[0]or code[1]or code[2]or code[3]:x = 4-v print(' '+'P='+str(p)+','+'V='+str(v-p)+','+'X='+str(x)) p = 0 v = 0 x = 0 d = input('Turn #4 : ') if d == code: print(WINNING_MSG) elif d[0]or d[1]or d[2]or d[3]== code[0]or code[1]or code[2]or code[3]: if d[0] == code[0]: p = p + 1 if d[1] == code[1]: p = p + 1 if d[2] == code[2]: p = p + 1 if d[3] == code[3]: p = p + 1 if d[0] in code: v = v + 1 if d[1] in code: v = v + 1 if d[2] in code: v = v + 1 if d[3] in code: v = v + 1 if d[0]or d[1]or d[2]or d[3]!= code[0]or code[1]or code[2]or code[3]:x = 4-v print(' '+'P='+str(p)+','+'V='+str(v-p)+','+'X='+str(x)) print('Sorry! You just lost it.') print('The answer is ',code) print('Please try again...') |
# 6330261921 (20.00) 116 (2021-02-12 21:38) a=input('Turn #1 : ') p=0 v=0 if len(a)!=4:print('ERROR') else: if code[0]==a[0]:p+=1 if code[1]==a[1]:p+=1 if code[2]==a[2]:p+=1 if code[3]==a[3]:p+=1 if code[0]==a[1]:v+=1 if code[0]==a[2]:v+=1 if code[0]==a[3]:v+=1 if code[1]==a[0]:v+=1 if code[1]==a[2]:v+=1 if code[1]==a[3]:v+=1 if code[2]==a[0]:v+=1 if code[2]==a[1]:v+=1 if code[2]==a[3]:v+=1 if code[3]==a[0]:v+=1 if code[3]==a[1]:v+=1 if code[3]==a[2]:v+=1 x = 4-p-v if p==4:print(WINNING_MSG) else: print(' P='+str(p)+',V='+str(v)+',X='+str(x)) a=input('Turn #2 : ') p=0 v=0 if len(a)!=4:print('ERROR') else: if code[0]==a[0]:p+=1 if code[1]==a[1]:p+=1 if code[2]==a[2]:p+=1 if code[3]==a[3]:p+=1 if code[0]==a[1]:v+=1 if code[0]==a[2]:v+=1 if code[0]==a[3]:v+=1 if code[1]==a[0]:v+=1 if code[1]==a[2]:v+=1 if code[1]==a[3]:v+=1 if code[2]==a[0]:v+=1 if code[2]==a[1]:v+=1 if code[2]==a[3]:v+=1 if code[3]==a[0]:v+=1 if code[3]==a[1]:v+=1 if code[3]==a[2]:v+=1 x = 4-p-v if p==4:print(WINNING_MSG) else: print(' P='+str(p)+',V='+str(v)+',X='+str(x)) a=input('Turn #3 : ') p=0 v=0 if len(a)!=4:print('ERROR') else: if code[0]==a[0]:p+=1 if code[1]==a[1]:p+=1 if code[2]==a[2]:p+=1 if code[3]==a[3]:p+=1 if code[0]==a[1]:v+=1 if code[0]==a[2]:v+=1 if code[0]==a[3]:v+=1 if code[1]==a[0]:v+=1 if code[1]==a[2]:v+=1 if code[1]==a[3]:v+=1 if code[2]==a[0]:v+=1 if code[2]==a[1]:v+=1 if code[2]==a[3]:v+=1 if code[3]==a[0]:v+=1 if code[3]==a[1]:v+=1 if code[3]==a[2]:v+=1 x = 4-p-v if p==4:print(WINNING_MSG) else: print(' P='+str(p)+',V='+str(v)+',X='+str(x)) a=input('Turn #4 : ') p=0 v=0 if len(a)!=4:print('ERROR') else: if code[0]==a[0]:p+=1 if code[1]==a[1]:p+=1 if code[2]==a[2]:p+=1 if code[3]==a[3]:p+=1 if code[0]==a[1]:v+=1 if code[0]==a[2]:v+=1 if code[0]==a[3]:v+=1 if code[1]==a[0]:v+=1 if code[1]==a[2]:v+=1 if code[1]==a[3]:v+=1 if code[2]==a[0]:v+=1 if code[2]==a[1]:v+=1 if code[2]==a[3]:v+=1 if code[3]==a[0]:v+=1 if code[3]==a[1]:v+=1 if code[3]==a[2]:v+=1 x = 4-p-v if p==4:print(WINNING_MSG) else: print(' P='+str(p)+',V='+str(v)+',X='+str(x)) print(LOSING_MSG) print('The answer is '+ code) print('Please try again...') |
# 6330262521 (20.00) 117 (2021-02-11 14:05) h = False if not h: P = 0 V = 0 X = 0 i1 = input('Turn #1 : ') if i1[0] in code: if i1[0] == code[0]:P +=1 else: V +=1 if i1[1] in code: if i1[1] == code[1]:P +=1 else: V +=1 if i1[2] in code: if i1[2] == code[2]:P +=1 else: V +=1 if i1[3] in code: if i1[3] == code[3]:P +=1 else: V +=1 X = 4-P-V if i1 == code: print(WINNING_MSG) h = True else: print(' P=' + str(P)+',V='+str(V)+',X='+str(X)) if not h: P = 0 V = 0 X = 0 i1 = input('Turn #2 : ') if i1[0] in code: if i1[0] == code[0]:P +=1 else: V +=1 if i1[1] in code: if i1[1] == code[1]:P +=1 else: V +=1 if i1[2] in code: if i1[2] == code[2]:P +=1 else: V +=1 if i1[3] in code: if i1[3] == code[3]:P +=1 else: V +=1 X = 4-P-V if i1 == code: print(WINNING_MSG) h = True else: print(' P=' + str(P)+',V='+str(V)+',X='+str(X)) if not h: P = 0 V = 0 X = 0 i1 = input('Turn #3 : ') if i1[0] in code: if i1[0] == code[0]:P +=1 else: V +=1 if i1[1] in code: if i1[1] == code[1]:P +=1 else: V +=1 if i1[2] in code: if i1[2] == code[2]:P +=1 else: V +=1 if i1[3] in code: if i1[3] == code[3]:P +=1 else: V +=1 X = 4-P-V if i1 == code: print(WINNING_MSG) h = True else: print(' P=' + str(P)+',V='+str(V)+',X='+str(X)) if not h: P = 0 V = 0 X = 0 i1 = input('Turn #4 : ') if i1[0] in code: if i1[0] == code[0]:P +=1 else: V +=1 if i1[1] in code: if i1[1] == code[1]:P +=1 else: V +=1 if i1[2] in code: if i1[2] == code[2]:P +=1 else: V +=1 if i1[3] in code: if i1[3] == code[3]:P +=1 else: V +=1 X = 4-P-V if i1 == code: print(WINNING_MSG) h = True else: print(' P=' + str(P)+',V='+str(V)+',X='+str(X)) print(LOSING_MSG) print('The answer is ' + code) print('Please try again...') |
# 6330263121 (20.00) 118 (2021-02-15 12:27) def random (g): x=0 v=0 p=0 c0 = code[0] c1 = code[1] c2 = code[2] c3 = code[3] m0 = g[0] m1 = g[1] m2 = g[2] m3 = g[3] if m0==c0: p+=1 elif m0 == c1 or m0 ==c2 or m0 ==c3: v+=1 else: x+=1 if m1==c1: p+=1 elif m1 == c0 or m1 ==c2 or m1 ==c3: v+=1 else: x+=1 if m2==c2: p+=1 elif m2 == c1 or m2 ==c0 or m2 ==c3: v+=1 else: x+=1 if m3==c3: p+=1 elif m3 == c1 or m3 ==c2 or m3 ==c0: v+=1 else: x+=1 if g == code: return('Congratulations! You won the game.') else : return(' 'f'P={p},V={v},X={x}') g1 = input('Turn #1 : ') a1 = random(g1) r1 = print(a1) if a1 =='Congratulations! You won the game.': exit else: g2 = input('Turn #2 : ') a2 = random(g2) print(a2) if a2 == 'Congratulations! You won the game.': exit else: g3 = input('Turn #3 : ') a3 = random(g3) print(a3) if a3 == 'Congratulations! You won the game.': exit else : g4 = input('Turn #4 : ') a4 = random(g4) print (a4) if a4 =='Congratulations! You won the game.': exit else : print('Sorry! You just lost it.') print('The answer is'' 'f'{code}') print('Please try again...') |
# 6330264821 (20.00) 119 (2021-02-15 22:15) x = input("Turn #1 : ") if x[0] == code[0] and x[1] == code[1] and x[2] == code[2] \ and x[3] == code[3]: print(WINNING_MSG) elif x[0] == code[0] and x[1] == code[1] and x[2] == code[2] : print(' P=3,V=0,X=1') elif x[0] == code[0] and x[1] == code[1] and x[3] == code[3] : print(' P=3,V=0,X=1') elif x[0] == code[0] and x[3] == code[3] and x[2] == code[2] : print(' P=3,V=0,X=1') elif x[3] == code[3] and x[1] == code[1] and x[2] == code[2] : print(' P=3,V=0,X=1') elif x[0] == code[0] and x[1] == code[1] and x[2] in code[0:] and x[3] in code[0:]: print(' P=2,V=2,X=0') elif x[0] == code[0] and x[2] == code[2] and x[1] in code[0:] and x[3] in code[0:]: print(' P=2,V=2,X=0') elif x[0] == code[0] and x[3] == code[3] and x[1] in code[0:] and x[2] in code[0:]: print(' P=2,V=2,X=0') elif x[1] == code[1] and x[2] == code[2] and x[0] in code[0:] and x[3] in code[0:]: print(' P=2,V=2,X=0') elif x[1] == code[1] and x[3] == code[3] and x[0] in code[0:] and x[2] in code[0:]: print(' P=2,V=2,X=0') elif x[3] == code[3] and x[2] == code[2] and x[1] in code[0:] and x[0] in code[0:]: print(' P=2,V=2,X=0') elif x[0] == code[0] and x[1] == code[1] and x[2] in code[0:] : print(' P=2,V=1,X=1') elif x[0] == code[0] and x[1] == code[1] and x[3] in code[0:] : print(' P=2,V=1,X=1') elif x[0] == code[0] and x[2] == code[2] and x[1] in code[0:] : print(' P=2,V=1,X=1') elif x[0] == code[0] and x[2] == code[2] and x[3] in code[0:] : print(' P=2,V=1,X=1') elif x[0] == code[0] and x[3] == code[3] and x[1] in code[0:] : print(' P=2,V=1,X=1') elif x[0] == code[0] and x[3] == code[3] and x[2] in code[0:] : print(' P=2,V=1,X=1') elif x[1] == code[1] and x[2] == code[2] and x[0] in code[0:] : print(' P=2,V=1,X=1') elif x[1] == code[1] and x[2] == code[2] and x[3] in code[0:] : print(' P=2,V=1,X=1') elif x[1] == code[1] and x[3] == code[3] and x[0] in code[0:] : print(' P=2,V=1,X=1') elif x[1] == code[1] and x[3] == code[3] and x[2] in code[0:] : print(' P=2,V=1,X=1') elif x[3] == code[3] and x[2] == code[2] and x[1] in code[0:] : print(' P=2,V=1,X=1') elif x[3] == code[3] and x[2] == code[2] and x[0] in code[0:] : print(' P=2,V=1,X=1') elif x[0] == code[0] and x[1] == code[1] : print(' P=2,V=0,X=2') elif x[0] == code[0] and x[2] == code[2] : print(' P=2,V=0,X=2') elif x[0] == code[0] and x[3] == code[3] : print(' P=2,V=0,X=2') elif x[1] == code[1] and x[2] == code[2] : print(' P=2,V=0,X=2') elif x[1] == code[1] and x[3] == code[3] : print(' P=2,V=0,X=2') elif x[3] == code[3] and x[2] == code[2] : print(' P=2,V=0,X=2') elif x[0] == code[0] and x[1] in code[0:] and x[2] in code[0:] and x[3] in code[0:]: print(' P=1,V=3,X=0') elif x[1] == code[1] and x[0] in code[0:] and x[2] in code[0:] and x[3] in code[0:]: print(' P=1,V=3,X=0') elif x[2] == code[2] and x[0] in code[0:] and x[1] in code[0:] and x[3] in code[0:]: print(' P=1,V=3,X=0') elif x[3] == code[3] and x[0] in code[0:] and x[1] in code[0:] and x[2] in code[0:]: print(' P=1,V=3,X=0') elif x[0] == code[0] and x[1] in code[0:] and x[2] in code[0:] : print(' P=1,V=2,X=1') elif x[0] == code[0] and x[1] in code[0:] and x[3] in code[0:] : print(' P=1,V=2,X=1') elif x[0] == code[0] and x[3] in code[0:] and x[2] in code[0:] : print(' P=1,V=2,X=1') elif x[1] == code[1] and x[0] in code[0:] and x[2] in code[0:] : print(' P=1,V=2,X=1') elif x[1] == code[1] and x[0] in code[0:] and x[3] in code[0:] : print(' P=1,V=2,X=1') elif x[1] == code[1] and x[3] in code[0:] and x[2] in code[0:] : print(' P=1,V=2,X=1') elif x[2] == code[2] and x[0] in code[0:] and x[1] in code[0:] : print(' P=1,V=2,X=1') elif x[2] == code[2] and x[0] in code[0:] and x[3] in code[0:] : print(' P=1,V=2,X=1') elif x[2] == code[2] and x[3] in code[0:] and x[1] in code[0:] : print(' P=1,V=2,X=1') elif x[3] == code[3] and x[0] in code[0:] and x[1] in code[0:] : print(' P=1,V=2,X=1') elif x[3] == code[3] and x[0] in code[0:] and x[2] in code[0:] : print(' P=1,V=2,X=1') elif x[3] == code[3] and x[2] in code[0:] and x[1] in code[0:] : print(' P=1,V=2,X=1') elif x[0] == code[0] : print(' P=1,V=1,X=2') elif x[1] == code[1] : print(' P=1,V=1,X=2') elif x[2] == code[2] : print(' P=1,V=1,X=2') elif x[3] == code[3] : print(' P=1,V=1,X=2') elif x[0] in code[0:] and x[1] in code[0:] and x[2] in code[0:] and x[3] in code[0:]: print(' P=0,V=4,X=0') elif x[0] in code[0:] and x[1] in code[0:] and x[2] in code[0:]: print(' P=0,V=3,X=1') elif x[0] in code[0:] and x[1] in code[0:] and x[3] in code[0:]: print(' P=0,V=3,X=1') elif x[0] in code[0:] and x[2] in code[0:] and x[3] in code[0:]: print(' P=0,V=3,X=1') elif x[2] in code[0:] and x[1] in code[0:] and x[3] in code[0:]: print(' P=0,V=3,X=1') elif x[0] in code[0:] and x[1] in code[0:] : print(' P=0,V=2,X=2') elif x[0] in code[0:] and x[2] in code[0:] : print(' P=0,V=2,X=2') elif x[0] in code[0:] and x[3] in code[0:] : print(' P=0,V=2,X=2') elif x[1] in code[0:] and x[2] in code[0:] : print(' P=0,V=2,X=2') elif x[1] in code[0:] and x[3] in code[0:] : print(' P=0,V=2,X=2') elif x[2] in code[0:] and x[3] in code[0:] : print(' P=0,V=2,X=2') if x[0] != code[0] or x[1] != code[1] or x[2] != code[2] or x[3] != code[3]: x = input("Turn #2 : ") if x[0] == code[0] and x[1] == code[1] and x[2] == code[2] and x[3] == code[3]: print(WINNING_MSG) elif x[0] == code[0] and x[1] == code[1] and x[2] == code[2] : print(' P=3,V=0,X=1') elif x[0] == code[0] and x[1] == code[1] and x[3] == code[3] : print(' P=3,V=0,X=1') elif x[0] == code[0] and x[3] == code[3] and x[2] == code[2] : print(' P=3,V=0,X=1') elif x[3] == code[3] and x[1] == code[1] and x[2] == code[2] : print(' P=3,V=0,X=1') elif x[0] == code[0] and x[1] == code[1] and x[2] in code[0:] and x[3] in code[0:]: print(' P=2,V=2,X=0') elif x[0] == code[0] and x[2] == code[2] and x[1] in code[0:] and x[3] in code[0:]: print(' P=2,V=2,X=0') elif x[0] == code[0] and x[3] == code[3] and x[1] in code[0:] and x[2] in code[0:]: print(' P=2,V=2,X=0') elif x[1] == code[1] and x[2] == code[2] and x[0] in code[0:] and x[3] in code[0:]: print(' P=2,V=2,X=0') elif x[1] == code[1] and x[3] == code[3] and x[0] in code[0:] and x[2] in code[0:]: print(' P=2,V=2,X=0') elif x[3] == code[3] and x[2] == code[2] and x[1] in code[0:] and x[0] in code[0:]: print(' P=2,V=2,X=0') elif x[0] == code[0] and x[1] == code[1] and x[2] in code[0:] : print(' P=2,V=1,X=1') elif x[0] == code[0] and x[1] == code[1] and x[3] in code[0:] : print(' P=2,V=1,X=1') elif x[0] == code[0] and x[2] == code[2] and x[1] in code[0:] : print(' P=2,V=1,X=1') elif x[0] == code[0] and x[2] == code[2] and x[3] in code[0:] : print(' P=2,V=1,X=1') elif x[0] == code[0] and x[3] == code[3] and x[1] in code[0:] : print(' P=2,V=1,X=1') elif x[0] == code[0] and x[3] == code[3] and x[2] in code[0:] : print(' P=2,V=1,X=1') elif x[1] == code[1] and x[2] == code[2] and x[0] in code[0:] : print(' P=2,V=1,X=1') elif x[1] == code[1] and x[2] == code[2] and x[3] in code[0:] : print(' P=2,V=1,X=1') elif x[1] == code[1] and x[3] == code[3] and x[0] in code[0:] : print(' P=2,V=1,X=1') elif x[1] == code[1] and x[3] == code[3] and x[2] in code[0:] : print(' P=2,V=1,X=1') elif x[3] == code[3] and x[2] == code[2] and x[1] in code[0:] : print(' P=2,V=1,X=1') elif x[3] == code[3] and x[2] == code[2] and x[0] in code[0:] : print(' P=2,V=1,X=1') elif x[0] == code[0] and x[1] == code[1] : print(' P=2,V=0,X=2') elif x[0] == code[0] and x[2] == code[2] : print(' P=2,V=0,X=2') elif x[0] == code[0] and x[3] == code[3] : print(' P=2,V=0,X=2') elif x[1] == code[1] and x[2] == code[2] : print(' P=2,V=0,X=2') elif x[1] == code[1] and x[3] == code[3] : print(' P=2,V=0,X=2') elif x[3] == code[3] and x[2] == code[2] : print(' P=2,V=0,X=2') elif x[0] == code[0] and x[1] in code[0:] and x[2] in code[0:] and x[3] in code[0:]: print(' P=1,V=3,X=0') elif x[1] == code[1] and x[0] in code[0:] and x[2] in code[0:] and x[3] in code[0:]: print(' P=1,V=3,X=0') elif x[2] == code[2] and x[0] in code[0:] and x[1] in code[0:] and x[3] in code[0:]: print(' P=1,V=3,X=0') elif x[3] == code[3] and x[0] in code[0:] and x[1] in code[0:] and x[2] in code[0:]: print(' P=1,V=3,X=0') elif x[0] == code[0] and x[1] in code[0:] and x[2] in code[0:] : print(' P=1,V=2,X=1') elif x[0] == code[0] and x[1] in code[0:] and x[3] in code[0:] : print(' P=1,V=2,X=1') elif x[0] == code[0] and x[3] in code[0:] and x[2] in code[0:] : print(' P=1,V=2,X=1') elif x[1] == code[1] and x[0] in code[0:] and x[2] in code[0:] : print(' P=1,V=2,X=1') elif x[1] == code[1] and x[0] in code[0:] and x[3] in code[0:] : print(' P=1,V=2,X=1') elif x[1] == code[1] and x[3] in code[0:] and x[2] in code[0:] : print(' P=1,V=2,X=1') elif x[2] == code[2] and x[0] in code[0:] and x[1] in code[0:] : print(' P=1,V=2,X=1') elif x[2] == code[2] and x[0] in code[0:] and x[3] in code[0:] : print(' P=1,V=2,X=1') elif x[2] == code[2] and x[3] in code[0:] and x[1] in code[0:] : print(' P=1,V=2,X=1') elif x[3] == code[3] and x[0] in code[0:] and x[1] in code[0:] : print(' P=1,V=2,X=1') elif x[3] == code[3] and x[0] in code[0:] and x[2] in code[0:] : print(' P=1,V=2,X=1') elif x[3] == code[3] and x[2] in code[0:] and x[1] in code[0:] : print(' P=1,V=2,X=1') elif x[0] == code[0] : print(' P=1,V=1,X=2') elif x[1] == code[1] : print(' P=1,V=1,X=2') elif x[2] == code[2] : print(' P=1,V=1,X=2') elif x[3] == code[3] : print(' P=1,V=1,X=2') elif x[0] in code[0:] and x[1] in code[0:] and x[2] in code[0:] and x[3] in code[0:]: print(' P=0,V=4,X=0') elif x[0] in code[0:] and x[1] in code[0:] and x[2] in code[0:]: print(' P=0,V=3,X=1') elif x[0] in code[0:] and x[1] in code[0:] and x[3] in code[0:]: print(' P=0,V=3,X=1') elif x[0] in code[0:] and x[2] in code[0:] and x[3] in code[0:]: print(' P=0,V=3,X=1') elif x[2] in code[0:] and x[1] in code[0:] and x[3] in code[0:]: print(' P=0,V=3,X=1') elif x[0] in code[0:] and x[1] in code[0:] : print(' P=0,V=2,X=2') elif x[0] in code[0:] and x[2] in code[0:] : print(' P=0,V=2,X=2') elif x[0] in code[0:] and x[3] in code[0:] : print(' P=0,V=2,X=2') elif x[1] in code[0:] and x[2] in code[0:] : print(' P=0,V=2,X=2') elif x[1] in code[0:] and x[3] in code[0:] : print(' P=0,V=2,X=2') elif x[2] in code[0:] and x[3] in code[0:] : print(' P=0,V=2,X=2') if x[0] != code[0] or x[1] != code[1] or x[2] != code[2] or x[3] != code[3]: x = input("Turn #3 : ") if x[0] == code[0] and x[1] == code[1] and x[2] == code[2] and x[3] == code[3]: print(WINNING_MSG) elif x[0] == code[0] and x[1] == code[1] and x[2] == code[2] : print(' P=3,V=0,X=1') elif x[0] == code[0] and x[1] == code[1] and x[3] == code[3] : print(' P=3,V=0,X=1') elif x[0] == code[0] and x[3] == code[3] and x[2] == code[2] : print(' P=3,V=0,X=1') elif x[3] == code[3] and x[1] == code[1] and x[2] == code[2] : print(' P=3,V=0,X=1') elif x[0] == code[0] and x[1] == code[1] and x[2] in code[0:] and x[3] in code[0:]: print(' P=2,V=2,X=0') elif x[0] == code[0] and x[2] == code[2] and x[1] in code[0:] and x[3] in code[0:]: print(' P=2,V=2,X=0') elif x[0] == code[0] and x[3] == code[3] and x[1] in code[0:] and x[2] in code[0:]: print(' P=2,V=2,X=0') elif x[1] == code[1] and x[2] == code[2] and x[0] in code[0:] and x[3] in code[0:]: print(' P=2,V=2,X=0') elif x[1] == code[1] and x[3] == code[3] and x[0] in code[0:] and x[2] in code[0:]: print(' P=2,V=2,X=0') elif x[3] == code[3] and x[2] == code[2] and x[1] in code[0:] and x[0] in code[0:]: print(' P=2,V=2,X=0') elif x[0] == code[0] and x[1] == code[1] and x[2] in code[0:] : print(' P=2,V=1,X=1') elif x[0] == code[0] and x[1] == code[1] and x[3] in code[0:] : print(' P=2,V=1,X=1') elif x[0] == code[0] and x[2] == code[2] and x[1] in code[0:] : print(' P=2,V=1,X=1') elif x[0] == code[0] and x[2] == code[2] and x[3] in code[0:] : print(' P=2,V=1,X=1') elif x[0] == code[0] and x[3] == code[3] and x[1] in code[0:] : print(' P=2,V=1,X=1') elif x[0] == code[0] and x[3] == code[3] and x[2] in code[0:] : print(' P=2,V=1,X=1') elif x[1] == code[1] and x[2] == code[2] and x[0] in code[0:] : print(' P=2,V=1,X=1') elif x[1] == code[1] and x[2] == code[2] and x[3] in code[0:] : print(' P=2,V=1,X=1') elif x[1] == code[1] and x[3] == code[3] and x[0] in code[0:] : print(' P=2,V=1,X=1') elif x[1] == code[1] and x[3] == code[3] and x[2] in code[0:] : print(' P=2,V=1,X=1') elif x[3] == code[3] and x[2] == code[2] and x[1] in code[0:] : print(' P=2,V=1,X=1') elif x[3] == code[3] and x[2] == code[2] and x[0] in code[0:] : print(' P=2,V=1,X=1') elif x[0] == code[0] and x[1] == code[1] : print(' P=2,V=0,X=2') elif x[0] == code[0] and x[2] == code[2] : print(' P=2,V=0,X=2') elif x[0] == code[0] and x[3] == code[3] : print(' P=2,V=0,X=2') elif x[1] == code[1] and x[2] == code[2] : print(' P=2,V=0,X=2') elif x[1] == code[1] and x[3] == code[3] : print(' P=2,V=0,X=2') elif x[3] == code[3] and x[2] == code[2] : print(' P=2,V=0,X=2') elif x[0] == code[0] and x[1] in code[0:] and x[2] in code[0:] and x[3] in code[0:]: print(' P=1,V=3,X=0') elif x[1] == code[1] and x[0] in code[0:] and x[2] in code[0:] and x[3] in code[0:]: print(' P=1,V=3,X=0') elif x[2] == code[2] and x[0] in code[0:] and x[1] in code[0:] and x[3] in code[0:]: print(' P=1,V=3,X=0') elif x[3] == code[3] and x[0] in code[0:] and x[1] in code[0:] and x[2] in code[0:]: print(' P=1,V=3,X=0') elif x[0] == code[0] and x[1] in code[0:] and x[2] in code[0:] : print(' P=1,V=2,X=1') elif x[0] == code[0] and x[1] in code[0:] and x[3] in code[0:] : print(' P=1,V=2,X=1') elif x[0] == code[0] and x[3] in code[0:] and x[2] in code[0:] : print(' P=1,V=2,X=1') elif x[1] == code[1] and x[0] in code[0:] and x[2] in code[0:] : print(' P=1,V=2,X=1') elif x[1] == code[1] and x[0] in code[0:] and x[3] in code[0:] : print(' P=1,V=2,X=1') elif x[1] == code[1] and x[3] in code[0:] and x[2] in code[0:] : print(' P=1,V=2,X=1') elif x[2] == code[2] and x[0] in code[0:] and x[1] in code[0:] : print(' P=1,V=2,X=1') elif x[2] == code[2] and x[0] in code[0:] and x[3] in code[0:] : print(' P=1,V=2,X=1') elif x[2] == code[2] and x[3] in code[0:] and x[1] in code[0:] : print(' P=1,V=2,X=1') elif x[3] == code[3] and x[0] in code[0:] and x[1] in code[0:] : print(' P=1,V=2,X=1') elif x[3] == code[3] and x[0] in code[0:] and x[2] in code[0:] : print(' P=1,V=2,X=1') elif x[3] == code[3] and x[2] in code[0:] and x[1] in code[0:] : print(' P=1,V=2,X=1') elif x[0] == code[0] : print(' P=1,V=1,X=2') elif x[1] == code[1] : print(' P=1,V=1,X=2') elif x[2] == code[2] : print(' P=1,V=1,X=2') elif x[3] == code[3] : print(' P=1,V=1,X=2') elif x[0] in code[0:] and x[1] in code[0:] and x[2] in code[0:] and x[3] in code[0:]: print(' P=0,V=4,X=0') elif x[0] in code[0:] and x[1] in code[0:] and x[2] in code[0:]: print(' P=0,V=3,X=1') elif x[0] in code[0:] and x[1] in code[0:] and x[3] in code[0:]: print(' P=0,V=3,X=1') elif x[0] in code[0:] and x[2] in code[0:] and x[3] in code[0:]: print(' P=0,V=3,X=1') elif x[2] in code[0:] and x[1] in code[0:] and x[3] in code[0:]: print(' P=0,V=3,X=1') elif x[0] in code[0:] and x[1] in code[0:] : print(' P=0,V=2,X=2') elif x[0] in code[0:] and x[2] in code[0:] : print(' P=0,V=2,X=2') elif x[0] in code[0:] and x[3] in code[0:] : print(' P=0,V=2,X=2') elif x[1] in code[0:] and x[2] in code[0:] : print(' P=0,V=2,X=2') elif x[1] in code[0:] and x[3] in code[0:] : print(' P=0,V=2,X=2') elif x[2] in code[0:] and x[3] in code[0:] : print(' P=0,V=2,X=2') if x[0] != code[0] or x[1] != code[1] or x[2] != code[2] or x[3] != code[3]: x = input("Turn #4 : ") if x[0] == code[0] and x[1] == code[1] and x[2] == code[2] and x[3] == code[3]: print(WINNING_MSG) elif x[0] == code[0] and x[1] == code[1] and x[2] == code[2] : print(' P=3,V=0,X=1') elif x[0] == code[0] and x[1] == code[1] and x[3] == code[3] : print(' P=3,V=0,X=1') elif x[0] == code[0] and x[3] == code[3] and x[2] == code[2] : print(' P=3,V=0,X=1') elif x[3] == code[3] and x[1] == code[1] and x[2] == code[2] : print(' P=3,V=0,X=1') elif x[0] == code[0] and x[1] == code[1] and x[2] in code[0:] and x[3] in code[0:]: print(' P=2,V=2,X=0') elif x[0] == code[0] and x[2] == code[2] and x[1] in code[0:] and x[3] in code[0:]: print(' P=2,V=2,X=0') elif x[0] == code[0] and x[3] == code[3] and x[1] in code[0:] and x[2] in code[0:]: print(' P=2,V=2,X=0') elif x[1] == code[1] and x[2] == code[2] and x[0] in code[0:] and x[3] in code[0:]: print(' P=2,V=2,X=0') elif x[1] == code[1] and x[3] == code[3] and x[0] in code[0:] and x[2] in code[0:]: print(' P=2,V=2,X=0') elif x[3] == code[3] and x[2] == code[2] and x[1] in code[0:] and x[0] in code[0:]: print(' P=2,V=2,X=0') elif x[0] == code[0] and x[1] == code[1] and x[2] in code[0:] : print(' P=2,V=1,X=1') elif x[0] == code[0] and x[1] == code[1] and x[3] in code[0:] : print(' P=2,V=1,X=1') elif x[0] == code[0] and x[2] == code[2] and x[1] in code[0:] : print(' P=2,V=1,X=1') elif x[0] == code[0] and x[2] == code[2] and x[3] in code[0:] : print(' P=2,V=1,X=1') elif x[0] == code[0] and x[3] == code[3] and x[1] in code[0:] : print(' P=2,V=1,X=1') elif x[0] == code[0] and x[3] == code[3] and x[2] in code[0:] : print(' P=2,V=1,X=1') elif x[1] == code[1] and x[2] == code[2] and x[0] in code[0:] : print(' P=2,V=1,X=1') elif x[1] == code[1] and x[2] == code[2] and x[3] in code[0:] : print(' P=2,V=1,X=1') elif x[1] == code[1] and x[3] == code[3] and x[0] in code[0:] : print(' P=2,V=1,X=1') elif x[1] == code[1] and x[3] == code[3] and x[2] in code[0:] : print(' P=2,V=1,X=1') elif x[3] == code[3] and x[2] == code[2] and x[1] in code[0:] : print(' P=2,V=1,X=1') elif x[3] == code[3] and x[2] == code[2] and x[0] in code[0:] : print(' P=2,V=1,X=1') elif x[0] == code[0] and x[1] == code[1] : print(' P=2,V=0,X=2') elif x[0] == code[0] and x[2] == code[2] : print(' P=2,V=0,X=2') elif x[0] == code[0] and x[3] == code[3] : print(' P=2,V=0,X=2') elif x[1] == code[1] and x[2] == code[2] : print(' P=2,V=0,X=2') elif x[1] == code[1] and x[3] == code[3] : print(' P=2,V=0,X=2') elif x[3] == code[3] and x[2] == code[2] : print(' P=2,V=0,X=2') elif x[0] == code[0] and x[1] in code[0:] and x[2] in code[0:] and x[3] in code[0:]: print(' P=1,V=3,X=0') elif x[1] == code[1] and x[0] in code[0:] and x[2] in code[0:] and x[3] in code[0:]: print(' P=1,V=3,X=0') elif x[2] == code[2] and x[0] in code[0:] and x[1] in code[0:] and x[3] in code[0:]: print(' P=1,V=3,X=0') elif x[3] == code[3] and x[0] in code[0:] and x[1] in code[0:] and x[2] in code[0:]: print(' P=1,V=3,X=0') elif x[0] == code[0] and x[1] in code[0:] and x[2] in code[0:] : print(' P=1,V=2,X=1') elif x[0] == code[0] and x[1] in code[0:] and x[3] in code[0:] : print(' P=1,V=2,X=1') elif x[0] == code[0] and x[3] in code[0:] and x[2] in code[0:] : print(' P=1,V=2,X=1') elif x[1] == code[1] and x[0] in code[0:] and x[2] in code[0:] : print(' P=1,V=2,X=1') elif x[1] == code[1] and x[0] in code[0:] and x[3] in code[0:] : print(' P=1,V=2,X=1') elif x[1] == code[1] and x[3] in code[0:] and x[2] in code[0:] : print(' P=1,V=2,X=1') elif x[2] == code[2] and x[0] in code[0:] and x[1] in code[0:] : print(' P=1,V=2,X=1') elif x[2] == code[2] and x[0] in code[0:] and x[3] in code[0:] : print(' P=1,V=2,X=1') elif x[2] == code[2] and x[3] in code[0:] and x[1] in code[0:] : print(' P=1,V=2,X=1') elif x[3] == code[3] and x[0] in code[0:] and x[1] in code[0:] : print(' P=1,V=2,X=1') elif x[3] == code[3] and x[0] in code[0:] and x[2] in code[0:] : print(' P=1,V=2,X=1') elif x[3] == code[3] and x[2] in code[0:] and x[1] in code[0:] : print(' P=1,V=2,X=1') elif x[0] == code[0] : print(' P=1,V=1,X=2') elif x[1] == code[1] : print(' P=1,V=1,X=2') elif x[2] == code[2] : print(' P=1,V=1,X=2') elif x[3] == code[3] : print(' P=1,V=1,X=2') elif x[0] in code[0:] and x[1] in code[0:] and x[2] in code[0:] and x[3] in code[0:]: print(' P=0,V=4,X=0') elif x[0] in code[0:] and x[1] in code[0:] and x[2] in code[0:]: print(' P=0,V=3,X=1') elif x[0] in code[0:] and x[1] in code[0:] and x[3] in code[0:]: print(' P=0,V=3,X=1') elif x[0] in code[0:] and x[2] in code[0:] and x[3] in code[0:]: print(' P=0,V=3,X=1') elif x[2] in code[0:] and x[1] in code[0:] and x[3] in code[0:]: print(' P=0,V=3,X=1') elif x[0] in code[0:] and x[1] in code[0:] : print(' P=0,V=2,X=2') elif x[0] in code[0:] and x[2] in code[0:] : print(' P=0,V=2,X=2') elif x[0] in code[0:] and x[3] in code[0:] : print(' P=0,V=2,X=2') elif x[1] in code[0:] and x[2] in code[0:] : print(' P=0,V=2,X=2') elif x[1] in code[0:] and x[3] in code[0:] : print(' P=0,V=2,X=2') elif x[2] in code[0:] and x[3] in code[0:] : print(' P=0,V=2,X=2') if x[0] != code[0] or x[1] != code[1] or x[2] != code[2] or x[3] != code[3]: print(LOSING_MSG) print('The answer is ' + code) print('Please try again...') |
# 6330265421 (20.00) 120 (2021-02-11 21:28) x = input('Turn #1 : ') P = 0 V = 0 X = 0 if len(x) == 4 and x == code: print(WINNING_MSG) else: if x[0]==code[0]: P +=1 if x[1]==code[1]: P +=1 if x[2]==code[2]: P +=1 if x[3]==code[3]: P +=1 if x[0] in code and x[0] != code[0]: V +=1 if x[1] in code and x[1] != code[1]: V +=1 if x[2] in code and x[2] != code[2]: V +=1 if x[3] in code and x[3] != code[3]: V +=1 if x[0] not in code: X +=1 if x[1] not in code: X +=1 if x[2] not in code: X +=1 if x[3] not in code: X +=1 print(' '*len('Turn #1 : ')+'P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) x = input('Turn #2 : ') P = 0 V = 0 X = 0 if len(x) == 4 and x == code: print(WINNING_MSG) else: if x[0]==code[0]: P +=1 if x[1]==code[1]: P +=1 if x[2]==code[2]: P +=1 if x[3]==code[3]: P +=1 if x[0] in code and x[0] != code[0]: V +=1 if x[1] in code and x[1] != code[1]: V +=1 if x[2] in code and x[2] != code[2]: V +=1 if x[3] in code and x[3] != code[3]: V +=1 if x[0] not in code: X +=1 if x[1] not in code: X +=1 if x[2] not in code: X +=1 if x[3] not in code: X +=1 print(' '*len('Turn #1 : ')+'P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) x = input('Turn #3 : ') P = 0 V = 0 X = 0 if len(x) == 4 and x == code: print(WINNING_MSG) else: if x[0]==code[0]: P +=1 if x[1]==code[1]: P +=1 if x[2]==code[2]: P +=1 if x[3]==code[3]: P +=1 if x[0] in code and x[0] != code[0]: V +=1 if x[1] in code and x[1] != code[1]: V +=1 if x[2] in code and x[2] != code[2]: V +=1 if x[3] in code and x[3] != code[3]: V +=1 if x[0] not in code: X +=1 if x[1] not in code: X +=1 if x[2] not in code: X +=1 if x[3] not in code: X +=1 print(' '*len('Turn #1 : ')+'P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) x = input('Turn #4 : ') P = 0 V = 0 X = 0 if len(x) == 4 and x == code: print(WINNING_MSG) else: if x[0]==code[0]: P +=1 if x[1]==code[1]: P +=1 if x[2]==code[2]: P +=1 if x[3]==code[3]: P +=1 if x[0] in code and x[0] != code[0]: V +=1 if x[1] in code and x[1] != code[1]: V +=1 if x[2] in code and x[2] != code[2]: V +=1 if x[3] in code and x[3] != code[3]: V +=1 if x[0] not in code: X +=1 if x[1] not in code: X +=1 if x[2] not in code: X +=1 if x[3] not in code: X +=1 print(' '*len('Turn #1 : ')+'P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) print(LOSING_MSG) print('The answer is '+ code) print('Please try again...') |
# 6330266021 (19.11) 121 (2021-02-15 23:48) a = input() P1 = 0 V1 = 0 X1 = 0 P2 = 0 V2 = 0 X2 = 0 P3 = 0 V3 = 0 X3 = 0 P3 = 0 V3 = 0 X3 = 0 P4 = 0 V4 = 0 X4 = 0 if a == code : print(WINNING_MSG) else: if a[0] == code[0]: P1+=1 else: P1+=0 if a[1] == code[1]: P1+=1 else: P1+=0 if a[2] == code[2]: P1+=1 else: P1+=0 if a[3] == code[3]: P1+=1 else: P1+=0 if a[0] in code: V1+=1 else: V1+=0 if a[1] in code: V1+=1 else: V1+=0 if a[2] in code: V1+=1 else: V1+=0 if a[3] in code: V1+=1 else: V1+=0 total = "P="+str(int(P1))+",V="+str(int(V1)-int(P1))+",X="+str(abs(4-(int(P1)+(int(V1)-int(P1))))) print("Turn #1 :",str(a)) print(" ",total) b = input() if b == code : print(WINNING_MSG) else: if b[0] == code[0]: P2+=1 else: P2+=0 if b[1] == code[1]: P2+=1 else: P2+=0 if b[2] == code[2]: P2+=1 else: P2+=0 if b[3] == code[3]: P2+=1 else: P2+=0 if b[0] in code: V2+=1 else: V2+=0 if b[1] in code: V2+=1 else: V2+=0 if b[2] in code: V2+=1 else: V2+=0 if b[3] in code: V2+=1 else: V2+=0 total = "P="+str(int(P2))+",V="+str(int(V2)-int(P2))+",X="+str(abs(4-(int(P2)+(int(V2)-int(P2))))) print("Turn #2 :",str(b)) print(" ",total) c = input() if c == code : print(WINNING_MSG) else: if c[0] == code[0]: P3+=1 else: P3+=0 if c[1] == code[1]: P3+=1 else: P3+=0 if c[2] == code[2]: P3+=1 else: P3+=0 if c[3] == code[3]: P3+=1 else: P3+=0 if c[0] in code: V3+=1 else: V3+=0 if c[1] in code: V3+=1 else: V3+=0 if c[2] in code: V3+=1 else: V3+=0 if c[3] in code: V3+=1 else: V3+=0 total = "P="+str(int(P3))+",V="+str(int(V3)-int(P3))+",X="+str(abs(4-(int(P3)+(int(V3)-int(P3))))) print("Turn #3 :",str(c)) print(" ",total) d = input() if d == code : print(WINNING_MSG) else: if d[0] == code[0]: P4+=1 else: P4+=0 if d[1] == code[1]: P4+=1 else: P4+=0 if d[2] == code[2]: P4+=1 else: P4+=0 if d[3] == code[3]: P4+=1 else: P4+=0 if d[0] in code: V4+=1 else: V4+=0 if d[1] in code: V4+=1 else: V4+=0 if d[2] in code: V4+=1 else: V4+=0 if d[3] in code: V4+=1 else: V4+=0 total = "P="+str(int(P4))+",V="+str(int(V4)-int(P4))+",X="+str(abs(4-(int(P4)+(int(V4)-int(P4))))) print("Turn #4 :",str(d)) print(" ",total) print(LOSING_MSG) print("The answer is","",code) print("Please try again...") |
# 6330267721 (20.00) 122 (2021-02-14 19:59) turn = 1 p,v=0,0 while turn <= 4 : x = input("Turn #"+str(turn)+" : ") x = x.upper() if x == code: print(WINNING_MSG) turn +=1 break x,new = [x[0],x[1],x[2],x[3]],[code[0],code[1],code[2],code[3]] check = [''] * 8 check[::2],check[1::2] = new,x check_count,v_check = 0,0 while check_count < 7: if check[check_count] == check[check_count+1]: check[check_count],check[check_count+1] = '0','0' p+=1 check_count +=2 while v_check < 4: if x[v_check] in check[::2] : v+=1 v_check += 1 print(" "*10+"P="+str(p)+","+"V="+str(v)+","+"X="+str(4-p-v)) if turn ==4: print(LOSING_MSG) print("The answer is",code) print("Please try again...") break p,v=0,0 turn +=1 |
# 6330268321 (17.40) 123 (2021-02-15 23:49) u=input("Turn #1 : ") p=0 v=0 x=0 if u[0] in code[0]: p+=1 if u[1] in code[1]: p+=1 if u[2] in code[2]: p+=1 if u[3] in code[3]: p+=1 if u[0] in code and not u[0] in code[0]: v+=1 if u[1] in code and not u[1] in code[1]: v+=1 if u[2] in code and not u[2] in code[2]: v+=1 if u[3] in code and not u[3] in code[3]: v+=1 if not u[0] in code: x+=1 if not u[1] in code: x+=1 if not u[2] in code: x+=1 if not u[3] in code: x+=1 if p==4: print(WINNING_MSG) else: print(" P="+str(p)+","+"V="+str(v)+","+"X="+str(x)) #-------------------------------------------------------------------- y=input("Turn #2 : ") p2=0 v2=0 x2=0 if y[0] in code[0]: p2+=1 if y[1] in code[1]: p2+=1 if y[2] in code[2]: p2+=1 if y[3] in code[3]: p2+=1 if y[0] in code and not y[0] in code[0]: v2+=1 if y[1] in code and not y[1] in code[1]: v2+=1 if y[2] in code and not y[2] in code[2]: v2+=1 if y[3] in code and not y[3] in code[3]: v2+=1 if not y[0] in code: x2+=1 if not y[1] in code: x2+=1 if not y[2] in code: x2+=1 if not y[3] in code: x2+=1 if p2==4: print(WINNING_MSG) else: print(" P="+str(p2)+","+"V="+str(v2)+","+"X="+str(x2)) #------------------------------------------------------------------------ y=input("Turn #3 : ") p3=0 v3=0 x3=0 if y[0] in code[0]: p3+=1 if y[1] in code[1]: p3+=1 if y[2] in code[2]: p3+=1 if y[3] in code[3]: p3+=1 if y[0] in code and not y[0] in code[0]: v3+=1 if y[1] in code and not y[1] in code[1]: v3+=1 if y[2] in code and not y[2] in code[2]: v3+=1 if y[3] in code and not y[3] in code[3]: v3+=1 if not y[0] in code: x3+=1 if not y[1] in code: x3+=1 if not y[2] in code: x3+=1 if not y[3] in code: x3+=1 if p3==4: print(WINNING_MSG) else: print(" P="+str(p3)+","+"V="+str(v3)+","+"X="+str(x3)) #------------------------------------------------------------------- y=input("Turn #4 : ") p4=0 v4=0 x4=0 if y[0] in code[0]: p4+=1 if y[1] in code[1]: p4+=1 if y[2] in code[2]: p4+=1 if y[3] in code[3]: p4+=1 if y[0] in code and not y[0] in code[0]: v4+=1 if y[1] in code and not y[1] in code[1]: v4+=1 if y[2] in code and not y[2] in code[2]: v4+=1 if y[3] in code and not y[3] in code[3]: v4+=1 if not y[0] in code: x4+=1 if not y[1] in code: x4+=1 if not y[2] in code: x4+=1 if not y[3] in code: x4+=1 if p4==4: print(WINNING_MSG) else: print(" P="+str(p4)+","+"V="+str(v4)+","+"X="+str(x4)) print(LOSING_MSG) print("The answer is",code) print("Please try again...") |
# 6330269021 (20.00) 124 (2021-02-14 21:58) code_list = list(code) status = "in game" i = 1 while i <= 4: attempt = input(f"Turn #{i} : ") P = 0 V = 0 X = 4 if attempt[0] in code_list: if attempt[0] == code[0]: P += 1 X -= 1 else: V += 1 X -= 1 if attempt[1] in code_list: if attempt[1] == code[1]: P += 1 X -= 1 else: V += 1 X -= 1 if attempt[2] in code_list: if attempt[2] == code[2]: P += 1 X -= 1 else: V += 1 X -= 1 if attempt[3] in code_list: if attempt[3] == code[3]: P += 1 X -= 1 else: V += 1 X -= 1 if P == 4: status = "won" print(WINNING_MSG) break else: print(f" P={P},V={V},X={X}") i += 1 if status != "won": print("Sorry! You just lost it.") print(f"The answer is {code}") print("Please try again...") |
# 6330270521 (19.89) 125 (2021-02-13 15:49) c = True b = list(code) #print(code) if c : p = 0 v = 0 x = 0 guess = input("Turn #1 : ") a = list(guess) if a[0] in code and a[0] != b[0]: v+=1 if a[1] in code and a[1] != b[1]: v+=1 if a[2] in code and a[2] != b[2]: v+=1 if a[3] in code and a[3] != b[3]: v+=1 if a[0] == b[0] : p+=1 if a[1] == b[1] : p+=1 if a[2] == b[2] : p+=1 if a[3] == b[3] : p+=1 if p == 4 : print(WINNING_MSG) c = False else : x = 4-p-v print(" P={},V={},X={}".format(p,v,x)) if c : p = 0 v = 0 x = 0 guess = input("Turn #2 : ") a = list(guess) if a[0] in code and a[0] != b[0]: v+=1 if a[1] in code and a[1] != b[1]: v+=1 if a[2] in code and a[2] != b[2]: v+=1 if a[3] in code and a[3] != b[3]: v+=1 if a[0] == b[0] : p+=1 if a[1] == b[1] : p+=1 if a[2] == b[2] : p+=1 if a[3] == b[3] : p+=1 if p == 4 : print(WINNING_MSG) c = False else : x = 4-p-v print(" P={},V={},X={}".format(p,v,x)) if c : p = 0 v = 0 x = 0 guess = input("Turn #3 : ") a = list(guess) if a[0] in code and a[0] != b[0]: v+=1 if a[1] in code and a[1] != b[1]: v+=1 if a[2] in code and a[2] != b[2]: v+=1 if a[3] in code and a[3] != b[3]: v+=1 if a[0] == b[0] : p+=1 if a[1] == b[1] : p+=1 if a[2] == b[2] : p+=1 if a[3] == b[3] : p+=1 if p == 4 : print(WINNING_MSG) c = False else : x = 4-p-v print(" P={},V={},X={}".format(p,v,x)) if c : p = 0 v = 0 x = 0 guess = input("Turn #4 : ") a = list(guess) if a[0] in code and a[0] != b[0]: v+=1 if a[1] in code and a[1] != b[1]: v+=1 if a[2] in code and a[2] != b[2]: v+=1 if a[3] in code and a[3] != b[3]: v+=1 if a[0] == b[0] : p+=1 if a[1] == b[1] : p+=1 if a[2] == b[2] : p+=1 if a[3] == b[3] : p+=1 if p == 4 : print(WINNING_MSG) c = False else : x = 4-p-v print(" P={},V={},X={}".format(p,v,x)) print(LOSING_MSG) print('The answer is ',code) print('Please try again') |
# 6330271121 (19.71) 126 (2021-02-13 19:52) def cal(t): p = 0 v = 0 x = 0 if t[0] == code[0] and t[1]==code[1] and t[2]==code[2] and t[3] != code [3]: p+= 3 x += 1 if t[0] == code[0] and t[1]==code[1] and t[2]!=code[2] and t[3] == code [3]: p+= 3 x += 1 if t[0] == code[0] and t[1]!=code[1] and t[2]==code[2] and t[3] == code [3]: p+=3 x += 1 if t[0] != code[0] and t[1]==code[1] and t[2]==code[2] and t[3] == code [3]: p+=3 x+=1 if t[0] != code[0] and t[1]!=code[1] and t[2]==code[2] and t[3] == code [3]: p += 2 if t[1] == code[0]: v += 1 if t[0] == code[1]: v+=1 else: x += 1 else: x += 1 if t[0] == code[1]: v+=1 else: x+=1 if t[0] != code[0] and t[1]==code[1] and t[2]!=code[2] and t[3] == code [3]: p += 2 if t[2] == code[0]: v += 1 if t[0] == code[2]: v+=1 else: x += 1 else: x += 1 if t[0] == code[2]: v+=1 else: x+=1 if t[0] != code[0] and t[1]==code[1] and t[2]==code[2] and t[3] != code [3]: p += 2 if t[3] == code[0]: v += 1 if t[0] == code[3]: v+=1 else: x += 1 else: x += 1 if t[0] == code[3]: v+=1 else: x+=1 if t[0] == code[0] and t[1]!=code[1] and t[2]!=code[2] and t[3] == code [3]: p += 2 if t[2] == code[1]: v += 1 if t[1] == code[2]: v+=1 else: x += 1 else: x += 1 if t[1] == code[2]: v+=1 else: x+=1 if t[0] == code[0] and t[1]==code[1] and t[2]!=code[2] and t[3] != code [3]: p += 2 if t[3] == code[2]: v += 1 if t[2] == code[3]: v+=1 else: x += 1 else: x += 1 if t[2] == code[3]: v+=1 else: x+=1 if t[0] == code[0] and t[1]!=code[1] and t[2]==code[2] and t[3] != code [3]: p += 2 if t[3] == code[1]: v += 1 if t[1] == code[3]: v+=1 else: x += 1 else: x += 1 if t[1] == code[3]: v+=1 else: x+=1 if t[0] != code[0] and t[1]!=code[1] and t[2]!=code[2] and t[3] == code [3]: p+=1 if t[0]==code[2] and t[1]==code[0] and t[2]==code[1]: v += 3 if t[0]==code[1] and t[1]==code[2] and t[2]==code[0]: v += 3 if t[0] not in code[0:3:] and t[1]==code[0] and t[2]==code[1]: v += 2 x += 1 if t[0]==code[2] and t[1] not in code[0:3:] and t[2]==code[1]: v += 2 x += 1 if t[0]==code[2] and t[1]==code[0] and t[2] not in code[0:3:]: v += 2 x += 1 if t[0] not in code[0:3:] and t[1]==code[2] and t[2]==code[0]: v += 2 x += 1 if t[0]==code[1] and t[1] not in code[0:3:] and t[2]==code[0]: v += 2 x += 1 if t[0]==code[1] and t[1]==code[2] and t[2] not in code[0:3:]: v += 2 x += 1 if t[0] not in code[0:3:] and t[1] not in code[0:3:] and t[2]==code[1]: v += 1 x += 2 if t[0] not in code[0:3:] and t[1]==code[0] and t[2] not in code[0:3:]: v += 1 x += 2 if t[0]==code[2] and t[1] not in code[0:3:] and t[2] not in code[0:3:]: v += 1 x += 2 if t[0]==code[1] and t[1] not in code[0:3:] and t[2] not in code[0:3:]: v += 1 x += 2 if t[0] not in code[0:3:] and t[1]==code[2] and t[2] not in code[0:3:]: v += 1 x += 2 if t[0] not in code[0:3:] and t[1] not in code[0:3:] and t[2]==code[0]: v += 1 x += 2 if t[0] not in code[0:3:] and t[1] not in code[0:3:] and t[2] not in code[0:3:]: x += 3 if t[0] != code[0] and t[1]!=code[1] and t[2]==code[2] and t[3] != code [3]: p+=1 if t[0]==code[3] and t[1]==code[0] and t[3]==code[1]: v += 3 if t[0]==code[1] and t[1]==code[3] and t[3]==code[0]: v += 3 if t[0] not in [code[0], code[1], code[3]] and t[1]==code[0] and t[3]==code[1]: v += 2 x += 1 if t[0]==code[3] and t[1] not in [code[0], code[1], code[3]] and t[3]==code[1]: v += 2 x += 1 if t[0]==code[3] and t[1]==code[0] and t[3] not in [code[0], code[1], code[3]]: v += 2 x += 1 if t[0] not in [code[0], code[1], code[3]] and t[1]==code[3] and t[3]==code[0]: v += 2 x += 1 if t[0]==code[1] and t[1] not in [code[0], code[1], code[3]] and t[3]==code[0]: v += 2 x += 1 if t[0]==code[1] and t[1]==code[3] and t[3] not in [code[0], code[1], code[3]]: v += 2 x += 1 if t[0] not in [code[0], code[1], code[3]] and t[1] not in [code[0], code[1], code[3]] and t[3]==code[1]: v += 1 x += 2 if t[0] not in [code[0], code[1], code[3]] and t[1]==code[0] and t[3] not in [code[0], code[1], code[3]]: v += 1 x += 2 if t[0]==code[3] and t[1] not in [code[0], code[1], code[3]] and t[3] not in [code[0], code[1], code[3]]: v += 1 x += 2 if t[0]==code[1] and t[1] not in [code[0], code[1], code[3]] and t[3] not in [code[0], code[1], code[3]]: v += 1 x += 2 if t[0] not in [code[0], code[1], code[3]] and t[1]==code[3] and t[3] not in [code[0], code[1], code[3]]: v += 1 x += 2 if t[0] not in [code[0], code[1], code[3]] and t[1] not in [code[0], code[1], code[3]] and t[3]==code[0]: v += 1 x += 2 if t[0] not in [code[0], code[1], code[3]] and t[1] not in [code[0], code[1], code[3]] and t[3] not in [code[0], code[1], code[3]]: x += 3 if t[0] != code[0] and t[1]==code[1] and t[2]!=code[2] and t[3] != code [3]: p+=1 if t[0]==code[3] and t[2]==code[0] and t[3]==code[2]: v += 3 if t[0]==code[2] and t[2]==code[3] and t[3]==code[0]: v += 3 if t[0] not in [code[0], code[2], code[3]] and t[2]==code[0] and t[3]==code[2]: v += 2 x += 1 if t[0]==code[3] and t[2] not in [code[0], code[2], code[3]] and t[3]==code[2]: v += 2 x += 1 if t[0]==code[3] and t[2]==code[0] and t[3] not in [code[0], code[2], code[3]]: v += 2 x += 1 if t[0] not in [code[0], code[2], code[3]] and t[2]==code[3] and t[3]==code[0]: v += 2 x += 1 if t[0]==code[2] and t[2] not in [code[0], code[2], code[3]] and t[3]==code[0]: v += 2 x += 1 if t[0]==code[2] and t[2]==code[3] and t[3] not in [code[0], code[2], code[3]]: v += 2 x += 1 if t[0] not in [code[0], code[2], code[3]] and t[2] not in [code[0], code[2], code[3]] and t[3]==code[2]: v += 1 x += 2 if t[0] not in [code[0], code[2], code[3]] and t[2]==code[0] and t[3] not in [code[0], code[2], code[3]]: v += 1 x += 2 if t[0]==code[3] and t[2] not in [code[0], code[2], code[3]] and t[3] not in [code[0], code[2], code[3]]: v += 1 x += 2 if t[0]==code[2] and t[2] not in [code[0], code[2], code[3]] and t[3] not in [code[0], code[2], code[3]]: v += 1 x += 2 if t[0] not in [code[0], code[2], code[3]] and t[2]==code[3] and t[3] not in [code[0], code[2], code[3]]: v += 1 x += 2 if t[0] not in [code[0], code[2], code[3]] and t[2] not in [code[0], code[2], code[3]] and t[3]==code[0]: v += 1 x += 2 if t[0] not in [code[0], code[2], code[3]] and t[2] not in [code[0], code[2], code[3]] and t[3] not in [code[0], code[2], code[3]]: x += 3 if t[0] == code[0] and t[1]!=code[1] and t[2]!=code[2] and t[3] != code [3]: p+=1 if t[1]==code[3] and t[2]==code[1] and t[3]==code[2]: v += 3 if t[1]==code[2] and t[2]==code[3] and t[3]==code[1]: v += 3 if t[1] not in [code[1], code[2], code[3]] and t[2]==code[1] and t[3]==code[2]: v += 2 x += 1 if t[1]==code[3] and t[2] not in [code[1], code[2], code[3]] and t[3]==code[2]: v += 2 x += 1 if t[1]==code[3] and t[2]==code[1] and t[3] not in [code[1], code[2], code[3]]: v += 2 x += 1 if t[1] not in [code[1], code[2], code[3]] and t[2]==code[3] and t[3]==code[1]: v += 2 x += 1 if t[1]==code[2] and t[2] not in [code[1], code[2], code[3]] and t[3]==code[1]: v += 2 x += 1 if t[1]==code[2] and t[2]==code[3] and t[3] not in [code[1], code[2], code[3]]: v += 2 x += 1 if t[1] not in [code[1], code[2], code[3]] and t[2] not in [code[1], code[2], code[3]] and t[3]==code[2]: v += 1 x += 2 if t[1] not in [code[1], code[2], code[3]] and t[2]==code[1] and t[3] not in [code[1], code[2], code[3]]: v += 1 x += 2 if t[1]==code[3] and t[2] not in [code[1], code[2], code[3]] and t[3] not in [code[1], code[2], code[3]]: v += 1 x += 2 if t[1]==code[2] and t[2] not in [code[1], code[2], code[3]] and t[3] not in [code[1], code[2], code[3]]: v += 1 x += 2 if t[1] not in [code[1], code[2], code[3]] and t[2]==code[3] and t[3] not in [code[1], code[2], code[3]]: v += 1 x += 2 if t[1] not in [code[1], code[2], code[3]] and t[2] not in [code[1], code[2], code[3]] and t[3]==code[1]: v += 1 x += 2 if t[1] not in [code[1], code[2], code[3]] and t[2] not in [code[1], code[2], code[3]] and t[3] not in [code[1], code[2], code[3]]: x += 3 if t[0] != code[0] and t[1]!=code[1] and t[2]!=code[2] and t[3] != code [3]: x += 4 if t[0] in code: v += 1 x -= 1 if t[1] in code: v += 1 x -= 1 if t[2] in code: v += 1 x -= 1 if t[3] in code: v += 1 x -= 1 result = [p,v,x] return result t = input('Turn #1 : ') if t[0] == code[0] and t[1]==code[1] and t[2]==code[2] and t[3] == code [3]: print(WINNING_MSG) else : p,v,x = cal(t) print(' P='+str(p)+',V='+str(v)+',X='+str(x)) t = input('Turn #2 : ') if t[0] == code[0] and t[1]==code[1] and t[2]==code[2] and t[3] == code [3]: print(WINNING_MSG) else : p,v,x = cal(t) print(' P='+str(p)+',V='+str(v)+',X='+str(x)) t = input('Turn #3 : ') if t[0] == code[0] and t[1]==code[1] and t[2]==code[2] and t[3] == code [3]: print(WINNING_MSG) else : p,v,x = cal(t) print(' P='+str(p)+',V='+str(v)+',X='+str(x)) t = input('Turn #4 : ') if t[0] == code[0] and t[1]==code[1] and t[2]==code[2] and t[3] == code [3]: print(WINNING_MSG) else : p,v,x = cal(t) print(' P='+str(p)+',V='+str(v)+',X='+str(x)) print(LOSING_MSG) print('The answer is',code) print('Please try again...') |
# 6330272821 (17.37) 127 (2021-02-14 21:57) def compare_color(code, user_input): P = 0 V = 0 X = 0 if user_input[0] in code: p, v = compare_position(user_input[0], code, 0) P += p V += v if user_input[1] in code: p, v = compare_position(user_input[1], code, 1) P += p V += v if user_input[2] in code: p, v = compare_position(user_input[2], code, 2) P += p V += v if user_input[3] in code: p, v = compare_position(user_input[3], code, 3) P += p V += v X = 4 - P - V return P, V, X def compare_position(user_input_n, code, n): P = 0 V = 0 if user_input_n == code[n]: P += 1 else: V += 1 return P, V user_input = input("Turn #1 : ") P, V, X = compare_color(user_input, code) if P == 4: print(WINNING_MSG) else: print(" "*9,"P=",P,",V=",V,",X=",X) user_input = input("Turn #2 : ") P, V, X = compare_color(user_input, code) if P == 4: print(WINNING_MSG) else: print(" "*9,"P=", P, ",V=", V, ",X=", X) user_input = input("Turn #3 : ") P, V, X = compare_color(user_input, code) if P == 4: print(WINNING_MSG) else: print(" "*9,"P=", P, ",V=", V, ",X=", X) user_input = input("Turn #4 : ") P, V, X = compare_color(user_input, code) if P == 4: print(WINNING_MSG) else: print(LOSING_MSG) print("The answer is", code) print("Please try again...") |
# 6330273421 (20.00) 128 (2021-02-12 20:58) x=input('Turn #1 : ') P=0 V=0 if code[0]==x[0]: P+=1 if code[1]==x[1]: P+=1 if code[2]==x[2]: P+=1 if code[3]==x[3]: P+=1 if x[0] in code[1:] : V+=1 if x[1] in code[:1]+code[2:] : V+=1 if x[2] in code[:2]+code[3:] : V+=1 if x[3] in code[:3] : V+=1 N=4-(P+V) P=str(P) V=str(V) N=str(N) if x==code: print('Congratulations! You won the game.') else : print(' P='+P+','+'V='+V+','+'X='+N) x=input('Turn #2 : ') P=0 V=0 if code[0]==x[0]: P+=1 if code[1]==x[1]: P+=1 if code[2]==x[2]: P+=1 if code[3]==x[3]: P+=1 if x[0] in code[1:] : V+=1 if x[1] in code[:1]+code[2:] : V+=1 if x[2] in code[:2]+code[3:] : V+=1 if x[3] in code[:3] : V+=1 N=4-(P+V) P=str(P) V=str(V) N=str(N) if x==code: print('Congratulations! You won the game.') else : print(' P='+P+','+'V='+V+','+'X='+N) x=input('Turn #3 : ') P=0 V=0 if code[0]==x[0]: P+=1 if code[1]==x[1]: P+=1 if code[2]==x[2]: P+=1 if code[3]==x[3]: P+=1 if x[0] in code[1:] : V+=1 if x[1] in code[:1]+code[2:] : V+=1 if x[2] in code[:2]+code[3:] : V+=1 if x[3] in code[:3] : V+=1 N=4-(P+V) P=str(P) V=str(V) N=str(N) if x==code: print('Congratulations! You won the game.') else : print(' P='+P+','+'V='+V+','+'X='+N) x=input('Turn #4 : ') P=0 V=0 if code[0]==x[0]: P+=1 if code[1]==x[1]: P+=1 if code[2]==x[2]: P+=1 if code[3]==x[3]: P+=1 if x[0] in code[1:] : V+=1 if x[1] in code[:1]+code[2:] : V+=1 if x[2] in code[:2]+code[3:] : V+=1 if x[3] in code[:3] : V+=1 N=4-(P+V) P=str(P) V=str(V) N=str(N) if x==code: print('Congratulations! You won the game.') else: print(' P='+P+','+'V='+V+','+'X='+N) print('Sorry! You just lost it.\nThe answer is '+code+'\nPlease try again...') |
# 6330274021 (17.37) 129 (2021-02-14 16:59) a = list("ABCDEF") code = list(code) ans1 = list(input("Turn #1 : ")) def play(): p = 0 v = 0 x = 0 if code[0] == ans1[0]: p += 1 elif ans1[0] in code: v += 1 else : x += 1 if code[1] == ans1[1]: p += 1 elif ans1[1] in code: v += 1 else : x += 1 if code[2] == ans1[2]: p += 1 elif ans1[2] in code: v += 1 else : x += 1 if code[3] == ans1[3]: p += 1 elif ans1[3] in code: v += 1 else : x += 1 return p,v,x P,V,X = play() if P==4: print(WINNING_MSG) exit() else : print(" P="+str(P)+",V="+str(V)+",X="+str(X)) ans1 = list(input("Turn #2 : ")) P,V,X = play() if P==4: print(WINNING_MSG) exit() else : print(" P="+str(P)+",V="+str(V)+",X="+str(X)) ans1 = list(input("Turn #3 : ")) P,V,X = play() if P==4: print(WINNING_MSG) exit() else : print(" P="+str(P)+",V="+str(V)+",X="+str(X)) ans1 = list(input("Turn #4 : ")) P,V,X = play() if P==4: print(WINNING_MSG) else : print(LOSING_MSG) print("The answer is "+"".join(code)) print("Please try again...") |
# 6330275721 (20.00) 130 (2021-02-14 19:03) p = 0 v = 0 x = 0 y = input('Turn #1 : ') if y[0] in code: v += 1 if y[0] == code[0]: v -= 1 p += 1 else: x += 1 if y[1] in code: v += 1 if y[1] == code[1]: v -= 1 p += 1 else: x += 1 if y[2] in code: v += 1 if y[2] == code[2]: v -= 1 p += 1 else: x += 1 if y[3] in code: v += 1 if y[3] == code[3]: v -= 1 p += 1 else: x += 1 if p == 4: print(WINNING_MSG) #--------------------------------------- else: print(' P='+str(p)+',V='+str(v)+',X='+str(x)) p = 0 v = 0 x = 0 y = input('Turn #2 : ') if y[0] in code: v += 1 if y[0] == code[0]: v -= 1 p += 1 else: x += 1 if y[1] in code: v += 1 if y[1] == code[1]: v -= 1 p += 1 else: x += 1 if y[2] in code: v += 1 if y[2] == code[2]: v -= 1 p += 1 else: x += 1 if y[3] in code: v += 1 if y[3] == code[3]: v -= 1 p += 1 else: x += 1 if p == 4: print(WINNING_MSG) #--------------------------------------- else: print(' P='+str(p)+',V='+str(v)+',X='+str(x)) p = 0 v = 0 x = 0 y = input('Turn #3 : ') if y[0] in code: v += 1 if y[0] == code[0]: v -= 1 p += 1 else: x += 1 if y[1] in code: v += 1 if y[1] == code[1]: v -= 1 p += 1 else: x += 1 if y[2] in code: v += 1 if y[2] == code[2]: v -= 1 p += 1 else: x += 1 if y[3] in code: v += 1 if y[3] == code[3]: v -= 1 p += 1 else: x += 1 if p == 4: print(WINNING_MSG) #--------------------------------------- else: print(' P='+str(p)+',V='+str(v)+',X='+str(x)) p = 0 v = 0 x = 0 y = input('Turn #4 : ') if y[0] in code: v += 1 if y[0] == code[0]: v -= 1 p += 1 else: x += 1 if y[1] in code: v += 1 if y[1] == code[1]: v -= 1 p += 1 else: x += 1 if y[2] in code: v += 1 if y[2] == code[2]: v -= 1 p += 1 else: x += 1 if y[3] in code: v += 1 if y[3] == code[3]: v -= 1 p += 1 else: x += 1 if p == 4: print(WINNING_MSG) #--------------------------------------- else: print(' P='+str(p)+',V='+str(v)+',X='+str(x)) print(LOSING_MSG) print('The answer is ',code) print('Please try again...') |
# 6330276321 (20.00) 131 (2021-02-14 00:48) #code = "FADE" chance = True run = 4 # round 1 P = 0 V = 0 X = 4 if chance : guess = input("Turn #1 : ") if guess[0] in code : if guess[0] == code[0] : P += 1 X -= 1 else : V += 1 X -= 1 if guess[1] in code : if guess[1] == code[1] : P += 1 else : V += 1 if guess[2] in code : if guess[2] == code[2] : P += 1 else : V += 1 if guess[3] in code : if guess[3] == code[3] : P += 1 else : V += 1 X = 4 - P - V if P == 4 : print(WINNING_MSG) chance = False else : print(" "*10 + "P="+str(P)+",V="+str(V)+",X="+str(X)) run -= 1 # round 2 P = 0 V = 0 X = 4 if chance : guess = input("Turn #2 : ") if guess[0] in code : if guess[0] == code[0] : P += 1 X -= 1 else : V += 1 X -= 1 if guess[1] in code : if guess[1] == code[1] : P += 1 else : V += 1 if guess[2] in code : if guess[2] == code[2] : P += 1 else : V += 1 if guess[3] in code : if guess[3] == code[3] : P += 1 else : V += 1 X = 4 - P - V if P == 4 : print(WINNING_MSG) chance = False else : print(" "*10 + "P="+str(P)+",V="+str(V)+",X="+str(X)) run -= 1 # round 3 P = 0 V = 0 X = 4 if chance : guess = input("Turn #3 : ") if guess[0] in code : if guess[0] == code[0] : P += 1 X -= 1 else : V += 1 X -= 1 if guess[1] in code : if guess[1] == code[1] : P += 1 else : V += 1 if guess[2] in code : if guess[2] == code[2] : P += 1 else : V += 1 if guess[3] in code : if guess[3] == code[3] : P += 1 else : V += 1 X = 4 - P - V if P == 4 : print(WINNING_MSG) chance = False else : print(" "*10 + "P="+str(P)+",V="+str(V)+",X="+str(X)) run -= 1 # round 4 P = 0 V = 0 X = 4 if chance : guess = input("Turn #4 : ") if guess[0] in code : if guess[0] == code[0] : P += 1 X -= 1 else : V += 1 X -= 1 if guess[1] in code : if guess[1] == code[1] : P += 1 else : V += 1 if guess[2] in code : if guess[2] == code[2] : P += 1 else : V += 1 if guess[3] in code : if guess[3] == code[3] : P += 1 else : V += 1 X = 4 - P - V if P == 4 : print(WINNING_MSG) chance = False else : print(" "*10 + "P="+str(P)+",V="+str(V)+",X="+str(X)) run -= 1 if run == 0 : print(LOSING_MSG) print("The answer is", code) print("Please try again...") |
# 6330277021 (20.00) 132 (2021-02-11 16:00) guess = input("Turn #1 : ") P = 0 V = 0 X = 0 if guess[0] == code[0] : P += 1 if guess[1] == code[1] : P += 1 if guess[2] == code[2] : P += 1 if guess[3] == code[3] : P += 1 if P == 4 : print(WINNING_MSG) else : if guess[0] in code[1::] : V += 1 if guess[1] in (code[0]+code[2::]) : V += 1 if guess[2] in (code[:2:]+code[3]) : V += 1 if guess[3] in code[:3:] : V += 1 X = 4 - (P+V) print(' '*10 + 'P=' + str(P) + ',' + 'V=' + str(V) + ',' + 'X=' + str(X)) guess = input("Turn #2 : ") P = 0 V = 0 X = 0 if guess[0] == code[0] : P += 1 if guess[1] == code[1] : P += 1 if guess[2] == code[2] : P += 1 if guess[3] == code[3] : P += 1 if P == 4 : print(WINNING_MSG) else : if guess[0] in code[1::] : V += 1 if guess[1] in (code[0]+code[2::]) : V += 1 if guess[2] in (code[:2:]+code[3]) : V += 1 if guess[3] in code[:3:] : V += 1 X = 4 - (P+V) print(' '*10 + 'P=' + str(P) + ',' + 'V=' + str(V) + ',' + 'X=' + str(X)) guess = input("Turn #3 : ") P = 0 V = 0 X = 0 if guess[0] == code[0] : P += 1 if guess[1] == code[1] : P += 1 if guess[2] == code[2] : P += 1 if guess[3] == code[3] : P += 1 if P == 4 : print(WINNING_MSG) else : if guess[0] in code[1::] : V += 1 if guess[1] in (code[0]+code[2::]) : V += 1 if guess[2] in (code[:2:]+code[3]) : V += 1 if guess[3] in code[:3:] : V += 1 X = 4 - (P+V) print(' '*10 + 'P=' + str(P) + ',' + 'V=' + str(V) + ',' + 'X=' + str(X)) guess = input("Turn #4 : ") P = 0 V = 0 X = 0 if guess[0] == code[0] : P += 1 if guess[1] == code[1] : P += 1 if guess[2] == code[2] : P += 1 if guess[3] == code[3] : P += 1 if P == 4 : print(WINNING_MSG) else : if guess[0] in code[1::] : V += 1 if guess[1] in (code[0]+code[2::]) : V += 1 if guess[2] in (code[:2:]+code[3]) : V += 1 if guess[3] in code[:3:] : V += 1 X = 4 - (P+V) print(' '*10 + 'P=' + str(P) + ',' + 'V=' + str(V) + ',' + 'X=' + str(X)) print(LOSING_MSG) print("The answer is ", code) print("Please try again...") |
# 6330278621 (20.00) 133 (2021-02-14 17:17) # TURN 1 Turn1 = input("Turn #1 : ") P1 = 0 V1 = 0 ########## P ######### if Turn1[0] in code[0] : P1 += 1 if Turn1[1] in code[1] : P1 += 1 if Turn1[2] in code[2] : P1 += 1 if Turn1[3] in code[3] : P1 += 1 ########## V ######### if Turn1[0] in code[1:] : V1 += 1 if Turn1[1] in code[2:] : V1 += 1 if Turn1[1] in code[0] : V1 += 1 if Turn1[2] in code[:2] : V1 += 1 if Turn1[2] in code[3] : V1 += 1 if Turn1[3] in code[:3] : V1 += 1 X1 = 4 - (P1+V1) if P1==4 : print(WINNING_MSG) else: print(' '*10 +'P='+str(P1) + ',V='+str(V1) + ',X='+str(X1)) # TURN 2 Turn2 = input("Turn #2 : ") P2 = 0 V2 = 0 ########## P ######### if Turn2[0] in code[0] : P2 += 1 if Turn2[1] in code[1] : P2 += 1 if Turn2[2] in code[2] : P2 += 1 if Turn2[3] in code[3] : P2 += 1 ########## V ######### if Turn2[0] in code[1:] : V2 += 1 if Turn2[1] in code[2:] : V2 += 1 if Turn2[1] in code[0] : V2 += 1 if Turn2[2] in code[:2] : V2 += 1 if Turn2[2] in code[3] : V2 += 1 if Turn2[3] in code[:3] : V2 += 1 X2 = 4 - (P2+V2) if P2==4 : print(WINNING_MSG) else: print(' '*10 +'P='+str(P2) + ',V='+str(V2) + ',X='+str(X2)) # TURN 3 Turn3 = input("Turn #3 : ") P3 = 0 V3 = 0 ########## P ######### if Turn3[0] in code[0] : P3 += 1 if Turn3[1] in code[1] : P3 += 1 if Turn3[2] in code[2] : P3 += 1 if Turn3[3] in code[3] : P3 += 1 ########## V ######### if Turn3[0] in code[1:] : V3 += 1 if Turn3[1] in code[2:] : V3 += 1 if Turn3[1] in code[0] : V3 += 1 if Turn3[2] in code[:2] : V3 += 1 if Turn3[2] in code[3] : V3 += 1 if Turn3[3] in code[:3] : V3 += 1 X3 = 4 - (P3+V3) if P3==4 : print(WINNING_MSG) else: print(' '*10 +'P='+str(P3) + ',V='+str(V3) + ',X='+str(X3)) # TURN 4 Turn4 = input("Turn #4 : ") P4 = 0 V4 = 0 ########## P ######### if Turn4[0] in code[0] : P4 += 1 if Turn4[1] in code[1] : P4 += 1 if Turn4[2] in code[2] : P4 += 1 if Turn4[3] in code[3] : P4 += 1 ########## V ######### if Turn4[0] in code[1:] : V4 += 1 if Turn4[1] in code[2:] : V4 += 1 if Turn4[1] in code[0] : V4 += 1 if Turn4[2] in code[:2] : V4 += 1 if Turn4[2] in code[3] : V4 += 1 if Turn4[3] in code[:3] : V4 += 1 X4 = 4 - (P4+V4) if P4==4 : print(WINNING_MSG) else: print(' '*10 +'P='+str(P4) + ',V='+str(V4) + ',X='+str(X4)) print(LOSING_MSG) print('The answer is',code) print('Please try again...') |
# 6330279221 (20.00) 134 (2021-02-13 21:10) c1 = input('Turn #1 : ',) if c1 == code: print(WINNING_MSG) else: if c1[0] in code: x0 = 0 if c1[0] == code[0]: p0 = 1 v0 = 0 else: p0 = 0 v0 = 1 else: p0 = 0 v0 = 0 x0 = 1 if c1[1] in code: x1 = 0 if c1[1] == code[1]: p1 = 1 v1 = 0 else: p1 = 0 v1 = 1 else: p1 = 0 v1 = 0 x1 = 1 if c1[2] in code: x2 = 0 if c1[2] == code[2]: p2 = 1 v2 = 0 else: p2 = 0 v2 = 1 else: p2 = 0 v2 = 0 x2 = 1 if c1[3] in code: x3 = 0 if c1[3] == code[3]: p3 = 1 v3 = 0 else: p3 = 0 v3 = 1 else: p3 = 0 v3 = 0 x3 = 1 ptot = str(p0+p1+p2+p3) vtot = str(v0+v1+v2+v3) xtot = str(x0+x1+x2+x3) print(' P='+ptot+','+'V='+vtot+','+'X='+xtot) #------------------------------------------------------- c2 = input('Turn #2 : ',) if c2 == code: print(WINNING_MSG) else: if c2[0] in code: x0 = 0 if c2[0] == code[0]: p0 = 1 v0 = 0 else: p0 = 0 v0 = 1 else: p0 = 0 v0 = 0 x0 = 1 if c2[1] in code: x1 = 0 if c2[1] == code[1]: p1 = 1 v1 = 0 else: p1 = 0 v1 = 1 else: p1 = 0 v1 = 0 x1 = 1 if c2[2] in code: x2 = 0 if c2[2] == code[2]: p2 = 1 v2 = 0 else: p2 = 0 v2 = 1 else: p2 = 0 v2 = 0 x2 = 1 if c2[3] in code: x3 = 0 if c2[3] == code[3]: p3 = 1 v3 = 0 else: p3 = 0 v3 = 1 else: p3 = 0 v3 = 0 x3 = 1 ptot = str(p0+p1+p2+p3) vtot = str(v0+v1+v2+v3) xtot = str(x0+x1+x2+x3) print(' P='+ptot+','+'V='+vtot+','+'X='+xtot) #------------------------------------------------------- c3 = input('Turn #3 : ',) if c3 == code: print(WINNING_MSG) else: if c3[0] in code: x0 = 0 if c3[0] == code[0]: p0 = 1 v0 = 0 else: p0 = 0 v0 = 1 else: p0 = 0 v0 = 0 x0 = 1 if c3[1] in code: x1 = 0 if c3[1] == code[1]: p1 = 1 v1 = 0 else: p1 = 0 v1 = 1 else: p1 = 0 v1 = 0 x1 = 1 if c3[2] in code: x2 = 0 if c3[2] == code[2]: p2 = 1 v2 = 0 else: p2 = 0 v2 = 1 else: p2 = 0 v2 = 0 x2 = 1 if c3[3] in code: x3 = 0 if c3[3] == code[3]: p3 = 1 v3 = 0 else: p3 = 0 v3 = 1 else: p3 = 0 v3 = 0 x3 = 1 ptot = str(p0+p1+p2+p3) vtot = str(v0+v1+v2+v3) xtot = str(x0+x1+x2+x3) print(' P='+ptot+','+'V='+vtot+','+'X='+xtot) #------------------------------------------------------ c4 = input('Turn #4 : ',) if c4 == code: print(WINNING_MSG) else: if c4[0] in code: x0 = 0 if c4[0] == code[0]: p0 = 1 v0 = 0 else: p0 = 0 v0 = 1 else: p0 = 0 v0 = 0 x0 = 1 if c4[1] in code: x1 = 0 if c4[1] == code[1]: p1 = 1 v1 = 0 else: p1 = 0 v1 = 1 else: p1 = 0 v1 = 0 x1 = 1 if c4[2] in code: x2 = 0 if c4[2] == code[2]: p2 = 1 v2 = 0 else: p2 = 0 v2 = 1 else: p2 = 0 v2 = 0 x2 = 1 if c4[3] in code: x3 = 0 if c4[3] == code[3]: p3 = 1 v3 = 0 else: p3 = 0 v3 = 1 else: p3 = 0 v3 = 0 x3 = 1 ptot = str(p0+p1+p2+p3) vtot = str(v0+v1+v2+v3) xtot = str(x0+x1+x2+x3) print(' P='+ptot+','+'V='+vtot+','+'X='+xtot) print(LOSING_MSG) print('The answer is', code) print('Please try again...') |
# 6330280821 (19.11) 135 (2021-02-14 13:05) a = input("Turn #1 : ") X=0 P=0 V=0 if a[0]==code[0] : P += 1 elif a[0] in code : V += 1 else : X += 1 if a[1]==code[1] : P += 1 elif a[1] in code : V += 1 else : X += 1 if a[2]==code[2] : P += 1 elif a[2] in code : V += 1 else : X += 1 if a[3]==code[3] : P += 1 elif a[3] in code : V += 1 else : X += 1 print("P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) if a==code : print(WINNING_MSG) else : a = input("Turn #2 : ") X=0 P=0 V=0 if a[0]==code[0] : P += 1 elif a[0] in code : V += 1 else : X += 1 if a[1]==code[1] : P += 1 elif a[1] in code : V += 1 else : X += 1 if a[2]==code[2] : P += 1 elif a[2] in code : V += 1 else : X += 1 if a[3]==code[3] : P += 1 elif a[3] in code : V += 1 else : X += 1 print("P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) if a==code : print(WINNING_MSG) else : a = input("Turn #3 : ") X=0 P=0 V=0 if a[0]==code[0] : P += 1 elif a[0] in code : V += 1 else : X += 1 if a[1]==code[1] : P += 1 elif a[1] in code : V += 1 else : X += 1 if a[2]==code[2] : P += 1 elif a[2] in code : V += 1 else : X += 1 if a[3]==code[3] : P += 1 elif a[3] in code : V += 1 else : X += 1 print("P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) if a==code : print(WINNING_MSG) else : a = input("Turn #4 : ") X=0 P=0 V=0 if a[0]==code[0] : P += 1 elif a[0] in code : V += 1 else : X += 1 if a[1]==code[1] : P += 1 elif a[1] in code : V += 1 else : X += 1 if a[2]==code[2] : P += 1 elif a[2] in code : V += 1 else : X += 1 if a[3]==code[3] : P += 1 elif a[3] in code : V += 1 else : X += 1 print("P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) if a==code : print(WINNING_MSG) else : print(LOSING_MSG) print("The answer is "+str(code)) print("Please try again...") |
# 6330281421 (20.00) 136 (2021-02-11 09:21) predict = input('Turn #1 : ') P = 0;V = 0;X = 0 if predict[0]==code[0]: P+=1 if predict[1]==code[1]: P+=1 if predict[2]==code[2]: P+=1 if predict[3]==code[3]: P+=1 if predict[0] in code: V+=1 if predict[1] in code: V+=1 if predict[2] in code: V+=1 if predict[3] in code: V+=1 V=V-P;X=4-V-P if P==4: print(WINNING_MSG) else: print(' P='+str(P)+',V='+str(V)+',X='+str(X)) predict = input('Turn #2 : ') P = 0;V = 0;X = 0 if predict[0]==code[0]: P+=1 if predict[1]==code[1]: P+=1 if predict[2]==code[2]: P+=1 if predict[3]==code[3]: P+=1 if predict[0] in code: V+=1 if predict[1] in code: V+=1 if predict[2] in code: V+=1 if predict[3] in code: V+=1 V=V-P;X=4-V-P if P==4: print(WINNING_MSG) else: print(' P='+str(P)+',V='+str(V)+',X='+str(X)) predict = input('Turn #3 : ') P = 0;V = 0;X = 0 if predict[0]==code[0]: P+=1 if predict[1]==code[1]: P+=1 if predict[2]==code[2]: P+=1 if predict[3]==code[3]: P+=1 if predict[0] in code: V+=1 if predict[1] in code: V+=1 if predict[2] in code: V+=1 if predict[3] in code: V+=1 V=V-P;X=4-V-P if P==4: print(WINNING_MSG) else: print(' P='+str(P)+',V='+str(V)+',X='+str(X)) predict = input('Turn #4 : ') P = 0;V = 0;X = 0 if predict[0]==code[0]: P+=1 if predict[1]==code[1]: P+=1 if predict[2]==code[2]: P+=1 if predict[3]==code[3]: P+=1 if predict[0] in code: V+=1 if predict[1] in code: V+=1 if predict[2] in code: V+=1 if predict[3] in code: V+=1 V=V-P;X=4-V-P if P==4: print(WINNING_MSG) else: print(' P='+str(P)+',V='+str(V)+',X='+str(X)) print(LOSING_MSG) print('The answer is ',code) print('Please try again...') |
# 6330282021 (20.00) 137 (2021-02-11 14:08) guess = str(input('Turn #1 : ')) P = 0 V = 0 X = 0 if guess[0] in code: if guess[0] == code[0]: P += 1 else: V += 1 elif guess[0] not in code: X += 1 if guess[1] in code: if guess[1] == code[1]: P += 1 else: V += 1 elif guess[1] not in code: X += 1 if guess[2] in code: if guess[2] == code[2]: P += 1 else: V += 1 elif guess[2] not in code: X += 1 if guess[3] in code: if guess[3] == code[3]: P += 1 else: V += 1 elif guess[3] not in code: X += 1 if P == 4: print('Congratulations! You won the game.') if P != 4: print(' '*10 + 'P=' + str(P) + ',' + 'V=' + str(V) + ',' + 'X=' + str(X)) guess = str(input('Turn #2 : ')) P = 0 V = 0 X = 0 if guess[0] in code: if guess[0] == code[0]: P += 1 else: V += 1 elif guess[0] not in code: X += 1 if guess[1] in code: if guess[1] == code[1]: P += 1 else: V += 1 elif guess[1] not in code: X += 1 if guess[2] in code: if guess[2] == code[2]: P += 1 else: V += 1 elif guess[2] not in code: X += 1 if guess[3] in code: if guess[3] == code[3]: P += 1 else: V += 1 elif guess[3] not in code: X += 1 if P == 4: print('Congratulations! You won the game.') if P != 4: print(' '*10 + 'P=' + str(P) + ',' + 'V=' + str(V) + ',' + 'X=' + str(X)) guess = str(input('Turn #3 : ')) P = 0 V = 0 X = 0 if guess[0] in code: if guess[0] == code[0]: P += 1 else: V += 1 elif guess[0] not in code: X += 1 if guess[1] in code: if guess[1] == code[1]: P += 1 else: V += 1 elif guess[1] not in code: X += 1 if guess[2] in code: if guess[2] == code[2]: P += 1 else: V += 1 elif guess[2] not in code: X += 1 if guess[3] in code: if guess[3] == code[3]: P += 1 else: V += 1 elif guess[3] not in code: X += 1 if P == 4: print('Congratulations! You won the game.') if P != 4: print(' '*10 + 'P=' + str(P) + ',' + 'V=' + str(V) + ',' + 'X=' + str(X)) guess = str(input('Turn #4 : ')) P = 0 V = 0 X = 0 if guess[0] in code: if guess[0] == code[0]: P += 1 else: V += 1 elif guess[0] not in code: X += 1 if guess[1] in code: if guess[1] == code[1]: P += 1 else: V += 1 elif guess[1] not in code: X += 1 if guess[2] in code: if guess[2] == code[2]: P += 1 else: V += 1 elif guess[2] not in code: X += 1 if guess[3] in code: if guess[3] == code[3]: P += 1 else: V += 1 elif guess[3] not in code: X += 1 if P == 4: print('Congratulations! You won the game.') if P != 4: print(' '*10 + 'P=' + str(P) + ',' + 'V=' + str(V) + ',' + 'X=' + str(X)) print('Sorry! You just lost it.') print('The answer is ',code) print('Please try again...') |
# 6330283721 (17.37) 138 (2021-02-12 19:27) n=0 p1=0 v1=0 x1=0 g1=input("Turn #1:") if g1[0] in code: if g1[0]==code[0]: p1+=1 else: v1+=1 else: x1+=1 if g1[1] in code: if g1[1]==code[1]: p1+=1 else: v1+=1 else: x1+=1 if g1[2] in code: if g1[2]==code[2]: p1+=1 else: v1+=1 else: x1+=1 if g1[3] in code: if g1[3]==code[3]: p1+=1 else: v1+=1 else: x1+=1 if p1==4: print(WINNING_MSG) else: n+=1 print(" P="+str(p1)+","+"V="+str(v1)+","+"X="+str(x1)) p2=0 v2=0 x2=0 g2=input("Turn #2:") if g2[0] in code: if g2[0]==code[0]: p2+=1 else: v2+=1 else: x2+=1 if g2[1] in code: if g2[1]==code[1]: p2+=1 else: v2+=1 else: x2+=1 if g2[2] in code: if g2[2]==code[2]: p2+=1 else: v2+=1 else: x2+=1 if g2[3] in code: if g2[3]==code[3]: p2+=1 else: v2+=1 else: x2+=1 if p2==4: print(WINNING_MSG) else: n+=1 print(" P="+str(p2)+","+"V="+str(v2)+","+"X="+str(x2)) p3=0 v3=0 x3=0 g3=input("Turn #3:") if g3[0] in code: if g3[0]==code[0]: p3+=1 else: v3+=1 else: x3+=1 if g3[1] in code: if g3[1]==code[1]: p3+=1 else: v3+=1 else: x3+=1 if g3[2] in code: if g3[2]==code[2]: p3+=1 else: v3+=1 else: x3+=1 if g3[3] in code: if g3[3]==code[3]: p3+=1 else: v3+=1 else: x3+=1 if p3==4: print(WINNING_MSG) else: n+=1 print(" P="+str(p3)+","+"V="+str(v3)+","+"X="+str(x3)) p4=0 v4=0 x4=0 g4=input("Turn #4:") if g4[0] in code: if g4[0]==code[0]: p4+=1 else: v4+=1 else: x4+=1 if g4[1] in code: if g4[1]==code[1]: p4+=1 else: v4+=1 else: x4+=1 if g4[2] in code: if g4[2]==code[2]: p4+=1 else: v4+=1 else: x4+=1 if g4[3] in code: if g4[3]==code[3]: p4+=1 else: v4+=1 else: x4+=1 if p4==4: print(WINNING_MSG) else: n+=1 print(" P="+str(p4)+","+"V="+str(v4)+","+"X="+str(x4)) if n==4: print(LOSING_MSG) print("The answer is",code) print("Please try again...") |
# 6330284321 (20.00) 139 (2021-02-15 20:00) #--------------------------------------------------- ptr = 0 # ------- period * 4 ---------- ptr = ptr + 1 p, v, x = 0, 0, 0 inp = input("Turn #" + str(ptr) + " : ") if code.find(inp[0]) == 0: p = p + 1 elif code.find(inp[0]) == -1: x = x + 1 if code.find(inp[1]) == 1: p = p + 1 elif code.find(inp[1]) == -1: x = x + 1 if code.find(inp[2]) == 2: p = p + 1 elif code.find(inp[2]) == -1: x = x + 1 if code.find(inp[3]) == 3: p = p + 1 elif code.find(inp[3]) == -1: x = x + 1 v = 4 - p - x if p == 4: print(WINNING_MSG) exit(0) else: print(" P=" + str(p) + ",V=" + str(v) + ",X=" + str(x)) # ------- period * 4 ---------- ptr = ptr + 1 p, v, x = 0, 0, 0 inp = input("Turn #" + str(ptr) + " : ") if code.find(inp[0]) == 0: p = p + 1 elif code.find(inp[0]) == -1: x = x + 1 if code.find(inp[1]) == 1: p = p + 1 elif code.find(inp[1]) == -1: x = x + 1 if code.find(inp[2]) == 2: p = p + 1 elif code.find(inp[2]) == -1: x = x + 1 if code.find(inp[3]) == 3: p = p + 1 elif code.find(inp[3]) == -1: x = x + 1 v = 4 - p - x if p == 4: print(WINNING_MSG) exit(0) else: print(" P=" + str(p) + ",V=" + str(v) + ",X=" + str(x)) # ------- period * 4 ---------- ptr = ptr + 1 p, v, x = 0, 0, 0 inp = input("Turn #" + str(ptr) + " : ") if code.find(inp[0]) == 0: p = p + 1 elif code.find(inp[0]) == -1: x = x + 1 if code.find(inp[1]) == 1: p = p + 1 elif code.find(inp[1]) == -1: x = x + 1 if code.find(inp[2]) == 2: p = p + 1 elif code.find(inp[2]) == -1: x = x + 1 if code.find(inp[3]) == 3: p = p + 1 elif code.find(inp[3]) == -1: x = x + 1 v = 4 - p - x if p == 4: print(WINNING_MSG) exit(0) else: print(" P=" + str(p) + ",V=" + str(v) + ",X=" + str(x)) # ------- period * 4 ---------- ptr = ptr + 1 p, v, x = 0, 0, 0 inp = input("Turn #" + str(ptr) + " : ") if code.find(inp[0]) == 0: p = p + 1 elif code.find(inp[0]) == -1: x = x + 1 if code.find(inp[1]) == 1: p = p + 1 elif code.find(inp[1]) == -1: x = x + 1 if code.find(inp[2]) == 2: p = p + 1 elif code.find(inp[2]) == -1: x = x + 1 if code.find(inp[3]) == 3: p = p + 1 elif code.find(inp[3]) == -1: x = x + 1 v = 4 - p - x if p == 4: print(WINNING_MSG) exit(0) else: print(" P=" + str(p) + ",V=" + str(v) + ",X=" + str(x)) print(LOSING_MSG) print("The answer is " + code) print("Please try again...") |
# 6330285021 (17.61) 140 (2021-02-14 22:21) m = input('Turn #1 :') w = 0 x = 0 y = 0 z = 0 a = 0 b = 0 c = 0 d = 0 top0 = False top1 = False top2 = False top3 = False w1 = 0 x1 = 0 y1 = 0 z1 = 0 a1 = 0 b1 = 0 c1 = 0 d1 = 0 top00 = False top11 = False top22 = False top33 = False w2 = 0 x2 = 0 y2 = 0 z2 = 0 a2 = 0 b2 = 0 c2 = 0 d2 = 0 top000 = False top111 = False top222 = False top333 = False w3 = 0 x3 = 0 y3 = 0 z3 = 0 a3 = 0 b3 = 0 c3 = 0 d3 = 0 top0000 = False top1111 = False top2222 = False top3333 = False if m!=code: if m[0]==code[0]: w = 1 top0 = True if m[1]==code[1]: x = 1 top1 = True if m[2]==code[2]: y = 1 top2 = True if m[3]==code[3]: z = 1 top3 = True P = w+x+y+z if m[0] in code and top0==False: a = 1 if m[1] in code and top1==False: b = 1 if m[2] in code and top2==False: c = 1 if m[3] in code and top3==False: d = 1 V = a+b+c+d print('P'+'='+ str(P) + ','+'V'+'='+ str(V) + ','+'X'+'='+ str(4-P-V)) m2 = input('Turn #2 :') if m2!=code: if m2[0]==code[0]: w1 = 1 top00 = True if m2[1]==code[1]: x1 = 1 top11 = True if m2[2]==code[2]: y1 = 1 top22 = True if m2[3]==code[3]: z1 = 1 top33 = True P = w1+x1+y1+z1 if m2[0] in code and top00==False: a1 = 1 if m2[1] in code and top11==False: b1 = 1 if m2[2] in code and top22==False: c1 = 1 if m2[3] in code and top33==False: d1 = 1 V = a1+b1+c1+d1 print('P'+'='+ str(P) + ','+'V'+'='+ str(V) + ','+'X'+'='+ str(4-P-V)) m3 = input('Turn #3 :') if m3!=code: if m3[0]==code[0]: w2 = 1 top000 = True if m3[1]==code[1]: x2 = 1 top111 = True if m3[2]==code[2]: y2 = 1 top222 = True if m3[3]==code[3]: z2 = 1 top333 = True P = w2+x2+y2+z2 if m3[0] in code and top000==False: a2 = 1 if m3[1] in code and top111==False: b2 = 1 if m3[2] in code and top222==False: c2 = 1 if m3[3] in code and top333==False: d2 = 1 V = a2+b2+c2+d2 print('P'+'='+ str(P) + ','+'V'+'='+ str(V) + ','+'X'+'='+ str(4-P-V)) m4 = input('Turn #4 :') if m4!=code: if m4[0]==code[0]: w3 = 1 top0000 = True if m4[1]==code[1]: x3 = 1 top1111 = True if m4[2]==code[2]: y3 = 1 top2222 = True if m4[3]==code[3]: z3 = 1 top3333 = True P = w3+x3+y3+z3 if m4[0] in code and top0000==False: a3 = 1 if m4[1] in code and top1111==False: b3 = 1 if m4[2] in code and top2222==False: c3 = 1 if m4[3] in code and top3333==False: d3 = 1 V = a3+b3+c3+d3 print('P'+'='+ str(P) + ','+'V'+'='+ str(V) + ','+'X'+'='+ str(4-P-V)) print("Sorry! You just lost it.") else: print("Congratulations! You won the game.") else: print("Congratulations! You won the game.") else: print("Congratulations! You won the game.") else: print("Congratulations! You won the game.") |
# 6330286621 (20.00) 141 (2021-02-14 01:43) #print(code) s=True #Turn 1 p,v,x=0,0,0 k=str(input("Turn #1 : ")) if code.find(k[0])==0 :p+=1 if code.find(k[1])==1 :p+=1 if code.find(k[2])==2 :p+=1 if code.find(k[3])==3 :p+=1 if code.find(k[0])>=0 and code.find(k[0])!=0 :v+=1 if code.find(k[1])>=0 and code.find(k[1])!=1 :v+=1 if code.find(k[2])>=0 and code.find(k[2])!=2 :v+=1 if code.find(k[3])>=0 and code.find(k[3])!=3 :v+=1 if code.find(k[0])==-1 :x+=1 if code.find(k[1])==-1 :x+=1 if code.find(k[2])==-1 :x+=1 if code.find(k[3])==-1 :x+=1 if p==4:print(WINNING_MSG) ; s=False else:print("\t "+"P="+str(p)+",V="+str(v)+",X="+str(x)) #Turn 2 if s==True : p,v,x=0,0,0 k=str(input("Turn #2 : ")) if code.find(k[0])==0 :p+=1 if code.find(k[1])==1 :p+=1 if code.find(k[2])==2 :p+=1 if code.find(k[3])==3 :p+=1 if code.find(k[0])>=0 and code.find(k[0])!=0 :v+=1 if code.find(k[1])>=0 and code.find(k[1])!=1 :v+=1 if code.find(k[2])>=0 and code.find(k[2])!=2 :v+=1 if code.find(k[3])>=0 and code.find(k[3])!=3 :v+=1 if code.find(k[0])==-1 :x+=1 if code.find(k[1])==-1 :x+=1 if code.find(k[2])==-1 :x+=1 if code.find(k[3])==-1 :x+=1 if p==4:print(WINNING_MSG) ; s=False else:print("\t "+"P="+str(p)+",V="+str(v)+",X="+str(x)) #Turn 3 if s==True : p,v,x=0,0,0 k=str(input("Turn #3 : ")) if code.find(k[0])==0 :p+=1 if code.find(k[1])==1 :p+=1 if code.find(k[2])==2 :p+=1 if code.find(k[3])==3 :p+=1 if code.find(k[0])>=0 and code.find(k[0])!=0 :v+=1 if code.find(k[1])>=0 and code.find(k[1])!=1 :v+=1 if code.find(k[2])>=0 and code.find(k[2])!=2 :v+=1 if code.find(k[3])>=0 and code.find(k[3])!=3 :v+=1 if code.find(k[0])==-1 :x+=1 if code.find(k[1])==-1 :x+=1 if code.find(k[2])==-1 :x+=1 if code.find(k[3])==-1 :x+=1 if p==4:print(WINNING_MSG) ; s=False else:print("\t "+"P="+str(p)+",V="+str(v)+",X="+str(x)) #Turn 4 if s==True : p,v,x=0,0,0 k=str(input("Turn #4 : ")) if code.find(k[0])==0 :p+=1 if code.find(k[1])==1 :p+=1 if code.find(k[2])==2 :p+=1 if code.find(k[3])==3 :p+=1 if code.find(k[0])>=0 and code.find(k[0])!=0 :v+=1 if code.find(k[1])>=0 and code.find(k[1])!=1 :v+=1 if code.find(k[2])>=0 and code.find(k[2])!=2 :v+=1 if code.find(k[3])>=0 and code.find(k[3])!=3 :v+=1 if code.find(k[0])==-1 :x+=1 if code.find(k[1])==-1 :x+=1 if code.find(k[2])==-1 :x+=1 if code.find(k[3])==-1 :x+=1 if p==4:print(WINNING_MSG) else: print("\t "+"P="+str(p)+",V="+str(v)+",X="+str(x)) print(LOSING_MSG) print("The answer is "+str(code)+"\n"+"Please try again...") |
# 6330288921 (20.00) 142 (2021-02-13 23:07) q = input("Turn #1 : ", ) p = 0 v = 0 if q == code : print(WINNING_MSG) else : if q[0] == code[0] : p = p+1 else: if q[0] == code[1] : v = v+1 if q[0] == code[2] : v = v+1 if q[0] == code[3] : v = v+1 if q[1] == code[1] : p = p+1 else: if q[1] == code[0] : v = v+1 if q[1] == code[2] : v = v+1 if q[1] == code[3] : v = v+1 if q[2] == code[2] : p = p+1 else: if q[2] == code[0] : v = v+1 if q[2] == code[1] : v = v+1 if q[2] == code[3] : v = v+1 if q[3] == code[3] : p = p+1 else: if q[3] == code[0] : v = v+1 if q[3] == code[1] : v = v+1 if q[3] == code[2] : v = v+1 print (" P="+str(p)+","+"V="+str(v)+","+"X="+str((4-p-v))) q = input("Turn #2 : ", ) p = 0 v = 0 if q == code : print(WINNING_MSG) else : if q[0] == code[0] : p = p+1 else: if q[0] == code[1] : v = v+1 if q[0] == code[2] : v = v+1 if q[0] == code[3] : v = v+1 if q[1] == code[1] : p = p+1 else: if q[1] == code[0] : v = v+1 if q[1] == code[2] : v = v+1 if q[1] == code[3] : v = v+1 if q[2] == code[2] : p = p+1 else: if q[2] == code[0] : v = v+1 if q[2] == code[1] : v = v+1 if q[2] == code[3] : v = v+1 if q[3] == code[3] : p = p+1 else: if q[3] == code[0] : v = v+1 if q[3] == code[1] : v = v+1 if q[3] == code[2] : v = v+1 print (" P="+str(p)+","+"V="+str(v)+","+"X="+str((4-p-v))) q = input("Turn #3 : ", ) p = 0 v = 0 if q == code : print(WINNING_MSG) else : if q[0] == code[0] : p = p+1 else: if q[0] == code[1] : v = v+1 if q[0] == code[2] : v = v+1 if q[0] == code[3] : v = v+1 if q[1] == code[1] : p = p+1 else: if q[1] == code[0] : v = v+1 if q[1] == code[2] : v = v+1 if q[1] == code[3] : v = v+1 if q[2] == code[2] : p = p+1 else: if q[2] == code[0] : v = v+1 if q[2] == code[1] : v = v+1 if q[2] == code[3] : v = v+1 if q[3] == code[3] : p = p+1 else: if q[3] == code[0] : v = v+1 if q[3] == code[1] : v = v+1 if q[3] == code[2] : v = v+1 print (" P="+str(p)+","+"V="+str(v)+","+"X="+str((4-p-v))) q = input("Turn #4 : ", ) p = 0 v = 0 if q == code : print(WINNING_MSG) else : if q[0] == code[0] : p = p+1 else: if q[0] == code[1] : v = v+1 if q[0] == code[2] : v = v+1 if q[0] == code[3] : v = v+1 if q[1] == code[1] : p = p+1 else: if q[1] == code[0] : v = v+1 if q[1] == code[2] : v = v+1 if q[1] == code[3] : v = v+1 if q[2] == code[2] : p = p+1 else: if q[2] == code[0] : v = v+1 if q[2] == code[1] : v = v+1 if q[2] == code[3] : v = v+1 if q[3] == code[3] : p = p+1 else: if q[3] == code[0] : v = v+1 if q[3] == code[1] : v = v+1 if q[3] == code[2] : v = v+1 print (" P="+str(p)+","+"V="+str(v)+","+"X="+str((4-p-v))) print (LOSING_MSG) print ("The answer is ",code) print ("Please try again...") |
# 6330289521 (20.00) 143 (2021-02-15 17:50) i=0 if i==0: x=input(("Turn #1 : ")) a0=x[0] a1=x[1] a2=x[2] a3=x[3] P=0 V=0 X=0 if a0 in code: if 0==code.index(a0): P=P+1 else: V=V+1 else: X=X+1 if a1 in code: if 1==code.index(a1): P=P+1 else: V=V+1 else: X=X+1 if a2 in code: if 2==code.index(a2): P=P+1 else: V=V+1 else: X=X+1 if a3 in code: if 3==code.index(a3): P=P+1 else: V=V+1 else: X=X+1 if P==4: print("Congratulations! You won the game.") else: print("\t "+"P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) i=i+1 if i==1: x=input(("Turn #2 : ")) a0=x[0] a1=x[1] a2=x[2] a3=x[3] P=0 V=0 X=0 if a0 in code: if 0==code.index(a0): P=P+1 else: V=V+1 else: X=X+1 if a1 in code: if 1==code.index(a1): P=P+1 else: V=V+1 else: X=X+1 if a2 in code: if 2==code.index(a2): P=P+1 else: V=V+1 else: X=X+1 if a3 in code: if 3==code.index(a3): P=P+1 else: V=V+1 else: X=X+1 if P==4: print("Congratulations! You won the game.") else: print("\t "+"P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) i=i+1 if i==2: x=input(("Turn #3 : ")) a0=x[0] a1=x[1] a2=x[2] a3=x[3] P=0 V=0 X=0 if a0 in code: if 0==code.index(a0): P=P+1 else: V=V+1 else: X=X+1 if a1 in code: if 1==code.index(a1): P=P+1 else: V=V+1 else: X=X+1 if a2 in code: if 2==code.index(a2): P=P+1 else: V=V+1 else: X=X+1 if a3 in code: if 3==code.index(a3): P=P+1 else: V=V+1 else: X=X+1 if P==4: print("Congratulations! You won the game.") else: print("\t "+"P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) i=i+1 if i==3: x=input(("Turn #4 : ")) a0=x[0] a1=x[1] a2=x[2] a3=x[3] P=0 V=0 X=0 if a0 in code: if 0==code.index(a0): P=P+1 else: V=V+1 else: X=X+1 if a1 in code: if 1==code.index(a1): P=P+1 else: V=V+1 else: X=X+1 if a2 in code: if 2==code.index(a2): P=P+1 else: V=V+1 else: X=X+1 if a3 in code: if 3==code.index(a3): P=P+1 else: V=V+1 else: X=X+1 if P==4: print("Congratulations! You won the game.") else: print("\t "+"P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) print('Sorry! You just lost it.') print('The answer is ',code) print('''Please try again... ''') |
# 6330290021 (20.00) 144 (2021-02-12 17:03) r = 1 T = input('Turn #'+ str(r)+' : ' ) if r != 4 : P = 0 V = 0 X = 0 if 'A' in code and 'A' in T: if code[0] == 'A': if T[0] == 'A': P += 1 elif T[1] == 'A': V += 1 elif T[2] == 'A': V += 1 elif T[3] == 'A': V += 1 elif code[1] == 'A': if T[0] == 'A': V += 1 elif T[1] == 'A': P += 1 elif T[2] == 'A': V += 1 elif T[3] == 'A': V += 1 elif code[2] == 'A': if T[0] == 'A': V += 1 elif T[1] == 'A': V += 1 elif T[2] == 'A': P += 1 elif T[3] == 'A': V += 1 elif code[3] == 'A': if T[0] == 'A': V += 1 elif T[1] == 'A': V += 1 elif T[2] == 'A': V += 1 elif T[3] == 'A': P += 1 if 'B' in code and 'B' in T: if code[0] == 'B': if T[0] == 'B': P += 1 elif T[1] == 'B': V += 1 elif T[2] == 'B': V += 1 elif T[3] == 'B': V += 1 elif code[1] == 'B': if T[0] == 'B': V += 1 elif T[1] == 'B': P += 1 elif T[2] == 'B': V += 1 elif T[3] == 'B': V += 1 elif code[2] == 'B': if T[0] == 'B': V += 1 elif T[1] == 'B': V += 1 elif T[2] == 'B': P += 1 elif T[3] == 'B': V += 1 elif code[3] == 'B': if T[0] == 'B': V += 1 elif T[1] == 'B': V += 1 elif T[2] == 'B': V += 1 elif T[3] == 'B': P += 1 if 'C' in code and 'C' in T: if code[0] == 'C': if T[0] == 'C': P += 1 elif T[1] == 'C': V += 1 elif T[2] == 'C': V += 1 elif T[3] == 'C': V += 1 elif code[1] == 'C': if T[0] == 'C': V += 1 elif T[1] == 'C': P += 1 elif T[2] == 'C': V += 1 elif T[3] == 'C': V += 1 elif code[2] == 'C': if T[0] == 'C': V += 1 elif T[1] == 'C': V += 1 elif T[2] == 'C': P += 1 elif T[3] == 'C': V += 1 elif code[3] == 'C': if T[0] == 'C': V += 1 elif T[1] == 'C': V += 1 elif T[2] == 'C': V += 1 elif T[3] == 'C': P += 1 if 'D' in code and 'D' in T: if code[0] == 'D': if T[0] == 'D': P += 1 elif T[1] == 'D': V += 1 elif T[2] == 'D': V += 1 elif T[3] == 'D': V += 1 elif code[1] == 'D': if T[0] == 'D': V += 1 elif T[1] == 'D': P += 1 elif T[2] == 'D': V += 1 elif T[3] == 'D': V += 1 elif code[2] == 'D': if T[0] == 'D': V += 1 elif T[1] == 'D': V += 1 elif T[2] == 'D': P += 1 elif T[3] == 'D': V += 1 elif code[3] == 'D': if T[0] == 'D': V += 1 elif T[1] == 'D': V += 1 elif T[2] == 'D': V += 1 elif T[3] == 'D': P += 1 if 'E' in code and 'E' in T: if code[0] == 'E': if T[0] == 'E': P += 1 elif T[1] == 'E': V += 1 elif T[2] == 'E': V += 1 elif T[3] == 'E': V += 1 elif code[1] == 'E': if T[0] == 'E': V += 1 elif T[1] == 'E': P += 1 elif T[2] == 'E': V += 1 elif T[3] == 'E': V += 1 elif code[2] == 'E': if T[0] == 'E': V += 1 elif T[1] == 'E': V += 1 elif T[2] == 'E': P += 1 elif T[3] == 'E': V += 1 elif code[3] == 'E': if T[0] == 'E': V += 1 elif T[1] == 'E': V += 1 elif T[2] == 'E': V += 1 elif T[3] == 'E': P += 1 if 'F' in code and 'F' in T: if code[0] == 'F': if T[0] == 'F': P += 1 elif T[1] == 'F': V += 1 elif T[2] == 'F': V += 1 elif T[3] == 'F': V += 1 elif code[1] == 'F': if T[0] == 'F': V += 1 elif T[1] == 'F': P += 1 elif T[2] == 'F': V += 1 elif T[3] == 'F': V += 1 elif code[2] == 'F': if T[0] == 'F': V += 1 elif T[1] == 'F': V += 1 elif T[2] == 'F': P += 1 elif T[3] == 'F': V += 1 elif code[3] == 'F': if T[0] == 'F': V += 1 elif T[1] == 'F': V += 1 elif T[2] == 'F': V += 1 elif T[3] == 'F': P += 1 X = 4-P-V if P == 4 : print(WINNING_MSG) elif code != T and r != 4 : print(' '*10+'P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) #--------------------------------------------------------------- r = 2 T = input('Turn #'+ str(r)+' : ' ) if r != 4 : P = 0 V = 0 X = 0 if 'A' in code and 'A' in T: if code[0] == 'A': if T[0] == 'A': P += 1 elif T[1] == 'A': V += 1 elif T[2] == 'A': V += 1 elif T[3] == 'A': V += 1 elif code[1] == 'A': if T[0] == 'A': V += 1 elif T[1] == 'A': P += 1 elif T[2] == 'A': V += 1 elif T[3] == 'A': V += 1 elif code[2] == 'A': if T[0] == 'A': V += 1 elif T[1] == 'A': V += 1 elif T[2] == 'A': P += 1 elif T[3] == 'A': V += 1 elif code[3] == 'A': if T[0] == 'A': V += 1 elif T[1] == 'A': V += 1 elif T[2] == 'A': V += 1 elif T[3] == 'A': P += 1 if 'B' in code and 'B' in T: if code[0] == 'B': if T[0] == 'B': P += 1 elif T[1] == 'B': V += 1 elif T[2] == 'B': V += 1 elif T[3] == 'B': V += 1 elif code[1] == 'B': if T[0] == 'B': V += 1 elif T[1] == 'B': P += 1 elif T[2] == 'B': V += 1 elif T[3] == 'B': V += 1 elif code[2] == 'B': if T[0] == 'B': V += 1 elif T[1] == 'B': V += 1 elif T[2] == 'B': P += 1 elif T[3] == 'B': V += 1 elif code[3] == 'B': if T[0] == 'B': V += 1 elif T[1] == 'B': V += 1 elif T[2] == 'B': V += 1 elif T[3] == 'B': P += 1 if 'C' in code and 'C' in T: if code[0] == 'C': if T[0] == 'C': P += 1 elif T[1] == 'C': V += 1 elif T[2] == 'C': V += 1 elif T[3] == 'C': V += 1 elif code[1] == 'C': if T[0] == 'C': V += 1 elif T[1] == 'C': P += 1 elif T[2] == 'C': V += 1 elif T[3] == 'C': V += 1 elif code[2] == 'C': if T[0] == 'C': V += 1 elif T[1] == 'C': V += 1 elif T[2] == 'C': P += 1 elif T[3] == 'C': V += 1 elif code[3] == 'C': if T[0] == 'C': V += 1 elif T[1] == 'C': V += 1 elif T[2] == 'C': V += 1 elif T[3] == 'C': P += 1 if 'D' in code and 'D' in T: if code[0] == 'D': if T[0] == 'D': P += 1 elif T[1] == 'D': V += 1 elif T[2] == 'D': V += 1 elif T[3] == 'D': V += 1 elif code[1] == 'D': if T[0] == 'D': V += 1 elif T[1] == 'D': P += 1 elif T[2] == 'D': V += 1 elif T[3] == 'D': V += 1 elif code[2] == 'D': if T[0] == 'D': V += 1 elif T[1] == 'D': V += 1 elif T[2] == 'D': P += 1 elif T[3] == 'D': V += 1 elif code[3] == 'D': if T[0] == 'D': V += 1 elif T[1] == 'D': V += 1 elif T[2] == 'D': V += 1 elif T[3] == 'D': P += 1 if 'E' in code and 'E' in T: if code[0] == 'E': if T[0] == 'E': P += 1 elif T[1] == 'E': V += 1 elif T[2] == 'E': V += 1 elif T[3] == 'E': V += 1 elif code[1] == 'E': if T[0] == 'E': V += 1 elif T[1] == 'E': P += 1 elif T[2] == 'E': V += 1 elif T[3] == 'E': V += 1 elif code[2] == 'E': if T[0] == 'E': V += 1 elif T[1] == 'E': V += 1 elif T[2] == 'E': P += 1 elif T[3] == 'E': V += 1 elif code[3] == 'E': if T[0] == 'E': V += 1 elif T[1] == 'E': V += 1 elif T[2] == 'E': V += 1 elif T[3] == 'E': P += 1 if 'F' in code and 'F' in T: if code[0] == 'F': if T[0] == 'F': P += 1 elif T[1] == 'F': V += 1 elif T[2] == 'F': V += 1 elif T[3] == 'F': V += 1 elif code[1] == 'F': if T[0] == 'F': V += 1 elif T[1] == 'F': P += 1 elif T[2] == 'F': V += 1 elif T[3] == 'F': V += 1 elif code[2] == 'F': if T[0] == 'F': V += 1 elif T[1] == 'F': V += 1 elif T[2] == 'F': P += 1 elif T[3] == 'F': V += 1 elif code[3] == 'F': if T[0] == 'F': V += 1 elif T[1] == 'F': V += 1 elif T[2] == 'F': V += 1 elif T[3] == 'F': P += 1 X = 4-P-V if P == 4 : print(WINNING_MSG) elif code != T and r != 4 : print(' '*10+'P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) #--------------------------------------------------------------- r = 3 T = input('Turn #'+ str(r)+' : ' ) if code == T : print(WINNING_MSG) elif r != 4 and code != T : P = 0 V = 0 X = 0 if 'A' in code and 'A' in T: if code[0] == 'A': if T[0] == 'A': P += 1 elif T[1] == 'A': V += 1 elif T[2] == 'A': V += 1 elif T[3] == 'A': V += 1 elif code[1] == 'A': if T[0] == 'A': V += 1 elif T[1] == 'A': P += 1 elif T[2] == 'A': V += 1 elif T[3] == 'A': V += 1 elif code[2] == 'A': if T[0] == 'A': V += 1 elif T[1] == 'A': V += 1 elif T[2] == 'A': P += 1 elif T[3] == 'A': V += 1 elif code[3] == 'A': if T[0] == 'A': V += 1 elif T[1] == 'A': V += 1 elif T[2] == 'A': V += 1 elif T[3] == 'A': P += 1 if 'B' in code and 'B' in T: if code[0] == 'B': if T[0] == 'B': P += 1 elif T[1] == 'B': V += 1 elif T[2] == 'B': V += 1 elif T[3] == 'B': V += 1 elif code[1] == 'B': if T[0] == 'B': V += 1 elif T[1] == 'B': P += 1 elif T[2] == 'B': V += 1 elif T[3] == 'B': V += 1 elif code[2] == 'B': if T[0] == 'B': V += 1 elif T[1] == 'B': V += 1 elif T[2] == 'B': P += 1 elif T[3] == 'B': V += 1 elif code[3] == 'B': if T[0] == 'B': V += 1 elif T[1] == 'B': V += 1 elif T[2] == 'B': V += 1 elif T[3] == 'B': P += 1 if 'C' in code and 'C' in T: if code[0] == 'C': if T[0] == 'C': P += 1 elif T[1] == 'C': V += 1 elif T[2] == 'C': V += 1 elif T[3] == 'C': V += 1 elif code[1] == 'C': if T[0] == 'C': V += 1 elif T[1] == 'C': P += 1 elif T[2] == 'C': V += 1 elif T[3] == 'C': V += 1 elif code[2] == 'C': if T[0] == 'C': V += 1 elif T[1] == 'C': V += 1 elif T[2] == 'C': P += 1 elif T[3] == 'C': V += 1 elif code[3] == 'C': if T[0] == 'C': V += 1 elif T[1] == 'C': V += 1 elif T[2] == 'C': V += 1 elif T[3] == 'C': P += 1 if 'D' in code and 'D' in T: if code[0] == 'D': if T[0] == 'D': P += 1 elif T[1] == 'D': V += 1 elif T[2] == 'D': V += 1 elif T[3] == 'D': V += 1 elif code[1] == 'D': if T[0] == 'D': V += 1 elif T[1] == 'D': P += 1 elif T[2] == 'D': V += 1 elif T[3] == 'D': V += 1 elif code[2] == 'D': if T[0] == 'D': V += 1 elif T[1] == 'D': V += 1 elif T[2] == 'D': P += 1 elif T[3] == 'D': V += 1 elif code[3] == 'D': if T[0] == 'D': V += 1 elif T[1] == 'D': V += 1 elif T[2] == 'D': V += 1 elif T[3] == 'D': P += 1 if 'E' in code and 'E' in T: if code[0] == 'E': if T[0] == 'E': P += 1 elif T[1] == 'E': V += 1 elif T[2] == 'E': V += 1 elif T[3] == 'E': V += 1 elif code[1] == 'E': if T[0] == 'E': V += 1 elif T[1] == 'E': P += 1 elif T[2] == 'E': V += 1 elif T[3] == 'E': V += 1 elif code[2] == 'E': if T[0] == 'E': V += 1 elif T[1] == 'E': V += 1 elif T[2] == 'E': P += 1 elif T[3] == 'E': V += 1 elif code[3] == 'E': if T[0] == 'E': V += 1 elif T[1] == 'E': V += 1 elif T[2] == 'E': V += 1 elif T[3] == 'E': P += 1 if 'F' in code and 'F' in T: if code[0] == 'F': if T[0] == 'F': P += 1 elif T[1] == 'F': V += 1 elif T[2] == 'F': V += 1 elif T[3] == 'F': V += 1 elif code[1] == 'F': if T[0] == 'F': V += 1 elif T[1] == 'F': P += 1 elif T[2] == 'F': V += 1 elif T[3] == 'F': V += 1 elif code[2] == 'F': if T[0] == 'F': V += 1 elif T[1] == 'F': V += 1 elif T[2] == 'F': P += 1 elif T[3] == 'F': V += 1 elif code[3] == 'F': if T[0] == 'F': V += 1 elif T[1] == 'F': V += 1 elif T[2] == 'F': V += 1 elif T[3] == 'F': P += 1 X = 4-P-V if P == 4 : print(WINNING_MSG) elif code != T and r != 4 : print(' '*10+'P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) #--------------------------------------------------------------- r = 4 T = input('Turn #'+ str(r)+' : ' ) if code == T : print(WINNING_MSG) elif code != T : P = 0 V = 0 X = 0 if 'A' in code and 'A' in T: if code[0] == 'A': if T[0] == 'A': P += 1 elif T[1] == 'A': V += 1 elif T[2] == 'A': V += 1 elif T[3] == 'A': V += 1 elif code[1] == 'A': if T[0] == 'A': V += 1 elif T[1] == 'A': P += 1 elif T[2] == 'A': V += 1 elif T[3] == 'A': V += 1 elif code[2] == 'A': if T[0] == 'A': V += 1 elif T[1] == 'A': V += 1 elif T[2] == 'A': P += 1 elif T[3] == 'A': V += 1 elif code[3] == 'A': if T[0] == 'A': V += 1 elif T[1] == 'A': V += 1 elif T[2] == 'A': V += 1 elif T[3] == 'A': P += 1 if 'B' in code and 'B' in T: if code[0] == 'B': if T[0] == 'B': P += 1 elif T[1] == 'B': V += 1 elif T[2] == 'B': V += 1 elif T[3] == 'B': V += 1 elif code[1] == 'B': if T[0] == 'B': V += 1 elif T[1] == 'B': P += 1 elif T[2] == 'B': V += 1 elif T[3] == 'B': V += 1 elif code[2] == 'B': if T[0] == 'B': V += 1 elif T[1] == 'B': V += 1 elif T[2] == 'B': P += 1 elif T[3] == 'B': V += 1 elif code[3] == 'B': if T[0] == 'B': V += 1 elif T[1] == 'B': V += 1 elif T[2] == 'B': V += 1 elif T[3] == 'B': P += 1 if 'C' in code and 'C' in T: if code[0] == 'C': if T[0] == 'C': P += 1 elif T[1] == 'C': V += 1 elif T[2] == 'C': V += 1 elif T[3] == 'C': V += 1 elif code[1] == 'C': if T[0] == 'C': V += 1 elif T[1] == 'C': P += 1 elif T[2] == 'C': V += 1 elif T[3] == 'C': V += 1 elif code[2] == 'C': if T[0] == 'C': V += 1 elif T[1] == 'C': V += 1 elif T[2] == 'C': P += 1 elif T[3] == 'C': V += 1 elif code[3] == 'C': if T[0] == 'C': V += 1 elif T[1] == 'C': V += 1 elif T[2] == 'C': V += 1 elif T[3] == 'C': P += 1 if 'D' in code and 'D' in T: if code[0] == 'D': if T[0] == 'D': P += 1 elif T[1] == 'D': V += 1 elif T[2] == 'D': V += 1 elif T[3] == 'D': V += 1 elif code[1] == 'D': if T[0] == 'D': V += 1 elif T[1] == 'D': P += 1 elif T[2] == 'D': V += 1 elif T[3] == 'D': V += 1 elif code[2] == 'D': if T[0] == 'D': V += 1 elif T[1] == 'D': V += 1 elif T[2] == 'D': P += 1 elif T[3] == 'D': V += 1 elif code[3] == 'D': if T[0] == 'D': V += 1 elif T[1] == 'D': V += 1 elif T[2] == 'D': V += 1 elif T[3] == 'D': P += 1 if 'E' in code and 'E' in T: if code[0] == 'E': if T[0] == 'E': P += 1 elif T[1] == 'E': V += 1 elif T[2] == 'E': V += 1 elif T[3] == 'E': V += 1 elif code[1] == 'E': if T[0] == 'E': V += 1 elif T[1] == 'E': P += 1 elif T[2] == 'E': V += 1 elif T[3] == 'E': V += 1 elif code[2] == 'E': if T[0] == 'E': V += 1 elif T[1] == 'E': V += 1 elif T[2] == 'E': P += 1 elif T[3] == 'E': V += 1 elif code[3] == 'E': if T[0] == 'E': V += 1 elif T[1] == 'E': V += 1 elif T[2] == 'E': V += 1 elif T[3] == 'E': P += 1 if 'F' in code and 'F' in T: if code[0] == 'F': if T[0] == 'F': P += 1 elif T[1] == 'F': V += 1 elif T[2] == 'F': V += 1 elif T[3] == 'F': V += 1 elif code[1] == 'F': if T[0] == 'F': V += 1 elif T[1] == 'F': P += 1 elif T[2] == 'F': V += 1 elif T[3] == 'F': V += 1 elif code[2] == 'F': if T[0] == 'F': V += 1 elif T[1] == 'F': V += 1 elif T[2] == 'F': P += 1 elif T[3] == 'F': V += 1 elif code[3] == 'F': if T[0] == 'F': V += 1 elif T[1] == 'F': V += 1 elif T[2] == 'F': V += 1 elif T[3] == 'F': P += 1 X = 4-P-V if P == 4 : print(WINNING_MSG) elif P!=4 : print(' '*10+'P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) print(LOSING_MSG) print('The answer is ',code) print('Please try again...') |
# 6330291721 (20.00) 145 (2021-02-13 11:23) turn1 = input("Turn #1 : ") P,V = 0,0 if code == turn1 : print(WINNING_MSG) else: if code[0] == turn1[0] : P = 1 elif turn1[0] in code : V = 1 if code[1] == turn1[1] : P += 1 elif turn1[1] in code : V += 1 if code[2] == turn1[2] : P += 1 elif turn1[2] in code : V += 1 if code[3] == turn1[3] : P += 1 elif turn1[3] in code : V += 1 print(" " + "P=" + str(P) + "," + "V=" + str(V) + "," + "X=" + str(4-P-V)) #------------------------------------------------------------------------------------ turn2 = input("Turn #2 : ") P,V = 0,0 if code == turn2 : print(WINNING_MSG) else: if code[0] == turn2[0] : P = 1 elif turn2[0] in code : V = 1 if code[1] == turn2[1] : P += 1 elif turn2[1] in code : V += 1 if code[2] == turn2[2] : P += 1 elif turn2[2] in code : V += 1 if code[3] == turn2[3] : P += 1 elif turn2[3] in code : V += 1 print(" " + "P=" + str(P) + "," + "V=" + str(V) + "," + "X=" + str(4-P-V)) #------------------------------------------------------------------------------------ turn3 = input("Turn #3 : ") P,V = 0,0 if code == turn3 : print(WINNING_MSG) else: if code[0] == turn3[0] : P = 1 elif turn3[0] in code : V = 1 if code[1] == turn3[1] : P += 1 elif turn3[1] in code : V += 1 if code[2] == turn3[2] : P += 1 elif turn3[2] in code : V += 1 if code[3] == turn3[3] : P += 1 elif turn3[3] in code : V += 1 print(" " + "P=" + str(P) + "," + "V=" + str(V) + "," + "X=" + str(4-P-V)) #------------------------------------------------------------------------------------ turn4 = input("Turn #4 : ") P,V = 0,0 if code == turn4 : print(WINNING_MSG) else: if code[0] == turn4[0] : P = 1 elif turn4[0] in code : V = 1 if code[1] == turn4[1] : P += 1 elif turn4[1] in code : V += 1 if code[2] == turn4[2] : P += 1 elif turn4[2] in code : V += 1 if code[3] == turn4[3] : P += 1 elif turn4[3] in code : V += 1 print(" " + "P=" + str(P) + "," + "V=" + str(V) + "," + "X=" + str(4-P-V)) print(LOSING_MSG) print("The answer is " + code) print("Please try again...") |
# 6330292321 (20.00) 146 (2021-02-11 12:02) m = 0 P,V,X = 0,0,0 s = input('Turn #1 : ') if s[0] in code: if s[0] == code[0]: P += 1 else: V += 1 else : X += 1 if s[1] in code: if s[1] == code[1]: P += 1 else: V += 1 else : X += 1 if s[2] in code: if s[2] == code[2]: P += 1 else: V += 1 else : X += 1 if s[3] in code: if s[3] == code[3]: P += 1 else: V += 1 else : X += 1 if P == 4 : m = 1 else : print(" "*10,'P=',P,',V=',V,',X=',X,sep='') if m == 0: P,V,X = 0,0,0 s = input('Turn #2 : ') if s[0] in code: if s[0] == code[0]: P += 1 else: V += 1 else : X += 1 if s[1] in code: if s[1] == code[1]: P += 1 else: V += 1 else : X += 1 if s[2] in code: if s[2] == code[2]: P += 1 else: V += 1 else : X += 1 if s[3] in code: if s[3] == code[3]: P += 1 else: V += 1 else : X += 1 if P == 4 : m = 1 else : print(" "*10,'P=',P,',V=',V,',X=',X,sep='') if m == 0: P,V,X = 0,0,0 s = input('Turn #3 : ') if s[0] in code: if s[0] == code[0]: P += 1 else: V += 1 else : X += 1 if s[1] in code: if s[1] == code[1]: P += 1 else: V += 1 else : X += 1 if s[2] in code: if s[2] == code[2]: P += 1 else: V += 1 else : X += 1 if s[3] in code: if s[3] == code[3]: P += 1 else: V += 1 else : X += 1 if P == 4 : m = 1 else : print(" "*10,'P=',P,',V=',V,',X=',X,sep='') if m == 0: P,V,X = 0,0,0 s = input('Turn #4 : ') if s[0] in code: if s[0] == code[0]: P += 1 else: V += 1 else : X += 1 if s[1] in code: if s[1] == code[1]: P += 1 else: V += 1 else : X += 1 if s[2] in code: if s[2] == code[2]: P += 1 else: V += 1 else : X += 1 if s[3] in code: if s[3] == code[3]: P += 1 else: V += 1 else : X += 1 if P == 4 : m = 1 else : print(" "*10,'P=',P,',V=',V,',X=',X,sep='') if P == 4 : print('Congratulations! You won the game.') else : print("Sorry! You just lost it.") print("The answer is ",code) print("Please try again...") |
# 6330293021 (15.90) 147 (2021-02-12 01:17) a = input('Turn #1 :') P = 0 V = 0 X = 0 if a == code : print(WINNING_MSG) else : if a[0] == code[0]: P += 1 if a[1] == code[1]: P += 1 if a[2] == code[2]: P += 1 if a[3] == code[3]: P += 1 if a[0] not in code: X += 1 if a[2] not in code: X += 1 if a[1] not in code: X += 1 if a[3] not in code: X += 1 else : V = 4-P-X print(' '+'P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) a = input('Turn #2 :') P = 0 V = 0 X = 0 if a == code : print(WINNING_MSG) else : if a[0] == code[0]: P += 1 if a[1] == code[1]: P += 1 if a[2] == code[2]: P += 1 if a[3] == code[3]: P += 1 if a[0] not in code: X += 1 if a[2] not in code: X += 1 if a[1] not in code: X += 1 if a[3] not in code: X += 1 else : V = 4-P-X print(' '+'P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) a = input('Turn #3 :') P = 0 V = 0 X = 0 if a == code : print(WINNING_MSG) else : if a[0] == code[0]: P += 1 if a[1] == code[1]: P += 1 if a[2] == code[2]: P += 1 if a[3] == code[3]: P += 1 if a[0] not in code: X += 1 if a[2] not in code: X += 1 if a[1] not in code: X += 1 if a[3] not in code: X += 1 else : V = 4-P-X print(' '+'P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) a = input('Turn #4 :') P = 0 V = 0 X = 0 if a == code : print(WINNING_MSG) else : if a[0] == code[0]: P += 1 if a[1] == code[1]: P += 1 if a[2] == code[2]: P += 1 if a[3] == code[3]: P += 1 if a[0] not in code: X += 1 if a[2] not in code: X += 1 if a[1] not in code: X += 1 if a[3] not in code: X += 1 else : V = 4-P-X print(' '+'P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) print(LOSING_MSG) |
# 6330294621 (20.00) 148 (2021-02-14 19:02) turn_1 = input("Turn #1 : ") P = 0 V = 0 X = 0 if turn_1 == code : print(WINNING_MSG) else : if turn_1[0] in code and turn_1[0] == code[0]: P += 1 elif turn_1[0] in code and turn_1[0] != code[0]: V += 1 else: X += 1 if turn_1[1] in code and turn_1[1] == code[1]: P += 1 elif turn_1[1] in code and turn_1[1] != code[1]: V += 1 else: X += 1 if turn_1[2] in code and turn_1[2] == code[2]: P += 1 elif turn_1[2] in code and turn_1[2] != code[2]: V += 1 else: X += 1 if turn_1[3] in code and turn_1[3] == code[3]: P += 1 elif turn_1[3] in code and turn_1[3] != code[3]: V += 1 else: X += 1 print (' '+' P='+ str(P) +','+'V='+ str(V) + ','+'X=' + str(X)) turn_2 = input("Turn #2 : ") V = 0 X = 0 P = 0 if turn_2 == code : print(WINNING_MSG) else : if turn_2[0] in code and turn_2[0] == code[0]: P += 1 elif turn_2[0] in code and turn_2[0] != code[0]: V += 1 else: X += 1 if turn_2[1] in code and turn_2[1] == code[1]: P += 1 elif turn_2[1] in code and turn_2[1] != code[1]: V += 1 else: X += 1 if turn_2[2] in code and turn_2[2] == code[2]: P += 1 elif turn_2[2] in code and turn_2[2] != code[2]: V += 1 else: X += 1 if turn_2[3] in code and turn_2[3] == code[3]: P += 1 elif turn_2[3] in code and turn_2[3] != code[3]: V += 1 else: X += 1 print (' '+' P='+ str(P) +','+'V='+ str(V) + ','+'X=' + str(X)) turn_3 = input("Turn #3 : ") V = 0 X = 0 P = 0 if turn_3 == code : print(WINNING_MSG) else : if turn_3[0] in code and turn_3[0] == code[0]: P += 1 elif turn_3[0] in code and turn_3[0] != code[0]: V += 1 else: X += 1 if turn_3[1] in code and turn_3[1] == code[1]: P += 1 elif turn_3[1] in code and turn_3[1] != code[1]: V += 1 else: X += 1 if turn_3[2] in code and turn_3[2] == code[2]: P += 1 elif turn_3[2] in code and turn_3[2] != code[2]: V += 1 else: X += 1 if turn_3[3] in code and turn_3[3] == code[3]: P += 1 elif turn_3[3] in code and turn_3[3] != code[3]: V += 1 else: X += 1 print (' '+' P='+ str(P) +','+'V='+ str(V) + ','+'X=' + str(X)) turn_4 = input("Turn #4 : ") V = 0 X = 0 P = 0 if turn_4 == code : print (WINNING_MSG) else : if turn_3[0] in code and turn_3[0] == code[0]: P += 1 elif turn_3[0] in code and turn_3[0] != code[0]: V += 1 else: X += 1 if turn_3[1] in code and turn_3[1] == code[1]: P += 1 elif turn_3[1] in code and turn_3[1] != code[1]: V += 1 else: X += 1 if turn_3[2] in code and turn_3[2] == code[2]: P += 1 elif turn_3[2] in code and turn_3[2] != code[2]: V += 1 else: X += 1 if turn_3[3] in code and turn_3[3] == code[3]: P += 1 elif turn_3[3] in code and turn_3[3] != code[3]: V += 1 else: X += 1 print (' '+' P='+ str(P) +','+'V='+ str(V) + ','+'X=' + str(X)) print ( LOSING_MSG ) print ('The answer is ' + code) print ('Please try again...' ) |
# 6330295221 (20.00) 149 (2021-02-14 18:50) x = input("Turn #1 : ") P = 0 V = 0 X = 0 if x == code: print(WINNING_MSG) else: if x[0] == code[0]: P += 1 if x[1] == code[1]: P += 1 if x[2] == code[2]: P += 1 if x[3] == code[3]: P += 1 if x[0] in code and x[0]!=code[0]: V += 1 if x[1] in code and x[1]!=code[1]: V += 1 if x[2] in code and x[2]!=code[2]: V += 1 if x[3] in code and x[3]!=code[3]: V += 1 if not(x[0] in code): X += 1 if not(x[1] in code): X += 1 if not(x[2] in code): X += 1 if not(x[3] in code): X += 1 print(" "+"P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) x = input("Turn #2 : ") P = 0 V = 0 X = 0 if x == code: print(WINNING_MSG) else: if x[0] == code[0]: P += 1 if x[1] == code[1]: P += 1 if x[2] == code[2]: P += 1 if x[3] == code[3]: P += 1 if x[0] in code and x[0]!=code[0]: V += 1 if x[1] in code and x[1]!=code[1]: V += 1 if x[2] in code and x[2]!=code[2]: V += 1 if x[3] in code and x[3]!=code[3]: V += 1 if not(x[0] in code): X += 1 if not(x[1] in code): X += 1 if not(x[2] in code): X += 1 if not(x[3] in code): X += 1 print(" "+"P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) x = input("Turn #3 : ") P = 0 V = 0 X = 0 if x == code: print(WINNING_MSG) else: if x[0] == code[0]: P += 1 if x[1] == code[1]: P += 1 if x[2] == code[2]: P += 1 if x[3] == code[3]: P += 1 if x[0] in code and x[0]!=code[0]: V += 1 if x[1] in code and x[1]!=code[1]: V += 1 if x[2] in code and x[2]!=code[2]: V += 1 if x[3] in code and x[3]!=code[3]: V += 1 if not(x[0] in code): X += 1 if not(x[1] in code): X += 1 if not(x[2] in code): X += 1 if not(x[3] in code): X += 1 print(" "+"P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) x = input("Turn #4 : ") P = 0 V = 0 X = 0 if x == code: print(WINNING_MSG) else: if x[0] == code[0]: P += 1 if x[1] == code[1]: P += 1 if x[2] == code[2]: P += 1 if x[3] == code[3]: P += 1 if x[0] in code and x[0]!=code[0]: V += 1 if x[1] in code and x[1]!=code[1]: V += 1 if x[2] in code and x[2]!=code[2]: V += 1 if x[3] in code and x[3]!=code[3]: V += 1 if not(x[0] in code): X += 1 if not(x[1] in code): X += 1 if not(x[2] in code): X += 1 if not(x[3] in code): X += 1 print(" "+"P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) print(LOSING_MSG) print("The answer is " + code) print("Please try again...") |
# 6330296921 (20.00) 150 (2021-02-14 02:49) R = 1 if R <= 4 : P = 0 V = 0 X = 0 ans = input("Turn #"+str(R)+" : ") if ans[0] == code[0]: P +=1 if ans[1] == code[1]: P +=1 if ans[2] == code[2]: P +=1 if ans[3] == code[3]: P +=1 if ans[0] in code: V +=1 if ans[1] in code: V +=1 if ans[2] in code: V +=1 if ans[3] in code: V +=1 V -= P X = 4-(V+P) R += 1 if P !=4: print(" "+"P="+str(P)+",V="+str(V)+",X="+str(X)) if P==4 : print(WINNING_MSG) R = 6 if R <= 4 : P = 0 V = 0 X = 0 ans = input("Turn #"+str(R)+" : ") if ans[0] == code[0]: P +=1 if ans[1] == code[1]: P +=1 if ans[2] == code[2]: P +=1 if ans[3] == code[3]: P +=1 if ans[0] in code: V +=1 if ans[1] in code: V +=1 if ans[2] in code: V +=1 if ans[3] in code: V +=1 V -= P X = 4-(V+P) R += 1 if P !=4: print(" "+"P="+str(P)+",V="+str(V)+",X="+str(X)) if P==4 : print(WINNING_MSG) R = 6 if R <= 4 : P = 0 V = 0 X = 0 ans = input("Turn #"+str(R)+" : ") if ans[0] == code[0]: P +=1 if ans[1] == code[1]: P +=1 if ans[2] == code[2]: P +=1 if ans[3] == code[3]: P +=1 if ans[0] in code: V +=1 if ans[1] in code: V +=1 if ans[2] in code: V +=1 if ans[3] in code: V +=1 V -= P X = 4-(V+P) R += 1 if P !=4: print(" "+"P="+str(P)+",V="+str(V)+",X="+str(X)) if P==4 : print(WINNING_MSG) R = 6 if R <= 4 : P = 0 V = 0 X = 0 ans = input("Turn #"+str(R)+" : ") if ans[0] == code[0]: P +=1 if ans[1] == code[1]: P +=1 if ans[2] == code[2]: P +=1 if ans[3] == code[3]: P +=1 if ans[0] in code: V +=1 if ans[1] in code: V +=1 if ans[2] in code: V +=1 if ans[3] in code: V +=1 V -= P X = 4-(V+P) R += 1 if P !=4: print(" "+"P="+str(P)+",V="+str(V)+",X="+str(X)) if P==4 : print(WINNING_MSG) R = 6 if R == 5: print(LOSING_MSG) print('The answer is ',code) print('Please try again...') |
# 6330298121 (17.26) 151 (2021-02-14 15:53) c = code i = input("Turn #1 : ") a = 0 p = 0 v = 0 if i[0] in c: a += 1 if i[1] in c: a += 1 if i[2] in c: a += 1 if i[3] in c: a += 1 if i[0] == c[0]: p += 1 if i[1] == c[1]: p += 1 if i[2] == c[2]: p += 1 if i[3] == c[3]: p += 1 v = a - p x = 4 - a if p == 4: print(WINNING_MSG) else : print(" "*10+"P=" + str(p) + ",V=" + str(v) + ",X=" + str(x)) j = input("Turn #2 : ") a = 0 p = 0 v = 0 if j[0] in c: a += 1 if j[1] in c: a += 1 if j[2] in c: a += 1 if j[3] in c: a += 1 if j[0] == c[0]: p += 1 if j[1] == c[1]: p += 1 if j[2] == c[2]: p += 1 if j[3] == c[3]: p += 1 v = a - p x = 4 - a if p == 4: print(WINNING_MSG) else : print(" "*10+"P=" + str(p) + ",V=" + str(v) + ",X=" + str(x)) j = input("Turn #3 : ") a = 0 p = 0 v = 0 if j[0] in c: a += 1 if j[1] in c: a += 1 if j[2] in c: a += 1 if j[3] in c: a += 1 if j[0] == c[0]: p += 1 if j[1] == c[1]: p += 1 if j[2] == c[2]: p += 1 if j[3] == c[3]: p += 1 v = a - p x = 4 - a if p == 4: print(WINNING_MSG) else : print(" "*10+"P=" + str(p) + ",V=" + str(v) + ",X=" + str(x)) j = input("Turn #4 : ") a = 0 p = 0 v = 0 if j[0] in c: a += 1 if j[1] in c: a += 1 if j[2] in c: a += 1 if j[3] in c: a += 1 if j[0] == c[0]: p += 1 if j[1] == c[1]: p += 1 if j[2] == c[2]: p += 1 if j[3] == c[3]: p += 1 v = a - p x = 4 - a if p == 4: print(WINNING_MSG) else : print(LOSING_MSG) print("The answer is",code) print("Plese try again...") |
# 6330299821 (20.00) 152 (2021-02-13 18:59) ans1 = input("Turn #1 : ") if ans1 == code: print(WINNING_MSG) else: a, b = 0, 0 if ans1[0] not in code: a += 1 elif ans1[0] == code[0]: b += 1 if ans1[1] not in code: a += 1 elif ans1[1] == code[1]: b += 1 if ans1[2] not in code: a += 1 elif ans1[2] == code[2]: b += 1 if ans1[3] not in code: a += 1 elif ans1[3] == code[3]: b += 1 c = 4 - a - b print(" P="+str(b)+",V="+str(c)+",X="+str(a)) ans2 = input("Turn #2 : ") if ans2 == code: print(WINNING_MSG) else: d, e = 0, 0 if ans2[0] not in code: d += 1 elif ans2[0] == code[0]: e += 1 if ans2[1] not in code: d += 1 elif ans2[1] == code[1]: e += 1 if ans2[2] not in code: d += 1 elif ans2[2] == code[2]: e += 1 if ans2[3] not in code: d += 1 elif ans2[3] == code[3]: e += 1 f = 4 - d - e print(" P=" + str(e) + ",V=" + str(f) + ",X=" + str(d)) ans3 = input("Turn #3 : ") if ans3 == code: print(WINNING_MSG) else: g, h = 0, 0 if ans3[0] not in code: g += 1 elif ans3[0] == code[0]: h += 1 if ans3[1] not in code: g += 1 elif ans3[1] == code[1]: h += 1 if ans3[2] not in code: g += 1 elif ans3[2] == code[2]: h += 1 if ans3[3] not in code: g += 1 elif ans3[3] == code[3]: h += 1 i = 4 - g - h print(" P=" + str(h) + ",V=" + str(i) + ",X=" + str(g)) ans4 = input("Turn #4 : ") if ans4 == code: print(WINNING_MSG) else: p, x = 0, 0 if ans4[0] not in code: x += 1 elif ans4[0] == code[0]: p += 1 if ans4[1] not in code: x += 1 elif ans4[1] == code[1]: p += 1 if ans4[2] not in code: x += 1 elif ans4[2] == code[2]: p += 1 if ans4[3] not in code: x += 1 elif ans4[3] == code[3]: p += 1 v = 4 - p - x print(" P=" + str(p) + ",V=" + str(v) + ",X=" + str(x)) print(LOSING_MSG) print("The answer is", code) print("Please try again...") |
# 6330300721 (14.51) 153 (2021-02-12 14:57) P = 0 V = 0 X = 0 g1 = input() if code == g1 : print(WINNING_MSG) elif code[0] == g1[0] : P += 1 if code[1] == g1[1] : P += 1 if code[2] == g1[2] : P += 1 if code[3] == g1[3] : P += 1 if g1[0] in list(code) and code[0] != g1[0] : V += 1 if g1[1] in list(code) and code[1] != g1[1] : V += 1 if g1[2] in list(code) and code[2] != g1[2] : V += 1 if g1[3] in list(code) and code[3] != g1[3] : V += 1 X += 4-P-V print('Turn #1 :', g1) print(' P='+str(P)+',V='+str(V)+',X='+str(X)) P = 0 V = 0 X = 0 g2 = input() if code == g2 : print(WINNING_MSG) elif code[0] == g2[0] : P += 1 if code[1] == g2[1] : P += 1 if code[2] == g2[2] : P += 1 if code[3] == g2[3] : P += 1 if g2[0] in list(code) and code[0] != g2[0] : V += 1 if g2[1] in list(code) and code[1] != g2[1] : V += 1 if g2[2] in list(code) and code[2] != g2[2] : V += 1 if g2[3] in list(code) and code[3] != g2[3] : V += 1 X += 4-P-V print('Turn #2 :', g2) print(' P='+str(P)+',V='+str(V)+',X='+str(X)) P = 0 V = 0 X = 0 g3 = input() if code == g3 : print(WINNING_MSG) elif code[0] == g3[0] : P += 1 if code[1] == g3[1] : P += 1 if code[2] == g3[2] : P += 1 if code[3] == g3[3] : P += 1 if g3[0] in list(code) and code[0] != g3[0] : V += 1 if g3[1] in list(code) and code[1] != g3[1] : V += 1 if g3[2] in list(code) and code[2] != g3[2] : V += 1 if g3[3] in list(code) and code[3] != g3[3] : V += 1 X += 4-P-V print('Turn #3 :', g3) print(' P='+str(P)+',V='+str(V)+',X='+str(X)) P = 0 V = 0 X = 0 g4 = input() if code == g4 : print(WINNING_MSG) elif code[0] == g4[0] : P += 1 if code[1] == g4[1] : P += 1 if code[2] == g4[2] : P += 1 if code[3] == g4[3] : P += 1 if g4[0] in list(code) and code[0] != g4[0] : V += 1 if g4[1] in list(code) and code[1] != g4[1] : V += 1 if g4[2] in list(code) and code[2] != g4[2] : V += 1 if g4[3] in list(code) and code[3] != g4[3] : V += 1 X += 4-P-V print('Turn #4 :', g4) print(' P='+str(P)+',V='+str(V)+',X='+str(X)) g5 = input() if code == g5 : print(WINNING_MSG) else : print(LOSING_MSG) print('The answer is'+' '+str(code)) print('Please try again...') |
# 6330301321 (20.00) 154 (2021-02-13 15:09) turn = 1 win = False #print(code) if not win : p=0 v=0 x=0 guess = input('Turn #'+str(turn)+' : ') if guess == code : print(WINNING_MSG) win = True else : if guess[0]==code[0]: p+=1 elif guess[0] in code : v+=1 else: x+=1 if guess[1]==code[1]: p+=1 elif guess[1] in code : v+=1 else: x+=1 if guess[2]==code[2]: p+=1 elif guess[2] in code : v+=1 else: x+=1 if guess[3]==code[3]: p+=1 elif guess[3] in code : v+=1 else: x+=1 turn+=1 print(' P='+str(p)+',V='+str(v)+',X='+str(x)) if not win : p=0 v=0 x=0 guess = input('Turn #'+str(turn)+' : ') if guess == code : print(WINNING_MSG) win = True else : if guess[0]==code[0]: p+=1 elif guess[0] in code : v+=1 else: x+=1 if guess[1]==code[1]: p+=1 elif guess[1] in code : v+=1 else: x+=1 if guess[2]==code[2]: p+=1 elif guess[2] in code : v+=1 else: x+=1 if guess[3]==code[3]: p+=1 elif guess[3] in code : v+=1 else: x+=1 turn+=1 print(' P='+str(p)+',V='+str(v)+',X='+str(x)) if not win : p=0 v=0 x=0 guess = input('Turn #'+str(turn)+' : ') if guess == code : print(WINNING_MSG) win = True else : if guess[0]==code[0]: p+=1 elif guess[0] in code : v+=1 else: x+=1 if guess[1]==code[1]: p+=1 elif guess[1] in code : v+=1 else: x+=1 if guess[2]==code[2]: p+=1 elif guess[2] in code : v+=1 else: x+=1 if guess[3]==code[3]: p+=1 elif guess[3] in code : v+=1 else: x+=1 turn+=1 print(' P='+str(p)+',V='+str(v)+',X='+str(x)) if not win : p=0 v=0 x=0 guess = input('Turn #'+str(turn)+' : ') if guess == code : print(WINNING_MSG) win = True else : if guess[0]==code[0]: p+=1 elif guess[0] in code : v+=1 else: x+=1 if guess[1]==code[1]: p+=1 elif guess[1] in code : v+=1 else: x+=1 if guess[2]==code[2]: p+=1 elif guess[2] in code : v+=1 else: x+=1 if guess[3]==code[3]: p+=1 elif guess[3] in code : v+=1 else: x+=1 turn+=1 print(' P='+str(p)+',V='+str(v)+',X='+str(x)) print(LOSING_MSG) print('The answer is '+code) print('Please try again...') |
# 6330302021 (20.00) 155 (2021-02-13 02:24) x1 = input("Turn #1 : ") countP = 0 countV = 0 countX = 0 check = 0 if x1 == code: print(WINNING_MSG) check = 1 else: if x1[0] == code[0]: countP += 1 else: if x1[0] in code: countV += 1 else: countX += 1 if x1[1] == code[1]: countP += 1 else: if x1[1] in code: countV += 1 else: countX += 1 if x1[2] == code[2]: countP += 1 else: if x1[2] in code: countV += 1 else: countX += 1 if x1[3] == code[3]: countP += 1 else: if x1[3] in code: countV += 1 else: countX += 1 print(" "*10+"P="+str(countP)+','+"V="+str(countV)+','+"X="+str(countX)) if check != 1: x2 = input("Turn #2 : ") countP = 0 countV = 0 countX = 0 if x2 == code: print(WINNING_MSG) else: if x2[0] == code[0]: countP += 1 else: if x2[0] in code: countV += 1 else: countX += 1 if x2[1] == code[1]: countP += 1 else: if x2[1] in code: countV += 1 else: countX += 1 if x2[2] == code[2]: countP += 1 else: if x2[2] in code: countV += 1 else: countX += 1 if x2[3] == code[3]: countP += 1 else: if x2[3] in code: countV += 1 else: countX += 1 print(" "*10+"P="+str(countP)+','+"V="+str(countV)+','+"X="+str(countX)) if check != 1: x3 = input("Turn #3 : ") countP = 0 countV = 0 countX = 0 if x3 == code: print(WINNING_MSG) else: if x3[0] == code[0]: countP += 1 else: if x3[0] in code: countV += 1 else: countX += 1 if x3[1] == code[1]: countP += 1 else: if x3[1] in code: countV += 1 else: countX += 1 if x3[2] == code[2]: countP += 1 else: if x3[2] in code: countV += 1 else: countX += 1 if x3[3] == code[3]: countP += 1 else: if x3[3] in code: countV += 1 else: countX += 1 print(" "*10+"P="+str(countP)+','+"V="+str(countV)+','+"X="+str(countX)) if check != 1: x4 = input("Turn #4 : ") countP = 0 countV = 0 countX = 0 if x4 == code: print(WINNING_MSG) else: if x4[0] == code[0]: countP += 1 else: if x4[0] in code: countV += 1 else: countX += 1 if x4[1] == code[1]: countP += 1 else: if x4[1] in code: countV += 1 else: countX += 1 if x4[2] == code[2]: countP += 1 else: if x4[2] in code: countV += 1 else: countX += 1 if x4[3] == code[3]: countP += 1 else: if x4[3] in code: countV += 1 else: countX += 1 print(" "*10+"P="+str(countP)+','+"V="+str(countV)+','+"X="+str(countX)) print(LOSING_MSG) print('The answer is'+' '+code) print('Please try again...') |
# 6330303621 (20.00) 156 (2021-02-13 22:12) a = input("Turn #1 : ") P=0 V=0 if code[0]==a[0] : P+=1 if not code[0]==a[0] and a in code : V+=1 else : if code[0]==a[1] : V+=1 if code[0]==a[2] : V+=1 if code[0]==a[3] : V+=1 if code[1]==a[1] : P+=1 if not code[1]==a[1] and a in code : V+=1 else : if code[1]==a[0] : V+=1 if code[1]==a[2] : V+=1 if code[1]==a[3] : V+=1 if code[2]==a[2] : P+=1 if not code[2]==a[2] and a in code : V+=1 else : if code[2]==a[0] : V+=1 if code[2]==a[1] : V+=1 if code[2]==a[3] : V+=1 if code[3]==a[3] : P+=1 if not code[3]==a[3] and a in code : V+=1 else : if code[3]==a[0] : V+=1 if code[3]==a[1] : V+=1 if code[3]==a[2] : V+=1 if P==4 : print(WINNING_MSG) else : print(" P="+str(P)+","+"V="+str(V)+","+"X="+str((4-P-V))) b = input("Turn #2 : ") P=0 V=0 if code[0]==b[0] : P+=1 if not code[0]==b[0] and b in code : V+=1 else : if code[0]==b[1] : V+=1 if code[0]==b[2] : V+=1 if code[0]==b[3] : V+=1 if code[1]==b[1] : P+=1 if not code[1]==b[1] and b in code : V+=1 else : if code[1]==b[0] : V+=1 if code[1]==b[2] : V+=1 if code[1]==b[3] : V+=1 if code[2]==b[2] : P+=1 if not code[2]==b[2] and b in code : V+=1 else : if code[2]==b[0] : V+=1 if code[2]==b[1] : V+=1 if code[2]==b[3] : V+=1 if code[3]==b[3] : P+=1 if not code[3]==b[3] and b in code : V+=1 else : if code[3]==b[0] : V+=1 if code[3]==b[1] : V+=1 if code[3]==b[2] : V+=1 if P==4 : print(WINNING_MSG) else : print(" P="+str(P)+","+"V="+str(V)+","+"X="+str((4-P-V))) c = input("Turn #3 : ") P=0 V=0 if code[0]==c[0] : P+=1 if not code[0]==c[0] and c in code : V+=1 else : if code[0]==c[1] : V+=1 if code[0]==c[2] : V+=1 if code[0]==c[3] : V+=1 if code[1]==c[1] : P+=1 if not code[1]==c[1] and c in code : V+=1 else : if code[1]==c[0] : V+=1 if code[1]==c[2] : V+=1 if code[1]==c[3] : V+=1 if code[2]==c[2] : P+=1 if not code[2]==c[2] and c in code : V+=1 else : if code[2]==c[0] : V+=1 if code[2]==c[1] : V+=1 if code[2]==c[3] : V+=1 if code[3]==c[3] : P+=1 if not code[3]==c[3] and c in code : V+=1 else : if code[3]==c[0] : V+=1 if code[3]==c[1] : V+=1 if code[3]==c[2] : V+=1 if P==4 : print(WINNING_MSG) else : print(" P="+str(P)+","+"V="+str(V)+","+"X="+str((4-P-V))) d = input("Turn #4 : ") P=0 V=0 if code[0]==d[0] : P+=1 if not code[0]==d[0] and d in code : V+=1 else : if code[0]==d[1] : V+=1 if code[0]==d[2] : V+=1 if code[0]==d[3] : V+=1 if code[1]==d[1] : P+=1 if not code[1]==d[1] and d in code : V+=1 else : if code[1]==d[0] : V+=1 if code[1]==d[2] : V+=1 if code[1]==d[3] : V+=1 if code[2]==d[2] : P+=1 if not code[2]==d[2] and d in code : V+=1 else : if code[2]==d[0] : V+=1 if code[2]==d[1] : V+=1 if code[2]==d[3] : V+=1 if code[3]==d[3] : P+=1 if not code[3]==d[3] and d in code : V+=1 else : if code[3]==d[0] : V+=1 if code[3]==d[1] : V+=1 if code[3]==d[2] : V+=1 if P==4 : print(WINNING_MSG) else : print(" P="+str(P)+","+"V="+str(V)+","+"X="+str((4-P-V))) print(LOSING_MSG) print("The answer is "+str(code)) print("Please try again...") |
# 6330304221 (20.00) 157 (2021-02-12 16:01) p, v, x, count, status = 0, 0, 0, 1, LOSING_MSG guess = '' if guess != code: print("Turn #{} : ".format(count), end='') guess = input() if guess[0] in code: v += 1 if guess[1] in code: v += 1 if guess[2] in code: v += 1 if guess[3] in code: v += 1 if guess[0] == code[0]: p += 1 if guess[1] == code[1]: p += 1 if guess[2] == code[2]: p += 1 if guess[3] == code[3]: p += 1 v = v - p x = 4 - p - v if p != 4: print(" " * 10 + "P={},V={},X={}".format(p, v, x)) count += 1 else: status = WINNING_MSG p, v, x = 0, 0, 0 if guess != code: print("Turn #{} : ".format(count), end='') guess = input() if guess[0] in code: v += 1 if guess[1] in code: v += 1 if guess[2] in code: v += 1 if guess[3] in code: v += 1 if guess[0] == code[0]: p += 1 if guess[1] == code[1]: p += 1 if guess[2] == code[2]: p += 1 if guess[3] == code[3]: p += 1 v = v - p x = 4 - p - v if p != 4: print(" " * 10 + "P={},V={},X={}".format(p, v, x)) count += 1 else: status = WINNING_MSG p, v, x = 0, 0, 0 if guess != code: print("Turn #{} : ".format(count), end='') guess = input() if guess[0] in code: v += 1 if guess[1] in code: v += 1 if guess[2] in code: v += 1 if guess[3] in code: v += 1 if guess[0] == code[0]: p += 1 if guess[1] == code[1]: p += 1 if guess[2] == code[2]: p += 1 if guess[3] == code[3]: p += 1 v = v - p x = 4 - p - v if p != 4: print(" " * 10 + "P={},V={},X={}".format(p, v, x)) count += 1 else: status = WINNING_MSG p, v, x = 0, 0, 0 if guess != code: print("Turn #{} : ".format(count), end='') guess = input() if guess[0] in code: v += 1 if guess[1] in code: v += 1 if guess[2] in code: v += 1 if guess[3] in code: v += 1 if guess[0] == code[0]: p += 1 if guess[1] == code[1]: p += 1 if guess[2] == code[2]: p += 1 if guess[3] == code[3]: p += 1 v = v - p x = 4 - p - v if p != 4: print(" " * 10 + "P={},V={},X={}".format(p, v, x)) if guess == code: status = WINNING_MSG if status == WINNING_MSG: print(WINNING_MSG) else: print(LOSING_MSG) print("The answer is {}".format(code)) print("Please try again...") |
# 6330305921 (20.00) 158 (2021-02-12 15:32) lol = input('Turn #1 : ') P = 0 V = 0 X = 0 win = 0 if code[0] == lol[0]: P += 1 if code[1] == lol[1]: P += 1 if code[2] == lol[2]: P += 1 if code[3] == lol[3]: P += 1 if lol[0] in code : V += 1 if lol[1] in code : V += 1 if lol[2] in code : V += 1 if lol[3] in code : V += 1 V = V - P X = 4 - V - P if P == 4 : print(WINNING_MSG) win += 1 else: print(' '*10 + 'P='+ str(P) + ',V='+str(V)+',X='+str(X)) if win == 0 : lol = input('Turn #2 : ') P = 0 V = 0 X = 0 if code[0] == lol[0]: P += 1 if code[1] == lol[1]: P += 1 if code[2] == lol[2]: P += 1 if code[3] == lol[3]: P += 1 if lol[0] in code : V += 1 if lol[1] in code : V += 1 if lol[2] in code : V += 1 if lol[3] in code : V += 1 V = V - P X = 4 - V - P if P == 4 : print(WINNING_MSG) win += 1 else: print(' '*10 + 'P='+ str(P) + ',V='+str(V)+',X='+str(X)) if win == 0 : lol = input('Turn #3 : ') P = 0 V = 0 X = 0 if code[0] == lol[0]: P += 1 if code[1] == lol[1]: P += 1 if code[2] == lol[2]: P += 1 if code[3] == lol[3]: P += 1 if lol[0] in code : V += 1 if lol[1] in code : V += 1 if lol[2] in code : V += 1 if lol[3] in code : V += 1 V = V - P X = 4 - V - P if P == 4 : print(WINNING_MSG) win += 1 else: print(' '*10 + 'P='+ str(P) + ',V='+str(V)+',X='+str(X)) if win == 0 : lol = input('Turn #4 : ') P = 0 V = 0 X = 0 if code[0] == lol[0]: P += 1 if code[1] == lol[1]: P += 1 if code[2] == lol[2]: P += 1 if code[3] == lol[3]: P += 1 if lol[0] in code : V += 1 if lol[1] in code : V += 1 if lol[2] in code : V += 1 if lol[3] in code : V += 1 V = V - P X = 4 - V - P if P == 4 : print(WINNING_MSG) else: print(' '*10 + 'P='+ str(P) + ',V='+str(V)+',X='+str(X)) print(LOSING_MSG) print('The answer is '+code) print('Please try again...') |
# 6330306521 (20.00) 159 (2021-02-15 22:02) a=input("Turn #1 : ") p=0 v=0 x=0 r=0 if r==0 : if a[0] in code : if a.index(a[0])==code.index(a[0]) : p+=1 else : v+=1 else : x+=1 if a[1] in code : if a.index(a[1])==code.index(a[1]) : p+=1 else : v+=1 else : x+=1 if a[2] in code : if a.index(a[2])==code.index(a[2]) : p+=1 else : v+=1 else : x+=1 if a[3] in code : if a.index(a[3])==code.index(a[3]) : p+=1 else : v+=1 else : x+=1 if p!=4 : print(" "*10+"P="+str(p)+","+"V="+str(v)+","+"X="+str(x)) else : print("Congratulations! You won the game.") r=1 #------------------------------------------------------ if r==0 : a=input("Turn #2 : ") p=0 v=0 x=0 if a[0] in code : if a.index(a[0])==code.index(a[0]) : p+=1 else : v+=1 else : x+=1 if a[1] in code : if a.index(a[1])==code.index(a[1]) : p+=1 else : v+=1 else : x+=1 if a[2] in code : if a.index(a[2])==code.index(a[2]) : p+=1 else : v+=1 else : x+=1 if a[3] in code : if a.index(a[3])==code.index(a[3]) : p+=1 else : v+=1 else : x+=1 if p!=4 : print(" "*10+"P="+str(p)+","+"V="+str(v)+","+"X="+str(x)) else : print("Congratulations! You won the game.") r=1 #------------------------------------------------------ if r==0 : a=input("Turn #3 : ") p=0 v=0 x=0 if a[0] in code : if a.index(a[0])==code.index(a[0]) : p+=1 else : v+=1 else : x+=1 if a[1] in code : if a.index(a[1])==code.index(a[1]) : p+=1 else : v+=1 else : x+=1 if a[2] in code : if a.index(a[2])==code.index(a[2]) : p+=1 else : v+=1 else : x+=1 if a[3] in code : if a.index(a[3])==code.index(a[3]) : p+=1 else : v+=1 else : x+=1 if p!=4 : print(" "*10+"P="+str(p)+","+"V="+str(v)+","+"X="+str(x)) else : print("Congratulations! You won the game.") r=1 #------------------------------------------------------- if r==0 : a=input("Turn #4 : ") p=0 v=0 x=0 if a[0] in code : if a.index(a[0])==code.index(a[0]) : p+=1 else : v+=1 else : x+=1 if a[1] in code : if a.index(a[1])==code.index(a[1]) : p+=1 else : v+=1 else : x+=1 if a[2] in code : if a.index(a[2])==code.index(a[2]) : p+=1 else : v+=1 else : x+=1 if a[3] in code : if a.index(a[3])==code.index(a[3]) : p+=1 else : v+=1 else : x+=1 if p!=4 : print(" "*10+"P="+str(p)+","+"V="+str(v)+","+"X="+str(x)) print("Sorry! You just lost it.") print("The answer is "+code) print("Please try again"+"...") else : print("Congratulations! You won the game.") |
# 6330307121 (19.11) 160 (2021-02-15 23:42) n=7 p=0 k=1 while n>3 or f'{p}'=='4': if f'{p}'=='4': print('Congratulations! You won the game.') break p=0 x=0 v=0 n-=1 a=input(f'Turn #{k} : ' ) k+=1 for i in range(0,len(code)): if code[i]==a[i]: p+=1 elif code[i]==a[0] or code[i]==a[1] or code[i]==a[2] or code[i]==a[3]: v+=1 elif code[i]!=a[0] or code[i]!=a[1] or code[i]!=a[2] or code[i]!=a[3]: x+=1 print(' 'f'P={p},V={v},X={x}') else: print('Sorry! You just lost it.') print('The answer is'' 'f'{code}') print('Please try again...') |
# 6330308821 (20.00) 161 (2021-02-13 16:00) R = input("Turn #1 : ") p = 0 v = 0 x = 0 if R[0] not in code: x += 1 elif R[0] in code and R[0] != code[0]: v += 1 elif R[0] == code[0]: p += 1 if R[1] not in code: x += 1 elif R[1] in code and R[1] != code[1]: v += 1 elif R[1] == code[1]: p += 1 if R[2] not in code: x += 1 elif R[2] in code and R[2] != code[2]: v += 1 elif R[2] == code[2]: p += 1 if R[3] not in code: x += 1 elif R[3] in code and R[3] != code[3]: v += 1 elif R[3] == code[3]: p += 1 if p == 4: print(WINNING_MSG) else: print(f"P={p},V={v},X={x}".rjust(21)) R = input("Turn #2 : ") p = 0 v = 0 x = 0 if R[0] not in code: x += 1 elif R[0] in code and R[0] != code[0]: v += 1 elif R[0] == code[0]: p += 1 if R[1] not in code: x += 1 elif R[1] in code and R[1] != code[1]: v += 1 elif R[1] == code[1]: p += 1 if R[2] not in code: x += 1 elif R[2] in code and R[2] != code[2]: v += 1 elif R[2] == code[2]: p += 1 if R[3] not in code: x += 1 elif R[3] in code and R[3] != code[3]: v += 1 elif R[3] == code[3]: p += 1 if p == 4: print(WINNING_MSG) else: print(f"P={p},V={v},X={x}".rjust(21)) R = input("Turn #3 : ") p = 0 v = 0 x = 0 if R[0] not in code: x += 1 elif R[0] in code and R[0] != code[0]: v += 1 elif R[0] == code[0]: p += 1 if R[1] not in code: x += 1 elif R[1] in code and R[1] != code[1]: v += 1 elif R[1] == code[1]: p += 1 if R[2] not in code: x += 1 elif R[2] in code and R[2] != code[2]: v += 1 elif R[2] == code[2]: p += 1 if R[3] not in code: x += 1 elif R[3] in code and R[3] != code[3]: v += 1 elif R[3] == code[3]: p += 1 if p == 4: print(WINNING_MSG) else: print(f"P={p},V={v},X={x}".rjust(21)) R = input("Turn #4 : ") p = 0 v = 0 x = 0 if R[0] not in code: x += 1 elif R[0] in code and R[0] != code[0]: v += 1 elif R[0] == code[0]: p += 1 if R[1] not in code: x += 1 elif R[1] in code and R[1] != code[1]: v += 1 elif R[1] == code[1]: p += 1 if R[2] not in code: x += 1 elif R[2] in code and R[2] != code[2]: v += 1 elif R[2] == code[2]: p += 1 if R[3] not in code: x += 1 elif R[3] in code and R[3] != code[3]: v += 1 elif R[3] == code[3]: p += 1 if p == 4: print(WINNING_MSG) else: print(f"P={p},V={v},X={x}".rjust(21)) print(LOSING_MSG) print(f"The answer is {code}") print("Please try again...") |
# 6330309421 (20.00) 162 (2021-02-15 13:59) rnd = 1 p, v, x = 0, 0, 0 g = input("Turn #" + str(rnd) + " : ") if code.find(g[0]) == 0: p = p + 1 elif code.find(g[0]) == -1: x = x + 1 if code.find(g[1]) == 1: p = p + 1 elif code.find(g[1]) == -1: x = x + 1 if code.find(g[2]) == 2: p = p + 1 elif code.find(g[2]) == -1: x = x + 1 if code.find(g[3]) == 3: p = p + 1 elif code.find(g[3]) == -1: x = x + 1 v = 4 - (p + x) if p == 4: print("Congratulations! You won the game.") exit(0) else: print(" P=" + str(p) + ",V=" + str(v) + ",X=" + str(x)) rnd = rnd + 1 p, v, x = 0, 0, 0 g = input("Turn #" + str(rnd) + " : ") if code.find(g[0]) == 0: p = p + 1 elif code.find(g[0]) == -1: x = x + 1 if code.find(g[1]) == 1: p = p + 1 elif code.find(g[1]) == -1: x = x + 1 if code.find(g[2]) == 2: p = p + 1 elif code.find(g[2]) == -1: x = x + 1 if code.find(g[3]) == 3: p = p + 1 elif code.find(g[3]) == -1: x = x + 1 v = 4 - (p + x) if p == 4: print("Congratulations! You won the game.") exit(0) else: print(" P=" + str(p) + ",V=" + str(v) + ",X=" + str(x)) rnd = rnd + 1 p, v, x = 0, 0, 0 g = input("Turn #" + str(rnd) + " : ") if code.find(g[0]) == 0: p = p + 1 elif code.find(g[0]) == -1: x = x + 1 if code.find(g[1]) == 1: p = p + 1 elif code.find(g[1]) == -1: x = x + 1 if code.find(g[2]) == 2: p = p + 1 elif code.find(g[2]) == -1: x = x + 1 if code.find(g[3]) == 3: p = p + 1 elif code.find(g[3]) == -1: x = x + 1 v = 4 - (p + x) if p == 4: print("Congratulations! You won the game.") exit(0) else: print(" P=" + str(p) + ",V=" + str(v) + ",X=" + str(x)) rnd = rnd + 1 p, v, x = 0, 0, 0 g = input("Turn #" + str(rnd) + " : ") if code.find(g[0]) == 0: p = p + 1 elif code.find(g[0]) == -1: x = x + 1 if code.find(g[1]) == 1: p = p + 1 elif code.find(g[1]) == -1: x = x + 1 if code.find(g[2]) == 2: p = p + 1 elif code.find(g[2]) == -1: x = x + 1 if code.find(g[3]) == 3: p = p + 1 elif code.find(g[3]) == -1: x = x + 1 v = 4 - (p + x) if p == 4: print("Congratulations! You won the game.") exit(0) else: print(" P=" + str(p) + ",V=" + str(v) + ",X=" + str(x)) print("Sorry! You just lost it.") print("The answer is " + code) print("Please try again...") |
# 6330310021 (20.00) 163 (2021-02-15 11:30) win = False P = 0 V = 0 X = 0 a = input("Turn #1 : ") if P != 4: if a[0] == code[0]: P += 1 if a[1] == code[1]: P += 1 if a[2] == code[2]: P += 1 if a[3] == code[3]: P += 1 if a[0] in code: V +=1 if a[1] in code: V +=1 if a[2] in code: V +=1 if a[3] in code: V +=1 V = V - P X = 4 - V - P if P!= 4: print(" "*len("Turn #1 : ") + "P=" + str(P) + ",V=" + str(V) + ",X=" + str(X)) if P!= 4: P = 0 V = 0 X = 0 a = input("Turn #2 : ") if a[0] == code[0]: P += 1 if a[1] == code[1]: P += 1 if a[2] == code[2]: P += 1 if a[3] == code[3]: P += 1 if a[0] in code: V += 1 if a[1] in code: V += 1 if a[2] in code: V += 1 if a[3] in code: V += 1 V = V - P X = 4 - V - P if P != 4: print(" " * len("Turn #2 : ") + "P=" + str(P) + ",V=" + str(V) + ",X=" + str(X)) if P!= 4: P = 0 V = 0 X = 0 a = input("Turn #3 : ") if a[0] == code[0]: P += 1 if a[1] == code[1]: P += 1 if a[2] == code[2]: P += 1 if a[3] == code[3]: P += 1 if a[0] in code: V += 1 if a[1] in code: V += 1 if a[2] in code: V += 1 if a[3] in code: V += 1 V = V - P X = 4 - V - P if P != 4: print(" " * len("Turn #3 : ") + "P=" + str(P) + ",V=" + str(V) + ",X=" + str(X)) if P!= 4: P = 0 V = 0 X = 0 a = input("Turn #4 : ") if a[0] == code[0]: P += 1 if a[1] == code[1]: P += 1 if a[2] == code[2]: P += 1 if a[3] == code[3]: P += 1 if a[0] in code: V += 1 if a[1] in code: V += 1 if a[2] in code: V += 1 if a[3] in code: V += 1 V = V - P X = 4 - V - P if P != 4: print(" " * len("Turn #4 : ") + "P=" + str(P) + ",V=" + str(V) + ",X=" + str(X)) if P == 4: win = True if win == True: print(WINNING_MSG) elif win == False: print(LOSING_MSG) print("The answer is", code) print("Please try again...") |
# 6330311621 (20.00) 164 (2021-02-11 19:11) T = 1 x1 = input("Turn #1 : ") note1 = len("Turn #1 : ") if x1 == code: print(WINNING_MSG) else: P = 0 if x1[0] == code[0]: P += 1 if x1[1] == code[1]: P += 1 if x1[2] == code[2]: P += 1 if x1[3] == code[3]: P += 1 V = 0 if x1[0] in code and x1[0] != code[0]: V += 1 if x1[1] in code and x1[1] != code[1]: V += 1 if x1[2] in code and x1[2] != code[2]: V += 1 if x1[3] in code and x1[3] != code[3]: V += 1 X = 0 if not(x1[0] in code): X += 1 if not(x1[1] in code): X += 1 if not(x1[2] in code): X += 1 if not(x1[3] in code): X += 1 T += 1 print(" "*note1+"P="+str(P)+",V="+str(V)+",X="+str(X)) if T == 2: x2 = input("Turn #2 : ") note2 = len("Turn #2 : ") if x2 == code: print(WINNING_MSG) else: P = 0 if x2[0] == code[0]: P += 1 if x2[1] == code[1]: P += 1 if x2[2] == code[2]: P += 1 if x2[3] == code[3]: P += 1 V = 0 if x2[0] in code and x2[0] != code[0]: V += 1 if x2[1] in code and x2[1] != code[1]: V += 1 if x2[2] in code and x2[2] != code[2]: V += 1 if x2[3] in code and x2[3] != code[3]: V += 1 X = 0 if not(x2[0] in code): X += 1 if not(x2[1] in code): X += 1 if not(x2[2] in code): X += 1 if not(x2[3] in code): X += 1 T += 1 print(" "*note2+"P="+str(P)+",V="+str(V)+",X="+str(X)) if T == 3: x3 = input("Turn #3 : ") note3 = len("Turn #3 : ") if x3 == code: print(WINNING_MSG) else: P = 0 if x3[0] == code[0]: P += 1 if x3[1] == code[1]: P += 1 if x3[2] == code[2]: P += 1 if x3[3] == code[3]: P += 1 V = 0 if x3[0] in code and x3[0] != code[0]: V += 1 if x3[1] in code and x3[1] != code[1]: V += 1 if x3[2] in code and x3[2] != code[2]: V += 1 if x3[3] in code and x3[3] != code[3]: V += 1 X = 0 if not(x3[0] in code): X += 1 if not(x3[1] in code): X += 1 if not(x3[2] in code): X += 1 if not(x3[3] in code): X += 1 T += 1 print(" "*note3+"P="+str(P)+",V="+str(V)+",X="+str(X)) if T == 4: x4 = input("Turn #4 : ") note4 = len("Turn #4 : ") if x4 == code: print(WINNING_MSG) else: P = 0 if x4[0] == code[0]: P += 1 if x4[1] == code[1]: P += 1 if x4[2] == code[2]: P += 1 if x4[3] == code[3]: P += 1 V = 0 if x4[0] in code and x4[0] != code[0]: V += 1 if x4[1] in code and x4[1] != code[1]: V += 1 if x4[2] in code and x4[2] != code[2]: V += 1 if x4[3] in code and x4[3] != code[3]: V += 1 X = 0 if not(x4[0] in code): X += 1 if not(x4[1] in code): X += 1 if not(x4[2] in code): X += 1 if not(x4[3] in code): X += 1 print(" "*note4+"P="+str(P)+",V="+str(V)+",X="+str(X)) print(LOSING_MSG) print("The answer is ",code) print("Please try again...") |
# 6330312221 (20.00) 165 (2021-02-11 16:15) ans1 = input("Turn #1 : ") if ans1 == code: print(WINNING_MSG) else: v1 = 0 if ans1[0] in code: v1 = v1+1 if ans1[1] in code: v1 = v1+1 if ans1[2] in code: v1 = v1+1 if ans1[3] in code: v1 = v1+1 p1 = 0 if ans1[0] == code[0]: p1 = p1+1 if ans1[1] == code[1]: p1 = p1+1 if ans1[2] == code[2]: p1 = p1+1 if ans1[3] == code[3]: p1 = p1+1 v1 = (v1-p1) x1 = 4-(v1+p1) v1 = str(v1) x1 = str(x1) p1 = str(p1) print(" "+"P="+p1+","+"V="+v1+","+"X="+x1) ans2 = input("Turn #2 : ") if ans2 == code: print(WINNING_MSG) else: v2 = 0 if ans2[0] in code: v2 = v2+1 if ans2[1] in code: v2 = v2+1 if ans2[2] in code: v2 = v2+1 if ans2[3] in code: v2 = v2+1 p2 = 0 if ans2[0] == code[0]: p2 = p2+1 if ans2[1] == code[1]: p2 = p2+1 if ans2[2] == code[2]: p2 = p2+1 if ans2[3] == code[3]: p2 = p2+1 v2 = (v2-p2) x2 = (4-(v2+p2)) v2 = str(v2) x2 = str(x2) p2 = str(p2) print(" "+"P="+p2+","+"V="+v2+","+"X="+x2) ans3 = input("Turn #3 : ") if ans3 == code: print(WINNING_MSG) else: v3 = 0 if ans3[0] in code: v3 = v3+1 if ans3[1] in code: v3 = v3+1 if ans3[2] in code: v3 = v3+1 if ans3[3] in code: v3 = v3+1 p3 = 0 if ans3[0] == code[0]: p3 = p3+1 if ans3[1] == code[1]: p3 = p3+1 if ans3[2] == code[2]: p3 = p3+1 if ans3[3] == code[3]: p3 = p3+1 v3 = (v3-p3) x3 = (4-(v3+p3)) v3 = str(v3) x3 = str(x3) p3 = str(p3) print(" "+"P="+p3+","+"V="+v3+","+"X="+x3) ans4 = input("Turn #4 : ") if ans4 == code: print(WINNING_MSG) else: v4 = 0 if ans4[0] in code: v4 = v4+1 if ans4[1] in code: v4 = v4+1 if ans4[2] in code: v4 = v4+1 if ans4[3] in code: v4 = v4+1 p4 = 0 if ans4[0] == code[0]: p4 = p4+1 if ans4[1] == code[1]: p4 = p4+1 if ans4[2] == code[2]: p4 = p4+1 if ans4[3] == code[3]: p4 = p4+1 v4 = (v4-p4) x4 = (4-(v4+p4)) v4 = str(v4) x4 = str(x4) p4 = str(p4) print(" "+"P="+p4+","+"V="+v4+","+"X="+x4) print(LOSING_MSG) print("The answer is ", code) print("Please try again...") |
# 6330313921 (20.00) 166 (2021-02-14 00:46) P, V, X =0, 0, 0 turn = 1 gcode = input('Turn #' + str(turn) + ' : ' ) #1 if code.find(gcode[0]) == 0 : P += 1 elif code.find(gcode[0]) == 1 : V += 1 elif code.find(gcode[0]) == 2 : V += 1 elif code.find(gcode[0]) == 3 : V += 1 if code.find(gcode[1]) == 1 : P += 1 elif code.find(gcode[1]) == 0 : V += 1 elif code.find(gcode[1]) == 2 : V += 1 elif code.find(gcode[1]) == 3 : V += 1 if code.find(gcode[2]) == 2 : P += 1 elif code.find(gcode[2]) == 0 : V += 1 elif code.find(gcode[2]) == 1 : V += 1 elif code.find(gcode[2]) == 3 : V += 1 if code.find(gcode[3]) == 3 : P += 1 elif code.find(gcode[3]) == 0 : V += 1 elif code.find(gcode[3]) == 1 : V += 1 elif code.find(gcode[3]) == 2 : V += 1 X = 4 - P - V if P == 4 : print(WINNING_MSG) exit(0) else : print(' P=' + str(P)+ ',V=' + str(V) + ',X=' + str(X) ) #2 P, V, X =0, 0, 0 turn += 1 gcode = input('Turn #' + str(turn) + ' : ' ) if code.find(gcode[0]) == 0 : P += 1 elif code.find(gcode[0]) == 1 : V += 1 elif code.find(gcode[0]) == 2 : V += 1 elif code.find(gcode[0]) == 3 : V += 1 if code.find(gcode[1]) == 1 : P += 1 elif code.find(gcode[1]) == 0 : V += 1 elif code.find(gcode[1]) == 2 : V += 1 elif code.find(gcode[1]) == 3 : V += 1 if code.find(gcode[2]) == 2 : P += 1 elif code.find(gcode[2]) == 0 : V += 1 elif code.find(gcode[2]) == 1 : V += 1 elif code.find(gcode[2]) == 3 : V += 1 if code.find(gcode[3]) == 3 : P += 1 elif code.find(gcode[3]) == 0 : V += 1 elif code.find(gcode[3]) == 1 : V += 1 elif code.find(gcode[3]) == 2 : V += 1 X = 4 - P - V if P == 4 : print(WINNING_MSG) exit(0) else : print(' P=' + str(P)+ ',V=' + str(V) + ',X=' + str(X) ) #3 P, V, X =0, 0, 0 turn += 1 gcode = input('Turn #' + str(turn) + ' : ' ) if code.find(gcode[0]) == 0 : P += 1 elif code.find(gcode[0]) == 1 : V += 1 elif code.find(gcode[0]) == 2 : V += 1 elif code.find(gcode[0]) == 3 : V += 1 if code.find(gcode[1]) == 1 : P += 1 elif code.find(gcode[1]) == 0 : V += 1 elif code.find(gcode[1]) == 2 : V += 1 elif code.find(gcode[1]) == 3 : V += 1 if code.find(gcode[2]) == 2 : P += 1 elif code.find(gcode[2]) == 0 : V += 1 elif code.find(gcode[2]) == 1 : V += 1 elif code.find(gcode[2]) == 3 : V += 1 if code.find(gcode[3]) == 3 : P += 1 elif code.find(gcode[3]) == 0 : V += 1 elif code.find(gcode[3]) == 1 : V += 1 elif code.find(gcode[3]) == 2 : V += 1 X = 4 - P - V if P == 4 : print(WINNING_MSG) exit(0) else : print(' P=' + str(P)+ ',V=' + str(V) + ',X=' + str(X) ) #4 P, V, X =0, 0, 0 turn += 1 gcode = input('Turn #' + str(turn) + ' : ' ) if code.find(gcode[0]) == 0 : P += 1 elif code.find(gcode[0]) == 1 : V += 1 elif code.find(gcode[0]) == 2 : V += 1 elif code.find(gcode[0]) == 3 : V += 1 if code.find(gcode[1]) == 1 : P += 1 elif code.find(gcode[1]) == 0 : V += 1 elif code.find(gcode[1]) == 2 : V += 1 elif code.find(gcode[1]) == 3 : V += 1 if code.find(gcode[2]) == 2 : P += 1 elif code.find(gcode[2]) == 0 : V += 1 elif code.find(gcode[2]) == 1 : V += 1 elif code.find(gcode[2]) == 3 : V += 1 if code.find(gcode[3]) == 3 : P += 1 elif code.find(gcode[3]) == 0 : V += 1 elif code.find(gcode[3]) == 1 : V += 1 elif code.find(gcode[3]) == 2 : V += 1 X = 4 - P - V if P == 4 : print(WINNING_MSG) exit(0) else : print(' P=' + str(P)+ ',V=' + str(V) + ',X=' + str(X) ) print(LOSING_MSG) print('The answer is ' + code) print("Please try again...") |
# 6330314521 (20.00) 167 (2021-02-13 22:40) P = 0 V = 0 X = 0 #---------------------------------first round------------------------- t1 = input('Turn #1 : ') #V section #check the first row if t1[0] == code[1] : V += 1 elif t1[0] == code[2] : V += 1 elif t1[0] == code[3] : V += 1 #check the second row if t1[1] == code[0] : V += 1 elif t1[1] == code[2] : V += 1 elif t1[1] == code[3] : V += 1 #check the third row if t1[2] == code[0] : V += 1 elif t1[2] == code[1] : V += 1 elif t1[2] == code[3] : V += 1 #check the last row if t1[3] == code[0] : V += 1 elif t1[3] == code[1] : V += 1 elif t1[3] == code[2] : V += 1 #P section if t1[0] == code[0] : P += 1 if t1[1] == code[1] : P += 1 if t1[2] == code[2] : P += 1 if t1[3] == code[3] : P += 1 #X section if t1[0] != code[0] : if t1[0] != code[1] : if t1[0] != code[2] : if t1[0] != code[3] : X += 1 if t1[1] != code[0] : if t1[1] != code[1] : if t1[1] != code[2] : if t1[1] != code[3] : X += 1 if t1[2] != code[0] : if t1[2] != code[1] : if t1[2] != code[2] : if t1[2] != code[3] : X += 1 if t1[3] != code[0] : if t1[3] != code[1] : if t1[3] != code[2] : if t1[3] != code[3] : X += 1 #DISPLAY SECTION 1 if P == 4 : print('Congratulations! You won the game.') else : #clue display print(' P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) #print('P='+str(P)) #print('X='+str(X)) #----------------------------------second round-------------------------- if P < 4 : t1 = input('Turn #2 : ') X = 0 P = 0 V = 0 #V section #check the first row if t1[0] == code[1] : V += 1 elif t1[0] == code[2] : V += 1 elif t1[0] == code[3] : V += 1 #check the second row if t1[1] == code[0] : V += 1 elif t1[1] == code[2] : V += 1 elif t1[1] == code[3] : V += 1 #check the third row if t1[2] == code[0] : V += 1 elif t1[2] == code[1] : V += 1 elif t1[2] == code[3] : V += 1 #check the last row if t1[3] == code[0] : V += 1 elif t1[3] == code[1] : V += 1 elif t1[3] == code[2] : V += 1 #P section if t1[0] == code[0] : P += 1 if t1[1] == code[1] : P += 1 if t1[2] == code[2] : P += 1 if t1[3] == code[3] : P += 1 #X section if t1[0] != code[0] : if t1[0] != code[1] : if t1[0] != code[2] : if t1[0] != code[3] : X += 1 if t1[1] != code[0] : if t1[1] != code[1] : if t1[1] != code[2] : if t1[1] != code[3] : X += 1 if t1[2] != code[0] : if t1[2] != code[1] : if t1[2] != code[2] : if t1[2] != code[3] : X += 1 if t1[3] != code[0] : if t1[3] != code[1] : if t1[3] != code[2] : if t1[3] != code[3] : X += 1 #DISPLAY SECTION 2 if P == 4 : print('Congratulations! You won the game.') else : #clue display print(' P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) #print('P='+str(P)) #print('X='+str(X)) #-------------------------------------third round------------------------- if P < 4 : t1 = input('Turn #3 : ') X = 0 P = 0 V = 0 #V section #check the first row if t1[0] == code[1] : V += 1 elif t1[0] == code[2] : V += 1 elif t1[0] == code[3] : V += 1 #check the second row if t1[1] == code[0] : V += 1 elif t1[1] == code[2] : V += 1 elif t1[1] == code[3] : V += 1 #check the third row if t1[2] == code[0] : V += 1 elif t1[2] == code[1] : V += 1 elif t1[2] == code[3] : V += 1 #check the last row if t1[3] == code[0] : V += 1 elif t1[3] == code[1] : V += 1 elif t1[3] == code[2] : V += 1 #P section if t1[0] == code[0] : P += 1 if t1[1] == code[1] : P += 1 if t1[2] == code[2] : P += 1 if t1[3] == code[3] : P += 1 #X section if t1[0] != code[0] : if t1[0] != code[1] : if t1[0] != code[2] : if t1[0] != code[3] : X += 1 if t1[1] != code[0] : if t1[1] != code[1] : if t1[1] != code[2] : if t1[1] != code[3] : X += 1 if t1[2] != code[0] : if t1[2] != code[1] : if t1[2] != code[2] : if t1[2] != code[3] : X += 1 if t1[3] != code[0] : if t1[3] != code[1] : if t1[3] != code[2] : if t1[3] != code[3] : X += 1 #DISPLAY SECTION 3 if P == 4 : print('Congratulations! You won the game.') else : #clue display print(' P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) #print('P='+str(P)) #print('X='+str(X)) #-------------------------------------final round------------------------------ if P < 4 : t1 = input('Turn #4 : ') X = 0 P = 0 V = 0 #V section #check the first row if t1[0] == code[1] : V += 1 elif t1[0] == code[2] : V += 1 elif t1[0] == code[3] : V += 1 #check the second row if t1[1] == code[0] : V += 1 elif t1[1] == code[2] : V += 1 elif t1[1] == code[3] : V += 1 #check the third row if t1[2] == code[0] : V += 1 elif t1[2] == code[1] : V += 1 elif t1[2] == code[3] : V += 1 #check the last row if t1[3] == code[0] : V += 1 elif t1[3] == code[1] : V += 1 elif t1[3] == code[2] : V += 1 #P section if t1[0] == code[0] : P += 1 if t1[1] == code[1] : P += 1 if t1[2] == code[2] : P += 1 if t1[3] == code[3] : P += 1 #X section if t1[0] != code[0] : if t1[0] != code[1] : if t1[0] != code[2] : if t1[0] != code[3] : X += 1 if t1[1] != code[0] : if t1[1] != code[1] : if t1[1] != code[2] : if t1[1] != code[3] : X += 1 if t1[2] != code[0] : if t1[2] != code[1] : if t1[2] != code[2] : if t1[2] != code[3] : X += 1 if t1[3] != code[0] : if t1[3] != code[1] : if t1[3] != code[2] : if t1[3] != code[3] : X += 1 #DISPLAY SECTION 4 if P == 4 : print('Congratulations! You won the game.') else : #clue display print(' P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) #print('P='+str(P)) #print('X='+str(X)) print('Sorry! You just lost it.') print('The answer is '+ code) print('Please try again...') |
# 6330315121 (20.00) 168 (2021-02-15 11:22) mycode = input('Turn #1 : ') if mycode[0] == code[0]: p1 = 1 else: p1 = 0 if mycode[1] == code[1]: p2 = 1 else: p2 = 0 if mycode[2] == code[2]: p3 = 1 else: p3 = 0 if mycode[3] == code[3]: p4 = 1 else: p4 = 0 if mycode[0] == code[0] or mycode[1] == code[1] or mycode[2] == code[2] or mycode[3] == code[3]: Sum_P = str(p1+p2+p3+p4) else: Sum_P = str(p1+p2+p3+p4) if mycode[0] in list(code) and mycode[0]!=code[0]: v1 = 1 else: v1 = 0 if mycode[1] in list(code) and mycode[1]!=code[1]: v2 = 1 else: v2 = 0 if mycode[2] in list(code) and mycode[2]!=code[2]: v3 = 1 else: v3 = 0 if mycode[3] in list(code) and mycode[3]!=code[3]: v4 = 1 else: v4 = 0 Sum_V = str(v1+v2+v3+v4) if mycode[0] in list(code): x1 = 0 else: x1 = 1 if mycode[1] in list(code): x2 = 0 else: x2 = 1 if mycode[2] in list(code): x3 = 0 else: x3 = 1 if mycode[3] in list(code): x4 = 0 else: x4 = 1 Sum_X = str(x1+x2+x3+x4) if mycode == code: print(WINNING_MSG) else: print(' '+'P='+Sum_P+',V='+Sum_V+',X='+Sum_X) mycode = input('Turn #2 : ') if mycode[0] == code[0]: p1 = 1 else: p1 = 0 if mycode[1] == code[1]: p2 = 1 else: p2 = 0 if mycode[2] == code[2]: p3 = 1 else: p3 = 0 if mycode[3] == code[3]: p4 = 1 else: p4 = 0 if mycode[0] == code[0] or mycode[1] == code[1] or mycode[2] == code[2] or mycode[3] == code[3]: Sum_P = str(p1+p2+p3+p4) else: Sum_P = str(p1+p2+p3+p4) if mycode[0] in list(code) and mycode[0]!=code[0]: v1 = 1 else: v1 = 0 if mycode[1] in list(code) and mycode[1]!=code[1]: v2 = 1 else: v2 = 0 if mycode[2] in list(code) and mycode[2]!=code[2]: v3 = 1 else: v3 = 0 if mycode[3] in list(code) and mycode[3]!=code[3]: v4 = 1 else: v4 = 0 Sum_V = str(v1+v2+v3+v4) if mycode[0] in list(code): x1 = 0 else: x1 = 1 if mycode[1] in list(code): x2 = 0 else: x2 = 1 if mycode[2] in list(code): x3 = 0 else: x3 = 1 if mycode[3] in list(code): x4 = 0 else: x4 = 1 Sum_X = str(x1+x2+x3+x4) if mycode == code: print(WINNING_MSG) else: print(' '+'P='+Sum_P+',V='+Sum_V+',X='+Sum_X) mycode = input('Turn #3 : ') if mycode[0] == code[0]: p1 = 1 else: p1 = 0 if mycode[1] == code[1]: p2 = 1 else: p2 = 0 if mycode[2] == code[2]: p3 = 1 else: p3 = 0 if mycode[3] == code[3]: p4 = 1 else: p4 = 0 if mycode[0] == code[0] or mycode[1] == code[1] or mycode[2] == code[2] or mycode[3] == code[3]: Sum_P = str(p1+p2+p3+p4) else: Sum_P = str(p1+p2+p3+p4) if mycode[0] in list(code) and mycode[0]!=code[0]: v1 = 1 else: v1 = 0 if mycode[1] in list(code) and mycode[1]!=code[1]: v2 = 1 else: v2 = 0 if mycode[2] in list(code) and mycode[2]!=code[2]: v3 = 1 else: v3 = 0 if mycode[3] in list(code) and mycode[3]!=code[3]: v4 = 1 else: v4 = 0 Sum_V = str(v1+v2+v3+v4) if mycode[0] in list(code): x1 = 0 else: x1 = 1 if mycode[1] in list(code): x2 = 0 else: x2 = 1 if mycode[2] in list(code): x3 = 0 else: x3 = 1 if mycode[3] in list(code): x4 = 0 else: x4 = 1 Sum_X = str(x1+x2+x3+x4) if mycode == code: print(WINNING_MSG) else: print(' '+'P='+Sum_P+',V='+Sum_V+',X='+Sum_X) mycode = input('Turn #4 : ') if mycode[0] == code[0]: p1 = 1 else: p1 = 0 if mycode[1] == code[1]: p2 = 1 else: p2 = 0 if mycode[2] == code[2]: p3 = 1 else: p3 = 0 if mycode[3] == code[3]: p4 = 1 else: p4 = 0 if mycode[0] == code[0] or mycode[1] == code[1] or mycode[2] == code[2] or mycode[3] == code[3]: Sum_P = str(p1+p2+p3+p4) else: Sum_P = str(p1+p2+p3+p4) if mycode[0] in list(code) and mycode[0]!=code[0]: v1 = 1 else: v1 = 0 if mycode[1] in list(code) and mycode[1]!=code[1]: v2 = 1 else: v2 = 0 if mycode[2] in list(code) and mycode[2]!=code[2]: v3 = 1 else: v3 = 0 if mycode[3] in list(code) and mycode[3]!=code[3]: v4 = 1 else: v4 = 0 Sum_V = str(v1+v2+v3+v4) if mycode[0] in list(code): x1 = 0 else: x1 = 1 if mycode[1] in list(code): x2 = 0 else: x2 = 1 if mycode[2] in list(code): x3 = 0 else: x3 = 1 if mycode[3] in list(code): x4 = 0 else: x4 = 1 Sum_X = str(x1+x2+x3+x4) if mycode == code: print(WINNING_MSG) else: print(' '+'P='+Sum_P+',V='+Sum_V+',X='+Sum_X) print(LOSING_MSG) print('The answer is'+' '+str(code)) print('Please try again...') |
# 6330316821 (20.00) 169 (2021-02-15 11:25) a = input("Turn #1 : ") P = 0 V = 0 X = 0 if "A" in a: if "A" in code and a.index("A") == code.index("A"): P += 1 elif "A" in code: V += 1 else: X += 1 if "B" in a: if "B" in code and a.index("B") == code.index("B"): P += 1 elif "B" in code: V += 1 else: X += 1 if "C" in a: if "C" in code and a.index("C") == code.index("C"): P += 1 elif "C" in code: V += 1 else: X += 1 if "D" in a: if "D" in code and a.index("D") == code.index("D"): P += 1 elif "D" in code: V += 1 else: X += 1 if "E" in a: if "E" in code and a.index("E") == code.index("E"): P += 1 elif "E" in code: V += 1 else: X += 1 if "F" in a: if "F" in code and a.index("F") == code.index("F"): P += 1 elif "F" in code: V += 1 else: X += 1 if P == 4: print(WINNING_MSG) else: print(" " + "P=" + str(P) + ",V=" + str(V) + ",X=" + str(X)) b = input("Turn #2 : ") W = 0 J = 0 K = 0 if "A" in b: if "A" in code and b.index("A") == code.index("A"): W += 1 elif "A" in code: J += 1 else: K += 1 if "B" in b: if "B" in code and b.index("B") == code.index("B"): W += 1 elif "B" in code: J += 1 else: K += 1 if "C" in b: if "C" in code and b.index("C") == code.index("C"): W += 1 elif "C" in code: J += 1 else: K += 1 if "D" in b: if "D" in code and b.index("D") == code.index("D"): W += 1 elif "D" in code: J += 1 else: K += 1 if "E" in b: if "E" in code and b.index("E") == code.index("E"): W += 1 elif "E" in code: J += 1 else: K += 1 if "F" in b: if "F" in code and b.index("F") == code.index("F"): W += 1 elif "F" in code: J += 1 else: K += 1 if W == 4: print(WINNING_MSG) else: print(" " + "P=" + str(W) + ",V=" + str(J) + ",X=" + str(K)) c = input("Turn #3 : ") C1 = 0 C2 = 0 C3 = 0 if "A" in c: if "A" in code and c.index("A") == code.index("A"): C1 += 1 elif "A" in code: C2 += 1 else: C3 += 1 if "B" in c: if "B" in code and c.index("B") == code.index("B"): C1 += 1 elif "B" in code: C2 += 1 else: C3 += 1 if "C" in c: if "C" in code and c.index("C") == code.index("C"): C1 += 1 elif "C" in code: C2 += 1 else: C3 += 1 if "D" in c: if "D" in code and c.index("D") == code.index("D"): C1 += 1 elif "D" in code: C2 += 1 else: C3 += 1 if "E" in c: if "E" in code and c.index("E") == code.index("E"): C1 += 1 elif "E" in code: C2 += 1 else: C3 += 1 if "F" in c: if "F" in code and c.index("F") == code.index("F"): C1 += 1 elif "F" in code: C2 += 1 else: C3 += 1 if C1 == 4: print(WINNING_MSG) else: print(" " + "P=" + str(C1) + ",V=" + str(C2) + ",X=" + str(C3)) d = input("Turn #4 : ") D1 = 0 D2 = 0 D3 = 0 if "A" in d: if "A" in code and d.index("A") == code.index("A"): D1 += 1 elif "A" in code: D2 += 1 else: D3 += 1 if "B" in d: if "B" in code and d.index("B") == code.index("B"): D1 += 1 elif "B" in code: D2 += 1 else: D3 += 1 if "C" in d: if "C" in code and d.index("C") == code.index("C"): D1 += 1 elif "C" in code: D2 += 1 else: D3 += 1 if "D" in d: if "D" in code and d.index("D") == code.index("D"): D1 += 1 elif "D" in code: D2 += 1 else: D3 += 1 if "E" in d: if "E" in code and d.index("E") == code.index("E"): D1 += 1 elif "E" in code: D2 += 1 else: D3 += 1 if "F" in d: if "F" in code and d.index("F") == code.index("F"): D1 += 1 elif "F" in code: D2 += 1 else: D3 += 1 if D1 == 4: print(WINNING_MSG) else: print(" " + "P=" + str(D1) + ",V=" + str(D2) + ",X=" + str(D3)) print(LOSING_MSG) print("The answer is " + code) print("Please try again...") |
# 6330317421 (19.90) 170 (2021-02-13 01:41) i = input('Turn #1 : ') if i == code : print('Congratulation! You won the game.') else : P, V = 0, 0 if i[0] in code : V += 1 if i[1] in code : V += 1 if i[2] in code : V += 1 if i[3] in code : V += 1 if i[0] == code[0] : P += 1 if i[1] == code[1] : P += 1 if i[2] == code[2] : P += 1 if i[3] == code[3] : P += 1 X = 4 - V V = V - P print(' P='+str(P)+',V='+str(V)+',X='+str(X)) i = input('Turn #2 : ') if i == code : print('Congratulation! You won the game.') else : P, V = 0, 0 if i[0] in code : V += 1 if i[1] in code : V += 1 if i[2] in code : V += 1 if i[3] in code : V += 1 if i[0] == code[0] : P += 1 if i[1] == code[1] : P += 1 if i[2] == code[2] : P += 1 if i[3] == code[3] : P += 1 X = 4 - V V = V - P print(' P='+str(P)+',V='+str(V)+',X='+str(X)) i = input('Turn #3 : ') if i == code : print('Congratulation! You won the game.') else : P, V = 0, 0 if i[0] in code : V += 1 if i[1] in code : V += 1 if i[2] in code : V += 1 if i[3] in code : V += 1 if i[0] == code[0] : P += 1 if i[1] == code[1] : P += 1 if i[2] == code[2] : P += 1 if i[3] == code[3] : P += 1 X = 4 - V V = V - P print(' P='+str(P)+',V='+str(V)+',X='+str(X)) i = input('Turn #4 : ') if i == code : print('Congratulation! You won the game.') else : P, V = 0, 0 if i[0] in code : V += 1 if i[1] in code : V += 1 if i[2] in code : V += 1 if i[3] in code : V += 1 if i[0] == code[0] : P += 1 if i[1] == code[1] : P += 1 if i[2] == code[2] : P += 1 if i[3] == code[3] : P += 1 X = 4 - V V = V - P print(' P='+str(P)+',V='+str(V)+',X='+str(X)) print('Sorry! You just lost it.') print('The answer is',code) print('Please try again...') |
# 6330318021 (20.00) 171 (2021-02-14 22:03) c1=code[0] ; c2=code[1] ; c3=code[2] ; c4=code[3] c_t=[c1,c2,c3,c4] P=0 ; V=0 ;X=0 guess=input('Turn #1 : ') g1=guess[0] ; g2=guess[1] ; g3=guess[2] ; g4=guess[3] if g1==c1 : P+=1 else : if g1 in c_t : V+=1 else : X+=1 if g2==c2 : P+=1 else : if g2 in c_t : V+=1 else : X+=1 if g3==c3 : P+=1 else : if g3 in c_t : V+=1 else : X+=1 if g4==c4 : P+=1 else : if g4 in c_t : V+=1 else : X+=1 if P==4 : print(WINNING_MSG) else : print(' '+'P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) if P!=4 : c1=code[0] ; c2=code[1] ; c3=code[2] ; c4=code[3] c_t=[c1,c2,c3,c4] P=0 ; V=0 ;X=0 guess=input('Turn #2 : ') g1=guess[0] ; g2=guess[1] ; g3=guess[2] ; g4=guess[3] if g1==c1 : P+=1 else : if g1 in c_t : V+=1 else : X+=1 if g2==c2 : P+=1 else : if g2 in c_t : V+=1 else : X+=1 if g3==c3 : P+=1 else : if g3 in c_t : V+=1 else : X+=1 if g4==c4 : P+=1 else : if g4 in c_t : V+=1 else : X+=1 if P==4 : print(WINNING_MSG) else : print(' '+'P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) if P!=4 : c1=code[0] ; c2=code[1] ; c3=code[2] ; c4=code[3] c_t=[c1,c2,c3,c4] P=0 ; V=0 ;X=0 guess=input('Turn #3 : ') g1=guess[0] ; g2=guess[1] ; g3=guess[2] ; g4=guess[3] if g1==c1 : P+=1 else : if g1 in c_t : V+=1 else : X+=1 if g2==c2 : P+=1 else : if g2 in c_t : V+=1 else : X+=1 if g3==c3 : P+=1 else : if g3 in c_t : V+=1 else : X+=1 if g4==c4 : P+=1 else : if g4 in c_t : V+=1 else : X+=1 if P==4 : print(WINNING_MSG) else : print(' '+'P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) if P!=4 : c1=code[0] ; c2=code[1] ; c3=code[2] ; c4=code[3] c_t=[c1,c2,c3,c4] P=0 ; V=0 ;X=0 guess=input('Turn #4 : ') g1=guess[0] ; g2=guess[1] ; g3=guess[2] ; g4=guess[3] if g1==c1 : P+=1 else : if g1 in c_t : V+=1 else : X+=1 if g2==c2 : P+=1 else : if g2 in c_t : V+=1 else : X+=1 if g3==c3 : P+=1 else : if g3 in c_t : V+=1 else : X+=1 if g4==c4 : P+=1 else : if g4 in c_t : V+=1 else : X+=1 if P==4 : print(WINNING_MSG) else : print(' '+'P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) print(LOSING_MSG) print('The answer is '+code) print('Please try again...') |
# 6330319721 (17.37) 172 (2021-02-15 11:18) #เช็คทีละหลัก?#เช็คทุกกรณี? P = 0 V = 0 X = 0 guess = input('Turn #1 : ') if code[0]==guess[0]:#ถูกที่ P+=1 elif code[0] in guess:#ไม่ถูกแต่อยู่ในนี้ V+=1 else: X+=1#ผิด if code[1]==guess[1]: P+=1 elif code[1] in guess: V+=1 else: X+=1 if code[2]==guess[2]: P+=1 elif code[2] in guess: V+=1 else: X+=1 if code[3]==guess[3]: P+=1 elif code[3] in guess: V+=1 else: X+=1 if P==4: print(WINNING_MSG)#ถ้าเดาถูก else:#ถ้ายังผิด print('\t P='+str(P)+',V='+str(V)+',X='+str(X)) P = 0#reset V = 0#reset X = 0#reset guess = input('Turn #2 : ') if code[0]==guess[0]: P+=1 elif code[0] in guess: V+=1 else: X+=1 if code[1]==guess[1]: P+=1 elif code[1] in guess: V+=1 else: X+=1 if code[2]==guess[2]: P+=1 elif code[2] in guess: V+=1 else: X+=1 if code[3]==guess[3]: P+=1 elif code[3] in guess: V+=1 else: X+=1 if P==4: print(WINNING_MSG) else: print('\t P='+str(P)+',V='+str(V)+',X='+str(X)) P = 0 V = 0 X = 0 guess = input('Turn #3 : ') if code[0]==guess[0]: P+=1 elif code[0] in guess: V+=1 else: X+=1 if code[1]==guess[1]: P+=1 elif code[1] in guess: V+=1 else: X+=1 if code[2]==guess[2]: P+=1 elif code[2] in guess: V+=1 else: X+=1 if code[3]==guess[3]: P+=1 elif code[3] in guess: V+=1 else: X+=1 if P==4: print(WINNING_MSG) else: print('\t P='+str(P)+',V='+str(V)+',X='+str(X)) P = 0 V = 0 X = 0 guess = input('Turn #4 : ') if code[0]==guess[0]: P+=1 elif code[0] in guess: V+=1 else: X+=1 if code[1]==guess[1]: P+=1 elif code[1] in guess: V+=1 else: X+=1 if code[2]==guess[2]: P+=1 elif code[2] in guess: V+=1 else:X+=1 if code[3]==guess[3]: P+=1 elif code[3] in guess: V+=1 else: X+=1 if P==4: print(WINNING_MSG) else: print(LOSING_MSG) print('The answer is ',code) print('Please try again...') |
# 6330320221 (20.00) 173 (2021-02-11 16:47) #TURN1-------------------------------------------- p,v,x=0,0,0 guess=input('Turn #1 : ') if guess==code: print(WINNING_MSG) else: #P if guess[0]==code[0]: p+=1 if guess[1]==code[1]: p+=1 if guess[2]==code[2]: p+=1 if guess[3]==code[3]: p+=1 #V if guess[0]!=code[0] and guess[0] in code: v+=1 if guess[1]!=code[1] and guess[1] in code: v+=1 if guess[2]!=code[2] and guess[2] in code: v+=1 if guess[3]!=code[3] and guess[3] in code: v+=1 #X if guess[0] not in code: x+=1 if guess[1] not in code: x+=1 if guess[2] not in code: x+=1 if guess[3] not in code: x+=1 print(' '+'P='+str(p)+',V='+str(v)+',X='+str(x)) #TURN2------------------------------------------------------- p,v,x=0,0,0 guess=input('Turn #2 : ') if guess==code: print(WINNING_MSG) else: #P if guess[0]==code[0]: p+=1 if guess[1]==code[1]: p+=1 if guess[2]==code[2]: p+=1 if guess[3]==code[3]: p+=1 #V if guess[0]!=code[0] and guess[0] in code: v+=1 if guess[1]!=code[1] and guess[1] in code: v+=1 if guess[2]!=code[2] and guess[2] in code: v+=1 if guess[3]!=code[3] and guess[3] in code: v+=1 #X if guess[0] not in code: x+=1 if guess[1] not in code: x+=1 if guess[2] not in code: x+=1 if guess[3] not in code: x+=1 print(' '+'P='+str(p)+',V='+str(v)+',X='+str(x)) #TURN3------------------------------------------------------------ p,v,x=0,0,0 guess=input('Turn #3 : ') if guess==code: print(WINNING_MSG) else: #P if guess[0]==code[0]: p+=1 if guess[1]==code[1]: p+=1 if guess[2]==code[2]: p+=1 if guess[3]==code[3]: p+=1 #V if guess[0]!=code[0] and guess[0] in code: v+=1 if guess[1]!=code[1] and guess[1] in code: v+=1 if guess[2]!=code[2] and guess[2] in code: v+=1 if guess[3]!=code[3] and guess[3] in code: v+=1 #X if guess[0] not in code: x+=1 if guess[1] not in code: x+=1 if guess[2] not in code: x+=1 if guess[3] not in code: x+=1 print(' '+'P='+str(p)+',V='+str(v)+',X='+str(x)) #TURN4------------------------------------------------------------ p,v,x=0,0,0 guess=input('Turn #4 : ') if guess==code: print(WINNING_MSG) else: #P if guess[0]==code[0]: p+=1 if guess[1]==code[1]: p+=1 if guess[2]==code[2]: p+=1 if guess[3]==code[3]: p+=1 #V if guess[0]!=code[0] and guess[0] in code: v+=1 if guess[1]!=code[1] and guess[1] in code: v+=1 if guess[2]!=code[2] and guess[2] in code: v+=1 if guess[3]!=code[3] and guess[3] in code: v+=1 #X if guess[0] not in code: x+=1 if guess[1] not in code: x+=1 if guess[2] not in code: x+=1 if guess[3] not in code: x+=1 print(' '+'P='+str(p)+',V='+str(v)+',X='+str(x)) print(LOSING_MSG) print('The answer is ',code) print('Please try again...') #END------------------------------------------------------------- |
# 6330321921 (20.00) 174 (2021-02-14 01:35) guess = input('Turn #1 : ') p = 0 v = 0 if guess[0] == code [0]: p += 1 v = v - 1 if guess[1] == code[1]: p += 1 v = v - 1 if guess[2] == code[2]: p += 1 v = v - 1 if guess[3] == code[3]: p += 1 v = v - 1 if guess[0] in code: v += 1 if guess[1] in code: v += 1 if guess[2] in code: v += 1 if guess[3] in code: v += 1 x = 4 - p - v if p == 4: print(WINNING_MSG) else: print('\t\t ' + 'P=' + str(p) + ',' + 'V=' + str(v) + ',' + 'X=' + str(x)) guess = input('Turn #2 : ') p = 0 v = 0 if guess[0] == code[0]: p += 1 v = v - 1 if guess[1] == code[1]: p += 1 v = v - 1 if guess[2] == code[2]: p += 1 v = v - 1 if guess[3] == code[3]: p += 1 v = v - 1 if guess[0] in code: v += 1 if guess[1] in code: v += 1 if guess[2] in code: v += 1 if guess[3] in code: v += 1 x = 4 - p - v if p == 4: print(WINNING_MSG) else: print('\t\t ' + 'P=' + str(p) + ',' + 'V=' + str(v) + ',' + 'X=' + str(x)) guess = input('Turn #3 : ') p = 0 v = 0 if guess[0] == code[0]: p += 1 v = v - 1 if guess[1] == code[1]: p += 1 v = v - 1 if guess[2] == code[2]: p += 1 v = v - 1 if guess[3] == code[3]: p += 1 v = v - 1 if guess[0] in code: v += 1 if guess[1] in code: v += 1 if guess[2] in code: v += 1 if guess[3] in code: v += 1 x = 4 - p - v if p == 4: print(WINNING_MSG) else: print('\t\t ' + 'P=' + str(p) + ',' + 'V=' + str(v) + ',' + 'X=' + str(x)) guess = input('Turn #4 : ') p = 0 v = 0 if guess[0] == code[0]: p += 1 v = v - 1 if guess[1] == code[1]: p += 1 v = v - 1 if guess[2] == code[2]: p += 1 v = v - 1 if guess[3] == code[3]: p += 1 v = v - 1 if guess[0] in code: v += 1 if guess[1] in code: v += 1 if guess[2] in code: v += 1 if guess[3] in code: v += 1 x = 4 - p - v if p == 4: print(WINNING_MSG) else: print('\t\t ' + 'P=' + str(p) + ',' + 'V=' + str(v) + ',' + 'X=' + str(x)) print(LOSING_MSG) print('The answer is ', code) print('Please try again...') |
# 6330322521 (8.27) 175 (2021-02-13 12:49) c=code P=0 V=0 X=0 Z=input('Turn #1 :') if Z[0]==c[0]: P+=1 elif Z[0] in c : V+=1 else:x+=1 if Z[1]==c[1]: P+=1 elif Z[1] in c : V+=1 else:X+=1 if Z[2]==c[2]: P+=1 elif Z[2] in c : V+=1 else:X+=1 if Z[3]==c[3]: P+=1 elif Z[3] in c : V+=1 else:X+=1 if P==4:print(WINNING_MSG) else: print('\tP='+str(P)+',V='+str(V)+',X='+str(X)) P=0 V=0 X=0 Z=input('Turn #2 :') if Z[0]==c[0]: P+=1 elif Z[0] in c : V+=1 else:X+=1 if Z[1]==c[1]: P+=1 elif Z[1] in c : V+=1 else:X+=1 if Z[2]==c[2]: P+=1 elif Z[2] in c : V+=1 else:X+=1 if Z[3]==c[3]: P+=1 elif Z[3] in c : V+=1 else:X+=1 if P==4:print(WINNING_MSG) else: print('\tP='+str(P)+',V='+str(V)+',X='+str(X)) P=0 V=0 X=0 c=input('Turn #3 :') if Z[0]==c[0]: P+=1 elif Z[0] in c : V+=1 else:X+=1 if Z[1]==c[1]: P+=1 elif Z[1] in c : V+=1 else:X+=1 if Z[2]==c[2]: P+=1 elif Z[2] in c : V+=1 else:X+=1 if Z[3]==c[3]: P+=1 elif Z[3] in c : V+=1 else:X+=1 if P==4:print(WINNING_MSG) else: print('\tP='+str(P)+',V='+str(V)+',X='+str(X)) P=0 V=0 X=0 Z=input('Turn #4 :') if Z[0]==c[0]: P+=1 elif Z[0] in c : V+=1 else:X+=1 if Z[1]==c[1]: P+=1 elif Z[1] in c : V+=1 else:X+=1 if Z[2]==c[2]: P+=1 elif l[2] in c : V+=1 else:X+=1 if Z[3]==c[3]: P+=1 elif Z[3] in c : V+=1 else:X+=1 if P==4:print(WINNING_MSG) else: print(LOSING_MSG) print('The answer is',code) print('Please try again...') |
# 6330323121 (16.49) 176 (2021-02-13 23:53) V=0 X=4 P=0 t1=input('Turn #1 : ') if t1[0] in code : X-= 1 if t1[0] == code[0] : P+=1 else: V+=1 if t1[1] in code : X-= 1 if t1[1] == code[1] : P+=1 else: P+=1 if t1[2] in code : X-= 1 if t1[2] == code[2] : P+=1 else: V+=1 if t1[3] in code : X-= 1 if t1[3] == code[3] : P+=1 else: V+=1 if t1 ==code : print(WINNING_MSG) else: print(' ','P'+'='+str(P),'V'+'='+str(V),'X'+'='+str(X)) P=0 V=0 X=4 t2=input('Turn #2 : ') if t2[0] in code : X-= 1 if t2[0] == code[0] : P+=1 else: V+=1 if t2[1] in code : X-= 1 if t2[1] == code[1] : P+=1 else: V+=1 if t2[2] in code : X-= 1 if t2[2] == code[2] : P+=1 else: V+=1 if t2[3] in code : X-= 1 if t2[3] == code[3] : P+=1 else: V+=1 if t2 ==code : print(WINNING_MSG) else: print(' ','P'+'='+str(P),'V'+'='+str(V),'X'+'='+str(X)) t3=input('Turn #3 : ') P=0 V=0 X=4 if t3[0] in code : X-= 1 if t3[0] == code[0] : P+=1 else: V+=1 if t3[1] in code : X-= 1 if t3[1] == code[1] : P+=1 else: V+=1 if t3[2] in code : X-= 1 if t2[2] == code[2] : P+=1 else: V+=1 if t3[3] in code : X-= 1 if t3[3] == code[3] : P+=1 else: V+=1 if t3 ==code : print(WINNING_MSG) else : print(' ','P'+'='+str(P),'V'+'='+str(V),'X'+'='+str(X)) t4=input('Turn #4 : ') P=0 V=0 X=4 if t4[0] in code : X-= 1 if t4[0] == code[0] : P+=1 else: V+=1 if t4[1] in code : X-= 1 if t4[1] == code[1] : P+=1 else: V+=1 if t4[2] in code : X-= 1 if t4[2] == code[2] : P+=1 else: V+=1 if t4[3] in code : X-= 1 if t4[3] == code[3] : P+=1 else: V+=1 if t4 ==code : print(WINNING_MSG) else : print(' ','P'+'='+str(P),'V'+'='+str(V),'X'+'='+str(X)) print(LOSING_MSG) print('the answer is',code) print('Please try again...') |
# 6330324821 (19.00) 177 (2021-02-13 14:01) Guess_1=input('Turn #1 : ') P1=0 V1=0 if Guess_1[0] in code[0]: P1+=1 if Guess_1[1] in code[1]: P1+=1 if Guess_1[2] in code[2]: P1+=1 if Guess_1[3] in code[3]: P1+=1 if Guess_1[0] in code and Guess_1[0] not in code[0]: V1+=1 if Guess_1[1] in code and Guess_1[1] not in code[1]: V1+=1 if Guess_1[2] in code and Guess_1[2] not in code[2]: V1+=1 if Guess_1[3] in code and Guess_1[3] not in code[3]: V1+=1 X1=4-V1-P1 print(' '*10+'P='+str(P1)+','+'V='+str(V1)+','+'X='+str(X1)) if P1==4: print(WINNING_MSG) else: Guess_2=input('Turn #2 : ') P2=0 V2=0 if Guess_2[0] in code[0]: P2+=1 if Guess_2[1] in code[1]: P2+=1 if Guess_2[2] in code[2]: P2+=1 if Guess_2[3] in code[3]: P2+=1 if Guess_2[0] in code and Guess_2[0] not in code[0]: V2+=1 if Guess_2[1] in code and Guess_2[1] not in code[1]: V2+=1 if Guess_2[2] in code and Guess_2[2] not in code[2]: V2+=1 if Guess_2[3] in code and Guess_2[3] not in code[3]: V2+=1 X2=4-V2-P2 print(' '*10+'P='+str(P2)+','+'V='+str(V2)+','+'X='+str(X2)) if P2==4: print(WINNING_MSG) else: Guess_3=input('Turn #3 : ') P3=0 V3=0 if Guess_3[0] in code[0]: P3+=1 if Guess_3[1] in code[1]: P3+=1 if Guess_3[2] in code[2]: P3+=1 if Guess_3[3] in code[3]: P3+=1 if Guess_3[0] in code and Guess_3[0] not in code[0]: V3+=1 if Guess_3[1] in code and Guess_3[1] not in code[1]: V3+=1 if Guess_3[2] in code and Guess_3[2] not in code[2]: V3+=1 if Guess_3[3] in code and Guess_3[3] not in code[3]: V3+=1 X3=4-V3-P3 print(' '*10+'P='+str(P3)+','+'V='+str(V3)+','+'X='+str(X3)) if P3==4: print(WINNING_MSG) else: Guess_4=input('Turn #4 : ') P4=0 V4=0 if Guess_4[0] in code[0]: P4+=1 if Guess_4[1] in code[1]: P4+=1 if Guess_4[2] in code[2]: P4+=1 if Guess_4[3] in code[3]: P4+=1 if Guess_4[0] in code and Guess_4[0] not in code[0]: V4+=1 if Guess_4[1] in code and Guess_4[1] not in code[1]: V4+=1 if Guess_4[2] in code and Guess_4[2] not in code[2]: V4+=1 if Guess_4[3] in code and Guess_4[3] not in code[3]: V4+=1 X4=4-V4-P4 print(' '*10+'P='+str(P4)+','+'V='+str(V4)+','+'X='+str(X4)) if P4==4: print(WINNING_MSG) else: print(LOSING_MSG) print('The answer is ',code) print('Please try agian...') |
# 6330325421 (20.00) 178 (2021-02-11 22:03) guess=input('Turn #'+str(1)+' : ') P=0 V=0 X=0 if guess[0] not in code: X+=1 if guess[1] not in code: X+=1 if guess[2] not in code: X+=1 if guess[3] not in code: X+=1 if guess[0]==code[0]: P+=1 if guess[1]==code[1]: P+=1 if guess[2]==code[2]: P+=1 if guess[3]==code[3]: P+=1 if guess[0] in code and guess[0]!=code[0]: V+=1 if guess[1] in code and guess[1]!=code[1]: V+=1 if guess[2] in code and guess[2]!=code[2]: V+=1 if guess[3] in code and guess[3]!=code[3]: V+=1 if guess!= code: print(' '+'P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) P,V,X=0,0,0 guess=input('Turn #'+str(2)+' : ') if guess[0] not in code: X+=1 if guess[1] not in code: X+=1 if guess[2] not in code: X+=1 if guess[3] not in code: X+=1 if guess[0]==code[0]: P+=1 if guess[1]==code[1]: P+=1 if guess[2]==code[2]: P+=1 if guess[3]==code[3]: P+=1 if guess[0] in code and guess[0]!=code[0]: V+=1 if guess[1] in code and guess[1]!=code[1]: V+=1 if guess[2] in code and guess[2]!=code[2]: V+=1 if guess[3] in code and guess[3]!=code[3]: V+=1 if guess!= code: print(' '+'P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) P,V,X=0,0,0 guess=input('Turn #'+str(3)+' : ') if guess[0] not in code: X+=1 if guess[1] not in code: X+=1 if guess[2] not in code: X+=1 if guess[3] not in code: X+=1 if guess[0]==code[0]: P+=1 if guess[1]==code[1]: P+=1 if guess[2]==code[2]: P+=1 if guess[3]==code[3]: P+=1 if guess[0] in code and guess[0]!=code[0]: V+=1 if guess[1] in code and guess[1]!=code[1]: V+=1 if guess[2] in code and guess[2]!=code[2]: V+=1 if guess[3] in code and guess[3]!=code[3]: V+=1 if guess!= code: print(' '+'P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) P,V,X=0,0,0 guess=input('Turn #'+str(4)+' : ') if guess[0] not in code: X+=1 if guess[1] not in code: X+=1 if guess[2] not in code: X+=1 if guess[3] not in code: X+=1 if guess[0]==code[0]: P+=1 if guess[1]==code[1]: P+=1 if guess[2]==code[2]: P+=1 if guess[3]==code[3]: P+=1 if guess[0] in code and guess[0]!=code[0]: V+=1 if guess[1] in code and guess[1]!=code[1]: V+=1 if guess[2] in code and guess[2]!=code[2]: V+=1 if guess[3] in code and guess[3]!=code[3]: V+=1 if guess!=code: print(' '+'P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) print(LOSING_MSG) print('The answer is ',code) print('Please try again...') else:print(WINNING_MSG) else:print(WINNING_MSG) else:print(WINNING_MSG) else:print(WINNING_MSG) |
# 6330326021 (20.00) 179 (2021-02-14 23:49) game = False if not game: guess = input("Turn #1 : ") P,V,X = 0,0,0 if guess[0] in code: if guess[0] == code[0]: P += 1 else : V += 1 else: X += 1 if guess[1] in code: if guess[1] == code[1]: P += 1 else: V += 1 else: X += 1 if guess[2] in code: if guess[2] == code[2]: P += 1 else: V += 1 else: X += 1 if guess[3] in code: if guess[3] == code[3]: P += 1 else: V += 1 else: X += 1 if P == 4: game = True print(WINNING_MSG) else: hint = "P=" + str(P) +",V=" + str(V) + ",X=" +str(X) print(" "*len("turn #1 : ") + hint) if not game: guess = input("Turn #2 : ") P,V,X = 0,0,0 if guess[0] in code: if guess[0] == code[0]: P += 1 else : V += 1 else: X += 1 if guess[1] in code: if guess[1] == code[1]: P += 1 else: V += 1 else: X += 1 if guess[2] in code: if guess[2] == code[2]: P += 1 else: V += 1 else: X += 1 if guess[3] in code: if guess[3] == code[3]: P += 1 else: V += 1 else: X += 1 if P == 4: game = True print(WINNING_MSG) else: hint = "P=" + str(P) +",V=" + str(V) + ",X=" +str(X) print(" "*len("turn #2 : ") + hint) if not game: guess = input("Turn #3 : ") P,V,X = 0,0,0 if guess[0] in code: if guess[0] == code[0]: P += 1 else : V += 1 else: X += 1 if guess[1] in code: if guess[1] == code[1]: P += 1 else: V += 1 else: X += 1 if guess[2] in code: if guess[2] == code[2]: P += 1 else: V += 1 else: X += 1 if guess[3] in code: if guess[3] == code[3]: P += 1 else: V += 1 else: X += 1 if P == 4: game = True print(WINNING_MSG) else: hint = "P=" + str(P) +",V=" + str(V) + ",X=" +str(X) print(" "*len("turn #3 : ") + hint) if not game: guess = input("Turn #4 : ") P,V,X = 0,0,0 if guess[0] in code: if guess[0] == code[0]: P += 1 else : V += 1 else: X += 1 if guess[1] in code: if guess[1] == code[1]: P += 1 else: V += 1 else: X += 1 if guess[2] in code: if guess[2] == code[2]: P += 1 else: V += 1 else: X += 1 if guess[3] in code: if guess[3] == code[3]: P += 1 else: V += 1 else: X += 1 if P == 4: game = True print(WINNING_MSG) else: hint = "P=" + str(P) +",V=" + str(V) + ",X=" +str(X) print(" "*len("turn #4 : ") + hint) print(LOSING_MSG) print("The answer is " + code) print("Please try again...") |
# 6330327721 (19.11) 180 (2021-02-14 20:20) CO=code rc = input() ans = rc p=v=x=0 a=ans[0] b=ans[1] c=ans[2] d=ans[3] if a in code : v=v+1 else : x=x+1 if b in code : v=v+1 else : x=x+1 if c in code : v=v+1 else : x=x+1 if d in code : v=v+1 else : x=x+1 if a==code[0] : v=v-1 p=p+1 if b==code[1] : v=v-1 p=p+1 if c==code[2] : v=v-1 p=p+1 if d==code[3] : v=v-1 p=p+1 print('Turn #1 :' , rc) #0000000000000000000000000000000000 if p==4 : print(WINNING_MSG) else : print('P='+str(p)+',V='+str(v)+',X='+str(x)) rc = input() ans = rc p=v=x=0 a=ans[0] b=ans[1] c=ans[2] d=ans[3] if a in code : v=v+1 else : x=x+1 if b in code : v=v+1 else : x=x+1 if c in code : v=v+1 else : x=x+1 if d in code : v=v+1 else : x=x+1 if a==code[0] : v=v-1 p=p+1 if b==code[1] : v=v-1 p=p+1 if c==code[2] : v=v-1 p=p+1 if d==code[3] : v=v-1 p=p+1 print('Turn #1 :' , rc) #0000000000000000000000000000 if p==4 : print(WINNING_MSG) else : print('P='+str(p)+',V='+str(v)+',X='+str(x)) rc = input() ans = rc p=v=x=0 a=ans[0] b=ans[1] c=ans[2] d=ans[3] if a in code : v=v+1 else : x=x+1 if b in code : v=v+1 else : x=x+1 if c in code : v=v+1 else : x=x+1 if d in code : v=v+1 else : x=x+1 if a==code[0] : v=v-1 p=p+1 if b==code[1] : v=v-1 p=p+1 if c==code[2] : v=v-1 p=p+1 if d==code[3] : v=v-1 p=p+1 print('Turn #1 :' , rc) #000000000000000000000000000 if p==4 : print(WINNING_MSG) else : print('P='+str(p)+',V='+str(v)+',X='+str(x)) rc = input() ans = rc p=v=x=0 a=ans[0] b=ans[1] c=ans[2] d=ans[3] if a in code : v=v+1 else : x=x+1 if b in code : v=v+1 else : x=x+1 if c in code : v=v+1 else : x=x+1 if d in code : v=v+1 else : x=x+1 if a==code[0] : v=v-1 p=p+1 if b==code[1] : v=v-1 p=p+1 if c==code[2] : v=v-1 p=p+1 if d==code[3] : v=v-1 p=p+1 print('Turn #1 :' , rc) if p==4 : print(WINNING_MSG) else : print('P='+str(p)+',V='+str(v)+',X='+str(x)) print(LOSING_MSG) print('The answer is ' + CO) print('Please try again...') |
# 6330328321 (19.11) 181 (2021-02-14 15:59) txtInput = 'Turn #1 : ' p=0 v=0 x=0 guess = str(input(txtInput)) if(code[0]==guess[0]): p+=1 if(code[1]==guess[1]): p+=1 if(code[2]==guess[2]): p+=1 if(code[3]==guess[3]): p+=1 if(guess[0]==code[1] or guess[0]==code[2] or guess[0]==code[3]): v+=1 if(guess[1]==code[0] or guess[1]==code[2] or guess[1]==code[3]): v+=1 if(guess[2]==code[0] or guess[2]==code[1] or guess[2]==code[3]): v+=1 if(guess[3]==code[0] or guess[3]==code[1] or guess[3]==code[2]): v+=1 x = 4-(p+v) print(' '*len(txtInput)+'P='+str(p)+',V='+str(v)+',X='+str(x)) if p==4: print(WINNING_MSG) else: txtInput = 'Turn #2 : ' p=0 v=0 x=0 guess = str(input(txtInput)) if(code[0]==guess[0]): p+=1 if(code[1]==guess[1]): p+=1 if(code[2]==guess[2]): p+=1 if(code[3]==guess[3]): p+=1 if(guess[0]==code[1] or guess[0]==code[2] or guess[0]==code[3]): v+=1 if(guess[1]==code[0] or guess[1]==code[2] or guess[1]==code[3]): v+=1 if(guess[2]==code[0] or guess[2]==code[1] or guess[2]==code[3]): v+=1 if(guess[3]==code[0] or guess[3]==code[1] or guess[3]==code[2]): v+=1 x = 4-(p+v) print(' '*len(txtInput)+'P='+str(p)+',V='+str(v)+',X='+str(x)) if p==4: print(WINNING_MSG) else: txtInput = 'Turn #3 : ' p=0 v=0 x=0 guess = str(input(txtInput)) if(code[0]==guess[0]): p+=1 if(code[1]==guess[1]): p+=1 if(code[2]==guess[2]): p+=1 if(code[3]==guess[3]): p+=1 if(guess[0]==code[1] or guess[0]==code[2] or guess[0]==code[3]): v+=1 if(guess[1]==code[0] or guess[1]==code[2] or guess[1]==code[3]): v+=1 if(guess[2]==code[0] or guess[2]==code[1] or guess[2]==code[3]): v+=1 if(guess[3]==code[0] or guess[3]==code[1] or guess[3]==code[2]): v+=1 x = 4-(p+v) print(' '*len(txtInput)+'P='+str(p)+',V='+str(v)+',X='+str(x)) if p==4: print(WINNING_MSG) else: txtInput = 'Turn #4 : ' p=0 v=0 x=0 guess = str(input(txtInput)) if(code[0]==guess[0]): p+=1 if(code[1]==guess[1]): p+=1 if(code[2]==guess[2]): p+=1 if(code[3]==guess[3]): p+=1 if(guess[0]==code[1] or guess[0]==code[2] or guess[0]==code[3]): v+=1 if(guess[1]==code[0] or guess[1]==code[2] or guess[1]==code[3]): v+=1 if(guess[2]==code[0] or guess[2]==code[1] or guess[2]==code[3]): v+=1 if(guess[3]==code[0] or guess[3]==code[1] or guess[3]==code[2]): v+=1 x = 4-(p+v) print(' '*len(txtInput)+'P='+str(p)+',V='+str(v)+',X='+str(x)) if p==4: print(WINNING_MSG) else: print(LOSING_MSG) print('The answer is ',code) print('Please try again...') |
# 6330329021 (20.00) 182 (2021-02-14 17:31) codeList = list(code) #1111111111111111111111 a=list(input('Turn #1 : ')) P=0;V=0;X=0 if a==codeList: a='win!' if a[0] == code[0]: P+=1 elif a[0] in code: V+=1 else: X+=1 if a[1] == code[1]: P+=1 elif a[1] in code: V+=1 else: X+=1 if a[2] == code[2]: P+=1 elif a[2] in code: V+=1 else: X+=1 if a[3] == code[3]: P+=1 elif a[3] in code: V+=1 else: X+=1 if a != 'win!': print(' P='+str(P)+',V='+str(V)+',X='+str(X)) #222222222222222222222222222222222222222222222 if a != 'win!': a=list(input('Turn #2 : ')) P=0;V=0;X=0 if a==codeList: a='win!' if a[0] == code[0]: P+=1 elif a[0] in code: V+=1 else: X+=1 if a[1] == code[1]: P+=1 elif a[1] in code: V+=1 else: X+=1 if a[2] == code[2]: P+=1 elif a[2] in code: V+=1 else: X+=1 if a[3] == code[3]: P+=1 elif a[3] in code: V+=1 else: X+=1 if a != 'win!': print(' P='+str(P)+',V='+str(V)+',X='+str(X)) #333333333333333333333333333333333 if a != 'win!': a=list(input('Turn #3 : ')) P=0;V=0;X=0 if a==codeList: a='win!' if a[0] == code[0]: P+=1 elif a[0] in code: V+=1 else: X+=1 if a[1] == code[1]: P+=1 elif a[1] in code: V+=1 else: X+=1 if a[2] == code[2]: P+=1 elif a[2] in code: V+=1 else: X+=1 if a[3] == code[3]: P+=1 elif a[3] in code: V+=1 else: X+=1 if a != 'win!': print(' P='+str(P)+',V='+str(V)+',X='+str(X)) #4444444444444444444444444444444 if a != 'win!': a=list(input('Turn #4 : ')) P=0;V=0;X=0 if a==codeList: a='win!' if a[0] == code[0]: P+=1 elif a[0] in code: V+=1 else: X+=1 if a[1] == code[1]: P+=1 elif a[1] in code: V+=1 else: X+=1 if a[2] == code[2]: P+=1 elif a[2] in code: V+=1 else: X+=1 if a[3] == code[3]: P+=1 elif a[3] in code: V+=1 else: X+=1 if a != 'win!': print(' P='+str(P)+',V='+str(V)+',X='+str(X)) #result if a=='win!': print(WINNING_MSG) else: print(LOSING_MSG) print('The answer is '+code) print('Please try again...') |
# 6330330521 (19.90) 183 (2021-02-12 23:28) text = input('Turn #1 : ') p = 0 v = 0 x = 0 if code[0]==text[0] and code[1]==text[1] and code[2]==text[2] and code[3]==text[3]: print('Congratulation! You won the game.') else: if code[0]==text[0]: p=p+1 if code[1]==text[1]: p=p+1 if code[2]==text[2]: p=p+1 if code[3]==text[3]: p=p+1 if code[0]==text[1] or code[0]==text[2] or code[0]==text[3]: v=v+1 if code[1]==text[0] or code[1]==text[2] or code[1]==text[3]: v=v+1 if code[2]==text[0] or code[2]==text[1] or code[2]==text[3]: v=v+1 if code[3]==text[0] or code[3]==text[1] or code[3]==text[2]: v=v+1 if text[0] not in code: x=x+1 if text[1] not in code: x=x+1 if text[2] not in code: x=x+1 if text[3] not in code: x=x+1 print(' P='+str(p)+',V='+str(v)+',X='+str(x)) text = input('Turn #2 : ') p = 0 v = 0 x = 0 if code[0]==text[0] and code[1]==text[1] and code[2]==text[2] and code[3]==text[3]: print('Congratulation! You won the game.') else: if code[0]==text[0]: p=p+1 if code[1]==text[1]: p=p+1 if code[2]==text[2]: p=p+1 if code[3]==text[3]: p=p+1 if code[0]==text[1] or code[0]==text[2] or code[0]==text[3]: v=v+1 if code[1]==text[0] or code[1]==text[2] or code[1]==text[3]: v=v+1 if code[2]==text[0] or code[2]==text[1] or code[2]==text[3]: v=v+1 if code[3]==text[0] or code[3]==text[1] or code[3]==text[2]: v=v+1 if text[0] not in code: x=x+1 if text[1] not in code: x=x+1 if text[2] not in code: x=x+1 if text[3] not in code: x=x+1 print(' P='+str(p)+',V='+str(v)+',X='+str(x)) text = input('Turn #3 : ') p = 0 v = 0 x = 0 if code[0]==text[0] and code[1]==text[1] and code[2]==text[2] and code[3]==text[3]: print('Congratulation! You won the game.') else: if code[0]==text[0]: p=p+1 if code[1]==text[1]: p=p+1 if code[2]==text[2]: p=p+1 if code[3]==text[3]: p=p+1 if code[0]==text[1] or code[0]==text[2] or code[0]==text[3]: v=v+1 if code[1]==text[0] or code[1]==text[2] or code[1]==text[3]: v=v+1 if code[2]==text[0] or code[2]==text[1] or code[2]==text[3]: v=v+1 if code[3]==text[0] or code[3]==text[1] or code[3]==text[2]: v=v+1 if text[0] not in code: x=x+1 if text[1] not in code: x=x+1 if text[2] not in code: x=x+1 if text[3] not in code: x=x+1 print(' P='+str(p)+',V='+str(v)+',X='+str(x)) text = input('Turn #4 : ') p = 0 v = 0 x = 0 if code[0]==text[0] and code[1]==text[1] and code[2]==text[2] and code[3]==text[3]: print('Congratulation! You won the game.') else: if code[0]==text[0]: p=p+1 if code[1]==text[1]: p=p+1 if code[2]==text[2]: p=p+1 if code[3]==text[3]: p=p+1 if code[0]==text[1] or code[0]==text[2] or code[0]==text[3]: v=v+1 if code[1]==text[0] or code[1]==text[2] or code[1]==text[3]: v=v+1 if code[2]==text[0] or code[2]==text[1] or code[2]==text[3]: v=v+1 if code[3]==text[0] or code[3]==text[1] or code[3]==text[2]: v=v+1 if text[0] not in code: x=x+1 if text[1] not in code: x=x+1 if text[2] not in code: x=x+1 if text[3] not in code: x=x+1 print(' P='+str(p)+',V='+str(v)+',X='+str(x)) print('Sorry! You just lost it.') print('The answer is '+code) print('Please try again...') |
# 6330331121 (20.00) 184 (2021-02-14 18:49) x = input("Turn #1 : ") P1 = 0 V1 = 0 X1 = 0 if x[0] == code[0]: P1 += 1 if x[1] == code[1]: P1 += 1 if x[2] == code[2]: P1 += 1 if x[3] == code[3]: P1 += 1 if (x[0] in code) and (x[0] != code[0]): V1 += 1 if (x[1] in code) and (x[1] != code[1]): V1 += 1 if (x[2] in code) and (x[2] != code[2]): V1 += 1 if (x[3] in code) and (x[3] != code[3]): V1 += 1 if x[0] not in code: X1 += 1 if x[1] not in code: X1 += 1 if x[2] not in code: X1 += 1 if x[3] not in code: X1 += 1 if P1 == 4: print(WINNING_MSG) else: print(" "*9,"P="+str(P1)+",V="+str(V1)+",X="+str(X1)) x = input("Turn #2 : ") P1 = 0 V1 = 0 X1 = 0 if x[0] == code[0]: P1 += 1 if x[1] == code[1]: P1 += 1 if x[2] == code[2]: P1 += 1 if x[3] == code[3]: P1 += 1 if (x[0] in code) and (x[0] != code[0]): V1 += 1 if (x[1] in code) and (x[1] != code[1]): V1 += 1 if (x[2] in code) and (x[2] != code[2]): V1 += 1 if (x[3] in code) and (x[3] != code[3]): V1 += 1 if x[0] not in code: X1 += 1 if x[1] not in code: X1 += 1 if x[2] not in code: X1 += 1 if x[3] not in code: X1 += 1 if P1 == 4: print(WINNING_MSG) else: print(" "*9,"P="+str(P1)+",V="+str(V1)+",X="+str(X1)) x = input("Turn #3 : ") P1 = 0 V1 = 0 X1 = 0 if x[0] == code[0]: P1 += 1 if x[1] == code[1]: P1 += 1 if x[2] == code[2]: P1 += 1 if x[3] == code[3]: P1 += 1 if (x[0] in code) and (x[0] != code[0]): V1 += 1 if (x[1] in code) and (x[1] != code[1]): V1 += 1 if (x[2] in code) and (x[2] != code[2]): V1 += 1 if (x[3] in code) and (x[3] != code[3]): V1 += 1 if x[0] not in code: X1 += 1 if x[1] not in code: X1 += 1 if x[2] not in code: X1 += 1 if x[3] not in code: X1 += 1 if P1 == 4: print(WINNING_MSG) else: print(" "*9,"P="+str(P1)+",V="+str(V1)+",X="+str(X1)) x = input("Turn #4 : ") P1 = 0 V1 = 0 X1 = 0 if x[0] == code[0]: P1 += 1 if x[1] == code[1]: P1 += 1 if x[2] == code[2]: P1 += 1 if x[3] == code[3]: P1 += 1 if (x[0] in code) and (x[0] != code[0]): V1 += 1 if (x[1] in code) and (x[1] != code[1]): V1 += 1 if (x[2] in code) and (x[2] != code[2]): V1 += 1 if (x[3] in code) and (x[3] != code[3]): V1 += 1 if x[0] not in code: X1 += 1 if x[1] not in code: X1 += 1 if x[2] not in code: X1 += 1 if x[3] not in code: X1 += 1 if P1 == 4: print(WINNING_MSG) else: print(" "*9,"P="+str(P1)+",V="+str(V1)+",X="+str(X1)) print(LOSING_MSG) print("The answer is " +code) print("Please try again...") |
# 6330332821 (20.00) 185 (2021-02-14 23:09) #========================================================= code_list=list(code) b=list(input('Turn #1 : ')) P=0 V=0 X=0 if b[0]==code[0]: P+=1 elif b[0] in code: V+=1 else: X+=1 if b[1]==code[1]: P+=1 elif b[1] in code: V+=1 else: X+=1 if b[2]==code[2]: P+=1 elif b[2] in code: V+=1 else: X+=1 if b[3]==code[3]: P+=1 elif b[3] in code: V+=1 else: X+=1 if b != code_list: print(' P='+str(P)+',V='+str(V)+',X='+str(X)) #================================================= if b != code_list: b=list(input('Turn #2 : ')) P=0 V=0 X=0 if b[0]==code[0]: P+=1 elif b[0] in code: V+=1 else: X+=1 if b[1]==code[1]: P+=1 elif b[1] in code: V+=1 else: X+=1 if b[2]==code[2]: P+=1 elif b[2] in code: V+=1 else: X+=1 if b[3]==code[3]: P+=1 elif b[3] in code: V+=1 else: X+=1 if b != code_list: print(' P='+str(P)+',V='+str(V)+',X='+str(X)) #================================================ if b != code_list: b=list(input('Turn #3 : ')) P=0 V=0 X=0 if b[0]==code[0]: P+=1 elif b[0] in code: V+=1 else: X+=1 if b[1]==code[1]: P+=1 elif b[1] in code: V+=1 else: X+=1 if b[2]==code[2]: P+=1 elif b[2] in code: V+=1 else: X+=1 if b[3]==code[3]: P+=1 elif b[3] in code: V+=1 else: X+=1 if b != code_list: print(' P='+str(P)+',V='+str(V)+',X='+str(X)) #=================================================== if b != code_list: b=list(input('Turn #4 : ')) P=0 V=0 X=0 if b[0]==code[0]: P+=1 elif b[0] in code: V+=1 else: X+=1 if b[1]==code[1]: P+=1 elif b[1] in code: V+=1 else: X+=1 if b[2]==code[2]: P+=1 elif b[2] in code: V+=1 else: X+=1 if b[3]==code[3]: P+=1 elif b[3] in code: V+=1 else: X+=1 if b != code_list: print(' P='+str(P)+',V='+str(V)+',X='+str(X)) #======================================================== if b==code_list: print(WINNING_MSG) else: print(LOSING_MSG) print('The answer is '+code) print('Please try again...') |
# 6330333421 (17.27) 186 (2021-02-15 17:03) game_end = False if not game_end: guess = input('Turn #1: ').strip().upper() p, v, x = 0, 0, 0 if guess[0]==code[0]: p =p+1 elif guess[0] in code: v =v+1 else: x =x+1 if guess[1]==code[1]: p =p+1 elif guess[1] in code: v =v+1 else: x =x+1 if guess[2]==code[2]: p =p+1 elif guess[2] in code: v =v+1 else: x =x+1 if guess[3]==code[3]: p =p+1 elif guess[3] in code: v =v+1 else: x =x+1 if guess == code: game_end = True print(WINNING_MSG) else: spaces = ' '*len('Turn #1: ') print(spaces + 'P='+str(p)+',V='+str(v)+',X='+str(x)) if not game_end: guess = input('Turn #2: ').strip().upper() p, v, x = 0, 0, 0 if guess[0]==code[0]: p =p+1 elif guess[0] in code: v =v+1 else: x =x+1 if guess[1]==code[1]: p =p+1 elif guess[1] in code: v =v+1 else: x =x+1 if guess[2]==code[2]: p =p+1 elif guess[2] in code: v =v+1 else: x =x+1 if guess[3]==code[3]: p =p+1 elif guess[3] in code: v =v+1 else: x =x+1 if guess == code: game_end = True print(WINNING_MSG) else: spaces = ' '*len('Turn #2: ') print(spaces + 'P='+str(p)+',V='+str(v)+',X='+str(x)) if not game_end: guess = input('Turn #3: ').strip().upper() p, v, x = 0, 0, 0 if guess[0]==code[0]: p =p+1 elif guess[0] in code: v =v+1 else: x =x+1 if guess[1]==code[1]: p =p+1 elif guess[1] in code: v =v+1 else: x =x+1 if guess[2]==code[2]: p =p+1 elif guess[2] in code: v =v+1 else: x =x+1 if guess[3]==code[3]: p =p+1 elif guess[3] in code: v =v+1 else: x =x+1 if guess == code: game_end = True print(WINNING_MSG) else: spaces = ' '*len('Turn #3: ') print(spaces + 'P='+str(p)+',V='+str(v)+',X='+str(x)) if not game_end: guess = input('Turn #4: ').strip().upper() p, v, x = 0, 0, 0 if guess[0]==code[0]: p =p+1 elif guess[0] in code: v =v+1 else: x =x+1 if guess[1]==code[1]: p =p+1 elif guess[1] in code: v =v+1 else: x =x+1 if guess[2]==code[2]: p =p+1 elif guess[2] in code: v =v+1 else: x =x+1 if guess[3]==code[3]: p =p+1 elif guess[3] in code: v =v+1 else: x =x+1 if guess == code: game_end = True print(WINNING_MSG) else: print(LOSING_MSG) print('The answer is '+code) print('Please try again...') |
# 6330334021 (20.00) 187 (2021-02-14 16:20) x = input('Turn #1 : ') P = 0 V = 0 X = 0 if x[0] in code: V += 1 if x[1] in code: V += 1 if x[2] in code: V += 1 if x[3] in code: V += 1 if x[0] in code[0]: P += 1 V -= 1 if x[1] in code[1]: P += 1 V -= 1 if x[2] in code[2]: P += 1 V -= 1 if x[3] in code[3]: P += 1 V -= 1 X = 4-P-V if P == 4: print(WINNING_MSG) else: print(' '+'P='+str(P)+',V='+str(V)+',X='+str(X)) if P != 4: x = input('Turn #2 : ') P = 0 V = 0 X = 0 if x[0] in code: V += 1 if x[1] in code: V += 1 if x[2] in code: V += 1 if x[3] in code: V += 1 if x[0] in code[0]: P += 1 V -= 1 if x[1] in code[1]: P += 1 V -= 1 if x[2] in code[2]: P += 1 V -= 1 if x[3] in code[3]: P += 1 V -= 1 X = 4-P-V if P == 4: print(WINNING_MSG) else: print(' '+'P='+str(P)+',V='+str(V)+',X='+str(X)) if P != 4: x = input('Turn #3 : ') P = 0 V = 0 X = 0 if x[0] in code: V += 1 if x[1] in code: V += 1 if x[2] in code: V += 1 if x[3] in code: V += 1 if x[0] in code[0]: P += 1 V -= 1 if x[1] in code[1]: P += 1 V -= 1 if x[2] in code[2]: P += 1 V -= 1 if x[3] in code[3]: P += 1 V -= 1 X = 4-P-V if P == 4: print(WINNING_MSG) else: print(' '+'P='+str(P)+',V='+str(V)+',X='+str(X)) if P != 4: x = input('Turn #4 : ') P = 0 V = 0 X = 0 if x[0] in code: V += 1 if x[1] in code: V += 1 if x[2] in code: V += 1 if x[3] in code: V += 1 if x[0] in code[0]: P += 1 V -= 1 if x[1] in code[1]: P += 1 V -= 1 if x[2] in code[2]: P += 1 V -= 1 if x[3] in code[3]: P += 1 V -= 1 X = 4-P-V if P == 4: print(WINNING_MSG) else: print(' '+'P='+str(P)+',V='+str(V)+',X='+str(X)) print(LOSING_MSG) print('The answer is '+str(code)) print('''Please try again...''') |
# 6330335721 (20.00) 188 (2021-02-11 10:35) p=0#ตรงสีและตรงตําแหน่ง v=0#ตรงสีแต่ไม่ตรงตําแหน่ง x=0#ไม่ตรงสี codebreaker= str(input("Turn #1 : ")) if codebreaker!=code:#turn 1 if codebreaker[0]==code[0]: p+=1 if codebreaker[1]==code[1]: p+=1 if codebreaker[2]==code[2]: p+=1 if codebreaker[3]==code[3]: p+=1 if codebreaker[0] in code and codebreaker[0]!=code[0]: v+=1 if codebreaker[1] in code and codebreaker[1]!=code[1]: v+=1 if codebreaker[2] in code and codebreaker[2]!=code[2]: v+=1 if codebreaker[3] in code and codebreaker[3]!=code[3]: v+=1 if codebreaker[0] not in code: x+=1 if codebreaker[1] not in code: x+=1 if codebreaker[2] not in code: x+=1 if codebreaker[3] not in code: x+=1 print(" P="+str(p)+ "," + "V="+str(v) + "," + "X=" +str(x)) codebreaker = input("Turn #2 : ") if codebreaker!=code:#turn 2 p=0#ตรงสีและตรงตําแหน่ง v=0#ตรงสีแต่ไม่ตรงตําแหน่ง x=0#ไม่ตรงสี if codebreaker[0]==code[0]: p+=1 if codebreaker[1]==code[1]: p+=1 if codebreaker[2]==code[2]: p+=1 if codebreaker[3]==code[3]: p+=1 if codebreaker[0] in code and codebreaker[0]!=code[0]: v+=1 if codebreaker[1] in code and codebreaker[1]!=code[1]: v+=1 if codebreaker[2] in code and codebreaker[2]!=code[2]: v+=1 if codebreaker[3] in code and codebreaker[3]!=code[3]: v+=1 if codebreaker[0] not in code: x+=1 if codebreaker[1] not in code: x+=1 if codebreaker[2] not in code: x+=1 if codebreaker[3] not in code: x+=1 print(" P="+str(p)+ "," + "V="+str(v) + "," + "X=" +str(x)) codebreaker = input("Turn #3 : ") if codebreaker!=code:#turn 3 p=0#ตรงสีและตรงตําแหน่ง v=0#ตรงสีแต่ไม่ตรงตําแหน่ง x=0#ไม่ตรงสี if codebreaker[0]==code[0]: p+=1 if codebreaker[1]==code[1]: p+=1 if codebreaker[2]==code[2]: p+=1 if codebreaker[3]==code[3]: p+=1 if codebreaker[0] in code and codebreaker[0]!=code[0]: v+=1 if codebreaker[1] in code and codebreaker[1]!=code[1]: v+=1 if codebreaker[2] in code and codebreaker[2]!=code[2]: v+=1 if codebreaker[3] in code and codebreaker[3]!=code[3]: v+=1 if codebreaker[0] not in code: x+=1 if codebreaker[1] not in code: x+=1 if codebreaker[2] not in code: x+=1 if codebreaker[3] not in code: x+=1 print(" P="+str(p)+ "," + "V="+str(v) + "," + "X=" +str(x)) codebreaker = input("Turn #4 : ") if codebreaker!=code: p=0#ตรงสีและตรงตําแหน่ง v=0#ตรงสีแต่ไม่ตรงตําแหน่ง x=0#ไม่ตรงสี if codebreaker[0]==code[0]: p+=1 if codebreaker[1]==code[1]: p+=1 if codebreaker[2]==code[2]: p+=1 if codebreaker[3]==code[3]: p+=1 if codebreaker[0] in code and codebreaker[0]!=code[0]: v+=1 if codebreaker[1] in code and codebreaker[1]!=code[1]: v+=1 if codebreaker[2] in code and codebreaker[2]!=code[2]: v+=1 if codebreaker[3] in code and codebreaker[3]!=code[3]: v+=1 if codebreaker[0] not in code: x+=1 if codebreaker[1] not in code: x+=1 if codebreaker[2] not in code: x+=1 if codebreaker[3] not in code: x+=1 print(" P="+str(p)+ "," + "V="+str(v) + "," + "X=" +str(x)) print(LOSING_MSG) print("The answer is ",code) print("Please try again...") else:#turn4 print(WINNING_MSG) else:#turn 3 print(WINNING_MSG) else:#turn 2 print(WINNING_MSG) else:#turn1 print(WINNING_MSG) |
# 6330336321 (20.00) 189 (2021-02-13 01:49) p = 0 v = 0 x = 0 #print(code) x = input("Turn #1 : ") if x[0] in code: v += 1 if x[1] in code: v += 1 if x[2] in code: v += 1 if x[3] in code: v += 1 if x[0] == code[0]: p += 1 if x[1] == code[1]: p += 1 if x[2] == code[2]: p += 1 if x[3] == code[3]: p += 1 if p == 4: print(WINNING_MSG) else: v = v - p x = 4 - (p + v) print(" "*10 + 'P=' + str(p)+',V=' + str(v) + ',X=' + str(x)) p = 0 v = 0 x = 0 x = input("Turn #2 : ") if x[0] in code: v += 1 if x[1] in code: v += 1 if x[2] in code: v += 1 if x[3] in code: v += 1 if x[0] == code[0]: p += 1 if x[1] == code[1]: p += 1 if x[2] == code[2]: p += 1 if x[3] == code[3]: p += 1 if p == 4: print(WINNING_MSG) else: v = v - p x = 4 - (p + v) print(" " * 10 + 'P=' + str(p) + ',V=' + str(v) + ',X=' + str(x)) p = 0 v = 0 x = 0 x = input("Turn #3 : ") if x[0] in code: v += 1 if x[1] in code: v += 1 if x[2] in code: v += 1 if x[3] in code: v += 1 if x[0] == code[0]: p += 1 if x[1] == code[1]: p += 1 if x[2] == code[2]: p += 1 if x[3] == code[3]: p += 1 if p == 4: print(WINNING_MSG) else: v = v - p x = 4 - (p + v) print(" " * 10 + 'P=' + str(p) + ',V=' + str(v) + ',X=' + str(x)) p = 0 v = 0 x = 0 x = input("Turn #4 : ") if x[0] in code: v += 1 if x[1] in code: v += 1 if x[2] in code: v += 1 if x[3] in code: v += 1 if x[0] == code[0]: p += 1 if x[1] == code[1]: p += 1 if x[2] == code[2]: p += 1 if x[3] == code[3]: p += 1 if p == 4: print(WINNING_MSG) else: v = v - p x = 4 - (p + v) print(" " * 10 + 'P=' + str(p) + ',V=' + str(v) + ',X=' + str(x)) print(LOSING_MSG) print("The answer is"+ " " + code ) print("Please try again...") |
# 6330337021 (20.00) 190 (2021-02-13 01:24) u = input("Turn #1 : ") p = 0 v = 0 x = 4 i = 0 if u== code : print(WINNING_MSG) else : if u[i] == code[i] : p += 1 elif u[i] in code[:]: v += 1 i += 1 if u[i] == code[i] : p += 1 elif u[i] in code[:]: v += 1 i += 1 if u[i] == code[i] : p += 1 elif u[i] in code[:]: v += 1 i += 1 if u[i] == code[i] : p += 1 elif u[i] in code[:]: v += 1 x -= p+v print(" "+"P="+str(p)+",V="+str(v)+",X="+str(x)) u = input("Turn #2 : ") p = 0 v = 0 x = 4 i = 0 if u== code : print(WINNING_MSG) else : if u[i] == code[i] : p += 1 elif u[i] in code[:]: v += 1 i += 1 if u[i] == code[i] : p += 1 elif u[i] in code[:]: v += 1 i += 1 if u[i] == code[i] : p += 1 elif u[i] in code[:]: v += 1 i += 1 if u[i] == code[i] : p += 1 elif u[i] in code[:]: v += 1 x -= p+v print(" "+"P="+str(p)+",V="+str(v)+",X="+str(x)) u = input("Turn #3 : ") p = 0 v = 0 x = 4 i = 0 if u== code : print(WINNING_MSG) else : if u[i] == code[i] : p += 1 elif u[i] in code[:]: v += 1 i += 1 if u[i] == code[i] : p += 1 elif u[i] in code[:]: v += 1 i += 1 if u[i] == code[i] : p += 1 elif u[i] in code[:]: v += 1 i += 1 if u[i] == code[i] : p += 1 elif u[i] in code[:]: v += 1 x -= p+v print(" "+"P="+str(p)+",V="+str(v)+",X="+str(x)) u = input("Turn #4 : ") p = 0 v = 0 x = 4 i = 0 if u== code : print(WINNING_MSG) else : if u[i] == code[i] : p += 1 elif u[i] in code[:]: v += 1 i += 1 if u[i] == code[i] : p += 1 elif u[i] in code[:]: v += 1 i += 1 if u[i] == code[i] : p += 1 elif u[i] in code[:]: v += 1 i += 1 if u[i] == code[i] : p += 1 elif u[i] in code[:]: v += 1 x -= p+v print(" "+"P="+str(p)+",V="+str(v)+",X="+str(x)) print(LOSING_MSG) print("The answer is ",code) print("Please try again...") |
# 6330338621 (20.00) 191 (2021-02-12 14:26) x = input('Turn #1 : ') if x[::1] == code[::1] : print(WINNING_MSG) else : if x[0] == code[0] : p0 = 1 else : p0 = 0 if x[1] == code[1] : p1 = 1 else : p1 = 0 if x[2] == code[2] : p2 = 1 else : p2 = 0 if x[3] == code[3] : p3 = 1 else : p3 = 0 P = p0 + p1 + p2 + p3 if x[0] in [code[1],code[2],code[3]] : v0 = 1 else : v0 = 0 if x[1] in [code[0],code[2],code[3]] : v1 = 1 else : v1 = 0 if x[2] in [code[1],code[0],code[3]] : v2 = 1 else : v2 = 0 if x[3] in [code[1],code[2],code[0]] : v3 = 1 else : v3 = 0 V = v0 + v1 + v2 + v3 X = 4 - (P + V) print(' ' + 'P=' + str(P) + ',V=' + str(V) + ',X=' + str(X)) x = input('Turn #2 : ') if x[::1] == code[::1] : print(WINNING_MSG) else : if x[0] == code[0] : p0 = 1 else : p0 = 0 if x[1] == code[1] : p1 = 1 else : p1 = 0 if x[2] == code[2] : p2 = 1 else : p2 = 0 if x[3] == code[3] : p3 = 1 else : p3 = 0 P = p0 + p1 + p2 + p3 if x[0] in [code[1],code[2],code[3]] : v0 = 1 else : v0 = 0 if x[1] in [code[0],code[2],code[3]] : v1 = 1 else : v1 = 0 if x[2] in [code[1],code[0],code[3]] : v2 = 1 else : v2 = 0 if x[3] in [code[1],code[2],code[0]] : v3 = 1 else : v3 = 0 V = v0 + v1 + v2 + v3 X = 4 - (P + V) print(' ' + 'P=' + str(P) + ',V=' + str(V) + ',X=' + str(X)) x = input('Turn #3 : ') if x[::1] == code[::1] : print(WINNING_MSG) else : if x[0] == code[0] : p0 = 1 else : p0 = 0 if x[1] == code[1] : p1 = 1 else : p1 = 0 if x[2] == code[2] : p2 = 1 else : p2 = 0 if x[3] == code[3] : p3 = 1 else : p3 = 0 P = p0 + p1 + p2 + p3 if x[0] in [code[1],code[2],code[3]] : v0 = 1 else : v0 = 0 if x[1] in [code[0],code[2],code[3]] : v1 = 1 else : v1 = 0 if x[2] in [code[1],code[0],code[3]] : v2 = 1 else : v2 = 0 if x[3] in [code[1],code[2],code[0]] : v3 = 1 else : v3 = 0 V = v0 + v1 + v2 + v3 X = 4 - (P + V) print(' ' + 'P=' + str(P) + ',V=' + str(V) + ',X=' + str(X)) x = input('Turn #4 : ') if x[::1] == code[::1] : print(WINNING_MSG) else : if x[0] == code[0] : p0 = 1 else : p0 = 0 if x[1] == code[1] : p1 = 1 else : p1 = 0 if x[2] == code[2] : p2 = 1 else : p2 = 0 if x[3] == code[3] : p3 = 1 else : p3 = 0 P = p0 + p1 + p2 + p3 if x[0] in [code[1],code[2],code[3]] : v0 = 1 else : v0 = 0 if x[1] in [code[0],code[2],code[3]] : v1 = 1 else : v1 = 0 if x[2] in [code[1],code[0],code[3]] : v2 = 1 else : v2 = 0 if x[3] in [code[1],code[2],code[0]] : v3 = 1 else : v3 = 0 V = v0 + v1 + v2 + v3 X = 4 - (P + V) print(' ' + 'P=' + str(P) + ',V=' + str(V) + ',X=' + str(X)) print(LOSING_MSG) print('''The answer is ''' + code) print('''Please try again...''') |
# 6330339221 (17.37) 192 (2021-02-13 01:32) a = input('Turn #1 : ') b = len('Turn #1 : ') x=4 v=0 p=0 if a == code : print(WINNING_MSG) else : if a[0] in code : x =x-1 if a[0] in code and a[0]!=code[0] : v = v+1 if a[0] == code[0] : p = p+1 if a[1] in code : x = x-1 if a[1] in code and a[1]!=code[1] : v = v+1 if a[1] == code[1] : p = p+1 if a[2] in code : x = x-1 if a[2] in code and a[2]!=code[2] : v = v+1 if a[2] == code[2] : p = p+1 if a[3] in code : x = x-1 if a[3] in code and a[3]!=code[3] : v = v+1 if a[3] == code[3] : p = p+1 if a == code : print(WINNING_MSG) else : print(' '*b+'P'+'='+str(p)+','+'V'+'='+str(max((v),0))+','+'X'+'='+str(x)) a = input('Turn #2 : ') b = len('Turn #2 : ') x=4 v=0 p=0 if a[0] in code : x =x-1 if a[0] in code and a[0]!=code[0] : v = v+1 if a[0] == code[0] : p = p+1 if a[1] in code : x = x-1 if a[1] in code and a[1]!=code[1] : v = v+1 if a[1] == code[1] : p = p+1 if a[2] in code : x = x-1 if a[2] in code and a[2]!=code[2] : v = v+1 if a[2] == code[2] : p = p+1 if a[3] in code : x = x-1 if a[3] in code and a[3]!=code[3] : v = v+1 if a[3] == code[3] : p = p+1 if a == code : print(WINNING_MSG) else : print(' '*b+'P'+'='+str(p)+','+'V'+'='+str(max((v),0))+','+'X'+'='+str(x)) a = input('Turn #3 : ') b = len('Turn #3 : ') x=4 v=0 p=0 if a[0] in code : x =x-1 if a[0] in code and a[0]!=code[0] : v = v+1 if a[0] == code[0] : p = p+1 if a[1] in code : x = x-1 if a[1] in code and a[1]!=code[1] : v = v+1 if a[1] == code[1] : p = p+1 if a[2] in code : x = x-1 if a[2] in code and a[2]!=code[2] : v = v+1 if a[2] == code[2] : p = p+1 if a[3] in code : x = x-1 if a[3] in code and a[3]!=code[3] : v = v+1 if a[3] == code[3] : p = p+1 if a == code : print(WINNING_MSG) else : print(' '*b+'P'+'='+str(p)+','+'V'+'='+str(max((v),0))+','+'X'+'='+str(x)) a = input('Turn #4 : ') b = len('Turn #4 : ') x=4 v=0 p=0 if a[0] in code : x =x-1 if a[0] in code and a[0]!=code[0] : v = v+1 if a[0] == code[0] : p = p+1 if a[1] in code : x = x-1 if a[1]!=code[1] : v = v+1 if a[1] == code[1] : p = p+1 if a[2] in code : x = x-1 if a[2] != code[2] : v = v+1 if a[2] == code[2] : p = p+1 if a[3] in code : x = x-1 if a[3]!=code[3] : v = v+1 if a[3] == code[3] : p = p+1 if a == code : print(WINNING_MSG) else : print(LOSING_MSG) print('The answer is',code) print('Please try again...') |
# 6330340821 (14.24) 193 (2021-02-12 23:06) a=0 b=0 c=4 G=input("Turn #1 : ") if G[:1:] in code[:1:]: a=1 c=3 elif G[:1:] in code[1::]: b=1 c=3 if G[1:2:] in code[1:2:]: a=a+1 c=c-1 elif G[1:2:] in code[:2:] or G[1:2:] in code[2::]: b=b+1 c=c-1 if G[2:3:] in code[2:3:]: a=a+1 c=c-1 elif G[2:3:] in code[:3:] or G[2:3:] in code[3::]: b=b+1 c=c-1 if G[3::] in code[3::]: a=a+1 c=c-1 elif G[3::] in code[:3:]: b=b+1 c=c-1 if G in code: print(WINNING_MSG) else: print(" "*10+"P="+str(a)+","+"V="+str(b)+","+"X="+str(c)) H=input("Turn #2 : ") if H[:1:] in code[:1:]: a=1 c=3 elif H[:1:] in code[1::]: b=1 c=3 if H[1:2:] in code[1:2:]: a=a+1 c=c-1 elif H[1:2:] in code[:2:] or H[1:2:] in code[2::]: b=b+1 c=c-1 if H[2:3:] in code[2:3:]: a=a+1 c=c-1 elif H[2:3:] in code[:3:] or H[2:3:] in code[3::]: b=b+1 c=c-1 if H[3::] in code[3::]: a=a+1 c=c-1 elif H[3::] in code[:3:]: b=b+1 c=c-1 if H in code: print(WINNING_MSG) else: print(" "*10+"P="+str(a)+","+"V="+str(b)+","+"X="+str(c)) I=input("Turn #3 : ") if I[:1:] in code[:1:]: a=1 c=3 elif I[:1:] in code[1::]: b=1 c=3 if I[1:2:] in code[1:2:]: a=a+1 c=c-1 elif I[1:2:] in code[:2:] or I[1:2:] in code[2::]: b=b+1 c=c-1 if I[2:3:] in code[2:3:]: a=a+1 c=c-1 elif I[2:3:] in code[:3:] or I[2:3:] in code[3::]: b=b+1 c=c-1 if I[3::] in code[3::]: a=a+1 c=c-1 elif I[3::] in code[:3:]: b=b+1 c=c-1 if I in code: print(WINNING_MSG) else: print(" "*10+"P="+str(a)+","+"V="+str(b)+","+"X="+str(c)) J=input("Turn #4 : ") if J[:1:] in code[:1:]: a=1 c=3 elif J[:1:] in code[1::]: b=1 c=3 if J[1:2:] in code[1:2:]: a=a+1 c=c-1 elif J[1:2:] in code[:2:] or J[1:2:] in code[2::]: b=b+1 c=c-1 if J[2:3:] in code[2:3:]: a=a+1 c=c-1 elif J[2:3:] in code[:3:] or J[2:3:] in code[3::]: b=b+1 c=c-1 if J[3::] in code[3::]: a=a+1 c=c-1 elif J[3::] in code[:3:]: b=b+1 c=c-1 if J in code: print(WINNING_MSG) else: print(" "*10+"P="+str(a)+","+"V="+str(b)+","+"X="+str(c)) print(LOSING_MSG) print("The answer is "+code) print("Please try again...") |
# 6330341421 (20.00) 194 (2021-02-12 16:44) print("Turn #1 :", end =" ") t = list(str(input())) codebr = list(code) p = 0 v = 0 x = 0 if t[0] in code: if t[0] == codebr[0]: p += 1 else: v += 1 else: x += 1 if t[1] in code: if t[1] == codebr[1]: p += 1 else: v += 1 else: x += 1 if t[2] in code: if t[2] == codebr[2]: p += 1 else: v += 1 else: x += 1 if t[3] in code: if t[3] == codebr[3]: p += 1 else: v += 1 else: x += 1 if t==codebr: print(WINNING_MSG) else: print(' '+'P='+str(p)+',V='+str(v)+',X='+str(x)) print("Turn #2 :", end =" ") t = list(str(input())) codebr = list(code) p = 0 v = 0 x = 0 if t[0] in code: if t[0] == codebr[0]: p += 1 else: v += 1 else: x += 1 if t[1] in code: if t[1] == codebr[1]: p += 1 else: v += 1 else: x += 1 if t[2] in code: if t[2] == codebr[2]: p += 1 else: v += 1 else: x += 1 if t[3] in code: if t[3] == codebr[3]: p += 1 else: v += 1 else: x += 1 if t==codebr: print(WINNING_MSG) else: print(' '+'P='+str(p)+',V='+str(v)+',X='+str(x)) print("Turn #3 :", end =" ") t = list(str(input())) codebr = list(code) p = 0 v = 0 x = 0 if t[0] in code: if t[0] == codebr[0]: p += 1 else: v += 1 else: x += 1 if t[1] in code: if t[1] == codebr[1]: p += 1 else: v += 1 else: x += 1 if t[2] in code: if t[2] == codebr[2]: p += 1 else: v += 1 else: x += 1 if t[3] in code: if t[3] == codebr[3]: p += 1 else: v += 1 else: x += 1 if t==codebr: print(WINNING_MSG) else: print(' '+'P='+str(p)+',V='+str(v)+',X='+str(x)) print("Turn #4 :", end =" ") t = list(str(input())) codebr = list(code) p = 0 v = 0 x = 0 if t[0] in code: if t[0] == codebr[0]: p += 1 else: v += 1 else: x += 1 if t[1] in code: if t[1] == codebr[1]: p += 1 else: v += 1 else: x += 1 if t[2] in code: if t[2] == codebr[2]: p += 1 else: v += 1 else: x += 1 if t[3] in code: if t[3] == codebr[3]: p += 1 else: v += 1 else: x += 1 if t==codebr: print(WINNING_MSG) else: print(' '+'P='+str(p)+',V='+str(v)+',X='+str(x)) print(LOSING_MSG) print('The answer is',code) print('Please try again...') |
# 6330342021 (20.00) 195 (2021-02-11 22:19) guess=input('Turn #1 : ') P,V,X=[0,0,0] if guess[0] == code[0] : P+=1 if guess[1] == code[1] : P+=1 if guess[2] == code[2] : P+=1 if guess[3] == code[3] : P+=1 if guess[0] in code : V+=1 if guess[1] in code : V+=1 if guess[2] in code : V+=1 if guess[3] in code : V+=1 V=V-P X=4-V-P if P==4 : print('Congratulations! You won the game.') else : print(' '+'P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) guess=input('Turn #2 : ') P,V,X=[0,0,0] if guess[0] == code[0] : P+=1 if guess[1] == code[1] : P+=1 if guess[2] == code[2] : P+=1 if guess[3] == code[3] : P+=1 if guess[0] in code : V+=1 if guess[1] in code : V+=1 if guess[2] in code : V+=1 if guess[3] in code : V+=1 V=V-P X=4-V-P if P==4 : print('Congratulations! You won the game.') else : print(' '+'P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) guess=input('Turn #3 : ') P,V,X=[0,0,0] if guess[0] == code[0] : P+=1 if guess[1] == code[1] : P+=1 if guess[2] == code[2] : P+=1 if guess[3] == code[3] : P+=1 if guess[0] in code : V+=1 if guess[1] in code : V+=1 if guess[2] in code : V+=1 if guess[3] in code : V+=1 V=V-P X=4-V-P if P==4 : print('Congratulations! You won the game.') else : print(' '+'P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) guess=input('Turn #4 : ') P,V,X=[0,0,0] if guess[0] == code[0] : P+=1 if guess[1] == code[1] : P+=1 if guess[2] == code[2] : P+=1 if guess[3] == code[3] : P+=1 if guess[0] in code : V+=1 if guess[1] in code : V+=1 if guess[2] in code : V+=1 if guess[3] in code : V+=1 V=V-P X=4-V-P if P==4 : print('Congratulations! You won the game.') else : print(' '+'P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) print('Sorry! You just lost it.\nThe answer is '+code+'\nPlease try again...') |
# 6330343721 (15.33) 196 (2021-02-15 21:08) k = str(input('Turn #1 :')) codeA = code p00 = 0; p01 = 0; p02 = 0; p03 = 0 v00 = 0; v01 = 0; v02 = 0; v03 = 0 x00 = 0; x01 = 0; x02 = 0; x03 = 0 if k[0] == codeA[0]: p00 = 1 codeA = codeA.replace(k[0], 'N') k = k.replace(k[0], 'M') elif k[0] == codeA[1]: v00 = 1 codeA = codeA.replace(k[1], 'N') k = k.replace(k[0], 'M') elif k[0] == codeA[2]: v00 = 1 codeA = codeA.replace(k[2], 'N') k = k.replace(k[0], 'M') elif k[0] == codeA[3]: v00 = 1 codeA = codeA.replace(k[3], 'N') k = k.replace(k[0], 'M') else: x00 = 1 if k[1] == codeA[1]: p01 = 1 codeA = codeA.replace(k[1], 'N') k = k.replace(k[1], 'M') elif k[1] == codeA[0]: v01 = 1 codeA = codeA.replace(k[0], 'N') k = k.replace(k[1], 'M') elif k[1] == codeA[2]: v01 = 1 codeA = codeA.replace(k[2], 'N') k = k.replace(k[1], 'M') elif k[1] == codeA[3]: v01 = 1 codeA = codeA.replace(k[3], 'N') k = k.replace(k[1], 'M') else: x01 = 1 if k[2] == codeA[2]: p02 = 1 codeA = codeA.replace(k[2], 'N') k = k.replace(k[2], 'M') elif k[2] == codeA[0]: v02 = 1 codeA = codeA.replace(k[0], 'N') k = k.replace(k[2], 'M') elif k[2] == codeA[1]: v02 = 1 codeA = codeA.replace(k[1], 'N') k = k.replace(k[2], 'M') elif k[2] == codeA[3]: v02 = 1 codeA = codeA.replace(k[3], 'N') k = k.replace(k[2], 'M') else: x02 = 1 if k[3] == codeA[3]: p03 = 1 codeA = codeA.replace(k[3], 'N') k = k.replace(k[3], 'M') elif k[3] == codeA[0]: v03 = 1 codeA = codeA.replace(k[0], 'N') k = k.replace(k[3], 'M') elif k[3] == codeA[1]: v03 = 1 codeA = codeA.replace(k[1], 'N') k = k.replace(k[3], 'M') elif k[3] == codeA[2]: v03 = 1 codeA = codeA.replace(k[2], 'N') k = k.replace(k[3], 'M') else: k = k.replace(k[3], 'N') x03 = 1 P = p00+p01+p02+p03 V = v00+v01+v02+v03 X = x00+x01+x02+x03 if P == 4: print('Congratulations! You won the game.') else: codeB = code print(' P='+str(P)+',V='+str(V)+',X='+str(X)) k = str(input('Turn #2 :')) p10 = 0; p11 = 0; p12 = 0; p13 = 0 v10 = 0; v11 = 0; v12 = 0; v13 = 0 x10 = 0; x11 = 0; x12 = 0; x13 = 0 if k[0] == codeB[0]: p10 = 1 k = k.replace(k[0], 'N') codeB = codeB.replace(k[0], 'M') elif k[0] == codeB[1]: v10 = 1 k = k.replace(k[0], 'N') codeB = codeB.replace(k[1], 'M') elif k[0] == codeB[2]: v10 = 1 k = k.replace(k[0], 'N') codeB = codeB.replace(k[2], 'M') elif k[0] == codeB[3]: v10 = 1 k = k.replace(k[0], 'N') codeB = codeB.replace(k[3], 'M') else: x10 = 1 if k[1] == codeB[1]: p11 = 1 k = k.replace(k[1], 'N') codeB = codeB.replace(k[1], 'M') elif k[1] == code[0]: v11 = 1 k = k.replace(k[1], 'N') codeB = codeB.replace(k[0], 'M') elif k[1] == code[2]: v11 = 1 k = k.replace(k[1], 'N') codeB = codeB.replace(k[2], 'M') elif k[1] == code[3]: v11 = 1 k = k.replace(k[1], 'N') codeB = codeB.replace(k[3], 'M') else: x11 = 1 if k[2] == codeB[2]: p12 = 1 k = k.replace(k[2], 'N') codeB = codeB.replace(k[2], 'M') elif k[2] == codeB[0]: v12 = 1 k = k.replace(k[2], 'N') codeB = codeB.replace(k[0], 'M') elif k[2] == codeB[1]: v12 = 1 k = k.replace(k[2], 'N') codeB = codeB.replace(k[1], 'M') elif k[2] == codeB[3]: v12 = 1 k = k.replace(k[2], 'N') codeB = codeB.replace(k[3], 'M') else: x12 = 1 if k[3] == codeB[3]: p13 = 1 k = k.replace(k[3], 'N') codeB = codeB.replace(k[3], 'M') elif k[3] == codeB[0]: v13 = 1 k = k.replace(k[3], 'N') codeB = codeB.replace(k[0], 'M') elif k[3] == codeB[1]: v13 = 1 k = k.replace(k[3], 'N') codeB = codeB.replace(k[1], 'M') elif k[3] == codeB[2]: v13 = 1 k = k.replace(k[3], 'N') codeB = codeB.replace(k[2], 'M') else: x13 = 1 P = p10+p11+p12+p13 V = v10+v11+v12+v13 X = x10+x11+x12+x13 if P == 4: print('Congratulations! You won the game.') else: print(' P='+str(P)+',V='+str(V)+',X='+str(X)) codeC = code k = str(input('Turn #3 :')) p20 = 0; p21 = 0; p22 = 0; p23 = 0 v20 = 0; v21 = 0; v22 = 0; v23 = 0 x20 = 0; x21 = 0; x22 = 0; x23 = 0 if k[0] == codeC[0]: p20 = 1 k = k.replace(k[0], 'N') codeC = codeC.replace(k[0], 'M') elif k[0] == codeC[1]: v20 = 1 k = k.replace(k[0], 'N') codeC = codeC.replace(k[1], 'M') elif k[0] == codeC[2]: v20 = 1 k = k.replace(k[0], 'N') codeC = codeC.replace(k[2], 'M') elif k[0] == codeC[3]: v20 = 1 k = k.replace(k[0], 'N') codeC = codeC.replace(k[3], 'M') else: x20 = 1 if k[1] == codeC[1]: p21 = 1 k = k.replace(k[1], 'N') codeC = codeC.replace(k[1], 'M') elif k[1] == codeC[0]: v21 = 1 k = k.replace(k[1], 'N') codeC = codeC.replace(k[0], 'M') elif k[1] == codeC[2]: v21 = 1 k = k.replace(k[1], 'N') codeC = codeC.replace(k[2], 'M') elif k[1] == codeC[3]: v21 = 1 k = k.replace(k[1], 'N') codeC = codeC.replace(k[3], 'M') else: x21 = 1 if k[2] == codeC[2]: p22 = 1 k = k.replace(k[2], 'N') codeC = codeC.replace(k[2], 'M') elif k[2] == codeC[0]: v22 = 1 k = k.replace(k[2], 'N') codeC = codeC.replace(k[0], 'M') elif k[2] == codeC[1]: v22 = 1 k = k.replace(k[2], 'N') codeC = codeC.replace(k[1], 'M') elif k[2] == codeC[3]: v22 = 1 k = k.replace(k[2], 'N') codeC = codeC.replace(k[3], 'M') else: x22 = 1 if k[3] == codeC[3]: p23 = 1 k = k.replace(k[3], 'N') codeC = codeC.replace(k[3], 'M') elif k[3] == codeC[0]: v23 = 1 k = k.replace(k[3], 'N') codeC = codeC.replace(k[0], 'M') elif k[3] == codeC[1]: v23 = 1 k = k.replace(k[3], 'N') codeC = codeC.replace(k[0], 'M') elif k[3] == codeC[2]: v23 = 1 k = k.replace(k[3], 'N') codeC = codeC.replace(k[0], 'M') else: x23 = 1 P = p20+p21+p22+p23 V = v20+v21+v22+v23 X = x20+x21+x22+x23 if P == 4: print('Congratulations! You won the game.') else: codeD = code print(' P='+str(P)+',V='+str(V)+',X='+str(X)) k = str(input('Turn #4 :')) p30 = 0; p31 = 0; p32 = 0; p33 = 0 v30 = 0; v31 = 0; v32 = 0; v33 = 0 x30 = 0; x31 = 0; x32 = 0; x33 = 0 if k[0] == codeD[0]: p30 = 1 k = k.replace(k[0], 'N') codeD = codeD.replace(k[0], 'M') elif k[0] == codeD[1]: v30 = 1 k = k.replace(k[0], 'N') codeD = codeD.replace(k[1], 'M') elif k[0] == codeD[2]: v30 = 1 k = k.replace(k[0], 'N') codeD = codeD.replace(k[2], 'M') elif k[0] == codeD[3]: v30 = 1 k = k.replace(k[0], 'N') codeD = codeD.replace(k[3], 'M') else: x30 = 1 if k[1] == codeD[1]: p31 = 1 k = k.replace(k[1], 'N') codeD = codeD.replace(k[1], 'M') elif k[1] == codeD[0]: v31 = 1 k = k.replace(k[1], 'N') codeD = codeD.replace(k[0], 'M') elif k[1] == codeD[2]: v31 = 1 k = k.replace(k[1], 'N') codeD = codeD.replace(k[2], 'M') elif k[1] == codeD[3]: v31 = 1 k = k.replace(k[1], 'N') codeD = codeD.replace(k[3], 'M') else: x31 = 1 if k[2] == codeD[2]: p32 = 1 k = k.replace(k[2], 'N') codeD = codeD.replace(k[2], 'M') elif k[2] == codeD[0]: v32 = 1 k = k.replace(k[2], 'N') codeD = codeD.replace(k[0], 'M') elif k[2] == codeD[1]: v32 = 1 k = k.replace(k[2], 'N') codeD = codeD.replace(k[1], 'M') elif k[2] == codeD[3]: v32 = 1 k = k.replace(k[2], 'N') codeD = codeD.replace(k[3], 'M') else: x32 = 1 if k[3] == codeD[3]: p33 = 1 k = k.replace(k[3], 'N') codeD = codeD.replace(k[3], 'M') elif k[3] == codeD[0]: v33 = 1 k = k.replace(k[3], 'N') codeD = codeD.replace(k[0], 'M') elif k[3] == codeD[1]: v33 = 1 k = k.replace(k[3], 'N') codeD = codeD.replace(k[1], 'M') elif k[3] == codeD[2]: v33 = 1 k = k.replace(k[3], 'N') codeD = codeD.replace(k[2], 'M') else: x33 = 1 P = p30+p31+p32+p33 V = v30+v31+v32+v33 X = x30+x31+x32+x33 if P == 4: print(WINNING_MSG) else: print(' P='+str(P)+',V='+str(V)+',X='+str(X)) print(LOSING_MSG) print('The answer is '+code) print('Please try again...') #ทำไม่ไหวแล้วครับ ขอโทษด้วยจริง ๆ ครับ นอนซมไปแล้ว ขอบคุณมาก ๆ ครับ |
# 6330344321 (20.00) 197 (2021-02-15 23:17) turn = 1 guess = '' p,v,x = 0,0,0 if guess != code: guess = input('Turn #1 : ') if guess[0] not in code: x += 1 else: if guess[0] == code[0]: p += 1 else: v += 1 if guess[1] not in code: x += 1 else: if guess[1] == code[1]: p += 1 else: v += 1 if guess[2] not in code: x += 1 else: if guess[2] == code[2]: p += 1 else: v += 1 if guess[3] not in code: x += 1 else: if guess[3] == code[3]: p += 1 else: v += 1 if guess != code: print(' P=' + str(p) + ',V=' + str(v) + ',X=' + str(x)) #--------------------------------------------------- turn = 2 p,v,x = 0,0,0 if guess != code: guess = input('Turn #2 : ') if guess[0] not in code: x += 1 else: if guess[0] == code[0]: p += 1 else: v += 1 if guess[1] not in code: x += 1 else: if guess[1] == code[1]: p += 1 else: v += 1 if guess[2] not in code: x += 1 else: if guess[2] == code[2]: p += 1 else: v += 1 if guess[3] not in code: x += 1 else: if guess[3] == code[3]: p += 1 else: v += 1 if guess != code: print(' P=' + str(p) + ',V=' + str(v) + ',X=' + str(x)) #--------------------------------------------------- turn = 3 p,v,x = 0,0,0 if guess != code: guess = input('Turn #3 : ') if guess[0] not in code: x += 1 else: if guess[0] == code[0]: p += 1 else: v += 1 if guess[1] not in code: x += 1 else: if guess[1] == code[1]: p += 1 else: v += 1 if guess[2] not in code: x += 1 else: if guess[2] == code[2]: p += 1 else: v += 1 if guess[3] not in code: x += 1 else: if guess[3] == code[3]: p += 1 else: v += 1 if guess != code: print(' P=' + str(p) + ',V=' + str(v) + ',X=' + str(x)) #--------------------------------------------------- turn = 4 p,v,x = 0,0,0 if guess != code: guess = input('Turn #4 : ') if guess[0] not in code: x += 1 else: if guess[0] == code[0]: p += 1 else: v += 1 if guess[1] not in code: x += 1 else: if guess[1] == code[1]: p += 1 else: v += 1 if guess[2] not in code: x += 1 else: if guess[2] == code[2]: p += 1 else: v += 1 if guess[3] not in code: x += 1 else: if guess[3] == code[3]: p += 1 else: v += 1 if guess != code: print(' P=' + str(p) + ',V=' + str(v) + ',X=' + str(x)) #--------------------------------------------------- if guess == code: print(WINNING_MSG) else: print(LOSING_MSG) print('The answer is ', code) print('Please try again...') |
# 6330345021 (20.00) 198 (2021-02-11 12:41) p = 0 ; v = 0 ; x = 0 c1 = input("Turn #1 : ") if c1 == code: print(WINNING_MSG) else: if c1[0] == code[0]: p+=1 if c1[1] == code[1]: p+=1 if c1[2] == code[2]: p+=1 if c1[3] == code[3]: p+=1 if c1[0] in code: v+=1 if c1[1] in code: v+=1 if c1[2] in code: v+=1 if c1[3] in code: v+=1 print(" "*10+"P="+str(p)+",V="+str(v-p)+",X="+str(4-v)) #--------------------------------------------------- p = 0 ; v = 0 ; x = 0 if c1 != code: c2 = input("Turn #2 : ") if c2 == code: print(WINNING_MSG) else: if c2[0] == code[0]: p+=1 if c2[1] == code[1]: p+=1 if c2[2] == code[2]: p+=1 if c2[3] == code[3]: p+=1 if c2[0] in code: v+=1 if c2[1] in code: v+=1 if c2[2] in code: v+=1 if c2[3] in code: v+=1 print(" "*10+"P="+str(p)+",V="+str(v-p)+",X="+str(4-v)) #--------------------------------------------------- p = 0 ; v = 0 ; x = 0 if c1 != code and c2 != code: c3 = input("Turn #3 : ") if c3 == code: print(WINNING_MSG) else: if c3[0] == code[0]: p+=1 if c3[1] == code[1]: p+=1 if c3[2] == code[2]: p+=1 if c3[3] == code[3]: p+=1 if c3[0] in code: v+=1 if c3[1] in code: v+=1 if c3[2] in code: v+=1 if c3[3] in code: v+=1 print(" "*10+"P="+str(p)+",V="+str(v-p)+",X="+str(4-v)) #--------------------------------------------------- p = 0 ; v = 0 ; x = 0 if c1 != code and c2 != code and c3 != code: c4 = input("Turn #4 : ") if c4 == code: print(WINNING_MSG) else: if c4[0] == code[0]: p+=1 if c4[1] == code[1]: p+=1 if c4[2] == code[2]: p+=1 if c4[3] == code[3]: p+=1 if c4[0] in code: v+=1 if c4[1] in code: v+=1 if c4[2] in code: v+=1 if c4[3] in code: v+=1 print(" "*10+"P="+str(p)+",V="+str(v-p)+",X="+str(4-v)) print(LOSING_MSG) print("The answer is",code) print("Please try again...") |
# 6330346621 (17.27) 199 (2021-02-14 03:11) l=code p=0 v=0 x=0 c=input('Turn #1 :') if l[0]==c[0]: p+=1 elif l[0] in c : v+=1 else:x+=1 if l[1]==c[1]: p+=1 elif l[1] in c : v+=1 else:x+=1 if l[2]==c[2]: p+=1 elif l[2] in c : v+=1 else:x+=1 if l[3]==c[3]: p+=1 elif l[3] in c : v+=1 else:x+=1 if p==4:print(WINNING_MSG) else: print('\t P='+str(p)+',V='+str(v)+',X='+str(x)) p=0 v=0 x=0 c=input('Turn #2 :') if l[0]==c[0]: p+=1 elif l[0] in c : v+=1 else:x+=1 if l[1]==c[1]: p+=1 elif l[1] in c : v+=1 else:x+=1 if l[2]==c[2]: p+=1 elif l[2] in c : v+=1 else:x+=1 if l[3]==c[3]: p+=1 elif l[3] in c : v+=1 else:x+=1 if p==4:print(WINNING_MSG) else: print('\t P='+str(p)+',V='+str(v)+',X='+str(x)) p=0 v=0 x=0 c=input('Turn #3 :') if l[0]==c[0]: p+=1 elif l[0] in c : v+=1 else:x+=1 if l[1]==c[1]: p+=1 elif l[1] in c : v+=1 else:x+=1 if l[2]==c[2]: p+=1 elif l[2] in c : v+=1 else:x+=1 if l[3]==c[3]: p+=1 elif l[3] in c : v+=1 else:x+=1 if p==4:print(WINNING_MSG) else: print('\t P='+str(p)+',V='+str(v)+',X='+str(x)) p=0 v=0 x=0 c=input('Turn #4 :') if l[0]==c[0]: p+=1 elif l[0] in c : v+=1 else:x+=1 if l[1]==c[1]: p+=1 elif l[1] in c : v+=1 else:x+=1 if l[2]==c[2]: p+=1 elif l[2] in c : v+=1 else:x+=1 if l[3]==c[3]: p+=1 elif l[3] in c : v+=1 else:x+=1 if p==4:print(WINNING_MSG) else: print(LOSING_MSG) print('The answer is',code) print('Please try again...') #---------------------------------------------------A |
# 6330347221 (20.00) 200 (2021-02-14 21:30) turn1 = input('Turn #1 : ') P = 0 V = 0 X = 0 if turn1[0] == code[0]: P += 1 elif turn1[0] in code: V += 1 else: X += 1 if turn1[1] == code[1]: P += 1 elif turn1[1] in code: V += 1 else: X += 1 if turn1[2] == code[2]: P += 1 elif turn1[2] in code: V += 1 else: X += 1 if turn1[3] == code[3]: P += 1 elif turn1[3] in code: V += 1 else: X += 1 if turn1 == code: print(WINNING_MSG) else: print(' P=' +str(P)+',V='+str(V)+',X='+str(X)) #--------------------------------------------------- turn2 = input('Turn #2 : ') P = 0 V = 0 X = 0 if turn2[0] == code[0]: P += 1 elif turn2[0] in code: V += 1 else: X += 1 if turn2[1] == code[1]: P += 1 elif turn2[1] in code: V += 1 else: X += 1 if turn2[2] == code[2]: P += 1 elif turn2[2] in code: V += 1 else: X += 1 if turn2[3] == code[3]: P += 1 elif turn2[3] in code: V += 1 else: X += 1 if turn2 == code: print(WINNING_MSG) else: print(' P=' +str(P)+',V='+str(V)+',X='+str(X)) #--------------------------------------------------- turn3 = input('Turn #3 : ') P = 0 V = 0 X = 0 if turn3[0] == code[0]: P += 1 elif turn3[0] in code: V += 1 else: X += 1 if turn3[1] == code[1]: P += 1 elif turn3[1] in code: V += 1 else: X += 1 if turn3[2] == code[2]: P += 1 elif turn3[2] in code: V += 1 else: X += 1 if turn3[3] == code[3]: P += 1 elif turn3[3] in code: V += 1 else: X += 1 if turn3 == code: print(WINNING_MSG) else: print(' P=' +str(P)+',V='+str(V)+',X='+str(X)) #--------------------------------------------------- turn4 = input('Turn #4 : ') P = 0 V = 0 X = 0 if turn4[0] == code[0]: P += 1 elif turn4[0] in code: V += 1 else: X += 1 if turn4[1] == code[1]: P += 1 elif turn4[1] in code: V += 1 else: X += 1 if turn4[2] == code[2]: P += 1 elif turn4[2] in code: V += 1 else: X += 1 if turn4[3] == code[3]: P += 1 elif turn4[3] in code: V += 1 else: X += 1 if turn4 == code: print(WINNING_MSG) else: print(' P=' +str(P)+',V='+str(V)+',X='+str(X)) print(LOSING_MSG) print('The answer is ', code) print('Please try again...') |
# 6330348921 (19.89) 201 (2021-02-12 17:59) P = 0 V = 0 X = 0 Turn1= input('Turn #1 : ') if Turn1 == code: print(WINNING_MSG) else: if Turn1[0] == code[0]: P += 1 if Turn1[1] == code[1]: P += 1 if Turn1[2] == code[2]: P += 1 if Turn1[3] == code[3]: P += 1 if Turn1[0] in code: V += 1 if Turn1[1] in code: V += 1 if Turn1[2] in code: V += 1 if Turn1[3] in code: V += 1 V += -P if Turn1[0] in code: pass else: X += 1 if Turn1[1] in code: pass else: X += 1 if Turn1[2] in code: pass else: X += 1 if Turn1[3] in code: pass else: X += 1 print(10*' '+'P='+str(P) +','+'V='+str(V) + ','+'X='+str(X) ) P = 0 V = 0 X = 0 Turn2= input('Turn #2 : ') if Turn2 == code: print('Congratulations! You won the game.') else: if Turn2[0] == code[0]: P += 1 if Turn2[1] == code[1]: P += 1 if Turn2[2] == code[2]: P += 1 if Turn2[3] == code[3]: P += 1 if Turn2[0] in code: V += 1 if Turn2[1] in code: V += 1 if Turn2[2] in code: V += 1 if Turn2[3] in code: V += 1 V += -P if Turn2[0] in code: pass else: X += 1 if Turn2[1] in code: pass else: X += 1 if Turn2[2] in code: pass else: X += 1 if Turn2[3] in code: pass else: X += 1 print(10*' '+'P='+str(P) +','+'V='+str(V) + ','+'X='+str(X) ) P = 0 V = 0 X = 0 Turn3= input('Turn #3 : ') if Turn3 == code: print('Congratulations! You won the game.') else: if Turn3[0] == code[0]: P += 1 if Turn3[1] == code[1]: P += 1 if Turn3[2] == code[2]: P += 1 if Turn3[3] == code[3]: P += 1 if Turn3[0] in code: V += 1 if Turn3[1] in code: V += 1 if Turn3[2] in code: V += 1 if Turn3[3] in code: V += 1 V += -P if Turn3[0] in code: pass else: X += 1 if Turn3[1] in code: pass else: X += 1 if Turn3[2] in code: pass else: X += 1 if Turn3[3] in code: pass else: X += 1 print(10*' '+'P='+str(P) +','+'V='+str(V) + ','+'X='+str(X) ) P = 0 V = 0 X = 0 Turn4= input('Turn #4 : ') if Turn4 == code: print('Congratulations! You won the game.') else: if Turn4[0] == code[0]: P += 1 if Turn4[1] == code[1]: P += 1 if Turn4[2] == code[2]: P += 1 if Turn4[3] == code[3]: P += 1 if Turn4[0] in code: V += 1 if Turn4[1] in code: V += 1 if Turn4[2] in code: V += 1 if Turn4[3] in code: V += 1 V += -P if Turn4[0] in code: pass else: X += 1 if Turn4[1] in code: pass else: X += 1 if Turn4[2] in code: pass else: X += 1 if Turn4[3] in code: pass else: X += 1 print(10*' '+'P='+str(P) +','+'V='+str(V) + ','+'X='+str(X) ) print(LOSING_MSG) print('The answer is',code) print('Please try agian...') |
# 6330349521 (20.00) 202 (2021-02-15 00:30) lc = list(code) t1 = input("Turn #1 : ") if t1==code: print(WINNING_MSG) else: P=0 V=0 X=0 if t1[0] in lc: if t1[0]==code[0]: P += 1 else: V += 1 else: X += 1 if t1[1] in lc: if t1[1]==code[1]: P += 1 else: V += 1 else: X += 1 if t1[2] in lc: if t1[2]==code[2]: P += 1 else: V += 1 else: X += 1 if t1[3] in lc: if t1[3]==code[3]: P += 1 else: V += 1 else: X += 1 print('\t '+"P="+str(P)+",V="+str(V)+",X="+str(X)) t2 = input("Turn #2 : ") if t2==code: print(WINNING_MSG) else: P=0 V=0 X=0 if t2[0] in lc: if t2[0]==code[0]: P += 1 else: V += 1 else: X += 1 if t2[1] in lc: if t2[1]==code[1]: P += 1 else: V += 1 else: X += 1 if t2[2] in lc: if t2[2]==code[2]: P += 1 else: V += 1 else: X += 1 if t2[3] in lc: if t2[3]==code[3]: P += 1 else: V += 1 else: X += 1 print('\t '+"P="+str(P)+",V="+str(V)+",X="+str(X)) t3 = input("Turn #3 : ") if t3==code: print(WINNING_MSG) else: P=0 V=0 X=0 if t3[0] in lc: if t3[0]==code[0]: P += 1 else: V += 1 else: X += 1 if t3[1] in lc: if t3[1]==code[1]: P += 1 else: V += 1 else: X += 1 if t3[2] in lc: if t3[2]==code[2]: P += 1 else: V += 1 else: X += 1 if t3[3] in lc: if t3[3]==code[3]: P += 1 else: V += 1 else: X += 1 print('\t '+"P="+str(P)+",V="+str(V)+",X="+str(X)) t4 = input("Turn #4 : ") if t4==code: print(WINNING_MSG) else: P=0 V=0 X=0 if t4[0] in lc: if t4[0]==code[0]: P += 1 else: V += 1 else: X += 1 if t4[1] in lc: if t4[1]==code[1]: P += 1 else: V += 1 else: X += 1 if t4[2] in lc: if t4[2]==code[2]: P += 1 else: V += 1 else: X += 1 if t4[3] in lc: if t4[3]==code[3]: P += 1 else: V += 1 else: X += 1 print('\t '+"P="+str(P)+",V="+str(V)+",X="+str(X)) print(LOSING_MSG) print("The answer is", code) print('Please try again...') |
# 6330350021 (20.00) 203 (2021-02-15 15:30) a = input('Turn #1 : ') P = 0 X = 0 if a[0] == code[0] : P += 1 if a[1] == code[1] : P += 1 if a[2] == code[2] : P += 1 if a[3] == code[3] : P += 1 if a[0] not in code : X += 1 if a[1] not in code : X += 1 if a[2] not in code : X += 1 if a[3] not in code : X += 1 V = 4-P-X P = str(P) V = str(V) X = str(X) if P == '4' : print(WINNING_MSG) else: print(' P='+P+',V='+V+',X='+X) a = input('Turn #2 : ') P = 0 X = 0 if a[0] == code[0] : P += 1 if a[1] == code[1] : P += 1 if a[2] == code[2] : P += 1 if a[3] == code[3] : P += 1 if a[0] not in code : X += 1 if a[1] not in code : X += 1 if a[2] not in code : X += 1 if a[3] not in code : X += 1 V = 4-P-X P = str(P) V = str(V) X = str(X) if P == '4' : print(WINNING_MSG) else: print(' P='+P+',V='+V+',X='+X) a = input('Turn #3 : ') P = 0 X = 0 if a[0] == code[0] : P += 1 if a[1] == code[1] : P += 1 if a[2] == code[2] : P += 1 if a[3] == code[3] : P += 1 if a[0] not in code : X += 1 if a[1] not in code : X += 1 if a[2] not in code : X += 1 if a[3] not in code : X += 1 V = 4-P-X P = str(P) V = str(V) X = str(X) if P == '4' : print(WINNING_MSG) else: print(' P='+P+',V='+V+',X='+X) a = input('Turn #4 : ') P = 0 X = 0 if a[0] == code[0] : P += 1 if a[1] == code[1] : P += 1 if a[2] == code[2] : P += 1 if a[3] == code[3] : P += 1 if a[0] not in code : X += 1 if a[1] not in code : X += 1 if a[2] not in code : X += 1 if a[3] not in code : X += 1 V = 4-P-X P = str(P) V = str(V) X = str(X) if P == '4' : print(WINNING_MSG) else: print(' P='+P+',V='+V+',X='+X) print(LOSING_MSG) print('The answer is',code) print('Please try again...') |
# 6330351721 (20.00) 204 (2021-02-12 22:46) P = 0 V = 0 X = 0 ans1 = input('Turn #1 : ') if ans1 == code: print(WINNING_MSG) else: if ans1[0] == code[0]: P += 1 elif ans1[0] in code: V += 1 else: X += 1 if ans1[1] == code[1]: P += 1 elif ans1[1] in code: V += 1 else: X += 1 if ans1[2] == code[2]: P += 1 elif ans1[2] in code: V += 1 else: X += 1 if ans1[3] == code[3]: P += 1 elif ans1[3] in code: V += 1 else: X += 1 print(' P='+str(P)+',V='+str(V)+',X='+str(X)) P = 0 V = 0 X = 0 ans2 = input('Turn #2 : ') if ans2 == code: print(WINNING_MSG) else: if ans2[0] == code[0]: P += 1 elif ans2[0] in code: V += 1 else: X += 1 if ans2[1] == code[1]: P += 1 elif ans2[1] in code: V += 1 else: X += 1 if ans2[2] == code[2]: P += 1 elif ans2[2] in code: V += 1 else: X += 1 if ans2[3] == code[3]: P += 1 elif ans2[3] in code: V += 1 else: X += 1 print(' P='+str(P)+',V='+str(V)+',X='+str(X)) P = 0 V = 0 X = 0 ans3 = input('Turn #3 : ') if ans3 == code: print(WINNING_MSG) else: if ans3[0] == code[0]: P += 1 elif ans3[0] in code: V += 1 else: X += 1 if ans3[1] == code[1]: P += 1 elif ans3[1] in code: V += 1 else: X += 1 if ans3[2] == code[2]: P += 1 elif ans3[2] in code: V += 1 else: X += 1 if ans3[3] == code[3]: P += 1 elif ans3[3] in code: V += 1 else: X += 1 print(' P='+str(P)+',V='+str(V)+',X='+str(X)) P = 0 V = 0 X = 0 ans4 = input('Turn #4 : ') if ans4 == code: print(WINNING_MSG) else: if ans4[0] == code[0]: P += 1 elif ans4[0] in code: V += 1 else: X += 1 if ans4[1] == code[1]: P += 1 elif ans4[1] in code: V += 1 else: X += 1 if ans4[2] == code[2]: P += 1 elif ans4[2] in code: V += 1 else: X += 1 if ans4[3] == code[3]: P += 1 elif ans4[3] in code: V += 1 else: X += 1 print(' P='+str(P)+',V='+str(V)+',X='+str(X)) print(LOSING_MSG) print('The answer is '+str(code)) print('Please try again...') |
# 6330352321 (17.37) 205 (2021-02-12 12:26) guess1 = input("Turn #1 : ") p1 = 0 v1 = 0 x1 = 0 if guess1[0] in code : if guess1[0] == code[0] : p1 += 1 else : v1 += 1 else : x1 += 1 if guess1[1] in code : if guess1[1] == code[1] : p1 += 1 else : v1 += 1 else : x1 += 1 if guess1[2] in code : if guess1[2] == code[2] : p1 += 1 else : v1 += 1 else : x1 += 1 if guess1[3] in code : if guess1[3] == code[3] : p1 += 1 else : v1 += 1 else : x1 += 1 if p1 == 4 : print(WINNING_MSG) else : print(" P="+str(p1)+",V="+str(v1)+",X="+str(x1)) guess2 = input("Turn #2 : ") p2 = 0 v2 = 0 x2 = 0 if guess2[0] in code : if guess2[0] == code[0] : p2 += 1 else : v2 += 1 else : x2 += 1 if guess2[1] in code : if guess2[1] == code[1] : p2 += 1 else : v2 += 1 else : x2 += 1 if guess2[2] in code : if guess2[2] == code[2] : p2 += 1 else : v2 += 1 else : x2 += 1 if guess2[3] in code : if guess2[3] == code[3] : p2 += 1 else : v2 += 1 else : x2 += 1 if p2 == 4 : print(WINNING_MSG) else : print(" P="+str(p2)+",V="+str(v2)+",X="+str(x2)) guess3 = input("Turn #3 : ") p3 = 0 v3 = 0 x3 = 0 if guess3[0] in code : if guess3[0] == code[0] : p3 += 1 else : v3 += 1 else : x3 += 1 if guess3[1] in code : if guess3[1] == code[1] : p3 += 1 else : v3 += 1 else : x3 += 1 if guess3[2] in code : if guess3[2] == code[2] : p3 += 1 else : v3 += 1 else : x3 += 1 if guess3[3] in code : if guess3[3] == code[3] : p3 += 1 else : v3 += 1 else : x3 += 1 if p3 == 4 : print(WINNING_MSG) else : print(" P="+str(p3)+",V="+str(v3)+",X="+str(x3)) guess4 = input("Turn #4 : ") p4 = 0 v4 = 0 x4 = 0 if guess4[0] in code : if guess4[0] == code[0] : p4 += 1 else : v4 += 1 else : x4 += 1 if guess4[1] in code : if guess4[1] == code[1] : p4 += 1 else : v4 += 1 else : x4 += 1 if guess4[2] in code : if guess4[2] == code[2] : p4 += 1 else : v4 += 1 else : x4 += 1 if guess4[3] in code : if guess4[3] == code[3] : p4 += 1 else : v4 += 1 else : x4 += 1 if p4 == 4 : print(WINNING_MSG) else : print(LOSING_MSG) print("The answer is "+str(code)) print("Please try again...") |
# 6330353021 (19.29) 206 (2021-02-13 01:58) I = input('Turn #1 : ') P,V,X = 0,0,0 if code[0] == I[0] : P += 1 else : if code[0] in I : V += 1 else : X += 1 if code[1] == I[1] : P += 1 else : if code[1] in I : V += 1 else : X += 1 if code[2] == I[2] : P += 1 else : if code[2] in I : V += 1 else : X += 1 if code[3] == I[3] : P += 1 else : if code[3] in I : V += 1 else : X += 1 if P == 4 and V == 0 and X == 0 : print(WINNING_MSG) else : print(' P='+str(P)+',V='+str(V)+',X='+str(X)) I = input('Turn #2 : ') P,V,X = 0,0,0 if code[0] == I[0] : P += 1 else : if code[0] in I : V += 1 else : X += 1 if code[1] == I[1] : P += 1 else : if code[1] in I : V += 1 else : X += 1 if code[2] == I[2] : P += 1 else : if code[2] in I : V += 1 else : X += 1 if code[3] == I[3] : P += 1 else : if code[3] in I : V += 1 else : X += 1 if P == 4 and V == 0 and X == 0 : print(WINNING_MSG) else : print(' P='+str(P)+',V='+str(V)+',X='+str(X)) I = input('Turn #3 : ') P,V,X = 0,0,0 if code[0] == I[0] : P += 1 else : if code[0] in I : V += 1 else : X += 1 if code[1] == I[1] : P += 1 else : if code[1] in I : V += 1 else : X += 1 if code[2] == I[2] : P += 1 else : if code[2] in I : V += 1 else : X += 1 if code[3] == I[3] : P += 1 else : if code[3] in I : V += 1 else : X += 1 if P == 4 and V == 0 and X == 0 : print(WINNING_MSG) else : print(' P='+str(P)+',V='+str(V)+',X='+str(X)) I = input('Turn #4 : ') P,V,X = 0,0,0 if code[0] == I[0] : P += 1 else : if code[0] in I : V += 1 else : X += 1 if code[1] == I[1] : P += 1 else : if code[1] in I : V += 1 else : X += 1 if code[2] == I[2] : P += 1 else : if code[2] in I : V += 1 else : X += 1 if code[3] == I[3] : P += 1 else : if code[3] in I : V += 1 else : X += 1 if P == 4 and V == 0 and X == 0 : print(WINNING_MSG) else : print(' P='+str(P)+',V='+str(V)+',X='+str(X)) print(LOSING_MSG) print('The answer is'+' '+code) print('Please try again...') |
# 6330354621 (16.74) 207 (2021-02-15 11:31) p=0 v=0 x=0 A=input('Turn #1 : ') #--------หา v,p,x รอบ 1 if A[0] == code[0]: p+=1 elif A[0] in code: v+=1 else: x+=1 if A[1] == code[1]: p+=1 elif A[1] in code: v+=1 else: x+=1 if A[2] == code[2]: p+=1 elif A[2] in code: v+=1 else: x+=1 if A[3] == code[3]: p+=1 elif A[3] in code: v+=1 else: x+=1 print('\t P='+str(p)+','+'V='+str(v)+','+'X='+str(x)) if p==4: print('WINNING_MSG') else:#--------หา v,p,x รอบ 2 A=input('Turn #2 : ') p=0 v=0 x=0 if A[0] == code[0]: p+=1 elif A[0] in code: v+=1 else: x+=1 if A[1] == code[1]: p+=1 elif A[1] in code: v+=1 else: x+=1 if A[2] == code[2]: p+=1 elif A[2] in code: v+=1 else: x+=1 if A[3] == code[3]: p+=1 elif A[3] in code: v+=1 else: x+=1 print('\t P='+str(p)+','+'V='+str(v)+','+'X='+str(x)) if p==4: print('WINNING_MSG') else:#--------หา v,p,x รอบ3 A=input('Turn #3 : ') p=0 v=0 x=0 if A[0] == code[0]: p+=1 elif A[0] in code: v+=1 else: x+=1 if A[1] == code[1]: p+=1 elif A[1] in code: v+=1 else: x+=1 if A[2] == code[2]: p+=1 elif A[2] in code: v+=1 else: x+=1 if A[3] == code[3]: p+=1 elif A[3] in code: v+=1 else: x+=1 print('\t P='+str(p)+','+'V='+str(v)+','+'X='+str(x)) if p==4: print('WINNING_MSG') else:#--------หา v,p,x รอบ4 A=input('Turn #4 : ') p=0 v=0 x=0 if A[0] == code[0]: p+=1 elif A[0] in code: v+=1 else: x+=1 if A[1] == code[1]: p+=1 elif A[1] in code: v+=1 else: x+=1 if A[2] == code[2]: p+=1 elif A[2] in code: v+=1 else: x+=1 if A[3] == code[3]: p+=1 elif A[3] in code: v+=1 else: x+=1 print('\t P='+str(p)+','+'V='+str(v)+','+'X='+str(x)) if p==4: print(WINNING_MSG) else: print(LOSING_MSG) print('the answer is',code) print("""Please try again...""") |
# 6330355221 (20.00) 208 (2021-02-13 20:38) x = input("Turn #1 : ") x1 = x[0] ; x2 = x[1] x3 = x[2] ; x4 = x[3] c1 = code[0] ; c2 = code[1] c3 = code[2] ; c4 = code[3] J = 0 ; F = 0 ; K = 0 if x == code : print("Congratulations! You won the game.") else : if x1 == c1 : J+=1 if x2 == c2 : J+=1 if x3 == c3 : J+=1 if x4 == c4 : J+=1 if x1 in code : F+=1 if x2 in code : F+=1 if x3 in code : F+=1 if x4 in code : F+=1 if x1 not in code : K+=1 if x2 not in code : K+=1 if x3 not in code : K+=1 if x4 not in code : K+=1 if J == 4 : print(WINNING_MSG) else : print(" P="+str(J)+","+"V="+str(int(F-J))+","+"X="+str(K)) y = input("Turn #2 : ") y1 = y[0] ; y2 = y[1] y3 = y[2] ; y4 = y[3] P2 = 0 ; V2 = 0 ; X2 = 0 if y1 == c1 : P2+=1 if y2 == c2 : P2+=1 if y3 == c3 : P2+=1 if y4 == c4 : P2+=1 if y1 in code : V2+=1 if y2 in code : V2+=1 if y3 in code : V2+=1 if y4 in code : V2+=1 if y1 not in code : X2+=1 if y2 not in code : X2+=1 if y3 not in code : X2+=1 if y4 not in code : X2+=1 if P2 == 4 : print(WINNING_MSG) else : print(" P="+str(P2)+","+"V="+str(int(V2-P2))+","+"X="+str(X2)) z = input("Turn #3 : ") z1 = z[0] ; z2 = z[1] z3 = z[2] ; z4 = z[3] P3 = 0 ; V3 = 0 ; X3 = 0 if z1 == c1 : P3+=1 if z2 == c2 : P3+=1 if z3 == c3 : P3+=1 if z4 == c4 : P3+=1 if z1 in code : V3+=1 if z2 in code : V3+=1 if z3 in code : V3+=1 if z4 in code : V3+=1 if z1 not in code : X3+=1 if z2 not in code : X3+=1 if z3 not in code : X3+=1 if z4 not in code : X3+=1 if P3 == 4 : print(WINNING_MSG) else : print(" P="+str(P3)+","+"V="+str(int(V3-P3))+","+"X="+str(X3)) Final = input("Turn #4 : ") Fa = Final[0] Fb = Final[1] Fc = Final[2] Fd = Final[3] P4 = 0 V4 = 0 X4 = 0 if Fa == c1 : P4+=1 if Fb == c2 : P4+=1 if Fc == c3 : P4+=1 if Fd == c4 : P4+=1 if Fa in code : V4+=1 if Fb in code : V4+=1 if Fc in code : V4+=1 if Fd in code : V4+=1 if Fa not in code : X4+=1 if Fb not in code : X4+=1 if Fc not in code : X4+=1 if Fd not in code : X4+=1 if P4 == 4 : print(WINNING_MSG) else : print(" P="+str(P4)+","+"V="+str(int(V4-P4))+","+"X="+str(X4)) print(LOSING_MSG) print("The answer is "+str(code)) print("Please try again...") |
# 6330356921 (20.00) 209 (2021-02-11 21:17) k = input('Turn #1 : ') v = 0 x = 0 p = 0 if k[0] in code : v +=1 if k[0] not in code : x +=1 if k[1] in code : v +=1 if k[1] not in code : x +=1 if k[2] in code : v +=1 if k[2] not in code : x +=1 if k[3] in code : v +=1 if k[3] not in code : x +=1 if k[0]==code[0] : v -=1 p +=1 if k[1]==code[1] : v -=1 p +=1 if k[2]==code[2] : v -=1 p +=1 if k[3]==code[3] : v -=1 p +=1 if p==4 : print(WINNING_MSG) exit() print(" "+"P=" +str(p)+ ",V=" + str(v) +",X=" +str(x)) k = input('Turn #2 : ') v = 0 x = 0 p = 0 if k[0] in code : v +=1 if k[0] not in code : x +=1 if k[1] in code : v +=1 if k[1] not in code : x +=1 if k[2] in code : v +=1 if k[2] not in code : x +=1 if k[3] in code : v +=1 if k[3] not in code : x +=1 if k[0]==code[0] : v -=1 p +=1 if k[1]==code[1] : v -=1 p +=1 if k[2]==code[2] : v -=1 p +=1 if k[3]==code[3] : v -=1 p +=1 if p==4 : print(WINNING_MSG) exit() print(" "+"P=" +str(p)+ ",V=" + str(v) +",X=" +str(x)) k = input('Turn #3 : ') v = 0 x = 0 p = 0 if k[0] in code : v +=1 if k[0] not in code : x +=1 if k[1] in code : v +=1 if k[1] not in code : x +=1 if k[2] in code : v +=1 if k[2] not in code : x +=1 if k[3] in code : v +=1 if k[3] not in code : x +=1 if k[0]==code[0] : v -=1 p +=1 if k[1]==code[1] : v -=1 p +=1 if k[2]==code[2] : v -=1 p +=1 if k[3]==code[3] : v -=1 p +=1 if p==4 : print(WINNING_MSG) exit() print(" "+"P=" +str(p)+ ",V=" + str(v) +",X=" +str(x)) k = input('Turn #4 : ') v = 0 x = 0 p = 0 if k[0] in code : v +=1 if k[0] not in code : x +=1 if k[1] in code : v +=1 if k[1] not in code : x +=1 if k[2] in code : v +=1 if k[2] not in code : x +=1 if k[3] in code : v +=1 if k[3] not in code : x +=1 if k[0]==code[0] : v -=1 p +=1 if k[1]==code[1] : v -=1 p +=1 if k[2]==code[2] : v -=1 p +=1 if k[3]==code[3] : v -=1 p +=1 if p==4 : print(WINNING_MSG) else : print(" "+"P=" +str(p)+ ",V=" + str(v) +",X=" +str(x)) print(LOSING_MSG) print('The answer is ' +code) print("Please try again...") |
# 6330357521 (2.17) 210 (2021-02-15 16:04) win = False code = 'DECF' Na = input('TURN #1 : ') x,y,z = [e for e in [0]*3] if code[0] == Na[0]: x += 1 if code[1] == Na[1]: x += 1 if code[2] == Na[2]: x += 1 if code[3] == Na[3]: x += 1 if x == 4: win = True if not win: if code[0] != Na[0] and Na[0] in code: y += 1 if Na[0] not in code: y += 1 if code[1] != Na[1] and Na[1] in code: y += 1 if Na[1] not in code: z += 1 if code[2] != Na[2] and Na[2] in code: y += 1 if Na[2] not in code: z += 1 if code[3] != Na[3] and Na[3] in code: y += 1 if Na[3] not in code: z += 1 print(len('TURN #1 : ')*' '+f'X={x},Y={y},Z={z}') x,y,z = [e for e in [0]*3] Na = input('TURN #2 : ') if code[0] == Na[0]: x += 1 if code[1] == Na[1]: x += 1 if code[2] == Na[2]: x += 1 if code[3] == Na[3]: x += 1 if x == 4: win = True if not win: if code[0] != Na[0] and Na[0] in code: y += 1 if Na[0] not in code: z += 1 if code[1] != Na[1] and Na[1] in code: y += 1 if Na[1] not in code: z += 1 if code[2] != Na[2] and Na[2] in code: y += 1 if Na[2] not in code: z += 1 if code[3] != Na[3] and Na[3] in code: y += 1 if Na[3] not in code: z += 1 print(len('TURN #1 : ')*' '+f'X={x},Y={y},Z={z}') x,y,z = [e for e in [0]*3] Na = input('TURN #3 : ') if code[0] == Na[0]: x += 1 if code[1] == Na[1]: x += 1 if code[2] == Na[2]: x += 1 if code[3] == Na[3]: x += 1 if x == 4: win = True if not win: if code[0] != Na[0] and Na[0] in code: y += 1 if Na[0] not in code: z += 1 if code[1] != Na[1] and Na[1] in code: y += 1 if Na[1] not in code: z += 1 if code[2] != Na[2] and Na[2] in code: y += 1 if Na[2] not in code: z += 1 if code[3] != Na[3] and Na[3] in code: y += 1 if Na[3] not in code: z += 1 print(len('TURN #1 : ')*' '+f'X={x},Y={y},Z={z}') x,y,z = [e for e in [0]*3] Na = input('TURN #4 : ') if code[0] == Na[0]: x += 1 if code[1] == Na[1]: x += 1 if code[2] == Na[2]: x += 1 if code[3] == Na[3]: x += 1 if x == 4: win = True if not win: if code[0] != Na[0] and Na[0] in code: y += 1 if Na[0] not in code: z += 1 if code[1] != Na[1] and Na[1] in code: y += 1 if Na[1] not in code: z += 1 if code[2] != Na[2] and Na[2] in code: y += 1 if Na[2] not in code: z += 1 if code[3] != Na[3] and Na[3] in code: y += 1 if Na[3] not in code: z += 1 print(len('TURN #1 : ')*' '+f'X={x},Y={y},Z={z}') if win: print(WINNING_MSG) else: print(LOSING_MSG) print(f'The answer is {code}') print('Please try again...') |
# 6330358121 (20.00) 211 (2021-02-12 01:39) t=input('Turn #1 : ') P=int(t[0]==code[0])+int(t[1]==code[1])+int(t[2]==code[2])\ +int(t[3]==code[3]) Q=int(t[0] in code)+int(t[1] in code)+int(t[2] in code)\ +int(t[3] in code) V=Q-P;X=4-P-V if P==4:print(WINNING_MSG) else: print('P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) t=input('Turn #2 : ') P=int(t[0]==code[0])+int(t[1]==code[1])+int(t[2]==code[2])\ +int(t[3]==code[3]) Q=int(t[0] in code)+int(t[1] in code)+int(t[2] in code)\ +int(t[3] in code) V=Q-P;X=4-P-V if P==4:print(WINNING_MSG) else: print('P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) t=input('Turn #3 : ') P=int(t[0]==code[0])+int(t[1]==code[1])+int(t[2]==code[2])\ +int(t[3]==code[3]) Q=int(t[0] in code)+int(t[1] in code)+int(t[2] in code)\ +int(t[3] in code) V=Q-P;X=4-P-V if P==4:print(WINNING_MSG) else: print('P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) t=input('Turn #4 : ') P=int(t[0]==code[0])+int(t[1]==code[1])+int(t[2]==code[2])\ +int(t[3]==code[3]) Q=int(t[0] in code)+int(t[1] in code)+int(t[2] in code)\ +int(t[3] in code) V=Q-P;X=4-P-V if P==4:print(WINNING_MSG) else: print('P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) print(LOSING_MSG) print('The answer is ',code) print('Please try again...') |
# 6330360321 (20.00) 212 (2021-02-15 19:28) code_input = input('Turn #1 : ') if ( code_input == code) : print('Congratulations! You won the game.' ) else : alist = list(code) blist = list(code_input) v = 0 x = 0 P = int(alist[0] == blist[0])+int(alist[1] == blist[1])+int(alist[2] == blist[2])+int(alist[3] == blist[3]) if ((alist[0] != blist[0]) and ( (alist[0] == blist[1]) or (alist[0] == blist[2]) or (alist[0] == blist[3]))) : v += 1 elif ((alist[0] != blist[0]) and ( (alist[0] != blist[1]) and (alist[0] != blist[2]) and (alist[0] != blist[1]))) : x += 1 if ((alist[1] != blist[1]) and ( (alist[1] == blist[0]) or (alist[1] == blist[2]) or (alist[1] == blist[3]))) : v += 1 elif ((alist[1] != blist[1]) and ( (alist[1] != blist[0]) and (alist[1] != blist[2]) and (alist[1] != blist[0]))) : x += 1 if ((alist[2] != blist[2]) and ( (alist[2] == blist[1]) or (alist[2] == blist[0]) or (alist[2] == blist[3]))) : v += 1 elif ((alist[2] != blist[2]) and ( (alist[2] != blist[1]) and (alist[2] != blist[0]) and (alist[2] != blist[0]))) : x += 1 if ((alist[3] != blist[3]) and ( (alist[3] == blist[1]) or (alist[3] == blist[2]) or (alist[3] == blist[0]))) : v += 1 elif ((alist[3] != blist[3]) and ( (alist[3] != blist[1]) and (alist[3] != blist[2]) and (alist[3] != blist[0]))) : x += 1 print(' P=' + str(P)+',V=' + str(v) + ',X='+ str(x)) code_input = input('Turn #2 : ') if ( code_input == code) : print('Congratulations! You won the game.' ) else : alist = list(code) blist = list(code_input) v = 0 x = 0 P = int(alist[0] == blist[0])+int(alist[1] == blist[1])+int(alist[2] == blist[2])+int(alist[3] == blist[3]) if ((alist[0] != blist[0]) and ( (alist[0] == blist[1]) or (alist[0] == blist[2]) or (alist[0] == blist[3]))) : v += 1 elif ((alist[0] != blist[0]) and ( (alist[0] != blist[1]) and (alist[0] != blist[2]) and (alist[0] != blist[1]))) : x += 1 if ((alist[1] != blist[1]) and ( (alist[1] == blist[0]) or (alist[1] == blist[2]) or (alist[1] == blist[3]))) : v += 1 elif ((alist[1] != blist[1]) and ( (alist[1] != blist[0]) and (alist[1] != blist[2]) and (alist[1] != blist[0]))) : x += 1 if ((alist[2] != blist[2]) and ( (alist[2] == blist[1]) or (alist[2] == blist[0]) or (alist[2] == blist[3]))) : v += 1 elif ((alist[2] != blist[2]) and ( (alist[2] != blist[1]) and (alist[2] != blist[0]) and (alist[2] != blist[0]))) : x += 1 if ((alist[3] != blist[3]) and ( (alist[3] == blist[1]) or (alist[3] == blist[2]) or (alist[3] == blist[0]))) : v += 1 elif ((alist[3] != blist[3]) and ( (alist[3] != blist[1]) and (alist[3] != blist[2]) and (alist[3] != blist[0]))) : x += 1 print(' P=' + str(P)+',V=' + str(v) + ',X='+ str(x)) code_input = input('Turn #3 : ') if ( code_input == code) : print('Congratulations! You won the game.' ) else : alist = list(code) blist = list(code_input) v = 0 x = 0 P = int(alist[0] == blist[0])+int(alist[1] == blist[1])+int(alist[2] == blist[2])+int(alist[3] == blist[3]) if ((alist[0] != blist[0]) and ( (alist[0] == blist[1]) or (alist[0] == blist[2]) or (alist[0] == blist[3]))) : v += 1 elif ((alist[0] != blist[0]) and ( (alist[0] != blist[1]) and (alist[0] != blist[2]) and (alist[0] != blist[1]))) : x += 1 if ((alist[1] != blist[1]) and ( (alist[1] == blist[0]) or (alist[1] == blist[2]) or (alist[1] == blist[3]))) : v += 1 elif ((alist[1] != blist[1]) and ( (alist[1] != blist[0]) and (alist[1] != blist[2]) and (alist[1] != blist[0]))) : x += 1 if ((alist[2] != blist[2]) and ( (alist[2] == blist[1]) or (alist[2] == blist[0]) or (alist[2] == blist[3]))) : v += 1 elif ((alist[2] != blist[2]) and ( (alist[2] != blist[1]) and (alist[2] != blist[0]) and (alist[2] != blist[0]))) : x += 1 if ((alist[3] != blist[3]) and ( (alist[3] == blist[1]) or (alist[3] == blist[2]) or (alist[3] == blist[0]))) : v += 1 elif ((alist[3] != blist[3]) and ( (alist[3] != blist[1]) and (alist[3] != blist[2]) and (alist[3] != blist[0]))) : x += 1 print(' P=' + str(P)+',V=' + str(v) + ',X='+ str(x)) code_input = input('Turn #4 : ') if ( code_input == code) : print('Congratulations! You won the game.' ) else : alist = list(code) blist = list(code_input) v = 0 x = 0 P = int(alist[0] == blist[0])+int(alist[1] == blist[1])+int(alist[2] == blist[2])+int(alist[3] == blist[3]) if ((alist[0] != blist[0]) and ( (alist[0] == blist[1]) or (alist[0] == blist[2]) or (alist[0] == blist[3]))) : v += 1 elif ((alist[0] != blist[0]) and ( (alist[0] != blist[1]) and (alist[0] != blist[2]) and (alist[0] != blist[1]))) : x += 1 if ((alist[1] != blist[1]) and ( (alist[1] == blist[0]) or (alist[1] == blist[2]) or (alist[1] == blist[3]))) : v += 1 elif ((alist[1] != blist[1]) and ( (alist[1] != blist[0]) and (alist[1] != blist[2]) and (alist[1] != blist[0]))) : x += 1 if ((alist[2] != blist[2]) and ( (alist[2] == blist[1]) or (alist[2] == blist[0]) or (alist[2] == blist[3]))) : v += 1 elif ((alist[2] != blist[2]) and ( (alist[2] != blist[1]) and (alist[2] != blist[0]) and (alist[2] != blist[0]))) : x += 1 if ((alist[3] != blist[3]) and ( (alist[3] == blist[1]) or (alist[3] == blist[2]) or (alist[3] == blist[0]))) : v += 1 elif ((alist[3] != blist[3]) and ( (alist[3] != blist[1]) and (alist[3] != blist[2]) and (alist[3] != blist[0]))) : x += 1 print(' P=' + str(P)+',V=' + str(v) + ',X='+ str(x)) print("Sorry! You just lost it.") print('''The answer is ''',code) print('''Please try again... ''') |
# 6330361021 (20.00) 213 (2021-02-12 12:31) #print(code) fst = input("Turn #1 : ") if code == fst: print(WINNING_MSG) else: p,v,x = 0,0,0 if fst[0] in code : if fst[0] == code[0]: p+=1 else: v+=1 else: x+=1 if fst[1] in code : if fst[1] == code[1]: p+=1 else: v+=1 else: x+=1 if fst[2] in code : if fst[2] == code[2]: p+=1 else: v+=1 else: x+=1 if fst[3] in code : if fst[3] == code[3]: p+=1 else: v+=1 else: x+=1 print(' P='+str(p)+',V='+str(v)+',X='+str(x)) scd = input("Turn #2 : ") if code == scd: print(WINNING_MSG) else: p,v,x = 0,0,0 if scd[0] in code : if scd[0] == code[0]: p+=1 else: v+=1 else: x+=1 if scd[1] in code : if scd[1] == code[1]: p+=1 else: v+=1 else: x+=1 if scd[2] in code : if scd[2] == code[2]: p+=1 else: v+=1 else: x+=1 if scd[3] in code : if scd[3] == code[3]: p+=1 else: v+=1 else: x+=1 print(' P='+str(p)+',V='+str(v)+',X='+str(x)) trd = input("Turn #3 : ") if code == trd: print(WINNING_MSG) else: p,v,x = 0,0,0 if trd[0] in code : if trd[0] == code[0]: p+=1 else: v+=1 else: x+=1 if trd[1] in code : if trd[1] == code[1]: p+=1 else: v+=1 else: x+=1 if trd[2] in code : if trd[2] == code[2]: p+=1 else: v+=1 else: x+=1 if trd[3] in code : if trd[3] == code[3]: p+=1 else: v+=1 else: x+=1 print(' P='+str(p)+',V='+str(v)+',X='+str(x)) fot = input("Turn #4 : ") if code == fot: print(WINNING_MSG) else: p,v,x = 0,0,0 if fot[0] in code : if fot[0] == code[0]: p+=1 else: v+=1 else: x+=1 if fot[1] in code : if fot[1] == code[1]: p+=1 else: v+=1 else: x+=1 if fot[2] in code : if fot[2] == code[2]: p+=1 else: v+=1 else: x+=1 if fot[3] in code : if fot[3] == code[3]: p+=1 else: v+=1 else: x+=1 print(' P='+str(p)+',V='+str(v)+',X='+str(x)) print(LOSING_MSG) print("The answer is ",code) print("Please try again...") |
# 6330362621 (19.74) 214 (2021-02-14 02:18) #A-F #เดาอย่างมาก4 #ไม่ให้ใช้คำสั่งวงวน while,for #print(code) #อย่าลืมเอาออก done = False what = input('TURN #1 : ') a,v,x = [e for e in [0]*3] if code[0] == what[0]: a += 1 if code[1] == what[1]: a += 1 if code[2] == what[2]: a += 1 if code[3] == what[3]: a += 1 if a == 4: done = True if not done : if code[0] !=what[0] and what[0] in code: v += 1 if code[1] !=what[1] and what[1] in code: v += 1 if code[2] !=what[2] and what[2] in code: v += 1 if code[3] != what[3] and what[3] in code: v += 1 if what[0] not in code: x += 1 if what[1] not in code: x += 1 if what[2] not in code: x += 1 if what[3] not in code: x += 1 print(len('TURN #1 : ')*' '+f'P={a},V={v},X={x}') a,v,x = [e for e in [0]*3] what = input('TURN #2 : ') if code[0] ==what[0]: a += 1 if code[1] ==what[1]: a += 1 if code[2] ==what[2]: a += 1 if code[3] ==what[3]: a += 1 if a == 4: done = True if not done: if code[0] != what[0] and what[0] in code: v +=1 if code[1] != what[1] and what[1] in code: v += 1 if code[2] != what[2] and what[2] in code: v += 1 if code[3] != what[3] and what[3] in code: v += 1 if what[0] not in code: x += 1 if what[1] not in code: x += 1 if what[2] not in code: x += 1 if what[3] not in code: x += 1 print(len('TURN #1 : ')*' '+f'P={a},V={v},X={x}') a,v,x = [e for e in [0]*3] what = input('TURN #3 : ') if code[0] == what[0]: a += 1 if code[1] == what[1]: a += 1 if code[2] == what[2]: a += 1 if code[3] == what[3]: a += 1 if a == 4: done = True if not done: if code[0] != what[0] and what[0] in code: v += 1 if code[1] != what[1] and what[1] in code: v += 1 if code[2] != what[2] and what[2] in code: v += 1 if code[3] != what[3] and what[3] in code: v += 1 if what[0] not in code: x += 1 if what[1] not in code: x += 1 if what[2] not in code: x += 1 if what[3] not in code: x += 1 print(len('TURN #1 : ')*' '+f'P={a},V={v},X={x}') a,v,x = [e for e in [0]*3] what = input('TURN #4 : ') if code[0] == what[0]: a += 1 if code[1] == what[1]: a += 1 if code[2] == what[2]: a += 1 if code[3] == what[3]: a += 1 if a == 4 : done = True if not done: if code[0] != what[0] and what[0] in code: v += 1 if code[1] != what[1] and what[1] in code: v += 1 if code[2] != what[2] and what[2] in code: v += 1 if code[3] != what[3] and what[3] in code: v += 1 if what[0] not in code: x += 1 if what[1] not in code: x += 1 if what[2] not in code: x += 1 if what[3] not in code: x += 1 print(len('TURN #1 : ')*' '+f'P={a},V={v},X={x}') if done: print(WINNING_MSG) else: print(LOSING_MSG) print('The answer is ',code) print('Please try again...') |
# 6330365521 (20.00) 215 (2021-02-12 15:13) p=0 v=0 print("Turn #1 : ",end="") cd=input() if(cd[0]==code[0]) : p=p+1 if(cd[1]==code[1]) : p=p+1 if(cd[2]==code[2]) : p=p+1 if(cd[3]==code[3]) : p=p+1 if(cd[0]in code) : v=v+1 if(cd[1]in code) : v=v+1 if(cd[2]in code) : v=v+1 if(cd[3]in code) : v=v+1 if p==4 : print(WINNING_MSG) pass else : v=v-p x=4-v-p print(" P="+str(p)+','+"V="+str(v)+','+"X="+str(x)) p=0 v=0 print("Turn #2 : ",end="") cd=input() if(cd[0]==code[0]) : p=p+1 if(cd[1]==code[1]) : p=p+1 if(cd[2]==code[2]) : p=p+1 if(cd[3]==code[3]) : p=p+1 if(cd[0]in code) : v=v+1 if(cd[1]in code) : v=v+1 if(cd[2]in code) : v=v+1 if(cd[3]in code) : v=v+1 if p==4 : print(WINNING_MSG) pass else : v=v-p x=4-v-p print(" P="+str(p)+','+"V="+str(v)+','+"X="+str(x)) p=0 v=0 print("Turn #3 : ",end="") cd=input() if(cd[0]==code[0]) : p=p+1 if(cd[1]==code[1]) : p=p+1 if(cd[2]==code[2]) : p=p+1 if(cd[3]==code[3]) : p=p+1 if(cd[0]in code) : v=v+1 if(cd[1]in code) : v=v+1 if(cd[2]in code) : v=v+1 if(cd[3]in code) : v=v+1 if p==4 : print(WINNING_MSG) pass else : v=v-p x=4-v-p print(" P="+str(p)+','+"V="+str(v)+','+"X="+str(x)) p=0 v=0 print("Turn #4 : ",end="") cd=input() if(cd[0]==code[0]) : p=p+1 if(cd[1]==code[1]) : p=p+1 if(cd[2]==code[2]) : p=p+1 if(cd[3]==code[3]) : p=p+1 if(cd[0]in code) : v=v+1 if(cd[1]in code) : v=v+1 if(cd[2]in code) : v=v+1 if(cd[3]in code) : v=v+1 if p==4 : print(WINNING_MSG) pass else : v=v-p x=4-v-p print(" P="+str(p)+','+"V="+str(v)+','+"X="+str(x)) print(LOSING_MSG) print('The answer is',code) print("Please try again"+"."+"."+".") |
# 6330366121 (19.90) 216 (2021-02-13 13:23) acetylcoa = input('Turn#1 : ') if acetylcoa == code : print(WINNING_MSG) else : P=0 V=0 X=0 if acetylcoa[0] in code: if acetylcoa[0] == code[0]: P+=1 else : V+=1 if acetylcoa[1] in code: if acetylcoa[1] == code[1]: P+=1 else : V+=1 if acetylcoa[2] in code: if acetylcoa[2] == code[2]: P+=1 else : V+=1 if acetylcoa[3] in code: if acetylcoa[3] == code[3]: P+=1 else : V+=1 X = 4-(P+V) print(' '+'P='+str(P),',','V='+str(V),',','X='+str(X)) acetylcoa = input('Turn#2 : ') if acetylcoa == code : print(WINNING_MSG) else : P=0 V=0 X=0 if acetylcoa[0] in code: if acetylcoa[0] == code[0]: P+=1 else : V+=1 if acetylcoa[1] in code: if acetylcoa[1] == code[1]: P+=1 else : V+=1 if acetylcoa[2] in code: if acetylcoa[2] == code[2]: P+=1 else : V+=1 if acetylcoa[3] in code: if acetylcoa[3] == code[3]: P+=1 else : V+=1 X = 4-(P+V) print(' '+'P='+str(P),',','V='+str(V),',','X='+str(X)) acetylcoa = input('Turn#3 : ') if acetylcoa == code : print(WINNING_MSG) else : P=0 V=0 X=0 if acetylcoa[0] in code: if acetylcoa[0] == code[0]: P+=1 else : V+=1 if acetylcoa[1] in code: if acetylcoa[1] == code[1]: P+=1 else : V+=1 if acetylcoa[2] in code: if acetylcoa[2] == code[2]: P+=1 else : V+=1 if acetylcoa[3] in code: if acetylcoa[3] == code[3]: P+=1 else : V+=1 X = 4-(P+V) print(' '+'P='+str(P),',','V='+str(V),',','X='+str(X)) acetylcoa = input('Turn#4 : ') if acetylcoa == code : print(WINNING_MSG) else : P=0 V=0 X=0 if acetylcoa[0] in code: if acetylcoa[0] == code[0]: P+=1 else : V+=1 if acetylcoa[1] in code: if acetylcoa[1] == code[1]: P+=1 else : V+=1 if acetylcoa[2] in code: if acetylcoa[2] == code[2]: P+=1 else : V+=1 if acetylcoa[3] in code: if acetylcoa[3] == code[3]: P+=1 else : V+=1 X = 4-(P+V) print(' '+'P='+str(P),',','V='+str(V),',','X='+str(X)) print(LOSING_MSG) print('The answer is ', code) print('Please try again...') |
# 6330367821 (20.00) 217 (2021-02-14 23:27) a = input('Turn #1 : ') if a[0] == code[0]: P=1 else: P=0 if a[1] == code[1]: P=P+1 else: P=P if a[2] == code[2]: P=P+1 else: P=P if a[3] == code[3]: P=P+1 else: P=P if a[0] in code[1::]: M=1 else: M=0 if a[1] in (code[0]+code[2::]): Y=M+1 else: Y=M if a[2] in (code[0:2:]+code[3]): Z=Y+1 else: Z=Y if a[3] in code[0:3:]: V=Z+1 else: V=Z X=4-V-P if a == code: print(WINNING_MSG) else: print (' P='+str(P)+',V='+str(V)+',X='+str(X)) b = input('Turn #2 : ') if b[0] == code[0]: P=1 else: P=0 if b[1] == code[1]: P=P+1 else: P=P if b[2] == code[2]: P=P+1 else: P=P if b[3] == code[3]: P=P+1 else: P=P if b[0] in code[1::]: M=1 else: M=0 if b[1] in (code[0]+code[2::]): Y=M+1 else: Y=M if b[2] in (code[0:2:]+code[3]): Z=Y+1 else: Z=Y if b[3] in code[0:3:]: V=Z+1 else: V=Z X=4-V-P if b == code: print(WINNING_MSG) else: print (' P='+str(P)+',V='+str(V)+',X='+str(X)) c = input('Turn #3 : ') if c[0] == code[0]: P=1 else: P=0 if c[1] == code[1]: P=P+1 else: P=P if c[2] == code[2]: P=P+1 else: P=P if c[3] == code[3]: P=P+1 else: P=P if c[0] in code[1::]: M=1 else: M=0 if c[1] in (code[0]+code[2::]): Y=M+1 else: Y=M if c[2] in (code[0:2:]+code[3]): Z=Y+1 else: Z=Y if c[3] in code[0:3:]: V=Z+1 else: V=Z X=4-P-V if c == code: print(WINNING_MSG) else: print (' P='+str(P)+',V='+str(V)+',X='+str(X)) d = input('Turn #4 : ') if d[0] == code[0]: P=1 else: P=0 if d[1] == code[1]: P=P+1 else: P=P if d[2] == code[2]: P=P+1 else: P=P if d[3] == code[3]: P=P+1 else: P=P if d[0] in code[1::]: M=1 else: M=0 if d[1] in (code[0]+code[2::]): Y=M+1 else: Y=M if d[2] in (code[0:2:]+code[3]): Z=Y+1 else: Z=Y if d[3] in code[0:3:]: V=Z+1 else: V=Z X=4-V-P if d == code: print(WINNING_MSG) else: print (' P='+str(P)+',V='+str(V)+',X='+str(X)) print (LOSING_MSG) print ('The answer is '+code) print ('Please try again...') |
# 6330370621 (18.67) 218 (2021-02-11 16:13) guess_1=input("Turn #1 : ") P = 0 V = 0 X = 0 if guess_1[0]==code[0] : P+=1 else : if guess_1[0] in code : V+=1 if guess_1[1]==code[1] : P+=1 else : if guess_1[1] in code : V+=1 if guess_1[2]==code[2] : P+=1 else : if guess_1[2] in code : V+=1 if guess_1[3]==code[3] : P+=1 else : if guess_1[2] in code : V+=1 X = 4-P-V if P==4 : print(WINNING_MSG) else : print(" "+"P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) guess_2=input("Turn #2 : ") P = 0 V = 0 X = 0 if guess_2[0]==code[0] : P+=1 else : if guess_2[0] in code : V+=1 if guess_2[1]==code[1] : P+=1 else : if guess_2[1] in code : V+=1 if guess_2[2]==code[2] : P+=1 else : if guess_2[2] in code : V+=1 if guess_2[3]==code[3] : P+=1 else : if guess_2[3] in code : V+=1 X = 4-P-V if P==4 : print(WINNING_MSG) else : print(" "+"P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) guess_3=input("Turn #3 : ") P = 0 V = 0 X = 0 if guess_3[0]==code[0] : P+=1 else : if guess_3[0] in code : V+=1 if guess_3[1]==code[1] : P+=1 else : if guess_3[1] in code : V+=1 if guess_3[2]==code[2] : P+=1 else : if guess_3[2] in code : V+=1 if guess_3[3]==code[3] : P+=1 else : if guess_3[3] in code : V+=1 X = 4-P-V if P==4 : print(WINNING_MSG) else : print(" "+"P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) guess_4=input("Turn #4 : ") P = 0 V = 0 X = 0 if guess_4[0]==code[0] : P+=1 else : if guess_4[0] in code : V+=1 if guess_4[1]==code[1] : P+=1 else : if guess_4[1] in code : V+=1 if guess_4[2]==code[2] : P+=1 else : if guess_4[2] in code : V+=1 if guess_4[3]==code[3] : P+=1 else : if guess_4[3] in code : V+=1 X = 4-P-V if P==4 : print(WINNING_MSG) else : print(" "+"P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) print(LOSING_MSG) print("The answer is "+code) print("Please try again...") |
# 6330371221 (17.40) 219 (2021-02-15 22:01) s = input("Turn #1 : ") P,V,X=0,0,0 win = False if s==code: win = True print(WINNING_MSG) if not win and s[0]==code[0]: P +=1 if not win and s[0] != code[0] and s[0] in code: V +=1 if not win and s[0] not in code: X +=1 if not win and s[1]==code[1]: P +=1 if not win and s[1] != code[1] and s[1] in code: V +=1 if not win and s[1] not in code: X +=1 if not win and s[2]==code[2]: P +=1 if not win and s[2] != code[2] and s[2] in code: V +=1 if not win and s[2] not in code: X +=1 if not win and s[3]==code[3]: P +=1 if not win and s[3] != code[3] and s[3] in code: V +=1 if not win and s[3] not in code: X +=1 if not win: print(" "+"P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) s = input("Turn #2 : ") P,V,X=0,0,0 win = False if s==code: win = True print(WINNING_MSG) if not win and s[0]==code[0]: P +=1 if not win and s[0] != code[0] and s[0] in code: V +=1 if not win and s[0] not in code: X +=1 if not win and s[1]==code[1]: P +=1 if not win and s[1] != code[1] and s[1] in code: V +=1 if not win and s[1] not in code: X +=1 if not win and s[2]==code[2]: P +=1 if not win and s[2] != code[2] and s[2] in code: V +=1 if not win and s[2] not in code: X +=1 if not win and s[3]==code[3]: P +=1 if not win and s[3] != code[3] and s[3] in code: V +=1 if not win and s[3] not in code: X +=1 if not win: print(" "+"P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) s = input("Turn #3 : ") P,V,X=0,0,0 win = False if s==code: win = True print(WINNING_MSG) if not win and s[0]==code[0]: P +=1 if not win and s[0] != code[0] and s[0] in code: V +=1 if not win and s[0] not in code: X +=1 if not win and s[1]==code[1]: P +=1 if not win and s[1] != code[1] and s[1] in code: V +=1 if not win and s[1] not in code: X +=1 if not win and s[2]==code[2]: P +=1 if not win and s[2] != code[2] and s[2] in code: V +=1 if not win and s[2] not in code: X +=1 if not win and s[3]==code[3]: P +=1 if not win and s[3] != code[3] and s[3] in code: V +=1 if not win and s[3] not in code: X +=1 if not win: print(" "+"P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) s = input("Turn #4 : ") P,V,X=0,0,0 win = False if s==code: win = True print(WINNING_MSG) if not win and s[0]==code[0]: P +=1 if not win and s[0] != code[0] and s[0] in code: V +=1 if not win and s[0] not in code: X +=1 if not win and s[1]==code[1]: P +=1 if not win and s[1] != code[1] and s[1] in code: V +=1 if not win and s[1] not in code: X +=1 if not win and s[2]==code[2]: P +=1 if not win and s[2] != code[2] and s[2] in code: V +=1 if not win and s[2] not in code: X +=1 if not win and s[3]==code[3]: P +=1 if not win and s[3] != code[3] and s[3] in code: V +=1 if not win and s[3] not in code: X +=1 if not win: print(" "+"P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) print(LOSING_MSG) print("The answer is"+" "+str(code)) print("""Please try again...""") |
# 6330372921 (20.00) 220 (2021-02-14 22:07) P = 0 V = 0 X = 0 a = input('Turn #1 : ') if a[0] == code[0]: P += 1 else : if a[0] in code: V += 1 else: X += 1 if a[1] == code[1]: P += 1 else : if a[1] in code: V += 1 else: X += 1 if a[2] == code[2]: P += 1 else : if a[2] in code: V += 1 else: X += 1 if a[3] == code[3]: P += 1 else : if a[3] in code: V += 1 else: X += 1 if P == 4: print('Congratulations! You won the game.') else: print(' '*10+'P='+str(P)+',V='+str(V)+',X='+str(X))#จบturn1 P = 0 V = 0 X = 0 a = input('Turn #2 : ') if a[0] == code[0]: P += 1 else : if a[0] in code: V += 1 else: X += 1 if a[1] == code[1]: P += 1 else : if a[1] in code: V += 1 else: X += 1 if a[2] == code[2]: P += 1 else : if a[2] in code: V += 1 else: X += 1 if a[3] == code[3]: P += 1 else : if a[3] in code: V += 1 else: X += 1 if P == 4: print('Congratulations! You won the game.') else: print(' '*10+'P='+str(P)+',V='+str(V)+',X='+str(X)) #จบturn2 P = 0 V = 0 X = 0 a = input('Turn #3 : ') if a[0] == code[0]: P += 1 else : if a[0] in code: V += 1 else: X += 1 if a[1] == code[1]: P += 1 else : if a[1] in code: V += 1 else: X += 1 if a[2] == code[2]: P += 1 else : if a[2] in code: V += 1 else: X += 1 if a[3] == code[3]: P += 1 else : if a[3] in code: V += 1 else: X += 1 if P == 4: print('Congratulations! You won the game.') else: print(' '*10+'P='+str(P)+',V='+str(V)+',X='+str(X)) #จบturn3 P = 0 V = 0 X = 0 a = input('Turn #4 : ') if a[0] == code[0]: P += 1 else : if a[0] in code: V += 1 else: X += 1 if a[1] == code[1]: P += 1 else : if a[1] in code: V += 1 else: X += 1 if a[2] == code[2]: P += 1 else : if a[2] in code: V += 1 else: X += 1 if a[3] == code[3]: P += 1 else : if a[3] in code: V += 1 else: X += 1 if P == 4: print('Congratulations! You won the game.') else: print(' '*10+'P='+str(P)+',V='+str(V)+',X='+str(X)) print('Sorry! You just lost it.') print('The answer is '+code) print('Please try again...') |
# 6330374121 (20.00) 221 (2021-02-11 12:08) ans = input('Turn #1 : ') #Turn1 P=0;V=0;X=0 if ans[0] == code[0]: P+=1 elif ans[0] in code: V+=1 else: X+=1 if ans[1] == code[1]: P+=1 elif ans[1] in code: V+=1 else: X+=1 if ans[2] == code[2]: P+=1 elif ans[2] in code: V+=1 else: X+=1 if ans[3] == code[3]: P+=1 elif ans[3] in code: V+=1 else: X+=1 if P == 4: print(WINNING_MSG) else: print(" " + "P="+str(P)+",V="+str(V)+",X="+str(X)) #Turn2 ans = input('Turn #2 : ') P=0;V=0;X=0 if ans[0] == code[0]: P+=1 elif ans[0] in code: V+=1 else: X+=1 if ans[1] == code[1]: P+=1 elif ans[1] in code: V+=1 else: X+=1 if ans[2] == code[2]: P+=1 elif ans[2] in code: V+=1 else: X+=1 if ans[3] == code[3]: P+=1 elif ans[3] in code: V+=1 else: X+=1 if P == 4: print(WINNING_MSG) else: print(" " + "P="+str(P)+",V="+str(V)+",X="+str(X)) #Turn3 ans = input('Turn #3 : ') P=0;V=0;X=0 if ans[0] == code[0]: P+=1 elif ans[0] in code: V+=1 else: X+=1 if ans[1] == code[1]: P+=1 elif ans[1] in code: V+=1 else: X+=1 if ans[2] == code[2]: P+=1 elif ans[2] in code: V+=1 else: X+=1 if ans[3] == code[3]: P+=1 elif ans[3] in code: V+=1 else: X+=1 if P == 4: print(WINNING_MSG) else: print(" " + "P="+str(P)+",V="+str(V)+",X="+str(X)) #Turn4 ans = input('Turn #4 : ') P=0;V=0;X=0 if ans[0] == code[0]: P+=1 elif ans[0] in code: V+=1 else: X+=1 if ans[1] == code[1]: P+=1 elif ans[1] in code: V+=1 else: X+=1 if ans[2] == code[2]: P+=1 elif ans[2] in code: V+=1 else: X+=1 if ans[3] == code[3]: P+=1 elif ans[3] in code: V+=1 else: X+=1 if P == 4: print(WINNING_MSG) else: print(" " + "P="+str(P)+",V="+str(V)+",X="+str(X)) print(LOSING_MSG) print("The answer is " + code) print("Please try again...") |
# 6330375821 (20.00) 222 (2021-02-15 16:40) G = 1 t = input('Turn #1 : ') p,v,x = 0,0,0 if t == code: print(WINNING_MSG) G = 0 if t != code: if t[0]==code[0]: p+= 1 if t[1]==code[1]: p+= 1 if t[2]==code[2]: p+=1 if t[3]==code[3]: p=p+1 if t[0] in code: v+=1 if t[1] in code: v+=1 if t[2] in code: v+=1 if t[3] in code: v+=1 v = v-p x = 4-(v+p) print(' P='+str(p)+','+'V='+str(v)+','+'X='+str(x)) #2 if G !=0: t = input('Turn #2 : ') p,v,x = 0,0,0 if t == code and G!=0 : print(WINNING_MSG) G = 0 if t != code and G!=0 : if t[0]==code[0]: p+=1 if t[1]==code[1]: p+=1 if t[2]==code[2]: p+=1 if t[3]==code[3]: p+=1 if t[0] in code: v+=1 if t[1] in code: v+=1 if t[2] in code: v+=1 if t[3] in code: v+=1 v = v-p x = 4-(v+p) print(' P='+str(p)+','+'V='+str(v)+','+'X='+str(x)) #3 if G !=0: t = input('Turn #3 : ') p,v,x = 0,0,0 if t == code and G !=0: print(WINNING_MSG) G = 0 if t != code and G !=0: if t[0]==code[0]: p+=1 if t[1]==code[1]: p+=1 if t[2]==code[2]: p+=1 if t[3]==code[3]: p+=1 if t[0] in code: v+=1 if t[1] in code: v+=1 if t[2] in code: v+=1 if t[3] in code: v+=1 v = v-p x = 4-(v+p) print(' P='+str(p)+','+'V='+str(v)+','+'X='+str(x)) #4 if G !=0: t = input('Turn #4 : ') p,v,x = 0,0,0 if t == code and G !=0: print(WINNING_MSG) G = 0 if t != code and G !=0: if t[0]==code[0]: p+=1 if t[1]==code[1]: p+=1 if t[2]==code[2]: p+=1 if t[3]==code[3]: p+=1 if t[0] in code: v+=1 if t[1] in code: v+=1 if t[2] in code: v+=1 if t[3] in code: v+=1 v = v-p x = 4-(v+p) print(' P='+str(p)+','+'V='+str(v)+','+'X='+str(x)) print(LOSING_MSG) print('The answer is '+code) print('Please try again...') |
# 6330376421 (20.00) 223 (2021-02-13 14:22) i=0 while i<=4: P=0 V=0 X=0 i+=1 if i==5: print(LOSING_MSG) print("""The answer is """+code) print('Please try again'+"""...""") break s=input("Turn #"+str(i)+" : ") if code[0]==s[0]: P+=1 elif s[0] in code: V+=1 else: X+=1 if code[1]==s[1]: P+=1 elif s[1] in code: V+=1 else: X+=1 if code[2]==s[2]: P+=1 elif s[2] in code: V+=1 else: X+=1 if code[3]==s[3]: P+=1 elif s[3] in code: V+=1 else: X+=1 if P==4: print(WINNING_MSG) break else: print((" "*9),"P="+str(P)+",V="+str(V)+",X="+str(X)) |
# 6330377021 (20.00) 224 (2021-02-12 11:50) P = 0 V = 0 X = 0 ans = input("Turn #1 : ") if ans[0] in code: if ans[0] == code[0]: P += 1 else: V+= 1 else: X += 1 if ans[1] in code: if ans[1] == code[1]: P += 1 else: V+= 1 else: X += 1 if ans[2] in code: if ans[2] == code[2]: P += 1 else: V+= 1 else: X += 1 if ans[3] in code: if ans[3] == code[3]: P += 1 else: V+= 1 else: X += 1 if ans == code: print(WINNING_MSG) else: print(" P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) P = 0 V = 0 X = 0 ans = input("Turn #2 : ") if ans[0] in code: if ans[0] == code[0]: P += 1 else: V+= 1 else: X += 1 if ans[1] in code: if ans[1] == code[1]: P += 1 else: V+= 1 else: X += 1 if ans[2] in code: if ans[2] == code[2]: P += 1 else: V+= 1 else: X += 1 if ans[3] in code: if ans[3] == code[3]: P += 1 else: V+= 1 else: X += 1 if ans == code: print(WINNING_MSG) else: print(" P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) P = 0 V = 0 X = 0 ans = input("Turn #3 : ") if ans[0] in code: if ans[0] == code[0]: P += 1 else: V+= 1 else: X += 1 if ans[1] in code: if ans[1] == code[1]: P += 1 else: V+= 1 else: X += 1 if ans[2] in code: if ans[2] == code[2]: P += 1 else: V+= 1 else: X += 1 if ans[3] in code: if ans[3] == code[3]: P += 1 else: V+= 1 else: X += 1 if ans == code: print(WINNING_MSG) else: print(" P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) P = 0 V = 0 X = 0 ans = input("Turn #4 : ") if ans[0] in code: if ans[0] == code[0]: P += 1 else: V+= 1 else: X += 1 if ans[1] in code: if ans[1] == code[1]: P += 1 else: V+= 1 else: X += 1 if ans[2] in code: if ans[2] == code[2]: P += 1 else: V+= 1 else: X += 1 if ans[3] in code: if ans[3] == code[3]: P += 1 else: V+= 1 else: X += 1 if ans == code: print(WINNING_MSG) else: print(" P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) print(LOSING_MSG) print("The answer is",code) print("Please try again...") |
# 6330378721 (17.37) 225 (2021-02-13 17:25) keyp = '' keyv = '' guess = input("Turn #1 : ") keyp = '' keyv = '' if guess in code: print(WINNING_MSG) else: if guess[0] in code: if guess[0] in code[0]: keyp = 'p' else: keyv = 'v' else: pass if guess[1] in code: if guess[1] in code[1]: keyp += 'p' else: keyv += 'v' else: pass if guess[2] in code: if guess[2] in code[2]: keyp += 'p' else: keyv += 'v' else: pass if guess[3] in code: if guess[3] in code[3]: keyp += 'p' else: keyv +='v' else: pass nP=len(keyp) nV=len(keyv) nX=4-(nP+nV) print(' P='+str(nP)+','+'V='+str(nV)+','+'X='+str(nX)) guess = input("Turn #2 : ") keyp = '' keyv = '' if guess in code: print(WINNING_MSG) else: if guess[0] in code: if guess[0] in code[0]: keyp = 'p' else: keyv = 'v' else: pass if guess[1] in code: if guess[1] in code[1]: keyp += 'p' else: keyv += 'v' else: pass if guess[2] in code: if guess[2] in code[2]: keyp += 'p' else: keyv += 'v' else: pass if guess[3] in code: if guess[3] in code[3]: keyp += 'p' else: keyv +='v' else: pass nP=len(keyp) nV=len(keyv) nX=4-(nP+nV) print(' P='+str(nP)+','+'V='+str(nV)+','+'X='+str(nX)) guess = input("Turn #3 : ") keyp = '' keyv = '' if guess in code: print(WINNING_MSG) else: if guess[0] in code: if guess[0] in code[0]: keyp = 'p' else: keyv = 'v' else: pass if guess[1] in code: if guess[1] in code[1]: keyp += 'p' else: keyv += 'v' else: pass if guess[2] in code: if guess[2] in code[2]: keyp += 'p' else: keyv += 'v' else: pass if guess[3] in code: if guess[3] in code[3]: keyp += 'p' else: keyv +='v' else: pass nP=len(keyp) nV=len(keyv) nX=4-(nP+nV) print(' P='+str(nP)+','+'V='+str(nV)+','+'X='+str(nX)) guess = input("Turn #4 : ") keyp = '' keyv = '' if guess in code: print(WINNING_MSG) else: if guess[0] in code: if guess[0] in code[0]: keyp = 'p' else: keyv = 'v' else: pass if guess[1] in code: if guess[1] in code[1]: keyp += 'p' else: keyv += 'v' else: pass if guess[2] in code: if guess[2] in code[2]: keyp += 'p' else: keyv += 'v' else: pass if guess[3] in code: if guess[3] in code[3]: keyp += 'p' else: keyv +='v' else: pass nP=len(keyp) nV=len(keyv) nX=4-(nP+nV) print(LOSING_MSG) print('The answer is ',code) print('Please try again...') |
# 6330379321 (19.29) 226 (2021-02-12 23:56) def function(code,play) : p=0 v=0 if play[0] in code : if play[0]==code[0] : p+=1 else : v+=1 if play[1] in code : if play[1]==code[1] : p+=1 else : v+=1 if play[2] in code : if play[2]==code[2] : p+=1 else : v+=1 if play[3] in code : if play[3]==code[3] : p+=1 else : v+=1 return p,v def P_function(code,play): p,v=function(code,play) return p,v def show_code(code,play) : function(code,play) if p==4 : print(WINNING_MSG) else : print(' '+'P='+str(p)+','+'V='+str(v)+','+'X='+str(4-p-v)) play = input("Turn #1 : ") p,v= P_function(code,play) show_code(code,play) if p==4 : pass else : play = input("Turn #2 : ") p,v= P_function(code,play) show_code(code,play) if p==4 : pass else : play = input("Turn #3 : ") p,v= P_function(code,play) show_code(code,play) if p==4 : pass else : play = input("Turn #4 : ") p,v= P_function(code,play) show_code(code,play) print(LOSING_MSG) print('The answer is',code) print('Please try again...') |
# 6330380921 (17.37) 227 (2021-02-12 23:06) P,V,X = 0,0,0 P1,V1,X1 = 0,0,0 P2,V2,X2 = 0,0,0 P3,V3,X3 = 0,0,0 a1 = input('Turn #1 : ') if a1[0] in code or a1[1] in code or a1[2] in code or a1[3] in code: if(a1[0] == code[0]): P += 1 if(a1[1] == code[1]): P += 1 if(a1[2]==code[2]): P += 1 if(a1[3] == code[3]): P += 1 # if a1[0] in code: V += 1 if (a1[1] in code): V += 1 if (a1[2] in code): V += 1 if (a1[3] in code): V += 1 # if (not (a1[0] in code)): X += 1 if (not (a1[1] in code)): X += 1 if (not (a1[2] in code)): X += 1 if (not (a1[3] in code)): X += 1 if P==4 and V-P==0 and X==0: print(WINNING_MSG) else: print(' P'+'='+str(P)+','+'V'+'='+str(V-P)+','+'X'+'='+str(X)) #2 if a1[0] in code or a1[1] in code or a1[2] in code or a1[3] in code: a2 = input('Turn #2 : ') if(a2[0] == code[0]): P1 += 1 if(a2[1] == code[1]): P1 += 1 if(a2[2]==code[2]): P1 += 1 if(a2[3] == code[3]): P1 += 1 # if a2[0] in code: V1 += 1 if (a2[1] in code): V1 += 1 if (a2[2] in code): V1 += 1 if (a2[3] in code): V1 += 1 # if (not (a2[0] in code)): X1 += 1 if (not (a2[1] in code)): X1 += 1 if (not (a2[2] in code)): X1 += 1 if (not (a2[3] in code)): X1 += 1 if P1==4 and V1-P1==0 and X1==0: print(WINNING_MSG) else: print(' P'+'='+str(P1)+','+'V'+'='+str(V1-P1)+','+'X'+'='+str(X1)) #3 if a2[0] in code or a2[1] in code or a2[2] in code or a2[3] in code: a3 = input('Turn #3 : ') if(a3[0] == code[0]): P2 += 1 if(a3[1] == code[1]): P2 += 1 if(a3[2]==code[2]): P2 += 1 if(a3[3] == code[3]): P2 += 1 # if a3[0] in code: V2 += 1 if (a3[1] in code): V2 += 1 if (a3[2] in code): V2 += 1 if (a3[3] in code): V2 += 1 # if (not (a3[0] in code)): X2 += 1 if (not (a3[1] in code)): X2 += 1 if (not (a3[2] in code)): X2 += 1 if (not (a3[3] in code)): X2 += 1 if P2==4 and V2-P2==0 and X2==0: print(WINNING_MSG) else: print(' P'+'='+str(P2)+','+'V'+'='+str(V2-P2)+','+'X'+'='+str(X2)) #4 if a3[0] in code or a3[1] in code or a3[2] in code or a3[3] in code: a4 = input('Turn #4 : ') if(a4[0] == code[0]): P3 += 1 if(a4[1] == code[1]): P3 += 1 if(a4[2]==code[2]): P3 += 1 if(a4[3] == code[3]): P3 += 1 # if a4[0] in code: V3 += 1 if (a4[1] in code): V3 += 1 if (a4[2] in code): V3 += 1 if (a4[3] in code): V3 += 1 # if (not (a4[0] in code)): X3 += 1 if (not (a4[1] in code)): X3 += 1 if (not (a4[2] in code)): X3 += 1 if (not (a4[3] in code)): X3 += 1 if P3==4 and V3-P3==0 and X3==0: print(WINNING_MSG) else: print(LOSING_MSG) print('The answer is',code) print('Please try again...') |
# 6330381521 (20.00) 228 (2021-02-13 21:57) c1 = code[0] c2 = code[1] c3 = code[2] c4 = code[3] a = input("Turn #1 : ") a1 = a[0] a2 = a[1] a3 = a[2] a4 = a[3] P = 0 V = 0 X = 0 if a1 == c1 : P+=1 if a2 == c2 : P+=1 if a3 == c3 : P+=1 if a4 == c4 : P+=1 if a1 in code : V+=1 if a2 in code : V+=1 if a3 in code : V+=1 if a4 in code : V+=1 if a1 not in code : X+=1 if a2 not in code : X+=1 if a3 not in code : X+=1 if a4 not in code : X+=1 if P == 4 : print(WINNING_MSG) else : print(" P="+str(P)+","+"V="+str(int(V-P))+","+"X="+str(X)) b = input("Turn #2 : ") b1 = b[0] b2 = b[1] b3 = b[2] b4 = b[3] P2 = 0 V2 = 0 X2 = 0 if b1 == c1 : P2+=1 if b2 == c2 : P2+=1 if b3 == c3 : P2+=1 if b4 == c4 : P2+=1 if b1 in code : V2+=1 if b2 in code : V2+=1 if b3 in code : V2+=1 if b4 in code : V2+=1 if b1 not in code : X2+=1 if b2 not in code : X2+=1 if b3 not in code : X2+=1 if b4 not in code : X2+=1 if P2 == 4 : print(WINNING_MSG) else : print(" P="+str(P2)+","+"V="+str(int(V2-P2))+","+"X="+str(X2)) d = input("Turn #3 : ") d1 = d[0] d2 = d[1] d3 = d[2] d4 = d[3] P3 = 0 V3 = 0 X3 = 0 if d1 == c1 : P3+=1 if d2 == c2 : P3+=1 if d3 == c3 : P3+=1 if d4 == c4 : P3+=1 if d1 in code : V3+=1 if d2 in code : V3+=1 if d3 in code : V3+=1 if d4 in code : V3+=1 if d1 not in code : X3+=1 if d2 not in code : X3+=1 if d3 not in code : X3+=1 if d4 not in code : X3+=1 if P3 == 4 : print(WINNING_MSG) else : print(" P="+str(P3)+","+"V="+str(int(V3-P3))+","+"X="+str(X3)) e = input("Turn #4 : ") e1 = e[0] e2 = e[1] e3 = e[2] e4 = e[3] P4 = 0 V4 = 0 X4 = 0 if e1 == c1 : P4+=1 if e2 == c2 : P4+=1 if e3 == c3 : P4+=1 if e4 == c4 : P4+=1 if e1 in code : V4+=1 if e2 in code : V4+=1 if e3 in code : V4+=1 if e4 in code : V4+=1 if e1 not in code : X4+=1 if e2 not in code : X4+=1 if e3 not in code : X4+=1 if e4 not in code : X4+=1 if P4 == 4 : print(WINNING_MSG) else : print(" P="+str(P4)+","+"V="+str(int(V4-P4))+","+"X="+str(X4)) print(LOSING_MSG) print("The answer is "+str(code)) print("Please try again...") |
# 6330382121 (19.90) 229 (2021-02-15 11:20) a1 = input('Turn #1 :') P = 0 V = 0 X = 0 if code[0] == a1[0]: P = P + 1 elif a1[0] == code[1] or a1[0] == code[2] or a1[0] == code[3]: V = V + 1 else: X = X + 1 if a1[1] == code[1]: P = P + 1 elif a1[1] == code[0] or a1[1] == code[2] or a1[1] == code[3]: V = V + 1 else: X = X + 1 if a1[2] == code[2]: P = P + 1 elif a1[2] == code[0] or a1[2] == code[1] or a1[2] == code[3]: V = V + 1 else: X = X + 1 if a1[3] == code[3]: P = P + 1 elif a1[3] == code[0] or a1[3] == code[1] or a1[3] == code[2] : V = V + 1 else: X = X + 1 if P == 4: print('Congratulations! You won the game.') else: print('P=' + str(P) + ',' + 'V=' + str(V) + ',' + 'X=' + str(X) ) P = 0 V = 0 X = 0 a2 = input('Turn #2 :') if code[0] == a2[0]: P = P + 1 elif a2[0] == code[1] or a2[0] == code[2] or a2[0] == code[3]: V = V + 1 else: X = X + 1 if a2[1] == code[1]: P = P + 1 elif a2[1] == code[0] or a2[1] == code[2] or a2[1] == code[3]: V = V + 1 else: X = X + 1 if a2[2] == code[2]: P = P + 1 elif a2[2] == code[0] or a2[2] == code[1] or a2[2] == code[3]: V = V + 1 else: X = X + 1 if a2[3] == code[3]: P = P + 1 elif a2[3] == code[0] or a2[3] == code[1] or a2[3] == code[2] : V = V + 1 else: X = X + 1 if P == 4: print('Congratulations! You won the game.') else: print('P=' + str(P) + ',' + 'V=' + str(V) + ',' + 'X=' + str(X) ) P = 0 V = 0 X = 0 a3 = input('Turn #3 :') if code[0] == a3[0]: P = P + 1 elif a3[0] == code[1] or a3[0] == code[2] or a3[0] == code[3]: V = V + 1 else: X = X + 1 if a3[1] == code[1]: P = P + 1 elif a3[1] == code[0] or a3[1] == code[2] or a3[1] == code[3]: V = V + 1 else: X = X + 1 if a3[2] == code[2]: P = P + 1 elif a3[2] == code[0] or a3[2] == code[1] or a3[2] == code[3]: V = V + 1 else: X = X + 1 if a3[3] == code[3]: P = P + 1 elif a3[3] == code[0] or a3[3] == code[1] or a3[3] == code[2] : V = V + 1 else: X = X + 1 if P == 4: print('Congratulations! You won the game.') else: print('P=' + str(P) + ',' + 'V=' + str(V) + ',' + 'X=' + str(X) ) P = 0 V = 0 X = 0 a4 = input('Turn #4 :') if code[0] == a4[0]: P = P + 1 elif a4[0] == code[1] or a4[0] == code[2] or a4[0] == code[3]: V = V + 1 else: X = X + 1 if a4[1] == code[1]: P = P + 1 elif a4[1] == code[0] or a4[1] == code[2] or a4[1] == code[3]: V = V + 1 else: X = X + 1 if a4[2] == code[2]: P = P + 1 elif a4[2] == code[0] or a4[2] == code[1] or a4[2] == code[3]: V = V + 1 else: X = X + 1 if a4[3] == code[3]: P = P + 1 elif a4[3] == code[0] or a4[3] == code[1] or a4[3] == code[2] : V = V + 1 else: X = X + 1 if P == 4: print('Congratulations! You won the game.') else: print('P=' + str(P) + ',' + 'V=' + str(V) + ',' + 'X=' + str(X) ) print('Sorry! You just lost it.') print('The answer is', code ) print('please try again...') |
# 6330384421 (20.00) 230 (2021-02-14 23:37) p=0 x=0 v=0 q=input('Turn #1 : ') if q==code: print(WINNING_MSG) else: if q[0]==code[0]:p+=1 if q[1]==code[1]:p+=1 if q[2]==code[2]:p+=1 if q[3]==code[3]:p+=1 if q[0] not in code:x+=1 if q[1] not in code:x+=1 if q[2] not in code:x+=1 if q[3] not in code:x+=1 v=4-p-x print(' P=' + str(p) + ',V=' + str(v) + ',X=' + str(x)) p=0 x=0 v=0 if q!=code: q=input('Turn #2 : ') if q==code: print(WINNING_MSG) else: if q[0]==code[0]:p+=1 if q[1]==code[1]:p+=1 if q[2]==code[2]:p+=1 if q[3]==code[3]:p+=1 if q[0] not in code:x+=1 if q[1] not in code:x+=1 if q[2] not in code:x+=1 if q[3] not in code:x+=1 v=4-p-x print(' P=' + str(p) + ',V=' + str(v) + ',X=' + str(x)) p=0 x=0 v=0 if q!=code: q=input('Turn #3 : ') if q==code: print(WINNING_MSG) else: if q[0]==code[0]:p+=1 if q[1]==code[1]:p+=1 if q[2]==code[2]:p+=1 if q[3]==code[3]:p+=1 if q[0] not in code:x+=1 if q[1] not in code:x+=1 if q[2] not in code:x+=1 if q[3] not in code:x+=1 v=4-p-x print(' P=' + str(p) + ',V=' + str(v) + ',X=' + str(x)) p=0 x=0 v=0 if q!=code: q=input('Turn #4 : ') if q==code: print(WINNING_MSG) else: if q[0]==code[0]:p+=1 if q[1]==code[1]:p+=1 if q[2]==code[2]:p+=1 if q[3]==code[3]:p+=1 if q[0] not in code:x+=1 if q[1] not in code:x+=1 if q[2] not in code:x+=1 if q[3] not in code:x+=1 v=4-p-x print(' P=' + str(p) + ',V=' + str(v) + ',X=' + str(x)) print(LOSING_MSG) print('The answer is ' + code) print('Please try again...') |
# 6330386721 (19.11) 231 (2021-02-14 23:13) a = input('Turn #1 : ') P = 0 V = 0 X = 0 if a[0] == code[0]: P += 1 elif a[0] not in code: X += 1 if a[1] == code[1]: P += 1 elif a[1] not in code: X += 1 if a[2] == code[2]: P += 1 elif a[2] not in code: X += 1 if a[3] == code[3]: P += 1 elif a[3] not in code: X += 1 V = abs(X + P - 4) print(' '*10 + 'P=' + str(P) + ',' + 'V=' + str(V) + ',' + 'X=' + str(X)) if a == code: print(WINNING_MSG) exit(0) b = input('Turn #2 : ') P = 0 V = 0 X = 0 if b[0] == code[0]: P += 1 elif b[0] not in code: X += 1 if b[1] == code[1]: P += 1 elif b[1] not in code: X += 1 if b[2] == code[2]: P += 1 elif b[2] not in code: X += 1 if b[3] == code[3]: P += 1 elif b[3] not in code: X += 1 V = abs(X + P - 4) print(' '*10 + 'P=' + str(P) + ',' + 'V=' + str(V) + ',' + 'X=' + str(X)) if b == code: print(WINNING_MSG) exit(0) c = input('Turn #3 : ') P = 0 V = 0 X = 0 if c[0] == code[0]: P += 1 elif c[0] not in code: X += 1 if c[1] == code[1]: P += 1 elif c[1] not in code: X += 1 if c[2] == code[2]: P += 1 elif c[2] not in code: X += 1 if c[3] == code[3]: P += 1 elif c[3] not in code: X += 1 V = abs(X + P - 4) print(' '*10 + 'P=' + str(P) + ',' + 'V=' + str(V) + ',' + 'X=' + str(X)) if c == code: print(WINNING_MSG) exit(0) d = input('Turn #4 : ') P = 0 V = 0 X = 0 if d[0] == code[0]: P += 1 elif d[0] not in code: X += 1 if d[1] == code[1]: P += 1 elif d[1] not in code: X += 1 if d[2] == code[2]: P += 1 elif d[2] not in code: X += 1 if d[3] == code[3]: P += 1 elif d[3] not in code: X += 1 V = abs(X + P - 4) print(' '*10 + 'P=' + str(P) + ',' + 'V=' + str(V) + ',' + 'X=' + str(X)) if d == code: print(WINNING_MSG) exit(0) if a != code and b != code and c != code and d != code: print(LOSING_MSG) print('The answer is ' + code) print('Please try again...') |
# 6330387321 (19.90) 232 (2021-02-15 17:29) codes = code[0],code[1],code[2],code[3] turnA = input("Turn #1: ") p1 = 0 x1 = 0 if turnA == code : print("Congratulations! You won the game.") if turnA[0] == code[0]: p1 += 1 if turnA[1] == code[1]: p1 += 1 if turnA[2] == code[2]: p1 += 1 if turnA[3] == code[3]: p1 += 1 elif turnA[1] == code[1]: p1 += 1 if turnA[2] == code[2]: p1 += 1 if turnA[3] == code[3]: p1 += 1 elif turnA[2] == code[2]: p1 += 1 if turnA[3] == code[3]: p1 += 1 elif turnA[3] == code[3]: p1 += 1 if turnA[0] not in codes : x1 += 1 if turnA[1] not in codes : x1 += 1 if turnA[2] not in codes : x1 += 1 if turnA[3] not in codes : x1 += 1 v1 = 4-(p1+x1) if turnA != code : print(" P="+str(p1)+","+"V="+str(v1)+","+"X="+str(x1)) turnB = input("Turn #2: ") p2 = 0 x2 = 0 if turnB == code : print("Congratulations! You won the game.") if turnB[0] == code[0]: p2 += 1 if turnB[1] == code[1]: p2 += 1 if turnB[2] == code[2]: p2 += 1 if turnB[3] == code[3]: p2 += 1 elif turnB[1] == code[1]: p2 += 1 if turnB[2] == code[2]: p2 += 1 if turnB[3] == code[3]: p2 += 1 elif turnB[2] == code[2]: p2 += 1 if turnB[3] == code[3]: p2 += 1 elif turnB[3] == code[3]: p2 += 1 if turnB[0] not in codes : x2 += 1 if turnB[1] not in codes : x2 += 1 if turnB[2] not in codes : x2 += 1 if turnB[3] not in codes : x2 += 1 v2 = 4-(p2+x2) if turnB != code : print(" P="+str(p2)+","+"V="+str(v2)+","+"X="+str(x2)) turnC = input("Turn #3: ") p3 = 0 x3 = 0 if turnC == code : print("Congratulations! You won the game.") if turnC[0] == code[0]: p3 += 1 if turnC[1] == code[1]: p3 += 1 if turnC[2] == code[2]: p3 += 1 if turnC[3] == code[3]: p3 += 1 elif turnC[1] == code[1]: p3 += 1 if turnC[2] == code[2]: p3 += 1 if turnC[3] == code[3]: p3 += 1 elif turnC[2] == code[2]: p3 += 1 if turnC[3] == code[3]: p3 += 1 elif turnC[3] == code[3]: p3 += 1 if turnC[0] not in codes : x3 += 1 if turnC[1] not in codes : x3 += 1 if turnC[2] not in codes : x3 += 1 if turnC[3] not in codes : x3 += 1 v3 = 4-(p3+x3) if turnC != code : print(" P="+str(p3)+","+"V="+str(v3)+","+"X="+str(x3)) turnD = input("Turn #4: ") p4 = 0 x4 = 0 if turnD == code : print("Congratulations! You won the game.") if turnD[0] == code[0]: p4 += 1 if turnD[1] == code[1]: p4 += 1 if turnD[2] == code[2]: p4 += 1 if turnD[3] == code[3]: p4 += 1 elif turnD[1] == code[1]: p4 += 1 if turnD[2] == code[2]: p4 += 1 if turnD[3] == code[3]: p4 += 1 elif turnD[2] == code[2]: p4 += 1 if turnD[3] == code[3]: p4 += 1 elif turnD[3] == code[3]: p4 += 1 if turnD[0] not in codes : x4 += 1 if turnD[1] not in codes : x4 += 1 if turnD[2] not in codes : x4 += 1 if turnD[3] not in codes : x4 += 1 v4 = 4-(p4+x4) if turnD != code : print(" P="+str(p4)+","+"V="+str(v4)+","+"X="+str(x4)) print("Sorry! You just lost it.") print("The answer is", code) print("Please try again...") |
# 6330388021 (20.00) 233 (2021-02-12 01:00) #print(code) g=input('Turn #1 : ') p=0 v=0 x=4 if g==code : print(WINNING_MSG) else : if g[0]==code[0]: p+=1 if g[1]==code[1]: p+=1 if g[2]==code[2]: p+=1 if g[3]==code[3]: p+=1 if g[0] in code and g[0]!=code[0]: v+=1 if g[1] in code and g[1]!=code[1]: v+=1 if g[2] in code and g[2]!=code[2]: v+=1 if g[3] in code and g[3]!=code[3]: v+=1 x-=(p+v) print(' P='+str(p)+',V='+str(v)+',X='+str(x)) g=input('Turn #2 : ') p=0 v=0 x=4 if g==code : print(WINNING_MSG) else : if g[0]==code[0]: p+=1 if g[1]==code[1]: p+=1 if g[2]==code[2]: p+=1 if g[3]==code[3]: p+=1 if g[0] in code and g[0]!=code[0]: v+=1 if g[1] in code and g[1]!=code[1]: v+=1 if g[2] in code and g[2]!=code[2]: v+=1 if g[3] in code and g[3]!=code[3]: v+=1 x-=(p+v) print(' P='+str(p)+',V='+str(v)+',X='+str(x)) g=input('Turn #3 : ') p=0 v=0 x=4 if g==code : print(WINNING_MSG) else : if g[0]==code[0]: p+=1 if g[1]==code[1]: p+=1 if g[2]==code[2]: p+=1 if g[3]==code[3]: p+=1 if g[0] in code and g[0]!=code[0]: v+=1 if g[1] in code and g[1]!=code[1]: v+=1 if g[2] in code and g[2]!=code[2]: v+=1 if g[3] in code and g[3]!=code[3]: v+=1 x-=(p+v) print(' P='+str(p)+',V='+str(v)+',X='+str(x)) g=input('Turn #4 : ') p=0 v=0 x=4 if g==code : print(WINNING_MSG) else : if g[0]==code[0]: p+=1 if g[1]==code[1]: p+=1 if g[2]==code[2]: p+=1 if g[3]==code[3]: p+=1 if g[0] in code and g[0]!=code[0]: v+=1 if g[1] in code and g[1]!=code[1]: v+=1 if g[2] in code and g[2]!=code[2]: v+=1 if g[3] in code and g[3]!=code[3]: v+=1 x-=(p+v) print(' P='+str(p)+',V='+str(v)+',X='+str(x)) print(LOSING_MSG) print('The answer is '+str(code)) print('Please try again...') |
# 6330389621 (20.00) 234 (2021-02-15 00:22) guess_code=input("Turn #1 : ") P=0 V=0 X=0 if code==guess_code: print(WINNING_MSG) else : #เช็คค่า p if code[0]==guess_code[0]: P+=1 if code[1]==guess_code[1]: P+=1 if code[2]==guess_code[2]: P+=1 if code[3]==guess_code[3]: P+=1 #เช็คค่า v if code[0] in str(guess_code) and code[0]!=guess_code[0]: V+=1 if code[1] in str(guess_code) and code[1]!=guess_code[1]: V+=1 if code[2] in str(guess_code) and code[2]!=guess_code[2] : V+=1 if code[3] in str(guess_code) and code[3]!=guess_code[3]: V+=1 #เช็คค่า x if code[0] not in str(guess_code) : X+=1 if code[1] not in str(guess_code) : X+=1 if code[2] not in str(guess_code) : X+=1 if code[3] not in str(guess_code) : X+=1 print(" "*9,"P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) guess_code2=input("Turn #2 : ") P2=0 V2=0 X2=0 if code==guess_code2: print(WINNING_MSG) else: #เช็คค่า p if code[0]==guess_code2[0]: P2+=1 if code[1]==guess_code2[1]: P2+=1 if code[2]==guess_code2[2]: P2+=1 if code[3]==guess_code2[3]: P2+=1 #เช็คค่า v if code[0] in str(guess_code2) and code[0]!=guess_code2[0]: V2+=1 if code[1] in str(guess_code2) and code[1]!=guess_code2[1]: V2+=1 if code[2] in str(guess_code2) and code[2]!=guess_code2[2]: V2+=1 if code[3] in str(guess_code2) and code[3]!=guess_code2[3]: V2+=1 #เช็คค่า x if code[0] not in str(guess_code2) : X2+=1 if code[1] not in str(guess_code2) : X2+=1 if code[2] not in str(guess_code2) : X2+=1 if code[3] not in str(guess_code2) : X2+=1 print(" "*9,"P="+str(P2)+","+"V="+str(V2)+","+"X="+str(X2)) guess_code3=input("Turn #3 : ") P3=0 V3=0 X3=0 if code==guess_code3: print(WINNING_MSG) else: #เช็คค่า p if code[0]==guess_code3[0]: P3+=1 if code[1]==guess_code3[1]: P3+=1 if code[2]==guess_code3[2]: P3+=1 if code[3]==guess_code3[3]: P3+=1 #เช็คค่า v if code[0] in str(guess_code3) and code[0]!=guess_code3[0]: V3+=1 if code[1] in str(guess_code3) and code[1]!=guess_code3[1]: V3+=1 if code[2] in str(guess_code3) and code[2]!=guess_code3[2]: V3+=1 if code[3] in str(guess_code3) and code[3]!=guess_code3[3]: V3+=1 #เช็คค่า x if code[0] not in str(guess_code3) : X3+=1 if code[1] not in str(guess_code3) : X3+=1 if code[2] not in str(guess_code3) : X3+=1 if code[3] not in str(guess_code3) : X3+=1 print(" "*9,"P="+str(P3)+","+"V="+str(V3)+","+"X="+str(X3)) guess_code4=input("Turn #4 : ") P4=0 V4=0 X4=0 if code==guess_code4: print(WINNING_MSG) else: #เช็คค่า p if code[0]==guess_code4[0]: P4+=1 if code[1]==guess_code4[1]: P4+=1 if code[2]==guess_code4[2]: P4+=1 if code[3]==guess_code4[3]: P4+=1 #เช็คค่า v if code[0] in str(guess_code4) and code[0]!=guess_code4[0]: V4+=1 if code[1] in str(guess_code4) and code[1]!=guess_code4[1]: V4+=1 if code[2] in str(guess_code4) and code[2]!=guess_code4[2]: V4+=1 if code[3] in str(guess_code4) and code[3]!=guess_code4[3]: V4+=1 #เช็คค่า x if code[0] not in str(guess_code4) : X4+=1 if code[1] not in str(guess_code4) : X4+=1 if code[2] not in str(guess_code4) : X4+=1 if code[3] not in str(guess_code4) : X4+=1 print(" "*9,"P="+str(P4)+","+"V="+str(V4)+","+"X="+str(X4)) print(LOSING_MSG) print("The answer is ",str(code)) print("Please try again...") |
# 6330391821 (20.00) 235 (2021-02-13 22:15) x = input("Turn #1 : ") y = "01" z = "10" P = int(y[x[0]==code[0]::2]) P += int(y[x[1]==code[1]::2]) P += int(y[x[2]==code[2]::2]) P += int(y[x[3]==code[3]::2]) V = int(y[x[0] in code and x[0]!=code[0]::2]) V += int(y[x[1] in code and x[1]!=x[0] and x[1]!=code[1]::2]) V += int(y[x[2] in code and x[2]!=x[1] and x[2]!=x[0] and x[2]!=code[2]::2]) V += int(y[x[3] in code and x[3]!=x[2] and x[3]!=x[1] and x[3]!=x[0] and x[3]!=code[3]::2]) X = int(y[x[0] not in code::2]) X += int(y[x[1] not in code and x[1]!=x[0]::2]) X += int(y[x[2] not in code and x[2]!=x[1] and x[2]!=x[0]::2]) X += int(y[x[3] not in code and x[3]!=x[2] and x[3]!=x[1] and x[3]!=x[0]::2]) if P != 4: print(" "+"P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) x1 = input("Turn #2 : ") P = int(y[x1[0]==code[0]::2]) P += int(y[x1[1]==code[1]::2]) P += int(y[x1[2]==code[2]::2]) P += int(y[x1[3]==code[3]::2]) V = int(y[x1[0] in code and x1[0]!=code[0]::2]) V += int(y[x1[1] in code and x1[1]!=x1[0] and x1[1]!=code[1]::2]) V += int(y[x1[2] in code and x1[2]!=x1[1] and x1[2]!=x1[0] and x1[2]!=code[2]::2]) V += int(y[x1[3] in code and x1[3]!=x1[2] and x1[3]!=x1[1] and x1[3]!=x1[0] and x1[3]!=code[3]::2]) X = int(y[x1[0] not in code::2]) X += int(y[x1[1] not in code and x1[1]!=x1[0]::2]) X += int(y[x1[2] not in code and x1[2]!=x1[1] and x1[2]!=x1[0]::2]) X += int(y[x1[3] not in code and x1[3]!=x1[2] and x1[3]!=x1[1] and x1[3]!=x1[0]::2]) if P != 4: print(" "+"P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) x2 = input("Turn #3 : ") P = int(y[x2[0]==code[0]::2]) P += int(y[x2[1]==code[1]::2]) P += int(y[x2[2]==code[2]::2]) P += int(y[x2[3]==code[3]::2]) V = int(y[x2[0] in code and x2[0]!=code[0]::2]) V += int(y[x2[1] in code and x2[1]!=x2[0] and x2[1]!=code[1]::2]) V += int(y[x2[2] in code and x2[2]!=x2[1] and x2[2]!=x2[0] and x2[2]!=code[2]::2]) V += int(y[x2[3] in code and x2[3]!=x2[2] and x2[3]!=x2[1] and x2[3]!=x2[0] and x2[3]!=code[3]::2]) X = int(y[x2[0] not in code::2]) X += int(y[x2[1] not in code and x2[1]!=x2[0]::2]) X += int(y[x2[2] not in code and x2[2]!=x2[1] and x2[2]!=x2[0]::2]) X += int(y[x2[3] not in code and x2[3]!=x2[2] and x2[3]!=x2[1] and x2[3]!=x2[0]::2]) if P != 4: print(" "+"P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) x3 = input("Turn #4 : ") P = int(y[x3[0]==code[0]::2]) P += int(y[x3[1]==code[1]::2]) P += int(y[x3[2]==code[2]::2]) P += int(y[x3[3]==code[3]::2]) V = int(y[x3[0] in code and x3[0]!=code[0]::2]) V += int(y[x3[1] in code and x3[1]!=x3[0] and x3[1]!=code[1]::2]) V += int(y[x3[2] in code and x3[2]!=x3[1] and x3[2]!=x3[0] and x3[2]!=code[2]::2]) V += int(y[x3[3] in code and x3[3]!=x3[2] and x3[3]!=x3[1] and x3[3]!=x3[0] and x3[3]!=code[3]::2]) X = int(y[x3[0] not in code::2]) X += int(y[x3[1] not in code and x3[1]!=x3[0]::2]) X += int(y[x3[2] not in code and x3[2]!=x3[1] and x3[2]!=x3[0]::2]) X += int(y[x3[3] not in code and x3[3]!=x3[2] and x3[3]!=x3[1] and x3[3]!=x3[0]::2]) if P != 4: print(" "+"P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) print(LOSING_MSG) print("The answer is "+code) print("Please try again...") else : print(WINNING_MSG) else: print(WINNING_MSG) else: print(WINNING_MSG) else: print(WINNING_MSG) |
# 6330392421 (20.00) 236 (2021-02-13 22:48) a = input('Turn #1 : ') P = 0 V = 0 X = 0 if code[0] == a[0]: P += 1 if code[1] == a[1]: P += 1 if code[2] == a[2]: P += 1 if code[3] == a[3]: P += 1 if (code[0] in a) and (code[0] != a[0]): V += 1 if (code[1] in a) and (code[1] != a[1]): V += 1 if (code[2] in a) and (code[2] != a[2]): V += 1 if (code[3] in a) and (code[3] != a[3]): V += 1 if not code[0] in a: X += 1 if not code[1] in a: X += 1 if not code[2] in a: X += 1 if not code[3] in a: X += 1 if P == 4: print('Congratulations! You won the game.') else: print(' ','P='+str(P)+',V='+str(V)+',X='+str(X)) #turn2 b = input('Turn #2 : ') P = 0 V = 0 X = 0 if code[0] == b[0]: P += 1 if code[1] == b[1]: P += 1 if code[2] == b[2]: P += 1 if code[3] == b[3]: P += 1 if (code[0] in b) and (code[0] != b[0]): V += 1 if (code[1] in b) and (code[1] != b[1]): V += 1 if (code[2] in b) and (code[2] != b[2]): V += 1 if (code[3] in b) and (code[3] != b[3]): V += 1 if not code[0] in b: X += 1 if not code[1] in b: X += 1 if not code[2] in b: X += 1 if not code[3] in b: X += 1 if P == 4: print('Congratulations! You won the game.') else: print(' ','P='+str(P)+',V='+str(V)+',X='+str(X)) #turn 3 c = input('Turn #3 : ') P = 0 V = 0 X = 0 if code[0] == c[0]: P += 1 if code[1] == c[1]: P += 1 if code[2] == c[2]: P += 1 if code[3] == c[3]: P += 1 if (code[0] in c) and (code[0] != c[0]): V += 1 if (code[1] in c) and (code[1] != c[1]): V += 1 if (code[2] in c) and (code[2] != c[2]): V += 1 if (code[3] in c) and (code[3] != c[3]): V += 1 if not code[0] in c: X += 1 if not code[1] in c: X += 1 if not code[2] in c: X += 1 if not code[3] in c: X += 1 if P == 4: print('Congratulations! You won the game.') else: print(' ','P='+str(P)+',V='+str(V)+',X='+str(X)) #turn 4 d = input('Turn #4 : ') P = 0 V = 0 X = 0 if code[0] == d[0]: P += 1 if code[1] == d[1]: P += 1 if code[2] == d[2]: P += 1 if code[3] == d[3]: P += 1 if (code[0] in d) and (code[0] != d[0]): V += 1 if (code[1] in d) and (code[1] != d[1]): V += 1 if (code[2] in d) and (code[2] != d[2]): V += 1 if (code[3] in d) and (code[3] != d[3]): V += 1 if not code[0] in d: X += 1 if not code[1] in d: X += 1 if not code[2] in d: X += 1 if not code[3] in d: X += 1 if P == 4: print('Congratulations! You won the game.') else: print(' ','P='+str(P)+',V='+str(V)+',X='+str(X)) print('Sorry! You just lost it.') print('The answer is', code) print('Please try again...') |
# 6330393021 (18.43) 237 (2021-02-15 23:20) iswin=False P=0 V=0 X=0 print('Turn #1:', end='') Player_code=input() if Player_code[0]==code[0] and Player_code[1]==code[1] and Player_code[2]==code[2] and Player_code[3]==code[3]: print(WINNING_MSG) iswin=True else: if Player_code[0]==code[0]: P+=1 if Player_code[1]==code[1]: P+=1 if Player_code[2]==code[2]: P+=1 if Player_code[3]==code[3]: P+=1 if Player_code[0] not in code: X+=1 if Player_code[1] not in code: X+=1 if Player_code[2] not in code: X+=1 if Player_code[3] not in code: X+=1 V=4-P-X print('P=',P,'V=',V,'X=',X) P=0 V=0 X=0 if not iswin: print('Turn #2:', end='') Player_code=input() if Player_code[0]==code[0] and Player_code[1]==code[1] and Player_code[2]==code[2] and Player_code[3]==code[3]: print(WINNING_MSG) iswin=True else: if Player_code[0]==code[0]: P+=1 if Player_code[1]==code[1]: P+=1 if Player_code[2]==code[2]: P+=1 if Player_code[3]==code[3]: P+=1 if Player_code[0] not in code: X+=1 if Player_code[1] not in code: X+=1 if Player_code[2] not in code: X+=1 if Player_code[3] not in code: X+=1 V=4-P-X print('P=',P,'V=',V,'X=',X) P=0 V=0 X=0 if not iswin: print('Turn #3:', end='') Player_code=input() if Player_code[0]==code[0] and Player_code[1]==code[1] and Player_code[2]==code[2] and Player_code[3]==code[3]: print(WINNING_MSG) iswin=True else: if Player_code[0]==code[0]: P+=1 if Player_code[1]==code[1]: P+=1 if Player_code[2]==code[2]: P+=1 if Player_code[3]==code[3]: P+=1 if Player_code[0] not in code: X+=1 if Player_code[1] not in code: X+=1 if Player_code[2] not in code: X+=1 if Player_code[3] not in code: X+=1 V=4-P-X print('P=',P,'V=',V,'X=',X) P=0 V=0 X=0 if not iswin: print('Turn #4:', end='') Player_code=input() if Player_code[0]==code[0] and Player_code[1]==code[1] and Player_code[2]==code[2] and Player_code[3]==code[3]: print(WINNING_MSG) iswin=True else: if Player_code[0]==code[0]: P+=1 if Player_code[1]==code[1]: P+=1 if Player_code[2]==code[2]: P+=1 if Player_code[3]==code[3]: P+=1 if Player_code[0] not in code: X+=1 if Player_code[1] not in code: X+=1 if Player_code[2] not in code: X+=1 if Player_code[3] not in code: X+=1 V=4-P-X print('P=',P,'V=',V,'X=',X) print(LOSING_MSG) print('The answer is', code) print('Please try again...') |
# 6330394721 (19.11) 238 (2021-02-15 01:33) k=input() p=0 v=0 if k[0] in code: v+=1 if k[1] in code: v+=1 if k[2] in code: v+=1 if k[3] in code: v+=1 if k[0]==code[0]: p+=1 if k[1]==code[1]: p+=1 if k[2]==code[2]: p+=1 if k[3]==code[3]: p+=1 if k==code: print(WINNING_MSG) else: print("Turn #1 : "+k) print(" "+"P="+str(p)+",V="+str(v-p)+",X="+str(4-v)) k=input() p=0 v=0 if k[0] in code: v+=1 if k[1] in code: v+=1 if k[2] in code: v+=1 if k[3] in code: v+=1 if k[0]==code[0]: p+=1 if k[1]==code[1]: p+=1 if k[2]==code[2]: p+=1 if k[3]==code[3]: p+=1 if k==code: print(WINNING_MSG) else: print("Turn #2 : "+k) print(" "+"P="+str(p)+",V="+str(v-p)+",X="+str(4-v)) k=input() p=0 v=0 if k[0] in code: v+=1 if k[1] in code: v+=1 if k[2] in code: v+=1 if k[3] in code: v+=1 if k[0]==code[0]: p+=1 if k[1]==code[1]: p+=1 if k[2]==code[2]: p+=1 if k[3]==code[3]: p+=1 if k==code: print(WINNING_MSG) else: print("Turn #3 : "+k) print(" "+"P="+str(p)+",V="+str(v-p)+",X="+str(4-v)) k=input() p=0 v=0 if k[0] in code: v+=1 if k[1] in code: v+=1 if k[2] in code: v+=1 if k[3] in code: v+=1 if k[0]==code[0]: p+=1 if k[1]==code[1]: p+=1 if k[2]==code[2]: p+=1 if k[3]==code[3]: p+=1 if k==code: print(WINNING_MSG) else: print("Turn #4 : "+k) print(" "+"P="+str(p)+",V="+str(v-p)+",X="+str(4-v)) print(LOSING_MSG) print("The answer is "+code) print("Please try again...") |
# 6330395321 (20.00) 239 (2021-02-15 17:24) blank = len("Turn ## : ") first = input("Turn #1 : ") P = 0 V = 0 X = 0 if first == code: print(WINNING_MSG) else: if first[0] == code[0]: P += 1 elif first[0] in code: V += 1 else: X += 1 if first[1] == code[1]: P += 1 elif first[1] in code: V += 1 else: X += 1 if first[2] == code[2]: P += 1 elif first[2] in code: V += 1 else: X += 1 if first[3] == code[3]: P += 1 elif first[3] in code: V += 1 else: X += 1 if first == code: pass else: print(" "*blank+"P="+str(P)+",V="+str(V)+",X="+str(X)) second = input("Turn #2 : ") P = 0 V = 0 X = 0 if second == code: print(WINNING_MSG) else: if second[0] == code[0]: P += 1 elif second[0] in code: V += 1 else: X += 1 if second[1] == code[1]: P += 1 elif second[1] in code: V += 1 else: X += 1 if second[2] == code[2]: P += 1 elif second[2] in code: V += 1 else: X += 1 if second[3] == code[3]: P += 1 elif second[3] in code: V += 1 else: X += 1 if second==code: pass else: print(" "*blank+"P="+str(P)+",V="+str(V)+",X="+str(X)) third = input("Turn #3 : ") P = 0 V = 0 X = 0 if third == code: print(WINNING_MSG) else: if third[0] == code[0]: P += 1 elif third[0] in code: V += 1 else: X += 1 if third[1] == code[1]: P += 1 elif third[1] in code: V += 1 else: X += 1 if third[2] == code[2]: P += 1 elif third[2] in code: V += 1 else: X += 1 if third[3] == code[3]: P += 1 elif third[3] in code: V += 1 else: X += 1 if third==code: pass else: print(" "*blank+"P="+str(P)+",V="+str(V)+",X="+str(X)) forth = input("Turn #4 : ") P = 0 V = 0 X = 0 if forth == code: print(WINNING_MSG) else: if forth[0] == code[0]: P += 1 elif forth[0] in code: V += 1 else: X += 1 if forth[1] == code[1]: P += 1 elif forth[1] in code: V += 1 else: X += 1 if forth[2] == code[2]: P += 1 elif forth[2] in code: V += 1 else: X += 1 if forth[3] == code[3]: P += 1 elif forth[3] in code: V += 1 else: X += 1 print(" "*blank+"P="+str(P)+",V="+str(V)+",X="+str(X)) print(LOSING_MSG) print("The answer is " + code) print("Please try again...") |
# 6330396021 (19.89) 240 (2021-02-15 09:48) in_turn1 = input("Turn #1 : ") if in_turn1 == code : print(WINNING_MSG) else : p = 0 v = 0 x = 4 if in_turn1 != code : if in_turn1[0] == code[0] : p += 1 if in_turn1[1] == code[1] : p += 1 if in_turn1[2] == code[2] : p += 1 if in_turn1[3] == code[3] : p += 1 if in_turn1[0] == code[1] or in_turn1[0] == code[2] or in_turn1[0] == code[3] : v += 1 if in_turn1[1] == code[0] or in_turn1[1] == code[2] or in_turn1[1] == code[3] : v += 1 if in_turn1[2] == code[0] or in_turn1[2] == code[1] or in_turn1[2] == code[3] : v += 1 if in_turn1[3] == code[0] or in_turn1[3] == code[1] or in_turn1[3] == code[2] : v += 1 x = x - (p+v) print(" "+"P="+str(p)+",V="+str(v)+",X="+str(x)) in_turn2 = input("Turn #2 : ") if in_turn2 == code : print(WINNING_MSG) else : p = 0 v = 0 x = 4 if in_turn1 != code : if in_turn2[0] == code[0] : p += 1 if in_turn2[1] == code[1] : p += 1 if in_turn2[2] == code[2] : p += 1 if in_turn2[3] == code[3] : p += 1 if in_turn2[0] == code[1] or in_turn2[0] == code[2] or in_turn2[0] == code[3] : v += 1 if in_turn2[1] == code[0] or in_turn2[1] == code[2] or in_turn2[1] == code[3] : v += 1 if in_turn2[2] == code[0] or in_turn2[2] == code[1] or in_turn2[2] == code[3] : v += 1 if in_turn2[3] == code[0] or in_turn2[3] == code[1] or in_turn2[3] == code[2] : v += 1 x = x - (p+v) print(" "+"P="+str(p)+",V="+str(v)+",X="+str(x)) in_turn3 = input("Turn #3 : ") if in_turn3 == code : print(WINNING_MSG) else : p = 0 v = 0 x = 4 if in_turn3 != code : if in_turn3[0] == code[0] : p += 1 if in_turn3[1] == code[1] : p += 1 if in_turn3[2] == code[2] : p += 1 if in_turn3[3] == code[3] : p += 1 if in_turn3[0] == code[1] or in_turn3[0] == code[2] or in_turn3[0] == code[3] : v += 1 if in_turn3[1] == code[0] or in_turn3[1] == code[2] or in_turn3[1] == code[3] : v += 1 if in_turn3[2] == code[0] or in_turn3[2] == code[1] or in_turn3[2] == code[3] : v += 1 if in_turn3[3] == code[0] or in_turn3[3] == code[1] or in_turn3[3] == code[2] : v += 1 x = x - (p+v) print(" "+"P="+str(p)+",V="+str(v)+",X="+str(x)) in_turn4 = input("Turn #4 : ") if in_turn4 == code : print(WINNING_MSG) else : p = 0 v = 0 x = 4 if in_turn4 != code : if in_turn4[0] == code[0] : p += 1 if in_turn4[1] == code[1] : p += 1 if in_turn4[2] == code[2] : p += 1 if in_turn4[3] == code[3] : p += 1 if in_turn4[0] == code[1] or in_turn4[0] == code[2] or in_turn4[0] == code[3] : v += 1 if in_turn4[1] == code[0] or in_turn4[1] == code[2] or in_turn4[1] == code[3] : v += 1 if in_turn4[2] == code[0] or in_turn4[2] == code[1] or in_turn4[2] == code[3] : v += 1 if in_turn4[3] == code[0] or in_turn4[3] == code[1] or in_turn4[3] == code[2] : v += 1 x = x - (p+v) print(" "+"P="+str(p)+",V="+str(v)+",X="+str(x)) print(LOSING_MSG) print("The answer is ",code) print("Please try again") |
# 6330397621 (16.83) 241 (2021-02-15 23:43) a = input("Turn #1 : ") P = 0 V = 0 X = 0 if not a in code : b = a.find(code[0]) if b is 0 : P+=1 if b is 1 : V+=1 if b is 2 : V+=1 if b is 3 : V+=1 if b is -1 : X+=1 c = a.find(code[1]) if c is 1 : P+=1 if c is 0 : V+=1 if c is 2 : V+=1 if c is 3 : V+=1 if c is -1 : X+=1 d = a.find(code[2]) if d is 2 : P+=1 if d is 0 : V+=1 if d is 1 : V+=1 if d is 3 : V+=1 if d is -1 : X+=1 e = a.find(code[3]) if e is 3 : P+=1 if e is 0 : V+=1 if e is 1 : V+=1 if e is 2 : V+=1 if e is -1 : X+=1 print(" P="+str(P)+",V="+str(V)+",X="+str(X)) else : print(WINNING_MSG) x = input('Turn #2 : ') P = 0 V = 0 X = 0 if not x in code : b = x.find(code[0]) if b is 0 : P+=1 if b is 1 : V+=1 if b is 2 : V+=1 if b is 3 : V+=1 if b is -1 : X+=1 c = x.find(code[1]) if c is 1 : P+=1 if c is 0 : V+=1 if c is 2 : V+=1 if c is 3 : V+=1 if c is -1 : X+=1 d = x.find(code[2]) if d is 2 : P+=1 if d is 0 : V+=1 if d is 1 : V+=1 if d is 3 : V+=1 if d is -1 : X+=1 e = x.find(code[3]) if e is 3 : P+=1 if e is 0 : V+=1 if e is 1 : V+=1 if e is 2 : V+=1 if e is -1 : X+=1 print(" P="+str(P)+",V="+str(V)+",X="+str(X)) else : print(WINNING_MSG) y = input('Turn #3 : ') P = 0 V = 0 X = 0 if not y in code : b = y.find(code[0]) if b is 0 : P+=1 if b is 1 : V+=1 if b is 2 : V+=1 if b is 3 : V+=1 if b is -1 : X+=1 c = y.find(code[1]) if c is 1 : P+=1 if c is 0 : V+=1 if c is 2 : V+=1 if c is 3 : V+=1 if c is -1 : X+=1 d = y.find(code[2]) if d is 2 : P+=1 if d is 0 : V+=1 if d is 1 : V+=1 if d is 3 : V+=1 if d is -1 : X+=1 e = y.find(code[3]) if e is 3 : P+=1 if e is 0 : V+=1 if e is 1 : V+=1 if e is 2 : V+=1 if e is -1 : X+=1 print(" P="+str(P)+",V="+str(V)+",X="+str(X)) else : print(WINNING_MSG) z = input('Turn #4 : ') P = 0 V = 0 X = 0 if not z in code : b = z.find(code[0]) if b is 0 : P+=1 if b is 1 : V+=1 if b is 2 : V+=1 if b is 3 : V+=1 if b is -1 : X+=1 c = x.find(code[1]) if c is 1 : P+=1 if c is 0 : V+=1 if c is 2 : V+=1 if c is 3 : V+=1 if c is -1 : X+=1 d = z.find(code[2]) if d is 2 : P+=1 if d is 0 : V+=1 if d is 1 : V+=1 if d is 3 : V+=1 if d is -1 : X+=1 e = z.find(code[3]) if e is 3 : P+=1 if e is 0 : V+=1 if e is 1 : V+=1 if e is 2 : V+=1 if e is -1 : X+=1 print(" P="+str(P)+",V="+str(V)+",X="+str(X)) print(LOSING_MSG) print("The answer is",code) print("Please try again...") else : print(WINNING_MSG) |
# 6330398221 (20.00) 242 (2021-02-13 16:27) #turn1 code1=[code[0],code[1],code[2],code[3]] P=0 V=0 X=0 x=input('Turn #1 : ') if x==code: print(WINNING_MSG) else: if x[0] in code1 or x[1] in code1 or x[2] in code1 or x[3] in code1: if x[0]==code[0]: #check x[0] P+=1;V=V;X=X elif x[0] in code1: P=P;V+=1;X=X else: P=P;V=V;X+=1 if x[1]==code[1]: #checkx[1] P+=1;V=V;X=X elif x[1] in code1: P=P;V+=1;X=X else: P=P;V=V;X+=1 if x[2]==code[2]: #check x[2] P+=1;V=V;X=X elif x[2] in code1: P=P;V+=1;X=X else: P=P;V=V;X+=1 if x[3]==code[3]: #check x[3] P+=1;V=V;X=X elif x[3] in code1: P=P;V+=1;X=X else: P=P;V=V;X+=1 print(' P='+str(P)+',V='+str(V)+',X='+str(X)) else: X=4 print(' P='+str(P)+',V='+str(V)+',X='+str(X)) #turn2 x=input('Turn #2 : ') P=0;V=0;X=0 if x==code: print(WINNING_MSG) else: if x[0] in code1 or x[1] in code1 or x[2] in code1 or x[3] in code1: if x[0]==code[0]: #check x[0] P+=1;V=V;X=X elif x[0] in code1: P=P;V+=1;X=X else: P=P;V=V;X+=1 if x[1]==code[1]: #checkx[1] P+=1;V=V;X=X elif x[1] in code1: P=P;V+=1;X=X else: P=P;V=V;X+=1 if x[2]==code[2]: #check x[2] P+=1;V=V;X=X elif x[2] in code1: P=P;V+=1;X=X else: P=P;V=V;X+=1 if x[3]==code[3]: #check x[3] P+=1;V=V;X=X elif x[3] in code1: P=P;V+=1;X=X else: P=P;V=V;X+=1 print(' P='+str(P)+',V='+str(V)+',X='+str(X)) else: X=4 print(' P='+str(P)+',V='+str(V)+',X='+str(X)) #turn3 x=input('Turn #3 : ') P=0;V=0;X=0 if x==code: print(WINNING_MSG) else: if x[0] in code1 or x[1] in code1 or x[2] in code1 or x[3] in code1: if x[0]==code[0]: #check x[0] P+=1;V=V;X=X elif x[0] in code1: P=P;V+=1;X=X else: P=P;V=V;X+=1 if x[1]==code[1]: #checkx[1] P+=1;V=V;X=X elif x[1] in code1: P=P;V+=1;X=X else: P=P;V=V;X+=1 if x[2]==code[2]: #check x[2] P+=1;V=V;X=X elif x[2] in code1: P=P;V+=1;X=X else: P=P;V=V;X+=1 if x[3]==code[3]: #check x[3] P+=1;V=V;X=X elif x[3] in code1: P=P;V+=1;X=X else: P=P;V=V;X+=1 print(' P='+str(P)+',V='+str(V)+',X='+str(X)) else: X=4 print(' P='+str(P)+',V='+str(V)+',X='+str(X)) #turn4 x=input('Turn #4 : ') P=0;V=0;X=0 if x==code: print(WINNING_MSG) else: if x[0] in code1 or x[1] in code1 or x[2] in code1 or x[3] in code1: if x[0]==code[0]: #check x[0] P+=1;V=V;X=X elif x[0] in code1: P=P;V+=1;X=X else: P=P;V=V;X+=1 if x[1]==code[1]: #checkx[1] P+=1;V=V;X=X elif x[1] in code1: P=P;V+=1;X=X else: P=P;V=V;X+=1 if x[2]==code[2]: #check x[2] P+=1;V=V;X=X elif x[2] in code1: P=P;V+=1;X=X else: P=P;V=V;X+=1 if x[3]==code[3]: #check x[3] P+=1;V=V;X=X elif x[3] in code1: P=P;V+=1;X=X else: P=P;V=V;X+=1 print(' P='+str(P)+',V='+str(V)+',X='+str(X)) else: X=4 print(' P='+str(P)+',V='+str(V)+',X='+str(X)) print(LOSING_MSG) print('The answer is '+code) print('Please try again...') |
# 6330399921 (20.00) 243 (2021-02-13 01:00) txt = input('Turn #1 : ') p = 0 v = 0 x = 4 if txt[0] in code or txt[1] in code or txt[2] in code or txt[3] in code: if txt[0] in code: v+=1 x-=1 if txt[0] == code[0]: v-=1 p+=1 if txt[1] in code: v+=1 x-=1 if txt[1] == code[1]: v-=1 p+=1 if txt[2] in code: v+=1 x-=1 if txt[2] == code[2]: v-=1 p+=1 if txt[3] in code: v+=1 x-=1 if txt[3] == code[3]: v-=1 p+=1 if p == 4: print(WINNING_MSG) else: print(' '*10+'P='+str(p)+','+'V='+str(v)+','+'X='+str(x)) else: print(' '*10+'P='+str(p)+','+'V='+str(v)+','+'X='+str(x)) if p != 4: txt = input('Turn #2 : ') p = 0 v = 0 x = 4 if txt[0] in code or txt[1] in code or txt[2] in code or txt[3] in code: if txt[0] in code: v+=1 x-=1 if txt[0] == code[0]: v-=1 p+=1 if txt[1] in code: v+=1 x-=1 if txt[1] == code[1]: v-=1 p+=1 if txt[2] in code: v+=1 x-=1 if txt[2] == code[2]: v-=1 p+=1 if txt[3] in code: v+=1 x-=1 if txt[3] == code[3]: v-=1 p+=1 if p == 4: print(WINNING_MSG) else: print(' '*10+'P='+str(p)+','+'V='+str(v)+','+'X='+str(x)) else: print(' '*10+'P='+str(p)+','+'V='+str(v)+','+'X='+str(x)) if p != 4: txt = input('Turn #3 : ') p = 0 v = 0 x = 4 if txt[0] in code or txt[1] in code or txt[2] in code or txt[3] in code: if txt[0] in code: v+=1 x-=1 if txt[0] == code[0]: v-=1 p+=1 if txt[1] in code: v+=1 x-=1 if txt[1] == code[1]: v-=1 p+=1 if txt[2] in code: v+=1 x-=1 if txt[2] == code[2]: v-=1 p+=1 if txt[3] in code: v+=1 x-=1 if txt[3] == code[3]: v-=1 p+=1 if p == 4: print(WINNING_MSG) else: print(' '*10+'P='+str(p)+','+'V='+str(v)+','+'X='+str(x)) else: print(' '*10+'P='+str(p)+','+'V='+str(v)+','+'X='+str(x)) if p != 4: txt = input('Turn #4 : ') p = 0 v = 0 x = 4 if txt[0] in code or txt[1] in code or txt[2] in code or txt[3] in code: if txt[0] in code: v+=1 x-=1 if txt[0] == code[0]: v-=1 p+=1 if txt[1] in code: v+=1 x-=1 if txt[1] == code[1]: v-=1 p+=1 if txt[2] in code: v+=1 x-=1 if txt[2] == code[2]: v-=1 p+=1 if txt[3] in code: v+=1 x-=1 if txt[3] == code[3]: v-=1 p+=1 if p == 4: print(WINNING_MSG) else: print(' '*10+'P='+str(p)+','+'V='+str(v)+','+'X='+str(x)) else: print(' '*10+'P='+str(p)+','+'V='+str(v)+','+'X='+str(x)) if p != 4: print(LOSING_MSG) print('The answer is',code) print('Please try again...') # In[ ]: |
# 6330400821 (19.29) 244 (2021-02-12 17:24) Color_pick = input("Turn #1 "+":"+" ") P = 0 V = 0 T = 1 if Color_pick == code and T==1 : print(WINNING_MSG) T -= 1 elif Color_pick != code : if Color_pick[0] == code[1] or Color_pick[0] == code[2] or Color_pick[0] == code[3] : V += 1 if Color_pick[1] == code[0] or Color_pick[1] == code[2] or Color_pick[1] == code[3] : V += 1 if Color_pick[2] == code[1] or Color_pick[2] == code[0] or Color_pick[2] == code[3] : V += 1 if Color_pick[3] == code[1] or Color_pick[3] == code[2] or Color_pick[3] == code[0] : V += 1 if Color_pick[0] == code[0] : P += 1 if Color_pick[1] == code[1] : P += 1 if Color_pick[2] == code[2] : P += 1 if Color_pick[3] == code[3] : P += 1 X = 4 - P - V print(" "+"P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) Color_pick = input("Turn #2 "+":"+" ") P = 0 V = 0 T = 1 if Color_pick == code and T == 1: print(WINNING_MSG) T -= 1 elif Color_pick != code : if Color_pick[0] == code[1] or Color_pick[0] == code[2] or Color_pick[0] == code[3] : V += 1 if Color_pick[1] == code[0] or Color_pick[1] == code[2] or Color_pick[1] == code[3] : V += 1 if Color_pick[2] == code[1] or Color_pick[2] == code[0] or Color_pick[2] == code[3] : V += 1 if Color_pick[3] == code[1] or Color_pick[3] == code[2] or Color_pick[3] == code[0] : V += 1 if Color_pick[0] == code[0] : P += 1 if Color_pick[1] == code[1] : P += 1 if Color_pick[2] == code[2] : P += 1 if Color_pick[3] == code[3] : P += 1 X = 4 - P - V print(" "+"P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) Color_pick = input("Turn #3 "+":"+" ") P = 0 V = 0 T = 1 if Color_pick == code and T == 1: print(WINNING_MSG) T -= 1 elif Color_pick != code : if Color_pick[0] == code[1] or Color_pick[0] == code[2] or Color_pick[0] == code[3] : V += 1 if Color_pick[1] == code[0] or Color_pick[1] == code[2] or Color_pick[1] == code[3] : V += 1 if Color_pick[2] == code[1] or Color_pick[2] == code[0] or Color_pick[2] == code[3] : V += 1 if Color_pick[3] == code[1] or Color_pick[3] == code[2] or Color_pick[3] == code[0] : V += 1 if Color_pick[0] == code[0] : P += 1 if Color_pick[1] == code[1] : P += 1 if Color_pick[2] == code[2] : P += 1 if Color_pick[3] == code[3] : P += 1 X = 4 - P - V print(" "+"P=" + str(P) + "," + "V=" + str(V) + "," + "X=" + str(X)) Color_pick = input("Turn #4 "+":"+" ") P = 0 V = 0 T = 1 if Color_pick == code and T == 1: print(WINNING_MSG) elif Color_pick != code : if Color_pick[0] == code[1] or Color_pick[0] == code[2] or Color_pick[0] == code[3] : V += 1 if Color_pick[1] == code[0] or Color_pick[1] == code[2] or Color_pick[1] == code[3] : V += 1 if Color_pick[2] == code[1] or Color_pick[2] == code[0] or Color_pick[2] == code[3] : V += 1 if Color_pick[3] == code[1] or Color_pick[3] == code[2] or Color_pick[3] == code[0] : V += 1 if Color_pick[0] == code[0] : P += 1 if Color_pick[1] == code[1] : P += 1 if Color_pick[2] == code[2] : P += 1 if Color_pick[3] == code[3] : P += 1 X = 4 - P - V print(" "+"P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) print(LOSING_MSG) print("The answer is "+code) print("Please try again...") |
# 6330401421 (17.21) 245 (2021-02-12 21:55) a = input('Turn #1 : ') p = 0 v = 0 if code[0] == a[0]: p += 1 else: p += 0 if code[1] == a[1]: p += 1 else: p += 0 if code[2] == a[2]: p += 1 else: p += 0 if code[3] == a[3]: p += 1 else: p += 0 if p == 4: print('Congratulations! You won the game.') elif code[0] in a: v += 1 else: v += 0 if code[1] in a: v += 1 else: v += 0 if code[2] in a: v += 1 else: v += 0 if code[3] in a: v += 1 else: v += 0 if p != 4: print(' '+'p='+str(p)+','+'v='+str(v-p)+','+'x='+str(4-v)) a = input('Turn #2 : ') p = 0 v = 0 if code[0] == a[0]: p += 1 else: p += 0 if code[1] == a[1]: p += 1 else: p += 0 if code[2] == a[2]: p += 1 else: p += 0 if code[3] == a[3]: p += 1 else: p += 0 if p == 4: print('Congratulations! You won the game.') elif code[0] in a: v += 1 else: v += 0 if code[1] in a: v += 1 else: v += 0 if code[2] in a: v += 1 else: v += 0 if code[3] in a: v += 1 else: v += 0 if p != 4: print(' '+'p='+str(p)+','+'v='+str(v-p)+','+'x='+str(4-v)) a = input('Turn #3 : ') p = 0 v = 0 if code[0] == a[0]: p += 1 else: p += 0 if code[1] == a[1]: p += 1 else: p += 0 if code[2] == a[2]: p += 1 else: p += 0 if code[3] == a[3]: p += 1 else: p += 0 if p == 4: print('Congratulations! You won the game.') elif code[0] in a: v += 1 else: v += 0 if code[1] in a: v += 1 else: v += 0 if code[2] in a: v += 1 else: v += 0 if code[3] in a: v += 1 else: v += 0 if p != 4: print(' '+'p='+str(p)+','+'v='+str(v-p)+','+'x='+str(4-v)) a = input('Turn #4 : ') p = 0 v = 0 if code[0] == a[0]: p += 1 else: p += 0 if code[1] == a[1]: p += 1 else: p += 0 if code[2] == a[2]: p += 1 else: p += 0 if code[3] == a[3]: p += 1 else: p += 0 if p == 4: print('Congratulations! You won the game.') elif code[0] in a: v += 1 else: v += 0 if code[1] in a: v += 1 else: v += 0 if code[2] in a: v += 1 else: v += 0 if code[3] in a: v += 1 else: v += 0 if p != 4: print(' '+'p='+str(p)+','+'v='+str(v-p)+','+'x='+str(4-v)) print('Sorry! You just lost it.') print('The answer is ',code) print('Please try again...') else: pass |
# 6330402021 (19.20) 246 (2021-02-12 17:33) p = 0 v = 0 maker = input("Turn #1 : ").upper() if maker == code : print(WINNING_MSG) else : if maker[0]==code[0] : p +=1 elif maker[0] in code : v +=1 if maker[1]==code[1] : p +=1 elif maker[1] in code : v +=1 if maker[2]==code[2] : p +=1 elif maker[2] in code : v +=1 if maker[3]==code[3] : p +=1 elif maker[3] in code : v +=1 x = (4-p)-v print(" P="+str(p)+","+"V="+str(v)+","+"X="+str(x)) p,v,x = 0,0,0 maker = input("Turn #2 : ").upper() if maker == code : print(WINNING_MSG) else : if maker[0]==code[0] : p +=1 elif maker[0] in code : v +=1 if maker[1]==code[1] : p +=1 elif maker[1] in code : v +=1 if maker[2]==code[2] : p +=1 elif maker[2] in code : v +=1 if maker[3]==code[3] : p +=1 elif maker[3] in code : v +=1 x = (4-p)-v print(" P="+str(p)+","+"V="+str(v)+","+"X="+str(x)) p,v,x = 0,0,0 maker = input("Turn #3 : ").upper() if maker == code : print(WINNING_MSG) else : if maker[0]==code[0] : p +=1 elif maker[0] in code : v +=1 if maker[1]==code[1] : p +=1 elif maker[1] in code : v +=1 if maker[2]==code[2] : p +=1 elif maker[2] in code : v +=1 if maker[3]==code[3] : p +=1 elif maker[3] in code : v +=1 x = (4-p)-v print(" P="+str(p)+","+"V="+str(v)+","+"X="+str(x)) p,v,x = 0,0,0 maker = input("Turn #4 : ").upper() if maker == code : print(WINNING_MSG) else : if maker[0]==code[0] : p +=1 elif maker[0] in code : v +=1 if maker[1]==code[1] : p +=1 elif maker[1] in code : v +=1 if maker[2]==code[2] : p +=1 elif maker[2] in code : v +=1 if maker[3]==code[3] : p +=1 elif maker[3] in code : v +=1 x = (4-p)-v print(" P="+str(p)+","+"V="+str(v)+","+"X="+str(x)) print(LOSING_MSG) print("The answer is "+code) print("Please try again...") |
# 6330403721 (20.00) 247 (2021-02-15 13:37) P = 0 V = 0 X = 0 m = input("Turn #1 : ") if m == code: print(WINNING_MSG) else: if m[0] in code: if m[0] == code[0]: P += 1 else: V += 1 else: X += 1 if m[1] in code: if m[1] == code[1]: P += 1 else: V += 1 else: X += 1 if m[2] in code: if m[2] == code[2]: P += 1 else: V += 1 else: X += 1 if m[3] in code: if m[3] == code[3]: P += 1 else: V += 1 else: X += 1 print(' P='+str(P) +',V='+str(V) + ',X='+ str(X)) P = 0 V = 0 X = 0 m = input("Turn #2 : ") if m == code: print(WINNING_MSG) else: if m[0] in code: if m[0] == code[0]: P += 1 else: V += 1 else: X += 1 if m[1] in code: if m[1] == code[1]: P += 1 else: V += 1 else: X += 1 if m[2] in code: if m[2] == code[2]: P += 1 else: V += 1 else: X += 1 if m[3] in code: if m[3] == code[3]: P += 1 else: V += 1 else: X += 1 print(' P='+str(P) +',V='+str(V) + ',X='+ str(X)) P = 0 V = 0 X = 0 m = input("Turn #3 : ") if m == code: print(WINNING_MSG) else: if m[0] in code: if m[0] == code[0]: P += 1 else: V += 1 else: X += 1 if m[1] in code: if m[1] == code[1]: P += 1 else: V += 1 else: X += 1 if m[2] in code: if m[2] == code[2]: P += 1 else: V += 1 else: X += 1 if m[3] in code: if m[3] == code[3]: P += 1 else: V += 1 else: X += 1 print(' P='+str(P) +',V='+str(V) + ',X='+ str(X)) P = 0 V = 0 X = 0 m = input("Turn #4 : ") if m == code: print(WINNING_MSG) else: if m[0] in code: if m[0] == code[0]: P += 1 else: V += 1 else: X += 1 if m[1] in code: if m[1] == code[1]: P += 1 else: V += 1 else: X += 1 if m[2] in code: if m[2] == code[2]: P += 1 else: V += 1 else: X += 1 if m[3] in code: if m[3] == code[3]: P += 1 else: V += 1 else: X += 1 print(' P='+str(P) +',V='+str(V) + ',X='+ str(X)) print(LOSING_MSG) print('The answer is'+' '+code) print('Please try again...') |
# 6330404321 (20.00) 248 (2021-02-15 19:29) win=0 p,v,x = 0,0,0 g = input('Turn #1 : ') if g == code: win = 1 else: if g[0] == code[0] : p += 1 elif g[0] in code : v +=1 if g[0] not in code: x += 1 if g[1] == code[1] : p += 1 elif g[1] in code : v +=1 if g[1] not in code: x += 1 if g[2] == code[2] : p += 1 elif g[2] in code : v +=1 if g[2] not in code: x += 1 if g[3] == code[3] : p += 1 elif g[3] in code : v +=1 if g[3] not in code: x += 1 print(' '+"P="+str(p)+","+"V="+str(v)+","+"X="+str(x)) if win==0: p,v,x = 0,0,0 g = input('Turn #2 : ') if g == code: win = True if not win: if g[0] == code[0] : p += 1 elif g[0] in code : v +=1 if g[0] not in code: x += 1 if g[1] == code[1] : p += 1 elif g[1] in code : v +=1 if g[1] not in code: x += 1 if g[2] == code[2] : p += 1 elif g[2] in code : v +=1 if g[2] not in code: x += 1 if g[3] == code[3] : p += 1 elif g[3] in code : v +=1 if g[3] not in code: x += 1 print(' '+"P="+str(p)+","+"V="+str(v)+","+"X="+str(x)) if win==0: p,v,x = 0,0,0 g = input('Turn #3 : ') if g == code: win=1 else: if g[0] == code[0] : p += 1 elif g[0] in code : v +=1 if g[0] not in code: x += 1 if g[1] == code[1] : p += 1 elif g[1] in code : v +=1 if g[1] not in code: x += 1 if g[2] == code[2] : p += 1 elif g[2] in code : v +=1 if g[2] not in code: x += 1 if g[3] == code[3] : p += 1 elif g[3] in code : v +=1 if g[3] not in code: x += 1 print(' '+"P="+str(p)+","+"V="+str(v)+","+"X="+str(x)) if win==0: p,v,x = 0,0,0 g = input('Turn #4 : ') if g == code: win = 1 else: if g[0] == code[0] : p += 1 elif g[0] in code : v +=1 if g[0] not in code: x += 1 if g[1] == code[1] : p += 1 elif g[1] in code : v +=1 if g[1] not in code: x += 1 if g[2] == code[2] : p += 1 elif g[2] in code : v +=1 if g[2] not in code: x += 1 if g[3] == code[3] : p += 1 elif g[3] in code : v +=1 if g[3] not in code: x += 1 print(' '+"P="+str(p)+","+"V="+str(v)+","+"X="+str(x)) if win==1: print(WINNING_MSG) else: print(LOSING_MSG) print(f'The answer is {code}') print('Please try again...') |
# 6330405021 (20.00) 249 (2021-02-15 12:21) t=[0]*3 a=input("Turn #1 : ").strip() if a!=code: if a[0] in code: t[int(a[0]!=code[0])]+=1 if a[1] in code: t[int(a[1]!=code[1])]+=1 if a[2] in code: t[int(a[2]!=code[2])]+=1 if a[3] in code: t[int(a[3]!=code[3])]+=1 t[2]=4-t[1]-t[0] print(f" P={t[0]},V={t[1]},X={t[2]}") t=[0]*3 a=input("Turn #2 : ").strip() if a!=code: if a[0] in code: t[int(a[0]!=code[0])]+=1 if a[1] in code: t[int(a[1]!=code[1])]+=1 if a[2] in code: t[int(a[2]!=code[2])]+=1 if a[3] in code: t[int(a[3]!=code[3])]+=1 t[2]=4-t[1]-t[0] print(f" P={t[0]},V={t[1]},X={t[2]}") t=[0]*3 a=input("Turn #3 : ").strip() if a!=code: if a[0] in code: t[int(a[0]!=code[0])]+=1 if a[1] in code: t[int(a[1]!=code[1])]+=1 if a[2] in code: t[int(a[2]!=code[2])]+=1 if a[3] in code: t[int(a[3]!=code[3])]+=1 t[2]=4-t[1]-t[0] print(f" P={t[0]},V={t[1]},X={t[2]}") t=[0]*3 a=input("Turn #4 : ").strip() if a!=code: if a[0] in code: t[int(a[0]!=code[0])]+=1 if a[1] in code: t[int(a[1]!=code[1])]+=1 if a[2] in code: t[int(a[2]!=code[2])]+=1 if a[3] in code: t[int(a[3]!=code[3])]+=1 t[2]=4-t[1]-t[0] print(f" P={t[0]},V={t[1]},X={t[2]}") if a==code: print(WINNING_MSG) else: print(LOSING_MSG) print(f"The answer is {code}") print("Please try again...") |
# 6330406621 (20.00) 250 (2021-02-12 19:35) lcode = code[0], code[1], code[2], code[3] turn1 = input("Turn #1 : ") p1 = 0 x1 = 0 if turn1[0] == code[0]: p1 += 1 if turn1[1] == code[1]: p1 += 1 if turn1[2] == code[2]: p1 += 1 if turn1[3] == code[3]: p1 += 1 elif turn1[1] == code[1]: p1 += 1 if turn1[2] == code[2]: p1 += 1 if turn1[3] == code[3]: p1 += 1 elif turn1[2] == code[2]: p1 += 1 if turn1[3] == code[3]: p1 += 1 elif turn1[3] == code[3]: p1 += 1 if turn1[0] not in lcode: x1 += 1 if turn1[1] not in lcode: x1 += 1 if turn1[2] not in lcode: x1 += 1 if turn1[3] not in lcode: x1 += 1 v1 = 4-(p1+x1) if turn1 != code: print(" P="+str(p1)+","+"V="+str(v1)+","+"X="+str(x1)) turn2 = input("Turn #2 : ") p2 = 0 x2 = 0 if turn2[0] == code[0]: p2 += 1 if turn2[1] == code[1]: p2 += 1 if turn2[2] == code[2]: p2 += 1 if turn2[3] == code[3]: p2 += 1 elif turn2[1] == code[1]: p2 += 1 if turn2[2] == code[2]: p2 += 1 if turn2[3] == code[3]: p2 += 1 elif turn2[2] == code[2]: p2 += 1 if turn2[3] == code[3]: p2 += 1 elif turn2[3] == code[3]: p2 += 1 if turn2[0] not in lcode: x2 += 1 if turn2[1] not in lcode: x2 += 1 if turn2[2] not in lcode: x2 += 1 if turn2[3] not in lcode: x2 += 1 v2 = 4-(p2+x2) if turn2 != code: print(" P="+str(p2)+","+"V="+str(v2)+","+"X="+str(x2)) turn3 = input("Turn #3 : ") p3 = 0 x3 = 0 if turn3[0] == code[0]: p3 += 1 if turn3[1] == code[1]: p3 += 1 if turn3[2] == code[2]: p3 += 1 if turn3[3] == code[3]: p3 += 1 elif turn3[1] == code[1]: p3 += 1 if turn3[2] == code[2]: p3 += 1 if turn3[3] == code[3]: p3 += 1 elif turn3[2] == code[2]: p3 += 1 if turn3[3] == code[3]: p3 += 1 elif turn3[3] == code[3]: p3 += 1 if turn3[0] not in lcode: x3 += 1 if turn3[1] not in lcode: x3 += 1 if turn3[2] not in lcode: x3 += 1 if turn3[3] not in lcode: x3 += 1 v3 = 4-(p3+x3) if turn3 != code: print(" P="+str(p3)+","+"V="+str(v3)+","+"X="+str(x3)) turn4 = input("Turn #4 : ") p4 = 0 x4 = 0 if turn4[0] == code[0]: p4 += 1 if turn4[1] == code[1]: p4 += 1 if turn4[2] == code[2]: p4 += 1 if turn4[3] == code[3]: p4 += 1 elif turn4[1] == code[1]: p4 += 1 if turn4[2] == code[2]: p4 += 1 if turn4[3] == code[3]: p4 += 1 elif turn4[2] == code[2]: p4 += 1 if turn4[3] == code[3]: p4 += 1 elif turn4[3] == code[3]: p4 += 1 if turn4[0] not in lcode: x4 += 1 if turn4[1] not in lcode: x4 += 1 if turn4[2] not in lcode: x4 += 1 if turn4[3] not in lcode: x4 += 1 v4 = 4-(p4+x4) if turn4 != code: print(" P="+str(p4)+","+"V="+str(v4)+","+"X="+str(x4)) print("Sorry! You just lost it.") print("The answer is", code) print("Please try again...") if turn4 == code: print("Congratulations! You won the game.") if turn3 == code: print("Congratulations! You won the game.") if turn2 == code: print("Congratulations! You won the game.") if turn1 == code: print("Congratulations! You won the game.") |
# 6330407221 (17.24) 251 (2021-02-12 22:04) x = input('Turn #1 : ') #p=4 if x == code : P=4 #p=3 elif (x[0] == code[0] and x[1] == code[1] and x[2] == code [2]) \ or (x[1] == code[1] and x[2] == code[2] and x[3] == code [3]) \ or (x[2] == code[2] and x[3] == code[3] and x[0] == code [0]) \ or (x[0] == code[0] and x[1] == code[1] and x[3] == code [3]) : P=3 #p=2 elif (x[0]==code[0] and x[1]==code[1]) \ or (x[0]==code[0] and x[2]==code[2]) \ or (x[0]==code[0] and x[3]==code[3]) \ or (x[1]==code[1] and x[2]==code[2]) \ or (x[1]==code[1] and x[3]==code[3]) \ or (x[2]==code[2] and x[3]==code[3]) : P=2 #p=1 elif (x[0]==code[0]) or (x[1]==code[1]) or (x[2]==code[2]) or (x[3]==code[3]): P=1 #p=0 elif (x[0]!=code[0]) and (x[1]!=code[1]) and (x[2]!=code[2]) and (x[3]!=code[3]): P=0 #v=4 if x[0] in code and x[1] in code and x[2] in code and x[3] in code : V=4 #v=3 elif (x[0] in code and x[1] in code and x[2] in code ) \ or (x[1] in code and x[2] in code and x[3] in code ) \ or (x[2] in code and x[3] in code and x[0] in code ) \ or (x[0] in code and x[1] in code and x[3] in code ) : V=3 #v=2 elif (x[0] in code and x[1] in code) \ or (x[0] in code and x[2] in code) \ or (x[0] in code and x[3] in code) \ or (x[1] in code and x[2] in code) \ or (x[1] in code and x[3] in code) \ or (x[2] in code and x[3] in code) : V=2 #v=1 elif (x[0] in code) or (x[1] in code) or (x[2] in code) or (x[3] in code): V=1 if P==4 : print ('Congratulations! You won the game.') quit() else : print (' '+'P='+str(P)+','+'V='+str(V-P)+','+'X='+str(4-V)) #2 x = input('Turn #2 : ') #p=4 if x == code : P=4 #p=3 elif (x[0] == code[0] and x[1] == code[1] and x[2] == code [2]) \ or (x[1] == code[1] and x[2] == code[2] and x[3] == code [3]) \ or (x[2] == code[2] and x[3] == code[3] and x[0] == code [0]) \ or (x[0] == code[0] and x[1] == code[1] and x[3] == code [3]) : P=3 #p=2 elif (x[0]==code[0] and x[1]==code[1]) \ or (x[0]==code[0] and x[2]==code[2]) \ or (x[0]==code[0] and x[3]==code[3]) \ or (x[1]==code[1] and x[2]==code[2]) \ or (x[1]==code[1] and x[3]==code[3]) \ or (x[2]==code[2] and x[3]==code[3]) : P=2 #p=1 elif (x[0]==code[0]) or (x[1]==code[1]) or (x[2]==code[2]) or (x[3]==code[3]): P=1 #p=0 elif (x[0]!=code[0]) and (x[1]!=code[1]) and (x[2]!=code[2]) and (x[3]!=code[3]): P=0 #v=4 if x[0] in code and x[1] in code and x[2] in code and x[3] in code : V=4 #v=3 elif (x[0] in code and x[1] in code and x[2] in code ) \ or (x[1] in code and x[2] in code and x[3] in code ) \ or (x[2] in code and x[3] in code and x[0] in code ) \ or (x[0] in code and x[1] in code and x[3] in code ) : V=3 #v=2 elif (x[0] in code and x[1] in code) \ or (x[0] in code and x[2] in code) \ or (x[0] in code and x[3] in code) \ or (x[1] in code and x[2] in code) \ or (x[1] in code and x[3] in code) \ or (x[2] in code and x[3] in code) : V=2 #v=1 elif (x[0] in code) or (x[1] in code) or (x[2] in code) or (x[3] in code): V=1 if P==4 : print ('Congratulations! You won the game.') quit() else : print (' '+'P='+str(P)+','+'V='+str(V-P)+','+'X='+str(4-V)) #3 x = input('Turn #3 : ') #p=4 if x == code : P=4 #p=3 elif (x[0] == code[0] and x[1] == code[1] and x[2] == code [2]) \ or (x[1] == code[1] and x[2] == code[2] and x[3] == code [3]) \ or (x[2] == code[2] and x[3] == code[3] and x[0] == code [0]) \ or (x[0] == code[0] and x[1] == code[1] and x[3] == code [3]) : P=3 #p=2 elif (x[0]==code[0] and x[1]==code[1]) \ or (x[0]==code[0] and x[2]==code[2]) \ or (x[0]==code[0] and x[3]==code[3]) \ or (x[1]==code[1] and x[2]==code[2]) \ or (x[1]==code[1] and x[3]==code[3]) \ or (x[2]==code[2] and x[3]==code[3]) : P=2 #p=1 elif (x[0]==code[0]) or (x[1]==code[1]) or (x[2]==code[2]) or (x[3]==code[3]): P=1 #p=0 elif (x[0]!=code[0]) and (x[1]!=code[1]) and (x[2]!=code[2]) and (x[3]!=code[3]): P=0 #v=4 if x[0] in code and x[1] in code and x[2] in code and x[3] in code : V=4 #v=3 elif (x[0] in code and x[1] in code and x[2] in code ) \ or (x[1] in code and x[2] in code and x[3] in code ) \ or (x[2] in code and x[3] in code and x[0] in code ) \ or (x[0] in code and x[1] in code and x[3] in code ) : V=3 #v=2 elif (x[0] in code and x[1] in code) \ or (x[0] in code and x[2] in code) \ or (x[0] in code and x[3] in code) \ or (x[1] in code and x[2] in code) \ or (x[1] in code and x[3] in code) \ or (x[2] in code and x[3] in code) : V=2 #v=1 elif (x[0] in code) or (x[1] in code) or (x[2] in code) or (x[3] in code): V=1 if P==4 : print ('Congratulations! You won the game.') quit() else : print (' '+'P='+str(P)+','+'V='+str(V-P)+','+'X='+str(4-V)) #4 x = input('Turn #4 : ') #p=4 if x == code : P=4 #p=3 elif (x[0] == code[0] and x[1] == code[1] and x[2] == code [2]) \ or (x[1] == code[1] and x[2] == code[2] and x[3] == code [3]) \ or (x[2] == code[2] and x[3] == code[3] and x[0] == code [0]) \ or (x[0] == code[0] and x[1] == code[1] and x[3] == code [3]) : P=3 #p=2 elif (x[0]==code[0] and x[1]==code[1]) \ or (x[0]==code[0] and x[2]==code[2]) \ or (x[0]==code[0] and x[3]==code[3]) \ or (x[1]==code[1] and x[2]==code[2]) \ or (x[1]==code[1] and x[3]==code[3]) \ or (x[2]==code[2] and x[3]==code[3]) : P=2 #p=1 elif (x[0]==code[0]) or (x[1]==code[1]) or (x[2]==code[2]) or (x[3]==code[3]): P=1 #p=0 elif (x[0]!=code[0]) and (x[1]!=code[1]) and (x[2]!=code[2]) and (x[3]!=code[3]): P=0 #v=4 if x[0] in code and x[1] in code and x[2] in code and x[3] in code : V=4 #v=3 elif (x[0] in code and x[1] in code and x[2] in code ) \ or (x[1] in code and x[2] in code and x[3] in code ) \ or (x[2] in code and x[3] in code and x[0] in code ) \ or (x[0] in code and x[1] in code and x[3] in code ) : V=3 #v=2 elif (x[0] in code and x[1] in code) \ or (x[0] in code and x[2] in code) \ or (x[0] in code and x[3] in code) \ or (x[1] in code and x[2] in code) \ or (x[1] in code and x[3] in code) \ or (x[2] in code and x[3] in code) : V=2 #v=1 elif (x[0] in code) or (x[1] in code) or (x[2] in code) or (x[3] in code): V=1 if P==4 : print ('Congratulations! You won the game.') quit() else : print ('Sorry! You just lost it.') print ('The answer is','',x) print ('Please try again...') |
# 6330408921 (20.00) 252 (2021-02-11 17:20) x = input('Turn #1 : ') check = False if x == code: print(WINNING_MSG) check = True exit() p = 0 n = 0 if x[0] == code[0]: p += 1 if x[1] == code[1]: p += 1 if x[2] == code[2]: p += 1 if x[3] == code[3]: p += 1 if x[0] in code: n += 1 if x[1] in code: n += 1 if x[2] in code: n += 1 if x[3] in code: n += 1 v = n-p x = 4-(v+p) if not check: print(' P='+str(p)+',V='+str(v)+',X='+str(x)) #2 x = input('Turn #2 : ') check = False if x == code: print(WINNING_MSG) check = True exit() p = 0 n = 0 if x[0] == code[0]: p += 1 if x[1] == code[1]: p += 1 if x[2] == code[2]: p += 1 if x[3] == code[3]: p += 1 if x[0] in code: n += 1 if x[1] in code: n += 1 if x[2] in code: n += 1 if x[3] in code: n += 1 v = n-p x = 4-(v+p) if not check: print(' P='+str(p)+',V='+str(v)+',X='+str(x)) #3 x = input('Turn #3 : ') check = False if x == code: print(WINNING_MSG) check = True exit() p = 0 n = 0 if x[0] == code[0]: p += 1 if x[1] == code[1]: p += 1 if x[2] == code[2]: p += 1 if x[3] == code[3]: p += 1 if x[0] in code: n += 1 if x[1] in code: n += 1 if x[2] in code: n += 1 if x[3] in code: n += 1 v = n-p x = 4-(v+p) if not check: print(' P='+str(p)+',V='+str(v)+',X='+str(x)) #4 x = input('Turn #4 : ') check = False if x == code: print(WINNING_MSG) check = True exit() p = 0 n = 0 if x[0] == code[0]: p += 1 if x[1] == code[1]: p += 1 if x[2] == code[2]: p += 1 if x[3] == code[3]: p += 1 if x[0] in code: n += 1 if x[1] in code: n += 1 if x[2] in code: n += 1 if x[3] in code: n += 1 v = n-p x = 4-(v+p) if not check: print(' P='+str(p)+',V='+str(v)+',X='+str(x)) print(LOSING_MSG) print('The answer is ', code) print('Please try again...') |
# 6330409521 (10.23) 253 (2021-02-15 10:56) #turn_1 FP = First_pick FP = input("Turn #1 : ") if FP == code: P = 4 elif FP[0:3] == code[0:3] or FP[1::] == code[1::] or ((FP[0:1]==code[0:1])and(FP[2::]==code[2::])): P = 3 elif (FP[0:2:1]==code[0:2:1])\ or (FP[0:3:2]==code[0:3:2])\ or (FP[0::3]==code[0::3])\ or (FP[1:3:]==code[1:3:])\ or (FP[1::2]==code[1::2])\ or (FP[2::]==code[2::]): P =2 elif FP[0] == code[0] and FP[1::]!=code[1::]\ or FP[1] == code[1] and FP[0]!=code[0] and FP[2::]!=code[2::]\ or FP[2] == code[2] and FP[0:2:]!=code[0:2:]and FP[3]!=code[3]\ or FP[3] == code[3] and FP[0:3:]!=code[0:3:]: P = 1 elif FP[0] != code[0] and FP[1] != code[1] and FP[2] != code[2] and FP[3] != code[3]: P = 0 if FP[0] in code and FP[1] in code and FP[2]in code and FP[3] in code: V=4 elif FP[0] in code and FP[1] in code and FP[2]in code\ or FP[1] in code and FP[2] in code and FP[3] in code\ or FP[0] in code and FP[1]in code and FP[3] in code\ or FP[0] in code and FP[2]in code and FP[3] in code: V=3 elif FP[0] in code and FP[1] in code\ or FP[0] in code and FP[2] in code\ or FP[0] in code and FP[3] in code\ or FP[1] in code and FP[2] in code\ or FP[1] in code and FP[3] in code\ or FP[2] in code and FP[3] in code: V=2 elif FP[0] in code\ or FP[1] in code\ or FP[2] in code\ or FP[3] in code: V=1 elif not (FP[0] in code and FP[1] in code and FP[2] in code and FP[3]in code): V=0 if P==4: print(WINNING_MSG) quit() else : print(" "+"P="+str(P)+","+"V="+str(V)+","+"X="+str(4-V)) #turn_2 SP = Second_pick SP = input("Turn #2 : ") if SP == code: P = 4 elif SP[0:3] == code[0:3] or SP[1::] == code[1::] or ((SP[0:1]==code[0:1])and(SP[2::]==code[2::])): P = 3 elif (SP[0:2:1]==code[0:2:1])\ or (SP[0:3:2]==code[0:3:2])\ or (SP[0::3]==code[0::3])\ or (SP[1:3:]==code[1:3:])\ or (SP[1::2]==code[1::2])\ or (SP[2::]==code[2::]): P =2 elif SP[0] == code[0] and SP[1::]!=code[1::]\ or SP[1] == code[1] and SP[0]!=code[0] and SP[2::]!=code[2::]\ or SP[2] == code[2] and SP[0:2:]!=code[0:2:]and SP[3]!=code[3]\ or SP[3] == code[3] and SP[0:3:]!=code[0:3:]: P = 1 elif SP[0] != code[0] and SP[1] != code[1] and SP[2] != code[2] and SP[3] != code[3]: P = 0 if SP[0] in code and SP[1] in code and SP[2]in code and SP[3] in code: V=4 elif SP[0] in code and SP[1] in code and SP[2]in code\ or SP[1] in code and SP[2]in code and SP[3] in code\ or SP[0] in code and SP[1]in code and SP[3] in code\ or SP[0] in code and SP[2]in code and SP[3] in code: V=3 elif SP[0] in code and SP[1] in code\ or SP[0] in code and SP[2] in code\ or SP[0] in code and SP[3] in code\ or SP[1] in code and SP[2] in code\ or SP[1] in code and SP[3] in code\ or SP[2] in code and SP[3] in code: V=2 elif SP[0] in code\ or SP[1] in code\ or SP[2] in code\ or SP[3] in code: V=1 elif not (SP[0] in code and SP[1] in code and SP[2] in code and SP[3]in code): V=0 if P==4: print(WINNING_MSG) quit() else : print(" "+"P="+str(P)+","+"V="+str(V)+","+"X="+str(4-V)) #turn_3 TP = Third_pick TP = input("Turn #3 : ") if TP == code: P = 4 elif TP[0:3] == code[0:3] or TP[1::] == code[1::] or ((TP[0:1]==code[0:1])and(TP[2::]==code[2::])): P = 3 elif (TP[0:2:1]==code[0:2:1])\ or (TP[0:3:2]==code[0:3:2])\ or (TP[0::3]==code[0::3])\ or (TP[1:3:]==code[1:3:])\ or (TP[1::2]==code[1::2])\ or (TP[2::]==code[2::]): P =2 elif TP[0] == code[0] and TP[1::]!=code[1::]\ or TP[1] == code[1] and TP[0]!=code[0] and TP[2::]!=code[2::]\ or TP[2] == code[2] and TP[0:2:]!=code[0:2:]and TP[3]!=code[3]\ or TP[3] == code[3] and TP[0:3:]!=code[0:3:]: P = 1 elif TP[0] != code[0] and TP[1] != code[1] and TP[2] != code[2] and TP[3] != code[3]: P = 0 if TP[0] in code and TP[1] in code and TP[2]in code and TP[3] in code: V=4 elif TP[0] in code and TP[1] in code and TP[2]in code\ or TP[1] in code and TP[2]in code and TP[3] in code\ or TP[0] in code and TP[1]in code and TP[3] in code\ or TP[0] in code and TP[2]in code and TP[3] in code: V=3 elif TP[0] in code and TP[1] in code\ or TP[0] in code and TP[2] in code\ or TP[0] in code and TP[3] in code\ or TP[1] in code and TP[2] in code\ or TP[1] in code and TP[3] in code\ or TP[2] in code and TP[3] in code: V=2 elif TP[0] in code\ or TP[1] in code\ or TP[2] in code\ or TP[3] in code: V=1 elif not (TP[0] in code and TP[1] in code and TP[2] in code and TP[3]in code): V=0 if P==4: print(WINNING_MSG) quit() else : print(" "+"P="+str(P)+","+"V="+str(V)+","+"X="+str(4-V)) #turn_4 LP = Last_pick LP = input("Turn #4 : ") if LP == code: P = 4 elif LP[0:3] == code[0:3] or LP[1::] == code[1::] or ((LP[0:1]==code[0:1])and(LP[2::]==code[2::])): P = 3 elif (LP[0:2:1]==code[0:2:1])\ or (LP[0:3:2]==code[0:3:2])\ or (LP[0::3]==code[0::3])\ or (LP[1:3:]==code[1:3:])\ or (LP[1::2]==code[1::2])\ or (LP[2::]==code[2::]): P =2 elif LP[0] == code[0] and LP[1::]!=code[1::]\ or LP[1] == code[1] and LP[0]!=code[0] and LP[2::]!=code[2::]\ or LP[2] == code[2] and LP[0:2:]!=code[0:2:]and LP[3]!=code[3]\ or LP[3] == code[3] and LP[0:3:]!=code[0:3:]: P = 1 elif LP[0] != code[0] and LP[1] != code[1] and LP[2] != code[2] and LP[3] != code[3]: P = 0 if LP[0] in code and LP[1] in code and LP[2]in code and LP[3] in code: V=4 elif LP[0] in code and LP[1] in code and LP[2]in code\ or LP[1] in code and LP[2]in code and LP[3] in code\ or LP[0] in code and LP[1]in code and LP[3] in code\ or LP[0] in code and LP[2]in code and LP[3] in code: V=3 elif LP[0] in code and LP[1] in code\ or LP[0] in code and LP[2] in code\ or LP[0] in code and LP[3] in code\ or LP[1] in code and LP[2] in code\ or LP[1] in code and LP[3] in code\ or LP[2] in code and LP[3] in code: V=2 elif LP[0] in code\ or LP[1] in code\ or LP[2] in code\ or LP[3] in code: V=1 elif not (LP[0] in code and LP[1] in code and LP[2] in code and LP[3]in code): V=0 if P==4: print(WINNING_MSG) quit() else : print(" "+"P="+str(P)+","+"V="+str(V)+","+"X="+str(4-V)) print(LOSING_MSG) print("The answer is "+str(code)) print("Please try again...") quit() |
# 6330410021 (20.00) 254 (2021-02-12 22:25) i=0 if i<4 : i=i+1 x=input('Turn #'+str(i)+' : ') P=0 V=0 X=0 if (x[0] ==code[0]): P=P+1 elif (x[0] in code): V=V+1 else: X=X+1 if (x[1] ==code[1]): P=P+1 elif (x[1] in code): V=V+1 else: X=X+1 if (x[2] ==code[2]): P=P+1 elif (x[2] in code): V=V+1 else: X=X+1 if (x[3] ==code[3]): P=P+1 elif (x[3] in code): V=V+1 else: X=X+1 if P==4: print(WINNING_MSG) i=99 else: print(' P='+str(P)+',V='+str(V)+',X='+str(X)) if i<4 : i=i+1 x=input('Turn #'+str(i)+' : ') P=0 V=0 X=0 if (x[0] ==code[0]): P=P+1 elif (x[0] in code): V=V+1 else: X=X+1 if (x[1] ==code[1]): P=P+1 elif (x[1] in code): V=V+1 else: X=X+1 if (x[2] ==code[2]): P=P+1 elif (x[2] in code): V=V+1 else: X=X+1 if (x[3] ==code[3]): P=P+1 elif (x[3] in code): V=V+1 else: X=X+1 if P==4: print(WINNING_MSG) i=99 else: print(' P='+str(P)+',V='+str(V)+',X='+str(X)) if i<4 : i=i+1 x=input('Turn #'+str(i)+' : ') P=0 V=0 X=0 if (x[0] ==code[0]): P=P+1 elif (x[0] in code): V=V+1 else: X=X+1 if (x[1] ==code[1]): P=P+1 elif (x[1] in code): V=V+1 else: X=X+1 if (x[2] ==code[2]): P=P+1 elif (x[2] in code): V=V+1 else: X=X+1 if (x[3] ==code[3]): P=P+1 elif (x[3] in code): V=V+1 else: X=X+1 if P==4: print(WINNING_MSG) i=99 else: print(' P='+str(P)+',V='+str(V)+',X='+str(X)) if i<4 : i=i+1 x=input('Turn #'+str(i)+' : ') P=0 V=0 X=0 if (x[0] ==code[0]): P=P+1 elif (x[0] in code): V=V+1 else: X=X+1 if (x[1] ==code[1]): P=P+1 elif (x[1] in code): V=V+1 else: X=X+1 if (x[2] ==code[2]): P=P+1 elif (x[2] in code): V=V+1 else: X=X+1 if (x[3] ==code[3]): P=P+1 elif (x[3] in code): V=V+1 else: X=X+1 if P==4: print(WINNING_MSG) i=99 else: print(' P='+str(P)+',V='+str(V)+',X='+str(X)) if i<4 : i=i+1 x=input('Turn #'+str(i)+' : ') P=0 V=0 X=0 if (x[0] ==code[0]): P=P+1 elif (x[0] in code): V=V+1 else: X=X+1 if (x[1] ==code[1]): P=P+1 elif (x[1] in code): V=V+1 else: X=X+1 if (x[2] ==code[2]): P=P+1 elif (x[2] in code): V=V+1 else: X=X+1 if (x[3] ==code[3]): P=P+1 elif (x[3] in code): V=V+1 else: X=X+1 if P==4: print(WINNING_MSG) i=99 else: print(' P='+str(P)+',V='+str(V)+',X='+str(X)) elif i==99: pass else: print(LOSING_MSG) print('The answer is '+code) print('Please try again...') |
# 6330411721 (20.00) 255 (2021-02-15 20:38) codel = [code[0],code[1],code[2],code[3]] g = input("Turn #1 : ") p=0 ; v=0 ; x=0 if g != code: if g[0] in code: if g[0] == code[0]: p += 1 else: v += 1 if g[1] in code: if g[1] == code[1]: p += 1 else: v += 1 if g[2] in code: if g[2] == code[2]: p += 1 else: v += 1 if g[3] in code: if g[3] == code[3]: p += 1 else: v += 1 x = 4-p-v print(" "+"P=" + str(p) + ",V=" + str(v)+ ",X=" + str(x)) p=0 ; v=0 ; x=0 g = input("Turn #2 : ") if g != code: if g[0] in code: if g[0] == code[0]: p += 1 else: v += 1 if g[1] in code: if g[1] == code[1]: p += 1 else: v += 1 if g[2] in code: if g[2] == code[2]: p += 1 else: v += 1 if g[3] in code: if g[3] == code[3]: p += 1 else: v += 1 x = 4-p-v print(" "+"P=" + str(p) + ",V=" + str(v)+ ",X=" + str(x)) p=0 ; v=0 ; x=0 g = input("Turn #3 : ") if g != code: if g[0] in code: if g[0] == code[0]: p += 1 else: v += 1 if g[1] in code: if g[1] == code[1]: p += 1 else: v += 1 if g[2] in code: if g[2] == code[2]: p += 1 else: v += 1 if g[3] in code: if g[3] == code[3]: p += 1 else: v += 1 x = 4-p-v print(" "+"P=" + str(p) + ",V=" + str(v)+ ",X=" + str(x)) p=0 ; v=0 ; x=0 g = input("Turn #4 : ") if g != code: if g[0] in code: if g[0] == code[0]: p += 1 else: v += 1 if g[1] in code: if g[1] == code[1]: p += 1 else: v += 1 if g[2] in code: if g[2] == code[2]: p += 1 else: v += 1 if g[3] in code: if g[3] == code[3]: p += 1 else: v += 1 x = 4-p-v print(" "+"P=" + str(p) + ",V=" + str(v)+ ",X=" + str(x)) if g==code: print(WINNING_MSG) else: print(LOSING_MSG) print("The answer is",code) print("Please try again...") |
# 6330412321 (20.00) 256 (2021-02-15 16:59) x =input("Turn #1 : ") codex = [code[0],code[1],code[2],code[3]] p1 = 0 v1 = 0 x1 = 0 if x[0]==codex[0]: p1 = 1 else: if x[0]!=code[0]: if x[0] in codex: v1 = 1 else: x1 = 1 p2 = 0 v2 = 0 x2 = 0 if x[1]==codex[1]: p2 = 1 else: if x[1]!=code[1]: if x[1] in codex: v2 = 1 else: x2 = 1 p3 = 0 v3 = 0 x3 = 0 if x[2]==codex[2]: p3 = 1 else: if x[2]!=code[2]: if x[2] in codex: v3 = 1 else: x3 = 1 p4 = 0 v4 = 0 x4 = 0 if x[3]==codex[3]: p4 = 1 else: if x[3]!=code[3]: if x[3] in codex: v4 = 1 else: x4 = 1 P=p1+p2+p3+p4 V=v1+v2+v3+v4 X=x1+x2+x3+x4 if P==4: print(WINNING_MSG) else: print(" "+"P="+str(P)+',',"V="+str(V)+',',"X="+str(X)) x =input("Turn #2 : ") codex = [code[0],code[1],code[2],code[3]] p1 = 0 v1 = 0 x1 = 0 if x[0]==codex[0]: p1 = 1 else: if x[0]!=code[0]: if x[0] in codex: v1 = 1 else: x1 = 1 p2 = 0 v2 = 0 x2 = 0 if x[1]==codex[1]: p2 = 1 else: if x[1]!=code[1]: if x[1] in codex: v2 = 1 else: x2 = 1 p3 = 0 v3 = 0 x3 = 0 if x[2]==codex[2]: p3 = 1 else: if x[2]!=code[2]: if x[2] in codex: v3 = 1 else: x3 = 1 p4 = 0 v4 = 0 x4 = 0 if x[3]==codex[3]: p4 = 1 else: if x[3]!=code[3]: if x[3] in codex: v4 = 1 else: x4 = 1 P=p1+p2+p3+p4 V=v1+v2+v3+v4 X=x1+x2+x3+x4 if P==4: print(WINNING_MSG) else: print(" "+"P="+str(P)+',',"V="+str(V)+',',"X="+str(X)) x =input("Turn #3 : ") codex = [code[0],code[1],code[2],code[3]] p1 = 0 v1 = 0 x1 = 0 if x[0]==codex[0]: p1 = 1 else: if x[0]!=code[0]: if x[0] in codex: v1 = 1 else: x1 = 1 p2 = 0 v2 = 0 x2 = 0 if x[1]==codex[1]: p2 = 1 else: if x[1]!=code[1]: if x[1] in codex: v2 = 1 else: x2 = 1 p3 = 0 v3 = 0 x3 = 0 if x[2]==codex[2]: p3 = 1 else: if x[2]!=code[2]: if x[2] in codex: v3 = 1 else: x3 = 1 p4 = 0 v4 = 0 x4 = 0 if x[3]==codex[3]: p4 = 1 else: if x[3]!=code[3]: if x[3] in codex: v4 = 1 else: x4 = 1 P=p1+p2+p3+p4 V=v1+v2+v3+v4 X=x1+x2+x3+x4 if P==4: print(WINNING_MSG) else: print(" "+"P="+str(P)+',',"V="+str(V)+',',"X="+str(X)) x =input("Turn #4 : ") codex = [code[0],code[1],code[2],code[3]] p1 = 0 v1 = 0 x1 = 0 if x[0]==codex[0]: p1 = 1 else: if x[0]!=code[0]: if x[0] in codex: v1 = 1 else: x1 = 1 p2 = 0 v2 = 0 x2 = 0 if x[1]==codex[1]: p2 = 1 else: if x[1]!=code[1]: if x[1] in codex: v2 = 1 else: x2 = 1 p3 = 0 v3 = 0 x3 = 0 if x[2]==codex[2]: p3 = 1 else: if x[2]!=code[2]: if x[2] in codex: v3 = 1 else: x3 = 1 p4 = 0 v4 = 0 x4 = 0 if x[3]==codex[3]: p4 = 1 else: if x[3]!=code[3]: if x[3] in codex: v4 = 1 else: x4 = 1 P=p1+p2+p3+p4 V=v1+v2+v3+v4 X=x1+x2+x3+x4 if P==4: print(WINNING_MSG) else: print(" "+"P="+str(P)+',',"V="+str(V)+',',"X="+str(X)) print(LOSING_MSG) print("The answer is "+code) print("Please try again...") |
# 6330413021 (20.00) 257 (2021-02-11 12:29) #print(code) guess = input('Turn #1 : ') p,v,x = 0,0,0 g1,g2,g3,g4 = False,False,False,False if guess[0] == code[0] : p += 1 g1 = True if guess[1] == code[1]: p += 1 g2 = True if guess[2] == code[2]: p += 1 g3 = True if guess[3] == code[3]: p += 1 g4 = True if g1 == False and guess[0] in code : v += 1 if g2 == False and guess[1] in code : v += 1 if g3 == False and guess[2] in code : v += 1 if g4 == False and guess[3] in code : v += 1 x = 4-p-v if p == 4 : print(WINNING_MSG) exit() print(' '+'P='+str(p)+','+'V='+str(v)+','+'X='+str(x)) guess = input('Turn #2 : ') p,v,x = 0,0,0 g1,g2,g3,g4 = False,False,False,False if guess[0] == code[0] : p += 1 g1 = True if guess[1] == code[1]: p += 1 g2 = True if guess[2] == code[2]: p += 1 g3 = True if guess[3] == code[3]: p += 1 g4 = True if g1 == False and guess[0] in code : v += 1 if g2 == False and guess[1] in code : v += 1 if g3 == False and guess[2] in code : v += 1 if g4 == False and guess[3] in code : v += 1 x = 4-p-v if p == 4 : print(WINNING_MSG) exit() print(' '+'P='+str(p)+','+'V='+str(v)+','+'X='+str(x)) guess = input('Turn #3 : ') p,v,x = 0,0,0 g1,g2,g3,g4 = False,False,False,False if guess[0] == code[0] : p += 1 g1 = True if guess[1] == code[1]: p += 1 g2 = True if guess[2] == code[2]: p += 1 g3 = True if guess[3] == code[3]: p += 1 g4 = True if g1 == False and guess[0] in code : v += 1 if g2 == False and guess[1] in code : v += 1 if g3 == False and guess[2] in code : v += 1 if g4 == False and guess[3] in code : v += 1 x = 4-p-v if p == 4 : print(WINNING_MSG) exit() print(' '+'P='+str(p)+','+'V='+str(v)+','+'X='+str(x)) guess = input('Turn #4 : ') p,v,x = 0,0,0 g1,g2,g3,g4 = False,False,False,False if guess[0] == code[0] : p += 1 g1 = True if guess[1] == code[1]: p += 1 g2 = True if guess[2] == code[2]: p += 1 g3 = True if guess[3] == code[3]: p += 1 g4 = True if g1 == False and guess[0] in code : v += 1 if g2 == False and guess[1] in code : v += 1 if g3 == False and guess[2] in code : v += 1 if g4 == False and guess[3] in code : v += 1 x = 4-p-v if p == 4 : print(WINNING_MSG) exit() print(' '+'P='+str(p)+','+'V='+str(v)+','+'X='+str(x)) if p != 4 : print(LOSING_MSG) print('The answer is',code) print('Please try again...') |
# 6330415221 (20.00) 258 (2021-02-15 01:15) P = 0 V = 0 X = 0 a = input('Turn #1 : ') if a==code : print('Congratulations! You won the game.') exit() else : if a[0]==code[0] : P += 1 if a[1]==code[1] : P += 1 if a[2]==code[2] : P += 1 if a[3]==code[3] : P += 1 if a[0]==code[1] or a[0]==code[2] or a[0]==code[3] : V += 1 if a[1]==code[0] or a[1]==code[2] or a[1]==code[3] : V += 1 if a[2]==code[0] or a[2]==code[1] or a[2]==code[3] : V += 1 if a[3]==code[0] or a[3]==code[1] or a[3]==code[2] : V += 1 X = 4-(P+V) print(' '*len('Turn #1 : ')+'P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) P = 0 V = 0 X = 0 a = input('Turn #2 : ') if a==code : print('Congratulations! You won the game.') exit() else : if a[0]==code[0] : P += 1 if a[1]==code[1] : P += 1 if a[2]==code[2] : P += 1 if a[3]==code[3] : P += 1 if a[0]==code[1] or a[0]==code[2] or a[0]==code[3] : V += 1 if a[1]==code[0] or a[1]==code[2] or a[1]==code[3] : V += 1 if a[2]==code[0] or a[2]==code[1] or a[2]==code[3] : V += 1 if a[3]==code[0] or a[3]==code[1] or a[3]==code[2] : V += 1 X = 4-(P+V) print(' '*len('Turn #2 : ')+'P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) P = 0 V = 0 X = 0 a = input('Turn #3 : ') if a==code : print('Congratulations! You won the game.') exit() else : if a[0]==code[0] : P += 1 if a[1]==code[1] : P += 1 if a[2]==code[2] : P += 1 if a[3]==code[3] : P += 1 if a[0]==code[1] or a[0]==code[2] or a[0]==code[3] : V += 1 if a[1]==code[0] or a[1]==code[2] or a[1]==code[3] : V += 1 if a[2]==code[0] or a[2]==code[1] or a[2]==code[3] : V += 1 if a[3]==code[0] or a[3]==code[1] or a[3]==code[2] : V += 1 X = 4-(P+V) print(' '*len('Turn #3 : ')+'P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) P = 0 V = 0 X = 0 a = input('Turn #4 : ') if a==code : print('Congratulations! You won the game.') exit() else : if a[0]==code[0] : P += 1 if a[1]==code[1] : P += 1 if a[2]==code[2] : P += 1 if a[3]==code[3] : P += 1 if a[0]==code[1] or a[0]==code[2] or a[0]==code[3] : V += 1 if a[1]==code[0] or a[1]==code[2] or a[1]==code[3] : V += 1 if a[2]==code[0] or a[2]==code[1] or a[2]==code[3] : V += 1 if a[3]==code[0] or a[3]==code[1] or a[3]==code[2] : V += 1 X = 4-(P+V) print(' '*len('Turn #4 : ')+'P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) print('Sorry! You just lost it.') print('The answer is',code) print('Please try again...') |
# 6330416921 (17.16) 259 (2021-02-14 22:24) ramdom = code a=input('Turn #1 :') P=0 V=0 X=0 if a[0] in ramdom: if a[0]==ramdom[0]: P+=1 else: V+=1 else: X+=1 if a[1] in ramdom: if a[1]==ramdom[1]: P+=1 else: V+=1 else: X+=1 if a[2] in ramdom: if a[2]==ramdom[2]: P+=1 else: V+=1 else: X+=1 if a[3] in ramdom: if a[3]==ramdom[3]: P+=1 else: V+=1 else: X+=1 if P==4: print(WINNING_MSG) else: print('P='+str(P)+',V='+str(V)+',X='+str(X)) a=input('Turn #2 :') P=0 V=0 X=0 if a[0] in ramdom: if a[0]==ramdom[0]: P+=1 else: V+=1 else: X+=1 if a[1] in ramdom: if a[1]==ramdom[1]: P+=1 else: V+=1 else: X+=1 if a[2] in ramdom: if a[2]==ramdom[2]: P+=1 else: V+=1 else: X+=1 if a[3] in ramdom: if a[3]==ramdom[3]: P+=1 else: V+=1 else: X+=1 if P==4: print(WINNING_MSG) else: print('P='+str(P)+',V='+str(V)+',X='+str(X)) a=input('Turn #3 :') P=0 V=0 X=0 if a[0] in ramdom: if a[0]==ramdom[0]: P+=1 else: V+=1 else: X+=1 if a[1] in ramdom: if a[1]==ramdom[1]: P+=1 else: V+=1 else: X+=1 if a[2] in ramdom: if a[2]==ramdom[2]: P+=1 else: V+=1 else: X+=1 if a[3] in ramdom: if a[3]==ramdom[3]: P+=1 else: V+=1 else: X+=1 if P==4: print(WINNING_MSG) else: print('P='+str(P)+',V='+str(V)+',X='+str(X)) a=input('Turn #4 :') P=0 V=0 X=0 if a[0] in ramdom: if a[0]==ramdom[0]: P+=1 else: V+=1 else: X+=1 if a[1] in ramdom: if a[1]==ramdom[1]: P+=1 else: V+=1 else: X+=1 if a[2] in ramdom: if a[2]==ramdom[2]: P+=1 else: V+=1 else: X+=1 if a[3] in ramdom: if a[3]==ramdom[3]: P+=1 else: V+=1 else: X+=1 if P==4: print(WINNING_MSG) else: print(LOSING_MSG) print("The answer is "+ramdom) print('Please try agian...' ) |
# 6330417521 (20.00) 260 (2021-02-15 21:37) turn=1 a = input("Turn #"+str(turn)+" : ").strip() if (a==code) : print(WINNING_MSG) else : P = 0 V = 0 X = 0 if (a[0] in code) : if a[0] == code[0]: P += 1 else : V += 1 else : X += 1 if (a[1] in code) : if a[1] == code[1]: P += 1 else : V += 1 else : X += 1 if (a[2] in code) : if a[2] == code[2]: P += 1 else : V += 1 else : X += 1 if (a[3] in code) : if a[3] == code[3]: P += 1 else : V += 1 else : X += 1 print(" "*10+"P="+str(P)+",V="+str(V)+",X="+str(X)) turn += 1 a = input("Turn #"+str(turn)+" : ").strip() if (a==code) : print(WINNING_MSG) else : P = 0 V = 0 X = 0 if (a[0] in code) : if a[0] == code[0]: P += 1 else : V += 1 else : X += 1 if (a[1] in code) : if a[1] == code[1]: P += 1 else : V += 1 else : X += 1 if (a[2] in code) : if a[2] == code[2]: P += 1 else : V += 1 else : X += 1 if (a[3] in code) : if a[3] == code[3]: P += 1 else : V += 1 else : X += 1 print(" "*10+"P="+str(P)+",V="+str(V)+",X="+str(X)) turn += 1 a = input("Turn #"+str(turn)+" : ").strip() if (a==code) : print(WINNING_MSG) else : P = 0 V = 0 X = 0 if (a[0] in code) : if a[0] == code[0]: P += 1 else : V += 1 else : X += 1 if (a[1] in code) : if a[1] == code[1]: P += 1 else : V += 1 else : X += 1 if (a[2] in code) : if a[2] == code[2]: P += 1 else : V += 1 else : X += 1 if (a[3] in code) : if a[3] == code[3]: P += 1 else : V += 1 else : X += 1 print(" "*10+"P="+str(P)+",V="+str(V)+",X="+str(X)) turn += 1 a = input("Turn #"+str(turn)+" : ").strip() if (a==code) : print(WINNING_MSG) else : P = 0 V = 0 X = 0 if (a[0] in code) : if a[0] == code[0]: P += 1 else : V += 1 else : X += 1 if (a[1] in code) : if a[1] == code[1]: P += 1 else : V += 1 else : X += 1 if (a[2] in code) : if a[2] == code[2]: P += 1 else : V += 1 else : X += 1 if (a[3] in code) : if a[3] == code[3]: P += 1 else : V += 1 else : X += 1 print(" "*10+"P="+str(P)+",V="+str(V)+",X="+str(X)) print(LOSING_MSG) print("The answer is ",code) print("Please try again...") |
# 6330418121 (20.00) 261 (2021-02-12 23:40) n = input("Turn #1 : ") p,v,x = 0,0,0 if n[0] in code: if n[0] == code[0]: p += 1 else: v += 1 else: x += 1 if n[1] in code: if n[1] == code[1]: p += 1 else: v += 1 else: x += 1 if n[2] in code: if n[2] == code[2]: p += 1 else: v += 1 else: x += 1 if n[3] in code: if n[3] == code[3]: p += 1 else: v += 1 else: x += 1 if p == 4: print(WINNING_MSG) else: print(" "*10 + "P="+str(p)+","+"V="+str(v)+","+"X="+str(x)) if n != code : m = input("Turn #2 : ") p,v,x = 0,0,0 if m[0] in code: if m[0] == code[0]: p += 1 else: v += 1 else: x += 1 if m[1] in code: if m[1] == code[1]: p += 1 else: v += 1 else: x += 1 if m[2] in code: if m[2] == code[2]: p += 1 else: v += 1 else: x += 1 if m[3] in code: if m[3] == code[3]: p += 1 else: v += 1 else: x += 1 if p == 4: print(WINNING_MSG) else: print(" "*10 + "P="+str(p)+","+"V="+str(v)+","+"X="+str(x)) if n != code and m != code : k = input("Turn #3 : ") p,v,x = 0,0,0 if k[0] in code: if k[0] == code[0]: p += 1 else: v += 1 else: x += 1 if k[1] in code: if k[1] == code[1]: p += 1 else: v += 1 else: x += 1 if k[2] in code: if k[2] == code[2]: p += 1 else: v += 1 else: x += 1 if k[3] in code: if k[3] == code[3]: p += 1 else: v += 1 else: x += 1 if p == 4: print(WINNING_MSG) else: print(" "*10 + "P="+str(p)+","+"V="+str(v)+","+"X="+str(x)) if n != code and m != code and k != code : g = input("Turn #4 : ") p,v,x = 0,0,0 if g[0] in code: if g[0] == code[0]: p += 1 else: v += 1 else: x += 1 if g[1] in code: if g[1] == code[1]: p += 1 else: v += 1 else: x += 1 if g[2] in code: if g[2] == code[2]: p += 1 else: v += 1 else: x += 1 if g[3] in code: if g[3] == code[3]: p += 1 else: v += 1 else: x += 1 if p == 4: print(WINNING_MSG) else: print(" "*10 + "P="+str(p)+","+"V="+str(v)+","+"X="+str(x)) print(LOSING_MSG) print("The answer is",code) print("Please try again...") |
# 6330420321 (20.00) 262 (2021-02-13 20:19) P = 0 V = 0 X = 0 Guess = input('Turn #1 : ').upper() if len(Guess) != 4 : print('Please input valid code.') else : if Guess[0] == code[0]: P += 1 elif Guess[0] == code[1]: V += 1 elif Guess[0] == code[2]: V += 1 elif Guess[0] == code[3]: V += 1 #------------------------------------------------------------------------------ if Guess[1] == code[0]: V += 1 elif Guess[1] == code[1]: P += 1 elif Guess[1] == code[2]: V += 1 elif Guess[1] == code[3]: V += 1 #------------------------------------------------------------------------------ if Guess[2] == code[0]: V += 1 elif Guess[2] == code[1]: V += 1 elif Guess[2] == code[2]: P += 1 elif Guess[2] == code[3]: V += 1 #------------------------------------------------------------------------------ if Guess[3] == code[0]: V += 1 elif Guess[3] == code[1]: V += 1 elif Guess[3] == code[2]: V += 1 elif Guess[3] == code[3]: P += 1 #------------------------------------------------------------------------------ X = 4-(P+V) if P == 4: print('Congratulations! You won the game.') exit() else : print(' '*len('Turn #1 : ')+'P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) P = 0 V = 0 X = 0 Guess = input('Turn #2 : ').upper() if len(Guess) != 4 : print('Please input valid code.') else : if Guess[0] == code[0]: P += 1 elif Guess[0] == code[1]: V += 1 elif Guess[0] == code[2]: V += 1 elif Guess[0] == code[3]: V += 1 #------------------------------------------------------------------------------ if Guess[1] == code[0]: V += 1 elif Guess[1] == code[1]: P += 1 elif Guess[1] == code[2]: V += 1 elif Guess[1] == code[3]: V += 1 #------------------------------------------------------------------------------ if Guess[2] == code[0]: V += 1 elif Guess[2] == code[1]: V += 1 elif Guess[2] == code[2]: P += 1 elif Guess[2] == code[3]: V += 1 #------------------------------------------------------------------------------ if Guess[3] == code[0]: V += 1 elif Guess[3] == code[1]: V += 1 elif Guess[3] == code[2]: V += 1 elif Guess[3] == code[3]: P += 1 #------------------------------------------------------------------------------ X = 4-(P+V) if P == 4: print('Congratulations! You won the game.') exit() else : print(' '*len('Turn #2 : ')+'P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) P = 0 V = 0 X = 0 Guess = input('Turn #3 : ').upper() if len(Guess) != 4 : print('Please input valid code.') else : if Guess[0] == code[0]: P += 1 elif Guess[0] == code[1]: V += 1 elif Guess[0] == code[2]: V += 1 elif Guess[0] == code[3]: V += 1 #------------------------------------------------------------------------------ if Guess[1] == code[0]: V += 1 elif Guess[1] == code[1]: P += 1 elif Guess[1] == code[2]: V += 1 elif Guess[1] == code[3]: V += 1 #------------------------------------------------------------------------------ if Guess[2] == code[0]: V += 1 elif Guess[2] == code[1]: V += 1 elif Guess[2] == code[2]: P += 1 elif Guess[2] == code[3]: V += 1 #------------------------------------------------------------------------------ if Guess[3] == code[0]: V += 1 elif Guess[3] == code[1]: V += 1 elif Guess[3] == code[2]: V += 1 elif Guess[3] == code[3]: P += 1 #------------------------------------------------------------------------------ X = 4-(P+V) if P == 4: print('Congratulations! You won the game.') exit() else : print(' '*len('Turn #3 : ')+'P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) P = 0 V = 0 X = 0 Guess = input('Turn #4 : ').upper() if len(Guess) != 4 : print('Please input valid code.') else : if Guess[0] == code[0]: P += 1 elif Guess[0] == code[1]: V += 1 elif Guess[0] == code[2]: V += 1 elif Guess[0] == code[3]: V += 1 #------------------------------------------------------------------------------ if Guess[1] == code[0]: V += 1 elif Guess[1] == code[1]: P += 1 elif Guess[1] == code[2]: V += 1 elif Guess[1] == code[3]: V += 1 #------------------------------------------------------------------------------ if Guess[2] == code[0]: V += 1 elif Guess[2] == code[1]: V += 1 elif Guess[2] == code[2]: P += 1 elif Guess[2] == code[3]: V += 1 #------------------------------------------------------------------------------ if Guess[3] == code[0]: V += 1 elif Guess[3] == code[1]: V += 1 elif Guess[3] == code[2]: V += 1 elif Guess[3] == code[3]: P += 1 #------------------------------------------------------------------------------ X = 4-(P+V) if P == 4: print('Congratulations! You won the game.') exit() else : print(' '*len('Turn #4 : ')+'P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) print('Sorry! You just lost it.') print('The answer is',code) print('Please try again...') |
# 6330422621 (20.00) 263 (2021-02-15 20:24) P = 0 V = 0 X = 0 code1 = code[0] code2 = code[1] code3 = code[2] code4 = code[3] allcode = [code1,code2,code3,code4] ans = input('Turn #1 : ').strip() if( ans[0] == code1 ): P += 1 elif( ans[0] in allcode ): V += 1 else: X += 1 if( ans[1] == code2 ): P += 1 elif( ans[1] in allcode ): V += 1 else: X += 1 if( ans[2] == code3 ): P += 1 elif( ans[2] in allcode ): V += 1 else: X += 1 if( ans[3] == code4 ): P += 1 elif( ans[3] in allcode ): V += 1 else: X += 1 if P == 4: print(WINNING_MSG) else: print(' '+'P='+str(int(P))+',V='+str(int(V))+',X='+str(int(X))) P = 0 V = 0 X = 0 ans = input('Turn #2 : ').strip() if( ans[0] == code1 ): P += 1 elif( ans[0] in allcode ): V += 1 else: X += 1 if( ans[1] == code2 ): P += 1 elif( ans[1] in allcode ): V += 1 else: X += 1 if( ans[2] == code3 ): P += 1 elif( ans[2] in allcode ): V += 1 else: X += 1 if( ans[3] == code4 ): P += 1 elif( ans[3] in allcode ): V += 1 else: X += 1 if P == 4: print(WINNING_MSG) else: print(' '+'P='+str(int(P))+',V='+str(int(V))+',X='+str(int(X))) P = 0 V = 0 X = 0 ans = input('Turn #3 : ').strip() if( ans[0] == code1 ): P += 1 elif( ans[0] in allcode ): V += 1 else: X += 1 if( ans[1] == code2 ): P += 1 elif( ans[1] in allcode ): V += 1 else: X += 1 if( ans[2] == code3 ): P += 1 elif( ans[2] in allcode ): V += 1 else: X += 1 if( ans[3] == code4 ): P += 1 elif( ans[3] in allcode ): V += 1 else: X += 1 if P == 4: print(WINNING_MSG) else: print(' '+'P='+str(int(P))+',V='+str(int(V))+',X='+str(int(X))) P = 0 V = 0 X = 0 ans = input('Turn #4 : ').strip() if( ans[0] == code1 ): P += 1 elif( ans[0] in allcode ): V += 1 else: X += 1 if( ans[1] == code2 ): P += 1 elif( ans[1] in allcode ): V += 1 else: X += 1 if( ans[2] == code3 ): P += 1 elif( ans[2] in allcode ): V += 1 else: X += 1 if( ans[3] == code4 ): P += 1 elif( ans[3] in allcode ): V += 1 else: X += 1 if P == 4: print(WINNING_MSG) else: print(' '+'P='+str(int(P))+',V='+str(int(V))+',X='+str(int(X))) print(LOSING_MSG) print('The answer is',code) print('Please try again...' ) |
# 6330423221 (14.40) 264 (2021-02-15 22:09) k=input("Turn #1 : ") X=0 P=0 V=0 if k == code: print(WINNING_MSG) elif [0] or k[1] or k[2] or k[3]==code[0] or code[1] or code[2] or code[3] : if k[0] == code[0]: P+=1 if k[1] == code[1]: P+=1 if k[2] == code[2]: P+=1 if k[3] == code[3]: P+=1 if k[0] in code: V+=1 if k[1] in code: V+=1 if k[2] in code: V+=1 if k[3] in code: V+=1 if k[0] or k[1] or k[2] or k[3] != code[0] or code[1] or code[2] or code[3]: X=4-V print(" "+"P="+str(P)+","+"V="+str(V-P)+","+"X="+str(X)) k=input("Turn #2 : ") X=0 P=0 V=0 if k == code: print(WINNING_MSG) elif k[0] or k[1] or k[2] or k[3]==code[0] or code[1] or code[2] or code[3] : if k[0] == code[0]: P+=1 if k[1] == code[1]: P+=1 if k[2] == code[2]: P+=1 if k[3] == code[3]: P+=1 if k[0] in code: V+=1 if k[1] in code: V+=1 if k[2] in code: V+=1 if k[3] in code: V+=1 if k[0] or k[1] or k[2] or k[3] != code[0] or code[1] or code[2] or code[3]: X=4-V print(" "+"P="+str(P)+","+"V="+str(V-P)+","+"X="+str(X)) k=input("Turn #3 : ") X=0 P=0 V=0 if k == code: print(WINNING_MSG) elif k[0] or k[1] or k[2] or k[3]==code[0] or code[1] or code[2] or code[3] : if k[0] == code[0]: P+=1 if k[1] == code[1]: P+=1 if k[2] == code[2]: P+=1 if k[3] == code[3]: P+=1 if k[0] in code: V+=1 if k[1] in code: V+=1 if k[2] in code: V+=1 if k[3] in code: V+=1 if k[0] or k[1] or k[2] or k[3] != code[0] or code[1] or code[2] or code[3]: X=4-V print(" "+"P="+str(P)+","+"V="+str(V-P)+","+"X="+str(X)) k=input("Turn #4: ") X=0 P=0 V=0 if k == code: print(WINNING_MSG) elif k[0] or k[1] or k[2] or k[3]==code[0] or code[1] or code[2] or code[3] : if k[0] == code[0]: P+=1 if k[1] == code[1]: P+=1 if k[2] == code[2]: P+=1 if k[3] == code[3]: P+=1 if k[0] in code: V+=1 if k[1] in code: V+=1 if k[2] in code: V+=1 if k[3] in code: V+=1 if k[0] or k[1] or k[2] or k[3] != code[0] or code[1] or code[2] or code[3]: X=4-V print(" "+"P="+str(P)+","+"V="+str(V-P)+","+"X="+str(X)) print(LOSING_MSG) |
# 6330424921 (17.37) 265 (2021-02-12 20:02) print(code) turn = 1 v,p=0,0 idn = "0" while turn <= 4 : while len(idn) !=4 : idn = input("Turn #"+str(turn)+" : ") idn = idn.upper() if idn == code: print(WINNING_MSG) break elif turn != 4: if idn[0] in code: if code[0] == idn[0]: p+=1 else: v+=1 if idn[1] in code: if code[1] == idn[1]: p+=1 else: v+=1 if idn[2] in code: if code[2] == idn[2]: p+=1 else: v+=1 if idn[3] in code: if code[3] == idn[3]: p+=1 else: v+=1 print(" "*10+"P="+str(p)+","+"V="+str(v)+","+"X="+str(4-p-v)) v,p,idn=0,0,"0" turn+=1 elif turn ==4: print(LOSING_MSG) print("The answer is",code) print("Please try again...") break |
# 6330425521 (20.00) 266 (2021-02-14 01:49) #TURN1 u = input('Turn #1 : ' ) P = 0 ; V = 0 ; X = 0 if u[0] == code[0]: P += 1 if u[1] == code[1]: P += 1 if u[2] == code[2]: P += 1 if u[3] == code[3]: P += 1 if u[0] in code: V += 1 if u[1] in code: V += 1 if u[2] in code: V += 1 if u[3] in code: V += 1 V -= P if u[0] not in code: X += 1 if u[1] not in code: X += 1 if u[2] not in code: X += 1 if u[3] not in code: X += 1 #TURN2 if P == 4: print(WINNING_MSG) else: print(" "+"P="+str(P)+",V="+str(V)+",X="+str(X)) u = input('Turn #2 : ' ) P = 0 ; V = 0 ; X = 0 if u[0] == code[0]: P += 1 if u[1] == code[1]: P += 1 if u[2] == code[2]: P += 1 if u[3] == code[3]: P += 1 if u[0] in code: V += 1 if u[1] in code: V += 1 if u[2] in code: V += 1 if u[3] in code: V += 1 V -= P if u[0] not in code: X += 1 if u[1] not in code: X += 1 if u[2] not in code: X += 1 if u[3] not in code: X += 1 #TURN3 if P == 4: print(WINNING_MSG) else: print(" "+"P="+str(P)+",V="+str(V)+",X="+str(X)) u = input('Turn #3 : ' ) P = 0 ; V = 0 ; X = 0 if u[0] == code[0]: P += 1 if u[1] == code[1]: P += 1 if u[2] == code[2]: P += 1 if u[3] == code[3]: P += 1 if u[0] in code: V += 1 if u[1] in code: V += 1 if u[2] in code: V += 1 if u[3] in code: V += 1 V -= P if u[0] not in code: X += 1 if u[1] not in code: X += 1 if u[2] not in code: X += 1 if u[3] not in code: X += 1 #TURN4 if P == 4: print(WINNING_MSG) else: print(" "+"P="+str(P)+",V="+str(V)+",X="+str(X)) u = input('Turn #4 : ' ) P = 0 ; V = 0 ; X = 0 if u[0] == code[0]: P += 1 if u[1] == code[1]: P += 1 if u[2] == code[2]: P += 1 if u[3] == code[3]: P += 1 if u[0] in code: V += 1 if u[1] in code: V += 1 if u[2] in code: V += 1 if u[3] in code: V += 1 V -= P if u[0] not in code: X += 1 if u[1] not in code: X += 1 if u[2] not in code: X += 1 if u[3] not in code: X += 1 #FINAL if P == 4: print(WINNING_MSG) else: print(" "+"P="+str(P)+",V="+str(V)+",X="+str(X)) print(LOSING_MSG) print("The answer is "+code) print("Please try again...") |
# 6330426121 (17.37) 267 (2021-02-15 19:14) LC = list(code) g = input('Turn #1 : ') p = 0 v = 0 x = 0 if g==code: print(WINNING_MSG) else: if list(g)[0]==LC[0]: p += 1 elif list(g)[0] in LC: v += 1 else: x += 1 if list(g)[1]==LC[1]: p += 1 elif list(g)[1] in LC: v += 1 else: x += 1 if list(g)[2]==LC[2]: p += 1 elif list(g)[2] in LC: v += 1 else: x += 1 if list(g)[3]==LC[3]: p += 1 elif list(g)[3] in LC: v += 1 else: x += 1 print(' P={:d},V={:d},X={:d}'.format(p,v,x)) g = input('Turn #2 : ') p = 0 v = 0 x = 0 if g==code: print(WINNING_MSG) else: if list(g)[0]==LC[0]: p += 1 elif list(g)[0] in LC: v += 1 else: x += 1 if list(g)[1]==LC[1]: p += 1 elif list(g)[1] in LC: v += 1 else: x += 1 if list(g)[2]==LC[2]: p += 1 elif list(g)[2] in LC: v += 1 else: x += 1 if list(g)[3]==LC[3]: p += 1 elif list(g)[3] in LC: v += 1 else: x += 1 print(' P={:d},V={:d},X={:d}'.format(p,v,x)) g = input('Turn #3 : ') p = 0 v = 0 x = 0 if g==code: print(WINNING_MSG) else: if list(g)[0]==LC[0]: p += 1 elif list(g)[0] in LC: v += 1 else: x += 1 if list(g)[1]==LC[1]: p += 1 elif list(g)[1] in LC: v += 1 else: x += 1 if list(g)[2]==LC[2]: p += 1 elif list(g)[2] in LC: v += 1 else: x += 1 if list(g)[3]==LC[3]: p += 1 elif list(g)[3] in LC: v += 1 else: x += 1 print(' P={:d},V={:d},X={:d}'.format(p,v,x)) g = input('Turn #4 : ') p = 0 v = 0 x = 0 if g==code: print(WINNING_MSG) else: print(LOSING_MSG) print('The answer is',code) print('Please try again...') |
# 6330427821 (19.89) 268 (2021-02-15 01:29) g = input('Turn #1 : ') P = 0 V = 0 X = 0 if g[0]==code[0] and g[1]==code[1] and g[2]==code[2] and g[3]==code[3]: print('Congratulations! You won the game.') else: if g[0]==code[0]: P+=1 if g[1]==code[1]: P+=1 if g[2]==code[2]: P+=1 if g[3]==code[3]: P+=1 a = code.find(g[0]) if a==-1: X=X+a else : V=V+1 a = code.find(g[1]) if a==-1: X=X+a else : V=V+1 a = code.find(g[2]) if a==-1: X=X+a else : V=V+1 a = code.find(g[3]) if a==-1: X=X+a else : V=V+1 print(' P='+str(P)+','+'V='+str(abs(P-V))+','+'X='+str(abs(X))) P2=0 V2=0 X2=0 g2 = input('Turn #2 : ') if g2[0]==code[0] and g2[1]==code[1] and g2[2]==code[2] and g2[3]==code[3]: print('Congratulations! You won the game.') else: if g2[0]==code[0]: P2+=1 if g2[1]==code[1]: P2+=1 if g2[2]==code[2]: P2+=1 if g2[3]==code[3]: P2+=1 a2 = code.find(g2[0]) if a2==-1: X2=X2+a2 else : V2=V2+1 a2 = code.find(g2[1]) if a2==-1: X2=X2+a2 else : V2=V2+1 a2 = code.find(g2[2]) if a2==-1: X2=X2+a2 else : V2=V2+1 a2 = code.find(g2[3]) if a2==-1: X2=X2+a2 else : V2=V2+1 print(' P='+str(P2)+','+'V='+str(abs(P2-V2))+','+'X='+str(abs(X2))) P3=0 V3=0 X3=0 g3 = input('Turn #3 : ') if g3[0]==code[0] and g3[1]==code[1] and g3[2]==code[2] and g3[3]==code[3]: print('Congratulations! You won the game.') else: if g3[0]==code[0]: P3+=1 if g3[1]==code[1]: P3+=1 if g3[2]==code[2]: P3+=1 if g3[3]==code[3]: P3+=1 a3 = code.find(g3[0]) if a3==-1: X3=X3+a3 else : V3=V3+1 a3 = code.find(g3[1]) if a3==-1: X3=X3+a3 else : V3=V3+1 a3 = code.find(g3[2]) if a3==-1: X3=X3+a3 else : V3=V3+1 a3 = code.find(g3[3]) if a3==-1: X3=X3+a3 else : V3=V3+1 print(' P='+str(P3)+','+'V='+str(abs(P3-V3))+','+'X='+str(abs(X3))) P4=0 V4=0 X4=0 g4 = input('Turn #4 : ') if g4[0]==code[0] and g4[1]==code[1] and g4[2]==code[2] and g4[3]==code[3]: print('Congratulations! You won the game.') else: if g4[0]==code[0]: P4+=1 if g4[1]==code[1]: P4+=1 if g4[2]==code[2]: P4+=1 if g4[3]==code[3]: P4+=1 a4 = code.find(g4[0]) if a4==-1: X4=X4+a4 else : V4=V4+1 a4 = code.find(g4[1]) if a4==-1: X4=X4+a4 else : V4=V4+1 a4 = code.find(g4[2]) if a4==-1: X4=X4+a4 else : V4=V4+1 a4 = code.find(g4[3]) if a4==-1: X4=X4+a4 else : V4=V4+1 print(' P='+str(P4)+','+'V='+str(abs(P4-V4))+','+'X='+str(abs(X4))) print('Sorry! you just lost it.') print('The answer is',code) print('Please try agian...') |
# 6330428421 (20.00) 269 (2021-02-15 14:00) #print(code) ans=input('Turn #1 : ') def check(ans,code): P=0 V=0 X=0 if ans[0] == code[0]: P+=1 elif ans[0] in code: V+=1 else: X+=1 if ans[1] == code[1]: P+=1 elif ans[1] in code: V+=1 else: X+=1 if ans[2] == code[2]: P+=1 elif ans[2] in code: V+=1 else: X+=1 if ans[3] == code[3]: P+=1 elif ans[3] in code: V+=1 else: X+=1 print(' ''P='+str(P) +','+'V='+ str(V) +','+'X='+ str(X)) if ans==code: print('Congratulations! You won the game.') else: check(ans,code) ans=input('Turn #2 : ') if ans==code: print('Congratulations! You won the game.') else: check(ans,code) ans=input('Turn #3 : ') if ans==code: print('Congratulations! You won the game.') else: check(ans,code) ans=input('Turn #4 : ') if ans==code: print('Congratulations! You won the game.') else: check(ans,code) print('Sorry! You just lost it.') print('The answer is',code) print('Please try again...') |
# 6330429021 (17.37) 270 (2021-02-14 22:27) code_1 = input("Turn #1 : ") P = 0 V = 0 if code_1[0] == code[0]: P += 1 elif code_1[0] in code: V += 1 if code_1[1] == code[1]: P += 1 elif code_1[1] in code: V += 1 if code_1[2] == code[2]: P += 1 elif code_1[2] in code: V += 1 if code_1[3] == code[3]: P += 1 elif code_1[3] in code: V += 1 if P == 4: print(WINNING_MSG) exit() else: X = len(code)-P-V print(" "*9,"P="+str(P)+",V="+str(V)+",X="+str(X)) code_2 = input("Turn #2 : ") P = 0 V = 0 if code_2[0] == code[0]: P += 1 elif code_2[0] in code: V += 1 if code_2[1] == code[1]: P += 1 elif code_2[1] in code: V += 1 if code_2[2] == code[2]: P += 1 elif code_2[2] in code: V += 1 if code_2[3] == code[3]: P += 1 elif code_2[3] in code: V += 1 if P == 4: print(WINNING_MSG) exit() else: X = len(code)-P-V print(" "*9,"P="+str(P)+",V="+str(V)+",X="+str(X)) code_3 = input("Turn #3 : ") P = 0 V = 0 if code_3[0] == code[0]: P += 1 elif code_3[0] in code: V += 1 if code_3[1] == code[1]: P += 1 elif code_3[1] in code: V += 1 if code_3[2] == code[2]: P += 1 elif code_3[2] in code: V += 1 if code_3[3] == code[3]: P += 1 elif code_3[3] in code: V += 1 if P == 4: print(WINNING_MSG) exit() else: X = len(code)-P-V print(" "*9,"P="+str(P)+",V="+str(V)+",X="+str(X)) code_4 = input("Turn #4 : ") P = 0 V = 0 if code_4[0] == code[0]: P += 1 elif code_4[0] in code: V += 1 if code_4[1] == code[1]: P += 1 elif code_4[1] in code: V += 1 if code_4[2] == code[2]: P += 1 elif code_4[2] in code: V += 1 if code_4[3] == code[3]: P += 1 elif code_4[3] in code: V += 1 if P == 4: print(WINNING_MSG) exit() else: print(LOSING_MSG) print("The answer is ",code) print("Please try again...") |
# 6330430621 (14.06) 271 (2021-02-13 00:27) #print(code) #--------------------------------------------------- c = input('Turn #1 : ') P = 0 if c[0] == code[0] and c[1] == code[1] and c[2] == code and c[3] == code[3]: P += 4 elif c[0] != code[0] and c[1] == code[1] and c[2] == code and c[3] == code[3]: P += 3 elif c[0] == code[0] and c[1] != code[1] and c[2] == code and c[3] == code[3]: P += 3 elif c[0] == code[0] and c[1] == code[1] and c[2] != code and c[3] == code[3]: P += 3 elif c[0] == code[0] and c[1] == code[1] and c[2] == code and c[3] != code[3]: P += 3 elif c[0] != code[0] and c[1] != code[1] and c[2] == code and c[3] == code[3]: P += 2 elif c[0] != code[0] and c[1] == code[1] and c[2] != code and c[3] == code[3]: P += 2 elif c[0] != code[0] and c[1] == code[1] and c[2] == code and c[3] != code[3]: P += 2 elif c[0] == code[0] and c[1] != code[1] and c[2] != code and c[3] == code[3]: P += 2 elif c[0] == code[0] and c[1] != code[1] and c[2] == code and c[3] != code[3]: P += 2 elif c[0] == code[0] and c[1] == code[1] and c[2] != code and c[3] != code[3]: P += 2 elif c[0] != code[0] and c[1] != code[1] and c[2] != code and c[3] == code[3]: P += 1 elif c[0] != code[0] and c[1] != code[1] and c[2] == code and c[3] != code[3]: P += 1 elif c[0] != code[0] and c[1] == code[1] and c[2] != code and c[3] != code[3]: P += 1 elif c[0] == code[0] and c[1] != code[1] and c[2] != code and c[3] != code[3]: P += 1 V = 0 if c[0] in code and c[0] != code[0] : V += 1 if c[1] in code and c[1] != code[1] : V += 1 if c[2] in code and c[2] != code[2] : V += 1 if c[3] in code and c[3] != code[3] : V += 1 X = 4 if c[0] in code : X -= 1 if c[1] in code : X -= 1 if c[2] in code : X -= 1 if c[3] in code : X -= 1 f = str(P) u = str(V) z = str(X) print(' ' +'P'+'='+ f+','+'V'+'='+u+','+'X'+'='+z ) #print(code) if P == 3 and V == 0 and X == 0: print(WINNING_MSG) else : b = input('Turn #2 : ')## and P == 0 and V == 0 and X == 4 P = 0 if b[0] == code[0] and b[1] == code[1] and b[2] == code and b[3] == code[3]: P += 4 elif b[0] != code[0] and b[1] == code[1] and b[2] == code and b[3] == code[3]: P += 3 elif b[0] == code[0] and b[1] != code[1] and b[2] == code and b[3] == code[3]: P += 3 elif b[0] == code[0] and b[1] == code[1] and b[2] != code and b[3] == code[3]: P += 3 elif b[0] == code[0] and b[1] == code[1] and b[2] == code and b[3] != code[3]: P += 3 elif b[0] != code[0] and b[1] != code[1] and b[2] == code and b[3] == code[3]: P += 2 elif b[0] != code[0] and b[1] == code[1] and b[2] != code and b[3] == code[3]: P += 2 elif b[0] != code[0] and b[1] == code[1] and b[2] == code and b[3] != code[3]: P += 2 elif b[0] == code[0] and b[1] != code[1] and b[2] != code and b[3] == code[3]: P += 2 elif b[0] == code[0] and b[1] != code[1] and b[2] == code and b[3] != code[3]: P += 2 elif b[0] == code[0] and b[1] == code[1] and b[2] != code and b[3] != code[3]: P += 2 elif b[0] != code[0] and b[1] != code[1] and b[2] != code and b[3] == code[3]: P += 1 elif b[0] != code[0] and b[1] != code[1] and b[2] == code and b[3] != code[3]: P += 1 elif b[0] != code[0] and b[1] == code[1] and b[2] != code and b[3] != code[3]: P += 1 elif b[0] == code[0] and b[1] != code[1] and b[2] != code and b[3] != code[3]: P += 1 V = 0 if b[0] in code and b[0] != code[0] : V += 1 if b[1] in code and b[1] != code[1] : V += 1 if b[2] in code and b[2] != code[2] : V += 1 if b[3] in code and b[3] != code[3] : V += 1 X = 4 if b[0] in code : X -= 1 if b[1] in code : X -= 1 if b[2] in code : X -= 1 if b[3] in code : X -= 1 f = str(P) u = str(V) z = str(X) print(' ' +'P'+'='+ f+','+'V'+'='+u+','+'X'+'='+z ) if P == 3 and V == 0 and X == 0: print(WINNING_MSG) else : q = input('Turn #3 : ')#and P == 0 and V == 0 and X == 4 P = 0 if q[0] == code[0] and q[1] == code[1] and q[2] == code and q[3] == code[3]: P += 4 elif q[0] != code[0] and q[1] == code[1] and q[2] == code and q[3] == code[3]: P += 3 elif q[0] == code[0] and q[1] != code[1] and q[2] == code and q[3] == code[3]: P += 3 elif q[0] == code[0] and q[1] == code[1] and q[2] != code and q[3] == code[3]: P += 3 elif q[0] == code[0] and q[1] == code[1] and q[2] == code and q[3] != code[3]: P += 3 elif q[0] != code[0] and q[1] != code[1] and q[2] == code and q[3] == code[3]: P += 2 elif q[0] != code[0] and q[1] == code[1] and q[2] != code and q[3] == code[3]: P += 2 elif q[0] != code[0] and q[1] == code[1] and q[2] == code and q[3] != code[3]: P += 2 elif q[0] == code[0] and q[1] != code[1] and q[2] != code and q[3] == code[3]: P += 2 elif q[0] == code[0] and q[1] != code[1] and q[2] == code and q[3] != code[3]: P += 2 elif q[0] == code[0] and q[1] == code[1] and q[2] != code and q[3] != code[3]: P += 2 elif q[0] != code[0] and q[1] != code[1] and q[2] != code and q[3] == code[3]: P += 1 elif q[0] != code[0] and q[1] != code[1] and q[2] == code and q[3] != code[3]: P += 1 elif q[0] != code[0] and q[1] == code[1] and q[2] != code and q[3] != code[3]: P += 1 elif q[0] == code[0] and q[1] != code[1] and q[2] != code and q[3] != code[3]: P += 1 V = 0 if q[0] in code and q[0] != code[0] : V += 1 if q[1] in code and q[1] != code[1] : V += 1 if q[2] in code and q[2] != code[2] : V += 1 if q[3] in code and q[3] != code[3] : V += 1 X = 4 if q[0] in code : X -= 1 if q[1] in code : X -= 1 if q[2] in code : X -= 1 if q[3] in code : X -= 1 f = str(P) u = str(V) z = str(X) print(' ' +'P'+'='+ f+','+'V'+'='+u+','+'X'+'='+z ) if P == 3 and V == 0 and X == 0: print(WINNING_MSG) else: t = input('Turn #4 : ') P = 0 if t[0] == code[0] and t[1] == code[1] and t[2] == code and t[3] == code[3]: P += 4 elif t[0] != code[0] and t[1] == code[1] and t[2] == code and t[3] == code[3]: P += 3 elif t[0] == code[0] and t[1] != code[1] and t[2] == code and t[3] == code[3]: P += 3 elif t[0] == code[0] and t[1] == code[1] and t[2] != code and t[3] == code[3]: P += 3 elif t[0] == code[0] and t[1] == code[1] and t[2] == code and t[3] != code[3]: P += 3 elif t[0] != code[0] and t[1] != code[1] and t[2] == code and t[3] == code[3]: P += 2 elif t[0] != code[0] and t[1] == code[1] and t[2] != code and t[3] == code[3]: P += 2 elif t[0] != code[0] and t[1] == code[1] and t[2] == code and t[3] != code[3]: P += 2 elif t[0] == code[0] and t[1] != code[1] and t[2] != code and t[3] == code[3]: P += 2 elif t[0] == code[0] and t[1] != code[1] and t[2] == code and t[3] != code[3]: P += 2 elif t[0] == code[0] and t[1] == code[1] and t[2] != code and t[3] != code[3]: P += 2 elif t[0] != code[0] and t[1] != code[1] and t[2] != code and t[3] == code[3]: P += 1 elif t[0] != code[0] and t[1] != code[1] and t[2] == code and t[3] != code[3]: P += 1 elif t[0] != code[0] and t[1] == code[1] and t[2] != code and t[3] != code[3]: P += 1 elif t[0] == code[0] and t[1] != code[1] and t[2] != code and t[3] != code[3]: P += 1 V = 0 if t[0] in code and t[0] != code[0] : V += 1 if t[1] in code and t[1] != code[1] : V += 1 if t[2] in code and t[2] != code[2] : V += 1 if t[3] in code and t[3] != code[3] : V += 1 X = 4 if t[0] in code : X -= 1 if t[1] in code : X -= 1 if t[2] in code : X -= 1 if t[3] in code : X -= 1 f = str(P) u = str(V) z = str(X) print(' ' +'P'+'='+ f+','+'V'+'='+u+','+'X'+'='+z ) if P == 3 and V == 0 and X == 0: print(WINNING_MSG) else : print(LOSING_MSG) print('The answer is',code) print('Please try again...') #print(len(h)) #print(k) |
# 6330431221 (17.26) 272 (2021-02-15 02:44) insert_code=input('Turn #1 : ') P=0 V=0 X=0 if insert_code[0] == code[0]: P +=1 elif (insert_code[0] == code[1]) or (insert_code[0]==code[2]) or (insert_code[0]==code[3]): V +=1 else: X +=1 if insert_code[1] == code[1]: P +=1 elif (insert_code[1] == code[0]) or (insert_code[1]==code[2]) or (insert_code[1]==code[3]): V +=1 else: X +=1 if insert_code[2] == code[2]: P +=1 elif (insert_code[2] == code[0]) or (insert_code[2]==code[1]) or (insert_code[2]==code[3]): V +=1 else: X +=1 if insert_code[3] == code[3]: P +=1 elif (insert_code[3] == code[0]) or (insert_code[3]==code[1]) or (insert_code[3]==code[2]): V +=1 else: X +=1 if P == 4: print(WINNING_MSG) else: print(" "+"P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) insert_code =input("Turn #2 : ") P=0 V=0 X=0 if insert_code[0] == code[0]: P +=1 elif (insert_code[0] == code[1]) or (insert_code[0]==code[2]) or (insert_code[0]==code[3]): V +=1 else: X +=1 if insert_code[1] == code[1]: P +=1 elif (insert_code[1] == code[0]) or (insert_code[1]==code[2]) or (insert_code[1]==code[3]): V +=1 else: X +=1 if insert_code[2] == code[2]: P +=1 elif (insert_code[2] == code[0]) or (insert_code[2]==code[1]) or (insert_code[2]==code[3]): V +=1 else: X +=1 if insert_code[3] == code[3]: P +=1 elif (insert_code[3] == code[0]) or (insert_code[3]==code[1]) or (insert_code[3]==code[2]): V +=1 else: X +=1 if P == 4: print(WINNING_MSG) else: print(" "+"P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) insert_code =input("Turn #3 : ") if P == 4: print(WINNING_MSG) else: print(" "+"P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) insert_code =input("Turn #4 : ") P=0 V=0 X=0 if insert_code[0] == code[0]: P +=1 elif (insert_code[0] == code[1]) or (insert_code[0]==code[2]) or (insert_code[0]==code[3]): V +=1 else: X +=1 if insert_code[1] == code[1]: P +=1 elif (insert_code[1] == code[0]) or (insert_code[1]==code[2]) or (insert_code[1]==code[3]): V +=1 else: X +=1 if insert_code[2] == code[2]: P +=1 elif (insert_code[2] == code[0]) or (insert_code[2]==code[1]) or (insert_code[2]==code[3]): V +=1 else: X +=1 if insert_code[3] == code[3]: P +=1 elif (insert_code[3] == code[0]) or (insert_code[3]==code[1]) or (insert_code[3]==code[2]): V +=1 else: X +=1 if P == 4: print(WINNING_MSG) else: print(" "+"P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) print(LOSING_MSG) print("The answer is ",code) print("Please try again...") |
# 6330432921 (20.00) 273 (2021-02-13 17:55) i = 0 while i < 4: Guess = input("Turn #"+str(i+1)+" : ") P = 0 if Guess[0] == code[0]: P += 1 else: P += 0 if Guess[1] == code[1]: P += 1 else: P += 0 if Guess[2] == code[2]: P += 1 else: P += 0 if Guess[3] == code[3]: P += 1 else: P += 0 if P == 4 : break V = 0 if Guess[0] in code: V += 1 else: V += 0 if Guess[1] in code: V += 1 else: V += 0 if Guess[2] in code: V += 1 else: V += 0 if Guess[3] in code: V += 1 else: V += 0 V = V-P X = len(code)-(P+V) print(" ","P=",P,",V=",V,",X=",X) i += 1 if P == 4: print(WINNING_MSG) else: print(LOSING_MSG) print("The answer is",code) print("Please try again...") |
# 6330433521 (20.00) 274 (2021-02-14 02:34) g = input('Turn #1 : ') p1=p2=p3=p4=v1=v2=v3=v4=x1=x2=x3=x4 = 0 if g[0] in code: if g[0]==code[0]: p1=1 else: v1=1 else: x1=1 if g[1] in code: if g[1]==code[1]: p2=1 else: v2=1 else: x2=1 if g[2] in code: if g[2]==code[2]: p3=1 else: v3=1 else: x3=1 if g[3] in code: if g[3]==code[3]: p4=1 else: v4=1 else: x4=1 P= str(p1+p2+p3+p4) V= str(v1+v2+v3+v4) X= str(x1+x2+x3+x4) if P=='4': print('Congratulations! You won the game.') else : print(' '+'P='+P+','+'V='+V+','+'X='+X) g = input('Turn #2 : ') p1=p2=p3=p4=v1=v2=v3=v4=x1=x2=x3=x4 = 0 if g[0] in code: if g[0]==code[0]: p1=1 else: v1=1 else: x1=1 if g[1] in code: if g[1]==code[1]: p2=1 else: v2=1 else: x2=1 if g[2] in code: if g[2]==code[2]: p3=1 else: v3=1 else: x3=1 if g[3] in code: if g[3]==code[3]: p4=1 else: v4=1 else: x4=1 P= str(p1+p2+p3+p4) V= str(v1+v2+v3+v4) X= str(x1+x2+x3+x4) if P=='4': print('Congratulations! You won the game.') else : print(' '+'P='+P+','+'V='+V+','+'X='+X) g = input('Turn #3 : ') p1=p2=p3=p4=v1=v2=v3=v4=x1=x2=x3=x4 = 0 if g[0] in code: if g[0]==code[0]: p1=1 else: v1=1 else: x1=1 if g[1] in code: if g[1]==code[1]: p2=1 else: v2=1 else: x2=1 if g[2] in code: if g[2]==code[2]: p3=1 else: v3=1 else: x3=1 if g[3] in code: if g[3]==code[3]: p4=1 else: v4=1 else: x4=1 P= str(p1+p2+p3+p4) V= str(v1+v2+v3+v4) X= str(x1+x2+x3+x4) if P=='4': print('Congratulations! You won the game.') else : print(' '+'P='+P+','+'V='+V+','+'X='+X) g = input('Turn #4 : ') p1=p2=p3=p4=v1=v2=v3=v4=x1=x2=x3=x4 = 0 if g[0] in code: if g[0]==code[0]: p1=1 else: v1=1 else: x1=1 if g[1] in code: if g[1]==code[1]: p2=1 else: v2=1 else: x2=1 if g[2] in code: if g[2]==code[2]: p3=1 else: v3=1 else: x3=1 if g[3] in code: if g[3]==code[3]: p4=1 else: v4=1 else: x4=1 P= str(p1+p2+p3+p4) V= str(v1+v2+v3+v4) X= str(x1+x2+x3+x4) if P=='4': print('Congratulations! You won the game.') else : print(' '+'P='+P+','+'V='+V+','+'X='+X) print('Sorry! You just lost it.') print('The answer is '+code) print('Please try again...') |
# 6330434121 (20.00) 275 (2021-02-14 22:50) Turn_1 = input("Turn #1 : ") P=0 V=0 if Turn_1[0]==code[0]: P += 1 elif Turn_1[0] in code: V += 1 if Turn_1[1]==code[1]: P += 1 elif Turn_1[1] in code: V += 1 if Turn_1[2]==code[2]: P += 1 elif Turn_1[2] in code: V += 1 if Turn_1[3]==code[3]: P += 1 elif Turn_1[3] in code: V += 1 X = 4-V-P if str(P)=="4": print("Congratulations! You won the game.") else: print(" " + "P=" + str(P) + ",V=" + str(V) + ",X=" + str(X)) Turn_2 = input("Turn #2 : ") P = 0 V = 0 if Turn_2[0] == code[0]: P += 1 elif Turn_2[0] in code: V += 1 if Turn_2[1] == code[1]: P += 1 elif Turn_2[1] in code: V += 1 if Turn_2[2] == code[2]: P += 1 elif Turn_2[2] in code: V += 1 if Turn_2[3] == code[3]: P += 1 elif Turn_2[3] in code: V += 1 X = 4 - V - P if str(P) == "4": print("Congratulations! You won the game.") else: print(" " + "P=" + str(P) + ",V=" + str(V) + ",X=" + str(X)) Turn_3 = input("Turn #3 : ") P = 0 V = 0 if Turn_3[0] == code[0]: P += 1 elif Turn_3[0] in code: V += 1 if Turn_3[1] == code[1]: P += 1 elif Turn_3[1] in code: V += 1 if Turn_3[2] == code[2]: P += 1 elif Turn_3[2] in code: V += 1 if Turn_3[3] == code[3]: P += 1 elif Turn_3[3] in code: V += 1 X = 4 - V - P if str(P) == "4": print("Congratulations! You won the game.") else: print(" " + "P=" + str(P) + ",V=" + str(V) + ",X=" + str(X)) Turn_4 = input("Turn #4 : ") P = 0 V = 0 if Turn_4[0] == code[0]: P += 1 elif Turn_4[0] in code: V += 1 if Turn_4[1] == code[1]: P += 1 elif Turn_4[1] in code: V += 1 if Turn_4[2] == code[2]: P += 1 elif Turn_4[2] in code: V += 1 if Turn_4[3] == code[3]: P += 1 elif Turn_4[3] in code: V += 1 X = 4 - V - P if str(P) == "4": print("Congratulations! You won the game.") else: print(" " + "P=" + str(P) + ",V=" + str(V) + ",X=" + str(X)) print("Sorry! You just lost it.") print("The answer is " + code) print("Please try again...") |
# 6330435821 (20.00) 276 (2021-02-13 11:20) NEXT_TURN=True #print(code) p,v,x=0,0,0 GUESS = str(input('Turn #1 : ')) if GUESS != code: p=int(GUESS[0] == code[0])+int(GUESS[1] == code[1])+int(GUESS[2] == code[2])+int(GUESS[3] == code[3]) x=int(GUESS[0] not in code)+int(GUESS[1] not in code)+int(GUESS[2] not in code)+int(GUESS[3] not in code) v=4-x-p print(' P='+str(p)+',V='+str(v)+',X='+str(4-p-v)) else: NEXT_TURN=False if NEXT_TURN: p, v, x = 0, 0, 0 GUESS = str(input('Turn #2 : ')) if GUESS != code: p=int(GUESS[0] == code[0])+int(GUESS[1] == code[1])+int(GUESS[2] == code[2])+int(GUESS[3] == code[3]) x=int(GUESS[0] not in code)+int(GUESS[1] not in code)+int(GUESS[2] not in code)+int(GUESS[3] not in code) v=4-x-p print(' P='+str(p)+',V='+str(v)+',X='+str(4-p-v)) else: NEXT_TURN=False if NEXT_TURN: p, v, x = 0, 0, 0 GUESS = str(input('Turn #3 : ')) if GUESS != code: p=int(GUESS[0] == code[0])+int(GUESS[1] == code[1])+int(GUESS[2] == code[2])+int(GUESS[3] == code[3]) x=int(GUESS[0] not in code)+int(GUESS[1] not in code)+int(GUESS[2] not in code)+int(GUESS[3] not in code) v=4-x-p print(' P='+str(p)+',V='+str(v)+',X='+str(4-p-v)) else: NEXT_TURN=False if NEXT_TURN: p, v, x = 0, 0, 0 GUESS = str(input('Turn #4 : ')) if GUESS != code: p=int(GUESS[0] == code[0])+int(GUESS[1] == code[1])+int(GUESS[2] == code[2])+int(GUESS[3] == code[3]) x=int(GUESS[0] not in code)+int(GUESS[1] not in code)+int(GUESS[2] not in code)+int(GUESS[3] not in code) v=4-x-p print(' P='+str(p)+',V='+str(v)+',X='+str(4-p-v)) print(LOSING_MSG) print('The answer is', code) print('Please try again...') else: NEXT_TURN=False if not NEXT_TURN: print(WINNING_MSG) |
# 6330436421 (20.00) 277 (2021-02-15 16:38) # Use for check answer when testing a program # print(f"Answer : {code}") code_split = list(code) for i in range(4): p = 0 v = 0 x = 0 answer = input(f"Turn #{i+1} : ") # This list is make for mark that if it's same we are not going to check again. Just check one time. check_status = [' ', ' ', ' ', ' '] # Support when some player not use a capitalize character when play this game. answer.upper() answer_split = list(answer) if len(answer) > 4: print(f"{' '*10}") elif len(answer) < 4: print(f"{' '*10} {len(answer)}") elif answer == code: import sys print("Congratulations! You won the game.") sys.exit() else: for j in range(4): if answer_split[j] == code_split[j]: check_status[j] = 'pass' for k in range(4): if check_status[k] == 'pass': p += 1 elif answer_split[k] in code_split: v += 1 else: x += 1 print(f"{' '*10}P={p},V={v},X={x}") print("Sorry! You just lost it.") print(f"The answer is {code}") print("Please try again...") |
# 6330437021 (20.00) 278 (2021-02-15 23:43) P=0 V=0 X=0 A=input("Turn #1 : ") if A==code: print(WINNING_MSG) else: if A[0]==code[0]: P+=1 if A[1]==code[1]: P+=1 if A[2]==code[2]: P+=1 if A[3]==code[3]: P+=1 if (A[0] in code) and (A[0]!=code[0]): V+=1 if (A[1] in code) and (A[1]!=code[1]): V+=1 if (A[2] in code) and (A[2]!=code[2]): V+=1 if (A[3] in code) and (A[3]!=code[3]): V+=1 if not (A[0] in code): X+=1 if not (A[1] in code): X+=1 if not (A[2] in code): X+=1 if not (A[3] in code): X+=1 print(" P=" + str(P) + ",V=" + str(V) + ",X=" + str(X)) P=0 V=0 X=0 A=input("Turn #2 : ") if A==code: print(WINNING_MSG) else: if A[0]==code[0]: P+=1 if A[1]==code[1]: P+=1 if A[2]==code[2]: P+=1 if A[3]==code[3]: P+=1 if (A[0] in code) and (A[0]!=code[0]): V+=1 if (A[1] in code) and (A[1]!=code[1]): V+=1 if (A[2] in code) and (A[2]!=code[2]): V+=1 if (A[3] in code) and (A[3]!=code[3]): V+=1 if not (A[0] in code): X+=1 if not (A[1] in code): X+=1 if not (A[2] in code): X+=1 if not (A[3] in code): X+=1 print(" P=" + str(P) + ",V=" + str(V) + ",X=" + str(X)) P=0 V=0 X=0 A=input("Turn #3 : ") if A==code: print(WINNING_MSG) else: if A[0]==code[0]: P+=1 if A[1]==code[1]: P+=1 if A[2]==code[2]: P+=1 if A[3]==code[3]: P+=1 if (A[0] in code) and (A[0]!=code[0]): V+=1 if (A[1] in code) and (A[1]!=code[1]): V+=1 if (A[2] in code) and (A[2]!=code[2]): V+=1 if (A[3] in code) and (A[3]!=code[3]): V+=1 if not (A[0] in code): X+=1 if not (A[1] in code): X+=1 if not (A[2] in code): X+=1 if not (A[3] in code): X+=1 print(" P=" + str(P) + ",V=" + str(V) + ",X=" + str(X)) P=0 V=0 X=0 A=input("Turn #4 : ") if A==code: print(WINNING_MSG) else: if A[0]==code[0]: P+=1 if A[1]==code[1]: P+=1 if A[2]==code[2]: P+=1 if A[3]==code[3]: P+=1 if (A[0] in code) and (A[0]!=code[0]): V+=1 if (A[1] in code) and (A[1]!=code[1]): V+=1 if (A[2] in code) and (A[2]!=code[2]): V+=1 if (A[3] in code) and (A[3]!=code[3]): V+=1 if not (A[0] in code): X+=1 if not (A[1] in code): X+=1 if not (A[2] in code): X+=1 if not (A[3] in code): X+=1 print(" P=" + str(P) + ",V=" + str(V) + ",X=" + str(X)) print(LOSING_MSG) print("The answer is " + code) print("Please try again...") |
# 6330439321 (17.71) 279 (2021-02-14 20:40) # --------------------------------------------------- TEN_WHITESPACE = ' ' * 10 not_win = True if not_win: P, V, X = 0, 0, 0 guess = input('Turn #1 : ') if guess[0] == code[0]: P += 1 elif guess[0] in code: V += 1 if guess[1] == code[1]: P += 1 elif guess[1] in code: V += 1 if guess[2] == code[2]: P += 1 elif guess[2] in code: V += 1 if guess[3] == code[3]: P += 1 elif guess[3] in code: V += 1 if P == 4: print(WINNING_MSG) not_win = False else: X = 4 - (P + V) print(TEN_WHITESPACE, 'P=', P, ',V=', V, ',X=', X, sep='') if not_win: P, V, X = 0, 0, 0 guess = input('Turn #2 : ') if guess[0] == code[0]: P += 1 elif guess[0] in code: V += 1 if guess[1] == code[1]: P += 1 elif guess[1] in code: V += 1 if guess[2] == code[2]: P += 1 elif guess[2] in code: V += 1 if guess[3] == code[3]: P += 1 elif guess[3] in code: V += 1 if P == 4: print(WINNING_MSG) not_win = False else: X = 4 - (P + V) print(TEN_WHITESPACE, 'P=', P, ',V=', V, ',X=', X, sep='') if not_win: P, V, X = 0, 0, 0 guess = input('Turn #3 : ') if guess[0] == code[0]: P += 1 elif guess[0] in code: V += 1 if guess[1] == code[1]: P += 1 elif guess[1] in code: V += 1 if guess[2] == code[2]: P += 1 elif guess[2] in code: V += 1 if guess[3] == code[3]: P += 1 elif guess[3] in code: V += 1 if P == 4: print(WINNING_MSG) not_win = False else: X = 4 - (P + V) print(TEN_WHITESPACE, 'P=', P, ',V=', V, ',X=', X, sep='') if not_win: P, V, X = 0, 0, 0 guess = input('Turn #4 : ') if guess[0] == code[0]: P += 1 elif guess[0] in code: V += 1 if guess[1] == code[1]: P += 1 elif guess[1] in code: V += 1 if guess[2] == code[2]: P += 1 elif guess[2] in code: V += 1 if guess[3] == code[3]: P += 1 elif guess[3] in code: V += 1 if P == 4: print(WINNING_MSG) not_win = False else: X = 4 - (P + V) print(TEN_WHITESPACE, 'P=', P, ',V=', V, ',X=', X, sep='') if not_win: print(LOSING_MSG) |
# 6330440921 (19.11) 280 (2021-02-12 18:35) won = 0 p = 0 v = 0 x = 0 if won == 0: first = input('Turn #1 : ') if first[0] == code[0]: p = p + 1 if first[1] == code[1]: p = p + 1 if first[2] == code[2]: p = p + 1 if first[3] == code[3]: p = p + 1 if first[0] not in code: x = x + 1 if first[1] not in code: x = x + 1 if first[2] not in code: x = x + 1 if first[3] not in code: x = x + 1 if first[0] in code and first[0] != code[0]: v = v + 1 if first[1] in code and first[1] != code[1]: v = v + 1 if first[2] in code and first[2] != code[2]: v = v + 1 if first[3] in code and first[3] != code[3]: v = v + 1 print(' ' + 'P=' + str(p) + ',' + 'V=' + str(v) + ',' + 'X=' + str(x)) if first == code: print('Congratulations! You won the game.') won = won + 1 if won == 0: p = 0 v = 0 x = 0 second = input('Turn #2 : ') if second[0] == code[0]: p = p + 1 if second[1] == code[1]: p = p + 1 if second[2] == code[2]: p = p + 1 if second[3] == code[3]: p = p + 1 if second[0] not in code: x = x + 1 if second[1] not in code: x = x + 1 if second[2] not in code: x = x + 1 if second[3] not in code: x = x + 1 if second[0] in code and second[0] != code[0]: v = v + 1 if second[1] in code and second[1] != code[1]: v = v + 1 if second[2] in code and second[2] != code[2]: v = v + 1 if second[3] in code and second[3] != code[3]: v = v + 1 print(' ' + 'P=' + str(p) + ',' + 'V=' + str(v) + ',' + 'X=' + str(x)) if second == code: print('Congratulations! You won the game.') won = won + 1 if won == 0: p = 0 v = 0 x = 0 third = input('Turn #3 : ') if third[0] == code[0]: p = p + 1 if third[1] == code[1]: p = p + 1 if third[2] == code[2]: p = p + 1 if third[3] == code[3]: p = p + 1 if third[0] not in code: x = x + 1 if third[1] not in code: x = x + 1 if third[2] not in code: x = x + 1 if third[3] not in code: x = x + 1 if third[0] in code and third[0] != code[0]: v = v + 1 if third[1] in code and third[1] != code[1]: v = v + 1 if third[2] in code and third[2] != code[2]: v = v + 1 if third[3] in code and third[3] != code[3]: v = v + 1 print(' ' + 'P=' + str(p) + ',' + 'V=' + str(v) + ',' + 'X=' + str(x)) if third == code: print('Congratulations! You won the game.') won = won + 1 if won == 0: p = 0 v = 0 x = 0 fourth = input('Turn #4 : ') if fourth[0] == code[0]: p = p + 1 if fourth[1] == code[1]: p = p + 1 if fourth[2] == code[2]: p = p + 1 if fourth[3] == code[3]: p = p + 1 if fourth[0] not in code: x = x + 1 if fourth[1] not in code: x = x + 1 if fourth[2] not in code: x = x + 1 if fourth[3] not in code: x = x + 1 if fourth[0] in code and fourth[0] != code[0]: v = v + 1 if fourth[1] in code and fourth[1] != code[1]: v = v + 1 if fourth[2] in code and fourth[2] != code[2]: v = v + 1 if fourth[3] in code and fourth[3] != code[3]: v = v + 1 print(' ' + 'P=' + str(p) + ',' + 'V=' + str(v) + ',' + 'X=' + str(x)) if fourth == code: print('Congratulations! You won the game.') won = won + 1 if won == 0: print('Sorry! You just lost it.') print('The answer is ' + code) print('Please try again...') |
# 6330441521 (20.00) 281 (2021-02-15 22:48) P = 0 V = 0 X = 0 lc = [code[0],code[1],code[2],code[3]] ans = input("Turn #1 : ") if ans == code: print("Congratulations! You won the game.") else: if ans[0] == code[0]: P+=1 if ans[1] == code[1]: P+=1 if ans[2] == code[2]: P+=1 if ans[3] == code[3]: P+=1 #-------------------------------------- if ans[0] in lc and ans[0] != code[0]: V += 1 if ans[1] in lc and ans[1] != code[1]: V += 1 if ans[2] in lc and ans[2] != code[2]: V += 1 if ans[3] in lc and ans[3] != code[3]: V += 1 #-------------------------------------- if ans[0] not in lc: X += 1 if ans[1] not in lc: X += 1 if ans[2] not in lc: X += 1 if ans[3] not in lc: X += 1 print(" P="+str(P)+",V="+str(V)+",X="+str(X)) P = 0 V = 0 X = 0 ans = input("Turn #2 : ") if ans == code: print("Congratulations! You won the game.") else: if ans[0] == code[0]: P+=1 if ans[1] == code[1]: P+=1 if ans[2] == code[2]: P+=1 if ans[3] == code[3]: P+=1 #-------------------------------------- if ans[0] in lc and ans[0] != code[0]: V += 1 if ans[1] in lc and ans[1] != code[1]: V += 1 if ans[2] in lc and ans[2] != code[2]: V += 1 if ans[3] in lc and ans[3] != code[3]: V += 1 #-------------------------------------- if ans[0] not in lc: X += 1 if ans[1] not in lc: X += 1 if ans[2] not in lc: X += 1 if ans[3] not in lc: X += 1 print(" P="+str(P)+",V="+str(V)+",X="+str(X)) P = 0 V = 0 X = 0 ans = input("Turn #3 : ") if ans == code: print("Congratulations! You won the game.") else: if ans[0] == code[0]: P+=1 if ans[1] == code[1]: P+=1 if ans[2] == code[2]: P+=1 if ans[3] == code[3]: P+=1 #-------------------------------------- if ans[0] in lc and ans[0] != code[0]: V += 1 if ans[1] in lc and ans[1] != code[1]: V += 1 if ans[2] in lc and ans[2] != code[2]: V += 1 if ans[3] in lc and ans[3] != code[3]: V += 1 #-------------------------------------- if ans[0] not in lc: X += 1 if ans[1] not in lc: X += 1 if ans[2] not in lc: X += 1 if ans[3] not in lc: X += 1 print(" P="+str(P)+",V="+str(V)+",X="+str(X)) P = 0 V = 0 X = 0 ans = input("Turn #4 : ") if ans == code: print("Congratulations! You won the game.") else: if ans[0] == code[0]: P+=1 if ans[1] == code[1]: P+=1 if ans[2] == code[2]: P+=1 if ans[3] == code[3]: P+=1 #-------------------------------------- if ans[0] in lc and ans[0] != code[0]: V += 1 if ans[1] in lc and ans[1] != code[1]: V += 1 if ans[2] in lc and ans[2] != code[2]: V += 1 if ans[3] in lc and ans[3] != code[3]: V += 1 #-------------------------------------- if ans[0] not in lc: X += 1 if ans[1] not in lc: X += 1 if ans[2] not in lc: X += 1 if ans[3] not in lc: X += 1 print(" P="+str(P)+",V="+str(V)+",X="+str(X)) print("Sorry! You just lost it.") print("The answer is "+code) print("Please try again...") |
# 6330443821 (20.00) 282 (2021-02-15 16:11) i = 4 a = 0 P = 0 V = 0 X = 0 x = input("Turn #1 : ") if x[0] == code[0]: P += 1 if x[1] == code[1]: P += 1 if x[2] == code[2]: P += 1 if x[3] == code[3]: P += 1 if x[0] == code[1] or x[0] == code[2] or x[0] == code[3]: V += 1 if x[1] == code[0] or x[1] == code[2] or x[1] == code[3]: V += 1 if x[2] == code[0] or x[2] == code[1] or x[2] == code[3]: V += 1 if x[3] == code[0] or x[3] == code[1] or x[3] == code[2]: V += 1 X = 4-P-V if P == 4: print(WINNING_MSG) else: print(" "+"P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) x = input("Turn #2 : ") P = 0 V = 0 X = 0 if x[0] == code[0]: P += 1 if x[1] == code[1]: P += 1 if x[2] == code[2]: P += 1 if x[3] == code[3]: P += 1 if x[0] == code[1] or x[0] == code[2] or x[0] == code[3]: V += 1 if x[1] == code[0] or x[1] == code[2] or x[1] == code[3]: V += 1 if x[2] == code[0] or x[2] == code[1] or x[2] == code[3]: V += 1 if x[3] == code[0] or x[3] == code[1] or x[3] == code[2]: V += 1 X = 4-P-V if P== 4: print(WINNING_MSG) else: print(" "+"P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) x = input("Turn #3 : ") P = 0 V = 0 X = 0 if x[0] == code[0]: P += 1 if x[1] == code[1]: P += 1 if x[2] == code[2]: P += 1 if x[3] == code[3]: P += 1 if x[0] == code[1] or x[0] == code[2] or x[0] == code[3]: V += 1 if x[1] == code[0] or x[1] == code[2] or x[1] == code[3]: V += 1 if x[2] == code[0] or x[2] == code[1] or x[2] == code[3]: V += 1 if x[3] == code[0] or x[3] == code[1] or x[3] == code[2]: V += 1 X = 4-P-V if P== 4: print(WINNING_MSG) else: print(" "+"P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) x = input("Turn #4 : ") P = 0 V = 0 X = 0 if x[0] == code[0]: P += 1 if x[1] == code[1]: P += 1 if x[2] == code[2]: P += 1 if x[3] == code[3]: P += 1 if x[0] == code[1] or x[0] == code[2] or x[0] == code[3]: V += 1 if x[1] == code[0] or x[1] == code[2] or x[1] == code[3]: V += 1 if x[2] == code[0] or x[2] == code[1] or x[2] == code[3]: V += 1 if x[3] == code[0] or x[3] == code[1] or x[3] == code[2]: V += 1 X = 4-P-V if P== 4: print(WINNING_MSG) else: print(" "+"P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) print(LOSING_MSG) print("The answer is"+" "+code) print("Please try again...") |
# 6330444421 (0.00) 283 (2021-02-15 13:59) #--------------------------------------------------- m=[code[0],code[1],code[2],code[3]] x=input('Turn #1 : ') n=(m.count(x[0])+m.count(x[1])+m.count(x[2])+m.count(x[3])) P=0 if m[0]==x[0]: P=+1 if m[1]==x[1]: P=+1 if m[2]==x[2]: P=+1 if m[3]==x[3]: P=+1 V=n-P X=4-b if P==4: print(WINNING_MSG) else : print(' P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) x=input('Turn #2 : ') b=(a.count(x[0])+a.count(x[1])+a.count(x[2])+a.count(x[3])) P=0 if a[0]==x[0]: P=+1 if a[1]==x[1]: P=+1 if a[2]==x[2]: P=+1 if a[3]==x[3]: P=+1 V=b-P X=4-b if P==4: print(WINNING_MSG) else : print(' P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) x=input('Turn #3 : ') n=(m.count(x[0])+m.count(x[1])+m.count(x[2])+m.count(x[3])) P=0 if m[0]==x[0]: P=+1 if m[1]==x[1]: P=+1 if m[2]==x[2]: P=+1 if m[3]==x[3]: P=+1 V=n-P X=4-b if P==4: print(WINNING_MSG) else : print(' P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) x=input('Turn #4 : ') n=(m.count(x[0])+m.count(x[1])+m.count(x[2])+m.count(x[3])) P=0 if m[0]==x[0]: P=+1 if m[1]==x[1]: P=+1 if m[2]==x[2]: P=+1 if m[3]==x[3]: P=+1 V=n-P X=4-b if P==4: print(WINNING_MSG) else: print(LOSING_MSG) print('The answer is'+' '+str(code)) print('Please try again') |
# 6330445021 (20.00) 284 (2021-02-15 08:58) W = 0 if W == 0: P,V = 0,0 a = input('Turn #1 : ') if a[0] == code[0]: P += 1 elif a[0] == code[1] or a[0] == code[2] or a[0] == code[3]: V += 1 if a[1] == code[1]: P += 1 elif a[1] == code[0] or a[1] == code[2] or a[1] == code[3]: V += 1 if a[2] == code[2]: P += 1 elif a[2] == code[0] or a[2] == code[1] or a[2] == code[3]: V += 1 if a[3] == code[3]: P += 1 elif a[3] == code[0] or a[3] == code[1] or a[3] == code[2]: V += 1 if P == 4: W += 1 else: print(' P=' + str(P) + ',V=' + str(V) + ',X=' + str(4-P-V)) if W == 0: P,V = 0,0 a = input('Turn #2 : ') if a[0] == code[0]: P += 1 elif a[0] == code[1] or a[0] == code[2] or a[0] == code[3]: V += 1 if a[1] == code[1]: P += 1 elif a[1] == code[0] or a[1] == code[2] or a[1] == code[3]: V += 1 if a[2] == code[2]: P += 1 elif a[2] == code[0] or a[2] == code[1] or a[2] == code[3]: V += 1 if a[3] == code[3]: P += 1 elif a[3] == code[0] or a[3] == code[1] or a[3] == code[2]: V += 1 if P == 4: W += 1 else: print(' P=' + str(P) + ',V=' + str(V) + ',X=' + str(4-P-V)) if W == 0: P,V = 0,0 a = input('Turn #3 : ') if a[0] == code[0]: P += 1 elif a[0] == code[1] or a[0] == code[2] or a[0] == code[3]: V += 1 if a[1] == code[1]: P += 1 elif a[1] == code[0] or a[1] == code[2] or a[1] == code[3]: V += 1 if a[2] == code[2]: P += 1 elif a[2] == code[0] or a[2] == code[1] or a[2] == code[3]: V += 1 if a[3] == code[3]: P += 1 elif a[3] == code[0] or a[3] == code[1] or a[3] == code[2]: V += 1 if P == 4: W += 1 else: print(' P=' + str(P) + ',V=' + str(V) + ',X=' + str(4-P-V)) if W == 0: P,V = 0,0 a = input('Turn #4 : ') if a[0] == code[0]: P += 1 elif a[0] == code[1] or a[0] == code[2] or a[0] == code[3]: V += 1 if a[1] == code[1]: P += 1 elif a[1] == code[0] or a[1] == code[2] or a[1] == code[3]: V += 1 if a[2] == code[2]: P += 1 elif a[2] == code[0] or a[2] == code[1] or a[2] == code[3]: V += 1 if a[3] == code[3]: P += 1 elif a[3] == code[0] or a[3] == code[1] or a[3] == code[2]: V += 1 if P == 4: W += 1 else: print(' P=' + str(P) + ',V=' + str(V) + ',X=' + str(4-P-V)) if W == 1: print(WINNING_MSG) else: print(LOSING_MSG) print('The answer is ' + code) print('Please try again...') |
# 6330446721 (19.36) 285 (2021-02-12 23:29) Z = input("Turn #1 : ") if Z[0] in code: V = 1 else: V = 0 if Z[0] == code[0]: P = 1 if Z[0] in code: V-=1 else: P = 0 if Z[0] in code: X = 0 else: X = 1 # if Z[1] in code: V += 1 else: V += 0 if Z[1] == code[1]: P += 1 if Z[1] in code: V-=1 else: P += 0 if Z[1] in code: X += 0 else: X += 1 # if Z[2] in code: V += 1 else: V += 0 if Z[2] == code[2]: P += 1 if Z[2] in code: V-=1 else: P += 0 if Z[2] in code: X += 0 else: X += 1 # if Z[3] in code: V += 1 else: V += 0 if Z[3] == code[3]: P += 1 if Z[3] in code: V-=1 else: P += 0 if Z[3] in code: X += 0 else: X += 1 if P==4: print(WINNING_MSG) else: print(" "+"P="+str(P) +","+ "V="+str(V) +","+ "X="+str(X) ) ############################################ if Z != code : Y = input("Turn #2 : ") if Y[0] in code: V = 1 else: V = 0 if Y[0] == code[0]: P = 1 if Y[0] in code: V-=1 else: P = 0 if Y[0] in code: X = 0 else: X = 1 # if Y[1] in code: V += 1 else: V += 0 if Y[1] == code[1]: P += 1 if Y[1] in code: V-=1 else: P += 0 if Y[1] in code: X += 0 else: X += 1 # if Y[2] in code: V += 1 else: V += 0 if Y[2] == code[2]: P += 1 if Y[2] in code: V-=1 else: P += 0 if Y[2] in code: X += 0 else: X += 1 # if Y[3] in code: V += 1 else: V += 0 if Y[3] == code[3]: P += 1 if Z[3] in code: V-=1 else: P += 0 if Y[3] in code: X += 0 else: X += 1 if P==4: print(WINNING_MSG) else: print(" "+"P="+str(P) +","+ "V="+str(V) +","+ "X="+str(X) ) ############################################ if Z != code and Y != code : U = input("Turn #3 : ") if U[0] in code: V = 1 else: V = 0 if U[0] == code[0]: P = 1 if U[0] in code: V-=1 else: P = 0 if U[0] in code: X = 0 else: X = 1 # if U[1] in code: V += 1 else: V += 0 if U[1] == code[1]: P += 1 if U[1] in code: V-=1 else: P += 0 if U[1] in code: X += 0 else: X += 1 # if U[2] in code: V += 1 else: V += 0 if U[2] == code[2]: P += 1 if U[2] in code: V-=1 else: P += 0 if U[2] in code: X += 0 else: X += 1 # if U[3] in code: V += 1 else: V += 0 if U[3] == code[3]: P += 1 if U[3] in code: V-=1 else: P += 0 if U[3] in code: X += 0 else: X += 1 if P==4: print(WINNING_MSG) else: print(" "+"P="+str(P) +","+ "V="+str(V) +","+ "X="+str(X) ) ############################################ if Z != code and Y != code and U != code : E = input("Turn #4 : ") if E[0] in code: V = 1 else: V = 0 if E[0] == code[0]: P = 1 if E[0] in code: V-=1 else: P = 0 if E[0] in code: X = 0 else: X = 1 # if E[1] in code: V += 1 else: V += 0 if E[1] == code[1]: P += 1 if E[1] in code: V-=1 else: P += 0 if E[1] in code: X += 0 else: X += 1 # if E[2] in code: V += 1 else: V += 0 if E[2] == code[2]: P += 1 if E[2] in code: V-=1 else: P += 0 if E[2] in code: X += 0 else: X += 1 # if E[3] in code: V += 1 else: V += 0 if E[3] == code[3]: P += 1 if E[3] in code: V-=1 else: P += 0 if E[3] in code: X += 0 else: X += 1 if P==4: print(WINNING_MSG) else: print(" "+"P="+str(P) +","+ "V="+str(V) +","+ "X="+str(X) ) ########################################## if P==4 and V==0 and X==0 : print(WINNING_MSG) else: print(LOSING_MSG) print("The answer is",code) print("Please try again...") #### |
# 6330447321 (19.89) 286 (2021-02-14 23:02) #Round 1 n=input('Turn #1 : ') p,v,x=0,0,0 #P if n[0]==code[0]: p+=1 if n[1]==code[1]: p+=1 if n[2]==code[2]: p+=1 if n[3]==code[3]: p+=1 #V if n[0]==code[1] or n[0]==code[2] or n[0]==code[3]: v+=1 if n[1]==code[0] or n[1]==code[2] or n[1]==code[3]: v+=1 if n[2]==code[1] or n[2]==code[0] or n[2]==code[3]: v+=1 if n[3]==code[1] or n[3]==code[2] or n[3]==code[0]: v+=1 #X if n[0] not in code: x+=1 if n[1] not in code: x+=1 if n[2] not in code: x+=1 if n[3] not in code: x+=1 if p==4: print(WINNING_MSG) else: print(' P='+str(p)+',V='+str(v)+',X='+str(x)) n=input('Turn #2 : ') #Round 2 p,v,x=0,0,0 #P if n[0]==code[0]: p+=1 if n[1]==code[1]: p+=1 if n[2]==code[2]: p+=1 if n[3]==code[3]: p+=1 #V if n[0]==code[1] or n[0]==code[2] or n[0]==code[3]: v+=1 if n[1]==code[0] or n[1]==code[2] or n[1]==code[3]: v+=1 if n[2]==code[1] or n[2]==code[0] or n[2]==code[3]: v+=1 if n[3]==code[1] or n[3]==code[2] or n[3]==code[0]: v+=1 #X if n[0] not in code: x+=1 if n[1] not in code: x+=1 if n[2] not in code: x+=1 if n[3] not in code: x+=1 if p==4: print(WINNING_MSG) else: print(' P='+str(p)+',V='+str(v)+',X='+str(x)) n=input('Turn #3 : ') #Round 3 p,v,x=0,0,0 #P if n[0]==code[0]: p+=1 if n[1]==code[1]: p+=1 if n[2]==code[2]: p+=1 if n[3]==code[3]: p+=1 #V if n[0]==code[1] or n[0]==code[2] or n[0]==code[3]: v+=1 if n[1]==code[0] or n[1]==code[2] or n[1]==code[3]: v+=1 if n[2]==code[1] or n[2]==code[0] or n[2]==code[3]: v+=1 if n[3]==code[1] or n[3]==code[2] or n[3]==code[0]: v+=1 #X if n[0] not in code: x+=1 if n[1] not in code: x+=1 if n[2] not in code: x+=1 if n[3] not in code: x+=1 if p==4: print(WINNING_MSG) else: print(' P='+str(p)+',V='+str(v)+',X='+str(x)) n=input('Turn #4 : ') #Round 4 p,v,x=0,0,0 #P if n[0]==code[0]: p+=1 if n[1]==code[1]: p+=1 if n[2]==code[2]: p+=1 if n[3]==code[3]: p+=1 #V if n[0]==code[1] or n[0]==code[2] or n[0]==code[3]: v+=1 if n[1]==code[0] or n[1]==code[2] or n[1]==code[3]: v+=1 if n[2]==code[1] or n[2]==code[0] or n[2]==code[3]: v+=1 if n[3]==code[1] or n[3]==code[2] or n[3]==code[0]: v+=1 #X if n[0] not in code: x+=1 if n[1] not in code: x+=1 if n[2] not in code: x+=1 if n[3] not in code: x+=1 if p==4: print(WINNING_MSG) else: print(' P='+str(p)+',V='+str(v)+',X='+str(x)) print(LOSING_MSG) print('The answer is ',code) print('Please try again. . .') |
# 6330448021 (13.74) 287 (2021-02-15 19:16) code1_input = input("Turn #1 : ") if code1_input == code : print(WINNING_MSG) else : a1 = code.find(code1_input[0]) a2 = code.find(code1_input[1]) a3 = code.find(code1_input[2]) a4 = code.find(code1_input[3]) list_a = [a1,a2,a3,a4] p_a = 0 if code1_input[0] == code[0]: p_a += 1 else : p_a += 0 if code1_input[1] == code[1]: p_a += 1 else : p_a += 0 if code1_input[2] == code[2] : p_a += 1 else : p_a += 0 if code1_input[3] == code[3] : p_a += 1 else : p_a += 0 x_a = list_a.count(-1) v_a = max((len(code1_input) - p_a - x_a),0) hint1 = "P="+str(p_a)+",V="+str(v_a)+",X="+str(x_a) print(hint1) code2_input = input("Turn #2 : ") if code2_input == code : print(WINNING_MSG) else : b1 = code.find(code2_input[0]) b2 = code.find(code2_input[1]) b3 = code.find(code2_input[2]) b4 = code.find(code2_input[3]) list_b = [b1,b3,b3,b4] p_b = 0 if code2_input[0] == code[0]: p_b += 1 else : p_b += 0 if code2_input[1] == code[1]: p_b += 1 else : p_b += 0 if code2_input[2] == code[2] : p_b += 1 else : p_b += 0 if code2_input[3] == code[3] : p_b += 1 else : p_b += 0 x_b = list_b.count(-1) v_b = max((len(list_b) - p_b - x_b),0) hint2 = "P="+str(p_b)+",V="+str(v_b)+",X="+str(x_b) print(hint2) code3_input = input("Turn #3 : ") if code3_input == code : print(WINNING_MSG) else : c1 = code.find(code3_input[0]) c2 = code.find(code3_input[1]) c3 = code.find(code3_input[2]) c4 = code.find(code3_input[3]) list_c = [c1,c2,c3,c4] p_c = 0 if code3_input[0] == code[0]: p_c += 1 else : p_c += 0 if code3_input[1] == code[1]: p_c += 1 else : p_c += 0 if code3_input[2] == code[2] : p_c += 1 else : p_c += 0 if code3_input[3] == code[3] : p_c += 1 else : p_c += 0 x_c = list_c.count(-1) v_c = max((len(list_c) - p_c - x_c),0) hint3 = "P="+str(p_c)+",V="+str(v_c)+",X="+str(x_c) print(hint3) code4_input = input("Turn #4 : ") if code4_input == code : print(WINNING_MSG) else : d1 = code.find(code4_input[0]) d2 = code.find(code4_input[1]) d3 = code.find(code4_input[2]) d4 = code.find(code4_input[3]) list_d = [d1,d2,d3,d4] p_d = 0 if code4_input[0] == code[0]: p_d += 1 else : p_d += 0 if code4_input[1] == code[1]: p_d += 1 else : p_d += 0 if code4_input[2] == code[2] : p_d += 1 else : p_d += 0 if code4_input[3] == code[3] : p_d += 1 else : p_d += 0 x_d = list_c.count(-1) v_d = max((len(list_d) - p_d - x_d),0) hint4 = "P="+str(p_d)+",V="+str(v_d)+",X="+str(x_d) print("The answer is",code) print(LOSING_MSG) |
# 6330449621 (17.37) 288 (2021-02-15 01:42) P = 0 V = 0 X = 0 Guess = input("Turn #1 : ") if Guess != code : if Guess[0] == code[0] : P += 1 elif Guess[0] in code : V += 1 if Guess[1] == code[1] : P += 1 elif Guess[1] in code : V += 1 if Guess[2] == code[2] : P += 1 elif Guess[2] in code : V += 1 if Guess[3] == code[3] : P += 1 elif Guess[3] in code : V += 1 X = 4-P-V print (" P="+(str(P)) + "," + "V="+(str(V)) + "," + "X="+(str(X))) Guess = input("Turn #2 : ") P = 0 V = 0 X = 0 if Guess != code : if Guess[0] == code[0] : P += 1 elif Guess[0] in code : V += 1 if Guess[1] == code[1] : P += 1 elif Guess[1] in code : V += 1 if Guess[2] == code[2] : P += 1 elif Guess[2] in code : V += 1 if Guess[3] == code[3] : P += 1 elif Guess[3] in code : V += 1 X = 4-P-V print (" P="+(str(P)) + "," + "V="+(str(V)) + "," + "X="+(str(X))) Guess = input("Turn #3 : ") P = 0 V = 0 X = 0 if Guess != code : if Guess[0] == code[0] : P += 1 elif Guess[0] in code : V += 1 if Guess[1] == code[1] : P += 1 elif Guess[1] in code : V += 1 if Guess[2] == code[2] : P += 1 elif Guess[2] in code : V += 1 if Guess[3] == code[3] : P += 1 elif Guess[3] in code : V += 1 X = 4-P-V print (" P="+(str(P)) + "," + "V="+(str(V)) + "," + "X="+(str(X))) Guess = input("Turn #4 : ") if Guess == code : print (WINNING_MSG) else : print ("Sorry! You just lost it.") print ("The answer is " + (code)) print ("Please try again...") |
# 6330450121 (20.00) 289 (2021-02-14 22:46) guess=input('Turn #1 : ') p=0 v=0 x=0 condition=True if condition: if guess[0]==code[0]: p=p+1 if guess[1]==code[1]: p=p+1 if guess[2]==code[2]: p=p+1 if guess[3]==code[3]: p=p+1 if(guess[0]==code[1]) or (guess[0]==code[2]) or (guess[0]==code[3]): v=v+1 if(guess[1]==code[0]) or (guess[1]==code[2]) or (guess[1]==code[3]): v=v+1 if(guess[2]==code[0]) or (guess[2]==code[1]) or (guess[2]==code[3]): v=v+1 if(guess[3]==code[1]) or (guess[3]==code[2]) or (guess[3]==code[0]): v=v+1 if (guess[0] not in code): x=x+1 if (guess[1] not in code): x=x+1 if (guess[2] not in code): x=x+1 if (guess[3] not in code): x=x+1 if p==4: print(WINNING_MSG) condition=False if condition: print(' P=' + str(p) + ',V=' + str(v) + ',X=' + str(x)) p=0 v=0 x=0 if condition: guess=input('Turn #2 : ') if guess[0]==code[0]: p=p+1 if guess[1]==code[1]: p=p+1 if guess[2]==code[2]: p=p+1 if guess[3]==code[3]: p=p+1 if(guess[0]==code[1]) or (guess[0]==code[2]) or (guess[0]==code[3]): v=v+1 if(guess[1]==code[0]) or (guess[1]==code[2]) or (guess[1]==code[3]): v=v+1 if(guess[2]==code[0]) or (guess[2]==code[1]) or (guess[2]==code[3]): v=v+1 if(guess[3]==code[1]) or (guess[3]==code[2]) or (guess[3]==code[0]): v=v+1 if (guess[0] not in code): x=x+1 if (guess[1] not in code): x=x+1 if (guess[2] not in code): x=x+1 if (guess[3] not in code): x=x+1 if p==4: print(WINNING_MSG) condition=False if condition: print(' P=' + str(p) + ',V=' + str(v) + ',X=' + str(x)) p=0 v=0 x=0 if condition: guess=input('Turn #3 : ') if guess[0]==code[0]: p=p+1 if guess[1]==code[1]: p=p+1 if guess[2]==code[2]: p=p+1 if guess[3]==code[3]: p=p+1 if(guess[0]==code[1]) or (guess[0]==code[2]) or (guess[0]==code[3]): v=v+1 if(guess[1]==code[0]) or (guess[1]==code[2]) or (guess[1]==code[3]): v=v+1 if(guess[2]==code[0]) or (guess[2]==code[1]) or (guess[2]==code[3]): v=v+1 if(guess[3]==code[1]) or (guess[3]==code[2]) or (guess[3]==code[0]): v=v+1 if (guess[0] not in code): x=x+1 if (guess[1] not in code): x=x+1 if (guess[2] not in code): x=x+1 if (guess[3] not in code): x=x+1 if p==4: print(WINNING_MSG) condition=False if condition: print(' P=' + str(p) + ',V=' + str(v) + ',X=' + str(x)) p=0 v=0 x=0 if condition: guess=input('Turn #4 : ') if guess[0]==code[0]: p=p+1 if guess[1]==code[1]: p=p+1 if guess[2]==code[2]: p=p+1 if guess[3]==code[3]: p=p+1 if(guess[0]==code[1]) or (guess[0]==code[2]) or (guess[0]==code[3]): v=v+1 if(guess[1]==code[0]) or (guess[1]==code[2]) or (guess[1]==code[3]): v=v+1 if(guess[2]==code[0]) or (guess[2]==code[1]) or (guess[2]==code[3]): v=v+1 if(guess[3]==code[1]) or (guess[3]==code[2]) or (guess[3]==code[0]): v=v+1 if (guess[0] not in code): x=x+1 if (guess[1] not in code): x=x+1 if (guess[2] not in code): x=x+1 if (guess[3] not in code): x=x+1 if p==4: print(WINNING_MSG) condition=False if condition: print(' P=' + str(p) + ',V=' + str(v) + ',X=' + str(x)) print(LOSING_MSG) print('The answer is ' + code) print('Please try again...') |
# 6330452421 (20.00) 290 (2021-02-13 15:39) #turn1 t = input("Turn #1 : " ) c1,c2,c3,c4 = t[0],t[1],t[2],t[3] P=0 V=0 X=0 if c1 in code: if c1==code[0]: P+=1 else: V+=1 else: X+=1 if c2 in code: if c2==code[1]: P+=1 else: V+=1 else: X+=1 if c3 in code: if c3==code[2]: P+=1 else: V+=1 else: X+=1 if c4 in code: if c4==code[3]: P+=1 else: V+=1 else: X+=1 if P==4: print('''Congratulations! You won the game. ''') else: print(" P="+ str(P) + ","+ "V=" + str(V) + ","+ "X="+ str(X)) #turn2 t = input("Turn #2 : " ) c1,c2,c3,c4 = t[0],t[1],t[2],t[3] P=0 V=0 X=0 if c1 in code: if c1==code[0]: P+=1 else: V+=1 else: X+=1 if c2 in code: if c2==code[1]: P+=1 else: V+=1 else: X+=1 if c3 in code: if c3==code[2]: P+=1 else: V+=1 else: X+=1 if c4 in code: if c4==code[3]: P+=1 else: V+=1 else: X+=1 if P==4: print('''Congratulations! You won the game. ''') else: print(" P="+ str(P) + ","+ "V=" + str(V) + ","+ "X="+ str(X)) #turn3 t = input("Turn #3 : " ) c1,c2,c3,c4 = t[0],t[1],t[2],t[3] P=0 V=0 X=0 if c1 in code: if c1==code[0]: P+=1 else: V+=1 else: X+=1 if c2 in code: if c2==code[1]: P+=1 else: V+=1 else: X+=1 if c3 in code: if c3==code[2]: P+=1 else: V+=1 else: X+=1 if c4 in code: if c4==code[3]: P+=1 else: V+=1 else: X+=1 if P==4: print('''Congratulations! You won the game. ''') else: print(" P="+ str(P) + ","+ "V=" + str(V) + ","+ "X="+ str(X)) #turn4 t = input("Turn #4 : " ) c1,c2,c3,c4 = t[0],t[1],t[2],t[3] P=0 V=0 X=0 if c1 in code: if c1==code[0]: P+=1 else: V+=1 else: X+=1 if c2 in code: if c2==code[1]: P+=1 else: V+=1 else: X+=1 if c3 in code: if c3==code[2]: P+=1 else: V+=1 else: X+=1 if c4 in code: if c4==code[3]: P+=1 else: V+=1 else: X+=1 if P==4: print('''Congratulations! You won the game. ''') else: print(" P="+ str(P) + ","+ "V=" + str(V) + ","+ "X="+ str(X)) print("Sorry! You just lost it.") print("The answer is ",code) print('''Please try again... ''') |
# 6330453021 (15.76) 291 (2021-02-12 22:56) #--- 1st --- win = False i = 1 a = input('Turn #'+str(i)+': ') p = 0 v = 0 x = 0 if a == code: win == True elif a[0] == code[0]: p += 1 elif a[0] in code: v += 1 elif a[0] not in code: x += 1 if a[1] ==code[1]: p += 1 elif a[1] in code: v += 1 elif a[1] not in code: x += 1 if a[2] == code[2]: p += 1 elif a[2] in code: v += 1 elif a[2] not in code: x += 1 if a[3] == code[3]: p += 1 elif a[3] in code: v += 1 elif a[3] not in code: x += 1 if win == True: pass # Waiting for WINNING_MSG else: win=False print(' P='+str(p)+',V='+str(v)+',X='+str(x)) # --- Start 2nd --- i += 1 a = input('Turn #'+str(i)+': ') p = 0 v = 0 x = 0 if a == code: win=True elif a[0] == code[0]: p += 1 elif a[0] in code: v += 1 elif a[0] not in code: x += 1 if a[1] == code[1]: p += 1 elif a[1] in code: v += 1 elif a[1] not in code: x += 1 if a[2] == code[2]: p += 1 elif a[2] in code: v += 1 elif a[2] not in code: x += 1 if a[3] == code[3]: p += 1 elif a[3] in code: v += 1 elif a[3] not in code: x += 1 if win == True: pass # Waiting for WINNING_MSG else: print(' P='+str(p)+',V='+str(v)+',X='+str(x)) win=False # --- Start 3rd i += 1 a = input('Turn #'+str(i)+': ') p = 0 v = 0 x = 0 if a == code: win=True elif a[0] == code[0]: p += 1 elif a[0] in code: v += 1 elif a[0] not in code: x += 1 if a[1] == code[1]: p += 1 elif a[1] in code: v += 1 elif a[1] not in code: x += 1 if a[2] == code[2]: p += 1 elif a[2] in code: v += 1 elif a[2] not in code: x += 1 if a[3] == code[3]: p += 1 elif a[3] in code: v += 1 elif a[3] not in code: x += 1 if win == True: pass # Waiting for WINNING_MSG else: # --- Start 4th - last one print(' P='+str(p)+',V='+str(v)+',X='+str(x)) i += 1 a = input('Turn #'+str(i)+': ') p = 0 v = 0 x = 0 if a == code: win=True elif a[0] == code[0]: p += 1 elif a[0] in code: v += 1 elif a[0] not in code: x += 1 if a[1] == code[1]: p += 1 elif a[1] in code: v += 1 elif a[1] not in code: x += 1 if a[2] == code[2]: p += 1 elif a[2] in code: v += 1 elif a[2] not in code: x += 1 if a[3] == code[3]: p += 1 elif a[3] in code: v += 1 elif a[3] not in code: x += 1 if win == True: print(WINNING_MSG) else: print(LOSING_MSG) print('The answer is ' + code) print('Please try again') |
# 6330454721 (20.00) 292 (2021-02-13 23:29) x1 = input("Turn #1 : ",) if x1 == code : print(WINNING_MSG) else : a = 0 if x1[0] == code[0] : a += 1 if x1[1] == code[1] : a += 1 if x1[2] == code[2] : a += 1 if x1[3] == code[3] : a += 1 b = 0 if x1[0] in code and x1[0] != code[0] : b += 1 if x1[1] in code and x1[1] != code[1] : b += 1 if x1[2] in code and x1[2] != code[2] : b += 1 if x1[3] in code and x1[3] != code[3] : b += 1 c = 4 if x1[0] in code : c -= 1 if x1[1] in code : c -= 1 if x1[2] in code : c -= 1 if x1[3] in code : c -= 1 print(" P="+str(a)+","+"V="+str(b)+","+"X="+str(c)) x2 = input("Turn #2 : ",) if x2 == code : print(WINNING_MSG) else : d = 0 if x2[0] == code[0] : d += 1 if x2[1] == code[1] : d += 1 if x2[2] == code[2] : d += 1 if x2[3] == code[3] : d += 1 e = 0 if x2[0] in code and x2[0] != code[0] : e += 1 if x2[1] in code and x2[1] != code[1] : e += 1 if x2[2] in code and x2[2] != code[2] : e += 1 if x2[3] in code and x2[3] != code[3] : e += 1 f = 4 if x2[0] in code : f -= 1 if x2[1] in code : f -= 1 if x2[2] in code : f -= 1 if x2[3] in code : f -= 1 print(" P="+str(d)+","+"V="+str(e)+","+"X="+str(f)) x3 = input("Turn #3 : ",) if x3 == code : print(WINNING_MSG) else : g = 0 if x3[0] == code[0] : g += 1 if x3[1] == code[1] : g += 1 if x3[2] == code[2] : g += 1 if x3[3] == code[3] : g += 1 h = 0 if x3[0] in code and x3[0] != code[0] : h += 1 if x3[1] in code and x3[1] != code[1] : h += 1 if x3[2] in code and x3[2] != code[2] : h += 1 if x3[3] in code and x3[3] != code[3] : h += 1 i = 4 if x3[0] in code : i -= 1 if x3[1] in code : i -= 1 if x3[2] in code : i -= 1 if x3[3] in code : i -= 1 print(" P="+str(g)+","+"V="+str(h)+","+"X="+str(i)) x4 = input("Turn #4 : ",) if x4 == code : print(WINNING_MSG) else : j = 0 if x4[0] == code[0] : j += 1 if x4[1] == code[1] : j += 1 if x4[2] == code[2] : j += 1 if x4[3] == code[3] : j += 1 k = 0 if x4[0] in code and x4[0] != code[0] : k += 1 if x4[1] in code and x4[1] != code[1] : k += 1 if x4[2] in code and x4[2] != code[2] : k += 1 if x4[3] in code and x4[3] != code[3] : k += 1 l = 4 if x4[0] in code : l -= 1 if x4[1] in code : l -= 1 if x4[2] in code : l -= 1 if x4[3] in code : l -= 1 print(" P="+str(j)+","+"V="+str(k)+","+"X="+str(l)) print(LOSING_MSG) print("The answer is",code) print("Please try again...") |
# 6330455321 (18.39) 293 (2021-02-13 20:02) print(code) def checkp (g,code) : if (g[0] == code[0] and g[1] == code[1] and g[2] == code[2]) or\ (g[1] == code[1] and g[2] == code[2] and g[3] == code[3]) or\ (g[0] == code[0] and g[2] == code[2] and g[3] == code[3]) or\ (g[0] == code[0] and g[1] == code[1] and g[2] == code[2]) : P = 3 elif (g[0] == code[0] and g[1] == code[1] ) or (g[0] == code[0] and g[2] == code[2] ) or (g[0] == code[0] and g[3] == code[3] )or\ (g[1] == code[1] and g[2] == code[2] ) or (g[1] == code[1] and g[3] == code[3] ) or(g[2] == code[2] and g[3] == code[3] ) : P = 2 elif (g[0] == code[0]) or g[1] == code[1] or g[2] == code[2] or g[3] == code[3] : P = 1 else : P = 0 return str(P) def checkv (g,code) : code2 = [code[0],code[1],code[2],code[3]] if ((g[0] in code2 and g[1] in code2 and g[2] in code2) and g[0] != code[0] and g[1] != code[1] and g[2] != code[2]) or\ ((g[1] in code2 and g[2] in code2 and g[3] in code2) and g[1] != code[1] and g[2] != code[2] and g[3] != code[3]) or\ ((g[0] in code2 and g[1] in code2 and g[3] in code2) and g[0] != code[0] and g[1] != code[1] and g[3] != code[3]) or\ ((g[0] in code2 and g[2] in code2 and g[3] in code2) and g[0] != code[0] and g[2] != code[2] and g[3] != code[3]) : V = 3 elif (g[0] in code2 and g[1] in code2) and g[0] != code[0] and g[1] != code[1] or \ (g[0] in code2 and g[2] in code2) and g[0] != code[0] and g[2] != code[2] or\ (g[0] in code2 and g[3] in code2) and g[0] != code[0] and g[3] != code[3] or\ (g[1] in code2 and g[2] in code2) and g[1] != code[1] and g[2] != code[2] or\ (g[1] in code2 and g[3] in code2) and g[1] != code[1] and g[3] != code[3] or\ (g[2] in code2 and g[3] in code2) and g[2] != code[2] and g[3] != code[3] : V = 2 elif (g[0] in code2 and g[0] != code[0]) or (g[1] in code2 and g[1] != code[1] ) or (g[2] in code2 and g[2] != code[2] )or (g[3] in code2 and g[3] != code[3]) : V = 1 else : V = 0 return str(V) def checkx (g,code) : code2 = [code[0],code[1],code[2],code[3]] if (g[0] not in code2 and g[1] not in code2) or\ (g[0] not in code2 and g[2] not in code2) or\ (g[0] not in code2 and g[3] not in code2) or\ (g[1] not in code2 and g[2] not in code2) or\ (g[1] not in code2 and g[3] not in code2) or\ (g[2] not in code2 and g[3] not in code2) : X = 2 elif g[0] not in code2 or g[1] not in code2 or g[2] not in code2 or g[3] not in code2 : X = 1 else: X = 0 return str(X) g1 = input("Turn #1 : ") if g1 == code : print(WINNING_MSG) else: print(" P="+checkp(g1,code)+","+"V="+checkv(g1,code)+","+"X="+checkx(g1,code)) g2 = input("Turn #2 : ") if g2 == code: print(WINNING_MSG) else: print(" P="+checkp(g2,code)+","+"V="+checkv(g2,code)+","+"X="+checkx(g2,code)) g3 = input("Turn #3 : ") if g3 == code: print(WINNING_MSG) else : print(" P="+checkp(g3,code)+","+"V="+checkv(g3,code)+","+"X="+checkx(g3,code)) g4 = input("Turn #4 : ") if g4 == code : print(WINNING_MSG) else : print(" P="+checkp(g4,code)+","+"V="+checkv(g4,code)+","+"X="+checkx(g4,code)) print(LOSING_MSG) print("The answer is",code) print("Please try again...") |
# 6330458221 (18.76) 294 (2021-02-12 20:20) i1 = input("Turn #1 : ") if i1 == code: print("Congratulations! You won the game.") else: if (i1[0] == code[0] and i1[1] == code[1] and i1[2] == code[2]) or\ (i1[0] == code[0] and i1[1] == code[1] and i1[3] == code[3]) or\ (i1[0] == code[0] and i1[2] == code[2] and i1[3] == code[0]) or\ (i1[1] == code[1] and i1[2] == code[2] and i1[3] == code[0]): p =3 elif (i1[0] == code[0] and i1[1] == code[1]) or\ (i1[0] == code[0] and i1[2] == code[2]) or\ (i1[0] == code[0] and i1[3] == code[3]) or\ (i1[1] == code[1] and i1[2] == code[2]) or\ (i1[1] == code[1] and i1[3] == code[3]) or\ (i1[2] == code[2] and i1[3] == code[3]): p = 2 elif (i1[0] == code[0]) or (i1[1] == code[1]) or (i1[2] == code[2]) or (i1[3] == code[3]): p = 1 else: p = 0 if i1[0] in code and i1[1] in code and i1[2] in code and i1[3] in code: v = 4 - p elif (i1[0] in code and i1[1] in code and i1[2] in code) or\ (i1[0] in code and i1[1] in code and i1[3] in code) or\ (i1[0] in code and i1[2] in code and i1[3] in code) or\ (i1[1] in code and i1[2] in code and i1[3] in code): v =3 - p elif (i1[0] in code and i1[1] in code) or\ (i1[0] in code and i1[2] in code) or\ (i1[0] in code and i1[3] in code) or\ (i1[1] in code and i1[2] in code) or\ (i1[1] in code and i1[3] in code) or\ (i1[2] in code and i1[3] in code): v = 2 - p elif (i1[0] in code) or (i1[1] in code) or (i1[2] in code) or (i1[3] in code): v = 1 - p else: v = 0 x = 4-(p+v) print(" P=" + str(p) +",V=" + str(v) + ",X=" + str(x)) i2 = input("Turn #2 : ") if i2 == code: print("Congratulations! You won the game.") else: if (i2[0] == code[0] and i2[1] == code[1] and i2[2] == code[2]) or\ (i2[0] == code[0] and i2[1] == code[1] and i2[3] == code[3]) or\ (i2[0] == code[0] and i2[2] == code[2] and i2[3] == code[0]) or\ (i2[1] == code[1] and i2[2] == code[2] and i2[3] == code[0]): p =3 elif (i2[0] == code[0] and i2[1] == code[1]) or\ (i2[0] == code[0] and i2[2] == code[2]) or\ (i2[0] == code[0] and i2[3] == code[3]) or\ (i2[1] == code[1] and i2[2] == code[2]) or\ (i2[1] == code[1] and i2[3] == code[3]) or\ (i2[2] == code[2] and i2[3] == code[3]): p = 2 elif (i2[0] == code[0]) or (i2[1] == code[1]) or (i2[2] == code[2]) or (i2[3] == code[3]): p = 1 else: p = 0 if i2[0] in code and i2[1] in code and i2[2] in code and i2[3] in code: v = 4 - p elif (i2[0] in code and i2[1] in code and i2[2] in code) or\ (i2[0] in code and i2[1] in code and i2[3] in code) or\ (i2[0] in code and i2[2] in code and i2[3] in code) or\ (i2[1] in code and i2[2] in code and i2[3] in code): v =3 - p elif (i2[0] in code and i2[1] in code) or\ (i2[0] in code and i2[2] in code) or\ (i2[0] in code and i2[3] in code) or\ (i2[1] in code and i2[2] in code) or\ (i2[1] in code and i2[3] in code) or\ (i2[2] in code and i2[3] in code): v = 2 - p elif (i2[0] in code) or (i2[1] in code) or (i2[2] in code) or (i2[3] in code): v = 1 - p else: v = 0 x = 4-(p+v) print(" P=" + str(p) +",V=" + str(v) + ",X=" + str(x)) i3 = input("Turn #3 : ") if i3 == code: print("Congratulations! You won the game.") else: if (i3[0] == code[0] and i3[1] == code[1] and i3[2] == code[2]) or\ (i3[0] == code[0] and i3[1] == code[1] and i3[3] == code[3]) or\ (i3[0] == code[0] and i3[2] == code[2] and i3[3] == code[0]) or\ (i3[1] == code[1] and i3[2] == code[2] and i3[3] == code[0]): p =3 elif (i3[0] == code[0] and i3[1] == code[1]) or\ (i3[0] == code[0] and i3[2] == code[2]) or\ (i3[0] == code[0] and i3[3] == code[3]) or\ (i3[1] == code[1] and i3[2] == code[2]) or\ (i3[1] == code[1] and i3[3] == code[3]) or\ (i3[2] == code[2] and i3[3] == code[3]): p = 2 elif (i3[0] == code[0]) or (i3[1] == code[1]) or (i3[2] == code[2]) or (i3[3] == code[3]): p = 1 else: p = 0 if i3[0] in code and i3[1] in code and i3[2] in code and i3[3] in code: v = 4 - p elif (i3[0] in code and i3[1] in code and i3[2] in code) or\ (i3[0] in code and i3[1] in code and i3[3] in code) or\ (i3[0] in code and i3[2] in code and i3[3] in code) or\ (i3[1] in code and i3[2] in code and i3[3] in code): v =3 - p elif (i3[0] in code and i3[1] in code) or\ (i3[0] in code and i3[2] in code) or\ (i3[0] in code and i3[3] in code) or\ (i3[1] in code and i3[2] in code) or\ (i3[1] in code and i3[3] in code) or\ (i3[2] in code and i3[3] in code): v = 2 - p elif (i3[0] in code) or (i3[1] in code) or (i3[2] in code) or (i3[3] in code): v = 1 - p else: v = 0 x = 4-(p+v) print(" P=" + str(p) +",V=" + str(v) + ",X=" + str(x)) i4 = input("Turn #4 : ") if i4 == code: print("Congratulations! You won the game.") else: if (i4[0] == code[0] and i4[1] == code[1] and i4[2] == code[2]) or\ (i4[0] == code[0] and i4[1] == code[1] and i4[3] == code[3]) or\ (i4[0] == code[0] and i4[2] == code[2] and i4[3] == code[0]) or\ (i4[1] == code[1] and i4[2] == code[2] and i4[3] == code[0]): p =3 elif (i4[0] == code[0] and i4[1] == code[1]) or\ (i4[0] == code[0] and i4[2] == code[2]) or\ (i4[0] == code[0] and i4[3] == code[3]) or\ (i4[1] == code[1] and i4[2] == code[2]) or\ (i4[1] == code[1] and i4[3] == code[3]) or\ (i4[2] == code[2] and i4[3] == code[3]): p = 2 elif (i4[0] == code[0]) or (i4[1] == code[1]) or (i4[2] == code[2]) or (i4[3] == code[3]): p = 1 else: p = 0 if i4[0] in code and i4[1] in code and i4[2] in code and i4[3] in code: v = 4 - p elif (i4[0] in code and i4[1] in code and i4[2] in code) or\ (i4[0] in code and i4[1] in code and i4[3] in code) or\ (i4[0] in code and i4[2] in code and i4[3] in code) or\ (i4[1] in code and i4[2] in code and i4[3] in code): v =3 - p elif (i4[0] in code and i4[1] in code) or\ (i4[0] in code and i4[2] in code) or\ (i4[0] in code and i4[3] in code) or\ (i4[1] in code and i4[2] in code) or\ (i4[1] in code and i4[3] in code) or\ (i4[2] in code and i4[3] in code): v = 2 - p elif (i4[0] in code) or (i4[1] in code) or (i4[2] in code) or (i4[3] in code): v = 1 - p else: v = 0 x = 4-(p+v) print(" P=" + str(p) +",V=" + str(v) + ",X=" + str(x)) print("Sorry! You just lost it.") print("The answer is",code) print("Please try again...") |
# 6330459921 (20.00) 295 (2021-02-13 22:54) #Turn1 a = input("Turn #1 : " ) P = 0 V = 0 X = 0 if code[0] == a[0] : P = P + 1 if (code[0] in a) and (code[0] != a[0]) : V = V + 1 if not code[0] in a : X = X + 1 if code[1] == a[1] : P = P + 1 if (code[1] in a) and (code[1] != a[1]) : V = V + 1 if not code[1] in a : X = X + 1 if code[2] == a[2] : P = P + 1 if (code[2] in a) and (code[2] != a[2]) : V = V + 1 if not code[2] in a : X = X + 1 if code[3] == a[3] : P = P + 1 if (code[3] in a) and (code[3] != a[3]) : V = V + 1 if not code[3] in a : X = X + 1 if P == 4 : print(WINNING_MSG) else : print(" " ,"P=" + str(P)+ ",V=" + str(V)+ ",X=" + str(X) ) #Turn2 b = input("Turn #2 : " ) P = 0 V = 0 X = 0 if code[0] == b[0] : P = P + 1 if (code[0] in b) and (code[0] != b[0]) : V = V + 1 if not code[0] in b : X = X + 1 if code[1] == b[1] : P = P + 1 if (code[1] in b) and (code[1] != b[1]) : V = V + 1 if not code[1] in b : X = X + 1 if code[2] == b[2] : P = P + 1 if (code[2] in b) and (code[2] != b[2]) : V = V + 1 if not code[2] in b : X = X + 1 if code[3] == b[3] : P = P + 1 if (code[3] in b) and (code[3] != b[3]) : V = V + 1 if not code[3] in b : X = X + 1 if P == 4 : print(WINNING_MSG) else : print(" " ,"P=" + str(P)+ ",V=" + str(V)+ ",X=" + str(X) ) #Turn3 c = input("Turn #3 : " ) P = 0 V = 0 X = 0 if code[0] == c[0] : P = P + 1 if (code[0] in c) and (code[0] != c[0]) : V = V + 1 if not code[0] in c : X = X + 1 if code[1] == c[1] : P = P + 1 if (code[1] in c) and (code[1] != c[1]) : V = V + 1 if not code[1] in c : X = X + 1 if code[2] == c[2] : P = P + 1 if (code[2] in c) and (code[2] != c[2]) : V = V + 1 if not code[2] in c : X = X + 1 if code[3] == c[3] : P = P + 1 if (code[3] in c) and (code[3] != c[3]) : V = V + 1 if not code[3] in c : X = X + 1 if P == 4 : print(WINNING_MSG) else : print(" " ,"P=" + str(P)+ ",V=" + str(V)+ ",X=" + str(X) ) #Turn4 d = input("Turn #4 : " ) P = 0 V = 0 X = 0 if code[0] == d[0] : P = P + 1 if (code[0] in d) and (code[0] != d[0]) : V = V + 1 if not code[0] in d : X = X + 1 if code[1] == d[1] : P = P + 1 if (code[1] in d) and (code[1] != d[1]) : V = V + 1 if not code[1] in d : X = X + 1 if code[2] == d[2] : P = P + 1 if (code[2] in d) and (code[2] != d[2]) : V = V + 1 if not code[2] in d : X = X + 1 if code[3] == d[3] : P = P + 1 if (code[3] in d) and (code[3] != d[3]) : V = V + 1 if not code[3] in d : X = X + 1 if P == 4 : print(WINNING_MSG) else : print(" " ,"P=" + str(P)+ ",V=" + str(V)+ ",X=" + str(X) ) print(LOSING_MSG) print("The answer is" , code) print("Please try again...") |
# 6330460421 (20.00) 296 (2021-02-11 21:33) p = 0 v = 0 x = 0 breaker = input("Turn #1 : ") if code[0] == breaker[0]: p += 1 elif breaker[0] in listc: v += 1 elif breaker[0] not in listc: x += 1 if code[1] == breaker[1]: p += 1 elif breaker[1] in listc: v += 1 elif breaker[1] not in listc: x += 1 if code[2] == breaker[2]: p += 1 elif breaker[2] in listc: v += 1 elif breaker[2] not in listc: x += 1 if code[3] == breaker[3]: p += 1 elif breaker[3] in listc: v += 1 elif breaker[3] not in listc: x += 1 if p == 4: print(WINNING_MSG) else: print(" " + "P=" + str(p) + "," + "V=" + str(v) + "," + "X=" + str(x)) if not p == 4: p = 0 v = 0 x = 0 breaker = input("Turn #2 : ") if code[0] == breaker[0]: p += 1 elif breaker[0] in listc: v += 1 elif breaker[0] not in listc: x += 1 if code[1] == breaker[1]: p += 1 elif breaker[1] in listc: v += 1 elif breaker[1] not in listc: x += 1 if code[2] == breaker[2]: p += 1 elif breaker[2] in listc: v += 1 elif breaker[2] not in listc: x += 1 if code[3] == breaker[3]: p += 1 elif breaker[3] in listc: v += 1 elif breaker[3] not in listc: x += 1 if p == 4: print(WINNING_MSG) else: print(" " + "P=" + str(p) + "," + "V=" + str(v) + "," + "X=" + str(x)) if not p == 4: p = 0 v = 0 x = 0 breaker = input("Turn #3 : ") if code[0] == breaker[0]: p += 1 elif breaker[0] in listc: v += 1 elif breaker[0] not in listc: x += 1 if code[1] == breaker[1]: p += 1 elif breaker[1] in listc: v += 1 elif breaker[1] not in listc: x += 1 if code[2] == breaker[2]: p += 1 elif breaker[2] in listc: v += 1 elif breaker[2] not in listc: x += 1 if code[3] == breaker[3]: p += 1 elif breaker[3] in listc: v += 1 elif breaker[3] not in listc: x += 1 if p == 4: print(WINNING_MSG) else: print(" " + "P=" + str(p) + "," + "V=" + str(v) + "," + "X=" + str(x)) if not p == 4: p = 0 v = 0 x = 0 breaker = input("Turn #4 : ") if code[0] == breaker[0]: p += 1 elif breaker[0] in listc: v += 1 elif breaker[0] not in listc: x += 1 if code[1] == breaker[1]: p += 1 elif breaker[1] in listc: v += 1 elif breaker[1] not in listc: x += 1 if code[2] == breaker[2]: p += 1 elif breaker[2] in listc: v += 1 elif breaker[2] not in listc: x += 1 if code[3] == breaker[3]: p += 1 elif breaker[3] in listc: v += 1 elif breaker[3] not in listc: x += 1 if p == 4: print(WINNING_MSG) else: print(" " + "P=" + str(p) + "," + "V=" + str(v) + "," + "X=" + str(x)) if not p == 4: print(LOSING_MSG) print("The answer is " + code) print("Please try again...") |
# 6330461021 (20.00) 297 (2021-02-14 22:59) a1 = input("Turn #1 : ") p1 = 0 v1 = 0 code_list = [code[0],code[1],code[2],code[3]] if code[0] == a1[0]: p1 += 1 if code[1] == a1[1]: p1 += 1 if code[2] == a1[2]: p1 += 1 if code[3] == a1[3]: p1 += 1 if a1[0] in code_list: v1 += 1 if a1[1] in code_list: v1 += 1 if a1[2] in code_list: v1 += 1 if a1[3] in code_list: v1 += 1 v1 -= p1 x1 = 4 - p1 - v1 if p1 == 4: print(WINNING_MSG) else: print(" P="+str(p1)+",V="+str(v1)+",X="+str(x1)) a2 = input("Turn #2 : ") p2 = 0 v2 = 0 if code[0] == a2[0]: p2 += 1 if code[1] == a2[1]: p2 += 1 if code[2] == a2[2]: p2 += 1 if code[3] == a2[3]: p2 += 1 if a2[0] in code_list: v2 += 1 if a2[1] in code_list: v2 += 1 if a2[2] in code_list: v2 += 1 if a2[3] in code_list: v2 += 1 v2 -= p2 x2 = 4 - p2 - v2 if p2 == 4: print(WINNING_MSG) else: print(" P="+str(p2)+",V="+str(v2)+",X="+str(x2)) a3 = input("Turn #3 : ") p3 = 0 v3 = 0 if code[0] == a3[0]: p3 += 1 if code[1] == a3[1]: p3 += 1 if code[2] == a3[2]: p3 += 1 if code[3] == a3[3]: p3 += 1 if a3[0] in code_list: v3 += 1 if a3[1] in code_list: v3 += 1 if a3[2] in code_list: v3 += 1 if a3[3] in code_list: v3 += 1 v3 -= p3 x3 = 4 - p3 - v3 if p3 == 4: print(WINNING_MSG) else: print(" P="+str(p3)+",V="+str(v3)+",X="+str(x3)) a4 = input("Turn #4 : ") p4 = 0 v4 = 0 if code[0] == a4[0]: p4 += 1 if code[1] == a4[1]: p4 += 1 if code[2] == a4[2]: p4 += 1 if code[3] == a4[3]: p4 += 1 if a4[0] in code_list: v4 += 1 if a4[1] in code_list: v4 += 1 if a4[2] in code_list: v4 += 1 if a4[3] in code_list: v4 += 1 v4 -= p4 x4 = 4 - p4 - v4 if p4 == 4: print(WINNING_MSG) else: print(" P="+str(p4)+",V="+str(v4)+",X="+str(x4)) print(LOSING_MSG) print("The answer is " + code) print("Please try again...") |
# 6330462721 (20.00) 298 (2021-02-15 23:52) t= input("Turn #1 : ").upper() P = 0 if t[0] == code[0] : P += 1 if t[1] == code[1] : P += 1 if t[2] == code[2] : P += 1 if t[3] == code[3] : P += 1 V = 0 if t[0] in code : V += 1 if t[1] in code : V += 1 if t[2] in code : V += 1 if t[3] in code : V += 1 V = V-P X = 4-P-V if P!=4 : print(" P="+str(P)+",V="+str(V)+",X="+str(X)) t= input("Turn #2 : ").upper() P = 0 if t[0] == code[0] : P += 1 if t[1] == code[1] : P += 1 if t[2] == code[2] : P += 1 if t[3] == code[3] : P += 1 V = 0 if t[0] in code : V += 1 if t[1] in code : V += 1 if t[2] in code : V += 1 if t[3] in code : V += 1 V = V-P X = 4-P-V if P!=4 : print(" P="+str(P)+",V="+str(V)+",X="+str(X)) t= input("Turn #3 : ").upper() P = 0 if t[0] == code[0] : P += 1 if t[1] == code[1] : P += 1 if t[2] == code[2] : P += 1 if t[3] == code[3] : P += 1 V = 0 if t[0] in code : V += 1 if t[1] in code : V += 1 if t[2] in code : V += 1 if t[3] in code : V += 1 V = V-P X = 4-P-V if P!=4 : print(" P="+str(P)+",V="+str(V)+",X="+str(X)) t= input("Turn #4 : ").upper() P = 0 if t[0] == code[0] : P += 1 if t[1] == code[1] : P += 1 if t[2] == code[2] : P += 1 if t[3] == code[3] : P += 1 V = 0 if t[0] in code : V += 1 if t[1] in code : V += 1 if t[2] in code : V += 1 if t[3] in code : V += 1 V = V-P X = 4-P-V if P!=4 : print(" P="+str(P)+",V="+str(V)+",X="+str(X)) print(LOSING_MSG) print("The answer is ",code) print("Please try again...") else : print(WINNING_MSG) else : print(WINNING_MSG) else : print(WINNING_MSG) else : print(WINNING_MSG) |
# 6330463321 (19.11) 299 (2021-02-15 22:24) a = input('Turn #1 : ') P = 0 V = 0 X = 0 if a[0] == code[0]: P += 1 if a[1] == code[1]: P += 1 if a[2] == code[2]: P += 1 if a[3] == code[3]: P += 1 P1 = str(P) if a[0] in code and a[0] != code[0]: V += 1 if a[1] in code and a[1] != code[1]: V += 1 if a[2] in code and a[2] != code[2]: V += 1 if a[3] in code and a[3] != code[3]: V += 1 V1 = str(V) if a[0] not in code: X += 1 if a[1] not in code: X += 1 if a[2] not in code: X += 1 if a[3] not in code: X += 1 X1 = str(X) print(' '+'P='+P1+','+'V='+V1+','+'X='+X1) if a == code: print(WINNING_MSG) else: a = input('Turn #2 : ') P = 0 V = 0 X = 0 if a[0] == code[0]: P += 1 if a[1] == code[1]: P += 1 if a[2] == code[2]: P += 1 if a[3] == code[3]: P += 1 P1 = str(P) if a[0] in code and a[0] != code[0]: V += 1 if a[1] in code and a[1] != code[1]: V += 1 if a[2] in code and a[2] != code[2]: V += 1 if a[3] in code and a[3] != code[3]: V += 1 V1 = str(V) if a[0] not in code: X += 1 if a[1] not in code: X += 1 if a[2] not in code: X += 1 if a[3] not in code: X += 1 X1 = str(X) print(' '+'P='+P1+','+'V='+V1+','+'X='+X1) if a == code: print(WINNING_MSG) else: a = input('Turn #3 : ') P = 0 V = 0 X = 0 if a[0] == code[0]: P += 1 if a[1] == code[1]: P += 1 if a[2] == code[2]: P += 1 if a[3] == code[3]: P += 1 P1 = str(P) if a[0] in code and a[0] != code[0]: V += 1 if a[1] in code and a[1] != code[1]: V += 1 if a[2] in code and a[2] != code[2]: V += 1 if a[3] in code and a[3] != code[3]: V += 1 V1 = str(V) if a[0] not in code: X += 1 if a[1] not in code: X += 1 if a[2] not in code: X += 1 if a[3] not in code: X += 1 X1 = str(X) print(' '+'P='+P1+','+'V='+V1+','+'X='+X1) if a == code: print(WINNING_MSG) else: a = input('Turn #4 : ') P = 0 V = 0 X = 0 if a[0] == code[0]: P += 1 if a[1] == code[1]: P += 1 if a[2] == code[2]: P += 1 if a[3] == code[3]: P += 1 P1 = str(P) if a[0] in code and a[0] != code[0]: V += 1 if a[1] in code and a[1] != code[1]: V += 1 if a[2] in code and a[2] != code[2]: V += 1 if a[3] in code and a[3] != code[3]: V += 1 V1 = str(V) if a[0] not in code: X += 1 if a[1] not in code: X += 1 if a[2] not in code: X += 1 if a[3] not in code: X += 1 X1 = str(X) print(' '+'P='+P1+','+'V='+V1+','+'X='+X1) if a == code: print(WINNING_MSG) else: print(LOSING_MSG) print('The answer is '+code) print('Please try again...') |
# 6330464021 (13.79) 300 (2021-02-12 14:57) a = input() P=0 ; V=0 ; X=0 if a[0] in code : if a[0] == code[0]: P+=1 else : V+=1 if a[1] in code : if a[1] == code[1]: P+=1 else : V+=1 if a[2] in code : if a[2] == code[2]: P+=1 else : V+=1 if a[3] in code : if a[3] == code[3]: P+=1 else : V+=1 X = 4-(P+V) if P==4 : print(WINNING_MSG) else: print('Turn #1 :' + a) print(' ','P='+str(P),'V='+str(V),'X='+str(X)) a = input() P=0 ; V=0 ; X=0 if a[0] in code : if a[0] == code[0]: P+=1 else : V+=1 if a[1] in code : if a[1] == code[1]: P+=1 else : V+=1 if a[2] in code : if a[2] == code[2]: P+=1 else : V+=1 if a[3] in code : if a[3] == code[3]: P+=1 else : V+=1 X = 4-(P+V) if P==4 : print(WINNING_MSG) else: print('Turn #2 :' + a) print(' ','P='+str(P),'V='+str(V),'X='+str(X)) a = input() P=0 ; V=0 ; X=0 if a[0] in code : if a[0] == code[0]: P+=1 else : V+=1 if a[1] in code : if a[1] == code[1]: P+=1 else : V+=1 if a[2] in code : if a[2] == code[2]: P+=1 else : V+=1 if a[3] in code : if a[3] == code[3]: P+=1 else : V+=1 X = 4-(P+V) if P==4 : print(WINNING_MSG) else: print('Turn #3 :' + a) print(' ','P='+str(P),'V='+str(V),'X='+str(X)) a = input() P=0 ; V=0 ; X=0 if a[0] in code : if a[0] == code[0]: P+=1 else : V+=1 if a[1] in code : if a[1] == code[1]: P+=1 else : V+=1 if a[2] in code : if a[2] == code[2]: P+=1 else : V+=1 if a[3] in code : if a[3] == code[3]: P+=1 else : V+=1 X = 4-(P+V) if P==4 : print(WINNING_MSG) else: print(LOSING_MSG) print('The answer is '+ str(code)) print('Please try again...') |
# 6330466221 (20.00) 301 (2021-02-13 04:01) x = input('Turn #1 : ') z = [code[0],code[1],code[2],code[3]] P = 0 ; V = 0 ; X = 0 if x[0] in z: if x[0] == z[0]: P += 1 else: V += 1 elif not x[0] in z: X += 1 if x[1] in z: if x[1] == z[1]: P += 1 else: V += 1 elif not x[1] in z: X += 1 if x[2] in z: if x[2] == z[2]: P += 1 else: V += 1 elif not x[2] in z: X += 1 if x[3] in z: if x[3] == z[3]: P += 1 else: V += 1 elif not x[3] in z: X += 1 if x == code: print(WINNING_MSG) else: print(f' P={P},V={V},X={X}') x = input('Turn #2 : ') P = 0 ; V = 0 ; X = 0 if x[0] in z: if x[0] == z[0]: P += 1 else: V += 1 elif not x[0] in z: X += 1 if x[1] in z: if x[1] == z[1]: P += 1 else: V += 1 elif not x[1] in z: X += 1 if x[2] in z: if x[2] == z[2]: P += 1 else: V += 1 elif not x[2] in z: X += 1 if x[3] in z: if x[3] == z[3]: P += 1 else: V += 1 elif not x[3] in z: X += 1 if x == code: print(WINNING_MSG) else: print(f' P={P},V={V},X={X}') x = input('Turn #3 : ') P = 0 ; V = 0 ; X = 0 if x[0] in z: if x[0] == z[0]: P += 1 else: V += 1 elif not x[0] in z: X += 1 if x[1] in z: if x[1] == z[1]: P += 1 else: V += 1 elif not x[1] in z: X += 1 if x[2] in z: if x[2] == z[2]: P += 1 else: V += 1 elif not x[2] in z: X += 1 if x[3] in z: if x[3] == z[3]: P += 1 else: V += 1 elif not x[3] in z: X += 1 if x == code: print(WINNING_MSG) else: print(f' P={P},V={V},X={X}') x = input('Turn #4 : ') P = 0 ; V = 0 ; X = 0 if x[0] in z: if x[0] == z[0]: P += 1 else: V += 1 elif not x[0] in z: X += 1 if x[1] in z: if x[1] == z[1]: P += 1 else: V += 1 elif not x[1] in z: X += 1 if x[2] in z: if x[2] == z[2]: P += 1 else: V += 1 elif not x[2] in z: X += 1 if x[3] in z: if x[3] == z[3]: P += 1 else: V += 1 elif not x[3] in z: X += 1 if x == code: print(WINNING_MSG) else: print(f' P={P},V={V},X={X}') print(LOSING_MSG) print(f'The answer is {code}') print('Please try again...') |
# 6330467921 (17.37) 302 (2021-02-15 17:31) p = 0 v = 0 x = 0 g = input("Turn #1 : ",) if g[0] in code: if g[0] == code[0]: p += 1 else: v += 1 else: x += 1 if g[1] in code: if g[1] == code[1]: p += 1 else: v += 1 else: x += 1 if g[2] in code: if g[2] == code[2]: p += 1 else: v += 1 else: x += 1 if g[3] in code: if g[3] == code[3]: p += 1 else: v += 1 else: x += 1 if p == 4: print(WINNING_MSG) else: print(' '*len("Turn #n : ")+"P="+str(p)+",V="+str(v)+",X="+str(x)) g = input("Turn #2 : ",) p,v,x = 0,0,0 if g[0] in code: if g[0] == code[0]: p += 1 else: v += 1 else: x += 1 if g[1] in code: if g[1] == code[1]: p += 1 else: v += 1 else: x += 1 if g[2] in code: if g[2] == code[2]: p += 1 else: v += 1 else: x += 1 if g[3] in code: if g[3] == code[3]: p += 1 else: v += 1 else: x += 1 if p == 4: print(WINNING_MSG) else: print(' '*len("Turn #n : ")+"P="+str(p)+",V="+str(v)+",X="+str(x)) g = input("Turn #3 : ",) p,v,x = 0,0,0 if g[0] in code: if g[0] == code[0]: p += 1 else: v += 1 else: x += 1 if g[1] in code: if g[1] == code[1]: p += 1 else: v += 1 else: x += 1 if g[2] in code: if g[2] == code[2]: p += 1 else: v += 1 else: x += 1 if g[3] in code: if g[3] == code[3]: p += 1 else: v += 1 else: x += 1 if p == 4: print(WINNING_MSG) else: print(' '*len("Turn #n : ")+"P="+str(p)+",V="+str(v)+",X="+str(x)) g = input("Turn #4 : ",) p,v,x = 0,0,0 if g[0] in code: if g[0] == code[0]: p += 1 else: v += 1 else: x += 1 if g[1] in code: if g[1] == code[1]: p += 1 else: v += 1 else: x += 1 if g[2] in code: if g[2] == code[2]: p += 1 else: v += 1 else: x += 1 if g[3] in code: if g[3] == code[3]: p += 1 else: v += 1 else: x += 1 if p == 4: print(WINNING_MSG) else: print(LOSING_MSG) print("The answer is",code) print("Please try again...") |
# 6330468521 (19.11) 303 (2021-02-14 23:53) p = 0 x = 0 v = 0 a = input('Turn #1 : ') if a[0] in code : if a[0] == code[0] : p = 1 else : v = 1 else : x = 1 if a[1] in code : if a[1] == code[1] : p = p+1 else : v = v+1 else : x = x+1 if a[2] in code : if a[2] == code[2] : p = p+1 else : v = v+1 else : x = x+1 if a[3] in code : if a[3] == code[3] : p = p+1 else : v = v+1 else : x = x+1 print(' '*10+'P='+str(p)+',V='+str(v)+',X='+str(x)) if p == 4 : print(WINNING_MSG) else : pp = 0 vv = 0 xx = 0 b = input('Turn #2 : ') if b[0] in code : if b[0] == code[0] : pp = 1 else : vv = 1 else : xx = 1 if b[1] in code : if b[1] == code[1] : pp = pp+1 else : vv = vv+1 else : xx = xx+1 if b[2] in code : if b[2] == code[2] : pp = pp+1 else : vv = vv+1 else : xx = xx+1 if b[3] in code : if b[3] == code[3] : pp = pp+1 else : vv = vv+1 else : xx = xx+1 print(' '*10+'P='+str(pp)+',V='+str(vv)+',X='+str(xx)) if pp == 4 : print(WINNING_MSG) else : ppp = 0 vvv = 0 xxx = 0 c = input('Turn #3 : ') if c[0] in code : if c[0] == code[0] : ppp = 1 else : vvv = 1 else : xxx = 1 if c[1] in code : if c[1] == code[1] : ppp = ppp+1 else : vvv = vvv+1 else : xxx = xxx+1 if c[2] in code : if c[2] == code[2] : ppp = ppp+1 else : vvv = vvv+1 else : xxx = xxx+1 if c[3] in code : if c[3] == code[3] : ppp = ppp+1 else : vvv = vvv+1 else : xxx = xxx+1 print(' '*10+'P='+str(ppp)+',V='+str(vvv)+',X='+str(xxx)) if ppp == 4 : print(WINNING_MSG) else : pppp = 0 vvvv = 0 xxxx = 0 d = input('Turn #4 : ') if d[0] in code : if d[0] == code[0] : pppp = 1 else : vvvv = 1 else : xxxx = 1 if d[1] in code : if d[1] == code[1] : pppp = pppp+1 else : vvvv = vvvv+1 else : xxxx = xxxx+1 if d[2] in code : if d[2] == code[2] : pppp = pppp+1 else : vvvv = vvvv+1 else : xxxx = xxxx+1 if d[3] in code : if d[3] == code[3] : pppp = pppp+1 else : vvvv = vvvv+1 else : xxxx = xxxx+1 print(' '*10+'P='+str(pppp)+',V='+str(vvvv)+',X='+str(xxxx)) if pppp == 4 : print(WINNING_MSG) else : print(LOSING_MSG) print('The answer is '+code) print('Please try again...') |
# 6330469121 (19.11) 304 (2021-02-14 03:21) x=input() p=0 v=0 if x[0]==code[0]: p+=1 if x[1]==code[1]: p+=1 if x[2]==code[2]: p+=1 if x[3]==code[3]: p+=1 if x[0] in code: v+=1 if x[1] in code: v+=1 if x[2] in code: v+=1 if x[3] in code: v+=1 if x[0]==code[0] and x[0] in code: v-=1 if x[1]==code[1] and x[1] in code: v-=1 if x[2]==code[2] and x[2] in code: v-=1 if x[3]==code[3] and x[3] in code: v-=1 y=str(4-p-v) p=str(p) v=str(v) print('Turn','#'+'1',':',x) if p=='4': print(WINNING_MSG) elif p!='4': print('\t P'+'='+p+','+'V'+'='+v+','+'X'+'='+y) x=input() p=0 v=0 if x[0]==code[0]: p+=1 if x[1]==code[1]: p+=1 if x[2]==code[2]: p+=1 if x[3]==code[3]: p+=1 if x[0] in code: v+=1 if x[1] in code: v+=1 if x[2] in code: v+=1 if x[3] in code: v+=1 if x[0]==code[0] and x[0] in code: v-=1 if x[1]==code[1] and x[1] in code: v-=1 if x[2]==code[2] and x[2] in code: v-=1 if x[3]==code[3] and x[3] in code: v-=1 y=str(4-p-v) p=str(p) v=str(v) print('Turn','#'+'2',':',x) if p=='4': print(WINNING_MSG) elif p !='4': print('\t P'+'='+p+','+'V'+'='+v+','+'X'+'='+y) x=input() p=0 v=0 if x[0]==code[0]: p+=1 if x[1]==code[1]: p+=1 if x[2]==code[2]: p+=1 if x[3]==code[3]: p+=1 if x[0] in code: v+=1 if x[1] in code: v+=1 if x[2] in code: v+=1 if x[3] in code: v+=1 if x[0]==code[0] and x[0] in code: v-=1 if x[1]==code[1] and x[1] in code: v-=1 if x[2]==code[2] and x[2] in code: v-=1 if x[3]==code[3] and x[3] in code: v-=1 y=str(4-p-v) p=str(p) v=str(v) print('Turn','#'+'3',':',x) if p=='4': print(WINNING_MSG) elif p!='4': print('\t P'+'='+p+','+'V'+'='+v+','+'X'+'='+y) x=input() p=0 v=0 if x[0]==code[0]: p+=1 if x[1]==code[1]: p+=1 if x[2]==code[2]: p+=1 if x[3]==code[3]: p+=1 if x[0] in code: v+=1 if x[1] in code: v+=1 if x[2] in code: v+=1 if x[3] in code: v+=1 if x[0]==code[0] and x[0] in code: v-=1 if x[1]==code[1] and x[1] in code: v-=1 if x[2]==code[2] and x[2] in code: v-=1 if x[3]==code[3] and x[3] in code: v-=1 y=str(4-p-v) p=str(p) v=str(v) print('Turn','#'+'4',':',x) if p=='4': print(WINNING_MSG) else : print('P'+'='+p+','+'V'+'='+v+','+'X'+'='+y) print(LOSING_MSG) print('The answer is',code) print('Please try again...') |
# 6330470721 (17.40) 305 (2021-02-14 23:48) r1 = input("Turn #1 : ") if r1[0]==code[0] and r1[1]==code[1] and r1[2]==code[2] and r1[3]==code[3]: print(WINNING_MSG) elif r1[0] not in code and r1[1] not in code and r1[2] not in code and r1[3] not in code: print(" P=0"+","+"V=0"+","+"X=4") elif (r1[0] in code and r1[0]!=code[0] and r1[1] not in code and r1[2] not in code and r1[3] not in code) or \ (r1[1] in code and r1[1]!=code[1] and r1[0] not in code and r1[2] not in code and r1[3] not in code) or \ (r1[2] in code and r1[2]!=code[2] and r1[1] not in code and r1[0] not in code and r1[3] not in code) or \ (r1[3] in code and r1[3]!=code[3] and r1[1] not in code and r1[2] not in code and r1[0] not in code): print(" P=0"+","+"V=1"+","+"X=3") elif (r1[0] in code and r1[1] in code and r1[0]!=code[0] and r1[1]!=code[1] and r1[2] not in code and r1[3] not in code) or \ (r1[0] in code and r1[2] in code and r1[0]!=code[0] and r1[2]!=code[2] and r1[1] not in code and r1[3] not in code) or \ (r1[0] in code and r1[3] in code and r1[0]!=code[0] and r1[3]!=code[3] and r1[2] not in code and r1[1] not in code) or \ (r1[1] in code and r1[2] in code and r1[1]!=code[1] and r1[2]!=code[2] and r1[0] not in code and r1[3] not in code) or \ (r1[1] in code and r1[3] in code and r1[1]!=code[1] and r1[3]!=code[3] and r1[0] not in code and r1[2] not in code) or \ (r1[2] in code and r1[3] in code and r1[2]!=code[2] and r1[3]!=code[3] and r1[0] not in code and r1[1] not in code): print(" P=0"+","+"V=2"+","+"X=2") elif (r1[0] in code and r1[1] in code and r1[2] in code and r1[0]!=code[0] and r1[1]!=code[1] and r1[2]!=code[2] and r1[3] not in code) or \ (r1[0] in code and r1[1] in code and r1[3] in code and r1[0]!=code[0] and r1[1]!=code[1] and r1[3]!=code[3] and r1[2] not in code) or \ (r1[0] in code and r1[2] in code and r1[3] in code and r1[0]!=code[0] and r1[2]!=code[2] and r1[3]!=code[3] and r1[1] not in code) or \ (r1[1] in code and r1[2] in code and r1[3] in code and r1[1]!=code[1] and r1[2]!=code[2] and r1[3]!=code[3] and r1[0] not in code): print(" P=0"+","+"V=3"+","+"X=1") elif (r1[0] in code and r1[1] in code and r1[2] in code and r1[3] in code and r1[0]!=code[0] and r1[1]!=code[1] and r1[2]!=code[2] and r1[3]!=code[3]): print(" P=0"+","+"V=4"+","+"X=0") elif (r1[0]==code[0] and r1[1] not in code and r1[2] not in code and r1[3] not in code) or \ (r1[1]==code[1] and r1[0] not in code and r1[2] not in code and r1[3] not in code) or \ (r1[2]==code[2] and r1[1] not in code and r1[0] not in code and r1[3] not in code) or \ (r1[3]==code[3] and r1[1] not in code and r1[2] not in code and r1[0] not in code) : print(" P=1"+","+"V=0"+","+"X=3") elif (r1[0] in code and r1[0]==code[0] and r1[1] in code and r1[1]!=code[1] and r1[2] not in code and r1[3] not in code) or \ (r1[0] in code and r1[0]==code[0] and r1[2] in code and r1[2]!=code[2] and r1[1] not in code and r1[3] not in code) or \ (r1[0] in code and r1[0]==code[0] and r1[3] in code and r1[3]!=code[3] and r1[1] not in code and r1[2] not in code) or \ (r1[1] in code and r1[1]==code[1] and r1[0] in code and r1[0]!=code[0] and r1[2] not in code and r1[3] not in code) or \ (r1[1] in code and r1[1]==code[1] and r1[2] in code and r1[2]!=code[2] and r1[0] not in code and r1[3] not in code) or \ (r1[1] in code and r1[1]==code[1] and r1[3] in code and r1[3]!=code[3] and r1[0] not in code and r1[2] not in code) or \ (r1[2] in code and r1[2]==code[2] and r1[3] in code and r1[3]!=code[3] and r1[0] not in code and r1[1] not in code) or \ (r1[2] in code and r1[2]==code[2] and r1[0] in code and r1[0]!=code[0] and r1[1] not in code and r1[3] not in code) or \ (r1[2] in code and r1[2]==code[2] and r1[1] in code and r1[1]!=code[1] and r1[0] not in code and r1[3] not in code) or \ (r1[3] in code and r1[3]==code[3] and r1[0] in code and r1[0]!=code[0] and r1[1] not in code and r1[2] not in code) or \ (r1[3] in code and r1[3]==code[3] and r1[1] in code and r1[1]!=code[1] and r1[0] not in code and r1[2] not in code) or \ (r1[3] in code and r1[3]==code[3] and r1[2] in code and r1[2]!=code[2] and r1[0] not in code and r1[1] not in code): print(" P=1"+","+"V=1"+","+"X=2") elif (r1[0] in code and r1[0]==code[0] and r1[1] in code and r1[1]!=code[1] and r1[2] in code and r1[2]!=code[2] and r1[3] not in code) or \ (r1[0] in code and r1[0]==code[0] and r1[1] in code and r1[1]!=code[1] and r1[3] in code and r1[3]!=code[3] and r1[2] not in code) or \ (r1[0] in code and r1[0]==code[0] and r1[2] in code and r1[2]!=code[2] and r1[3] in code and r1[3]!=code[3] and r1[1] not in code) or \ (r1[1] in code and r1[1]==code[1] and r1[2] in code and r1[2]!=code[2] and r1[3] in code and r1[3]!=code[3] and r1[0] not in code) or \ (r1[1] in code and r1[1]==code[1] and r1[2] in code and r1[2]!=code[2] and r1[0] in code and r1[0]!=code[0] and r1[3] not in code) or \ (r1[1] in code and r1[1]==code[1] and r1[3] in code and r1[3]!=code[3] and r1[0] in code and r1[0]!=code[0] and r1[2] not in code) or \ (r1[2] in code and r1[2]==code[2] and r1[0] in code and r1[0]!=code[0] and r1[1] in code and r1[1]!=code[1] and r1[3] not in code) or \ (r1[2] in code and r1[2]==code[2] and r1[0] in code and r1[0]!=code[0] and r1[3] in code and r1[3]!=code[3] and r1[1] not in code) or \ (r1[2] in code and r1[2]==code[2] and r1[1] in code and r1[1]!=code[1] and r1[3] in code and r1[3]!=code[3] and r1[0] not in code) or \ (r1[3] in code and r1[3]==code[3] and r1[0] in code and r1[0]!=code[0] and r1[1] in code and r1[1]!=code[1] and r1[2] not in code) or \ (r1[3] in code and r1[3]==code[3] and r1[0] in code and r1[0]!=code[0] and r1[2] in code and r1[2]!=code[2] and r1[1] not in code) or \ (r1[3] in code and r1[3]==code[3] and r1[2] in code and r1[2]!=code[2] and r1[1] in code and r1[1]!=code[1] and r1[0] not in code): print(" P=1"+","+"V=2"+","+"X=1") elif (r1[0] in code and r1[0]==code[0] and r1[1] in code and r1[1]!=code[1] and r1[2] in code and r1[2]!=code[2] and r1[3] in code and r1[3]!=code[3]) or \ (r1[1] in code and r1[1]==code[1] and r1[0] in code and r1[0]!=code[0] and r1[2] in code and r1[2]!=code[2] and r1[3] in code and r1[3]!=code[3]) or \ (r1[2] in code and r1[2]==code[2] and r1[1] in code and r1[1]!=code[1] and r1[0] in code and r1[0]!=code[0] and r1[3] in code and r1[3]!=code[3]) or \ (r1[3] in code and r1[3]==code[3] and r1[1] in code and r1[1]!=code[1] and r1[2] in code and r1[2]!=code[2] and r1[0] in code and r1[0]!=code[0]): print(" P=1"+","+"V=3"+","+"X=0") elif (r1[0] in code and r1[0]==code[0] and r1[1] in code and r1[1]==code[1] and r1[2] not in code and r1[3] not in code) or \ (r1[0] in code and r1[0]==code[0] and r1[2] in code and r1[2]==code[2] and r1[1] not in code and r1[3] not in code) or \ (r1[0] in code and r1[0]==code[0] and r1[3] in code and r1[3]==code[3] and r1[1] not in code and r1[2] not in code) or \ (r1[1] in code and r1[1]==code[1] and r1[2] in code and r1[2]==code[2] and r1[0] not in code and r1[3] not in code) or \ (r1[1] in code and r1[1]==code[1] and r1[3] in code and r1[3]==code[3] and r1[0] not in code and r1[2] not in code) or \ (r1[2] in code and r1[2]==code[2] and r1[3] in code and r1[3]==code[3] and r1[0] not in code and r1[1] not in code): print(" P=2"+","+"V=0"+","+"X=2") elif (r1[0] in code and r1[0]==code[0] and r1[1] in code and r1[1]==code[1] and r1[2] in code and r1[2]!=code[2] and r1[3] not in code) or \ (r1[0] in code and r1[0]==code[0] and r1[2] in code and r1[2]==code[2] and r1[1] in code and r1[1]!=code[1] and r1[3] not in code) or \ (r1[2] in code and r1[2]==code[2] and r1[1] in code and r1[1]==code[1] and r1[0] in code and r1[0]!=code[0] and r1[3] not in code) or \ (r1[0] in code and r1[0]==code[0] and r1[1] in code and r1[1]==code[1] and r1[3] in code and r1[3]!=code[3] and r1[2] not in code) or \ (r1[0] in code and r1[0]==code[0] and r1[3] in code and r1[3]==code[3] and r1[1] in code and r1[1]!=code[1] and r1[2] not in code) or \ (r1[3] in code and r1[3]==code[3] and r1[1] in code and r1[1]==code[1] and r1[0] in code and r1[0]!=code[0] and r1[2] not in code) or \ (r1[0] in code and r1[0]==code[0] and r1[2] in code and r1[2]==code[2] and r1[3] in code and r1[3]!=code[3] and r1[1] not in code) or \ (r1[0] in code and r1[0]==code[0] and r1[3] in code and r1[3]==code[3] and r1[2] in code and r1[2]!=code[2] and r1[1] not in code) or \ (r1[2] in code and r1[2]==code[2] and r1[3] in code and r1[3]==code[3] and r1[0] in code and r1[0]!=code[0] and r1[1] not in code) or \ (r1[2] in code and r1[2]==code[2] and r1[1] in code and r1[1]==code[1] and r1[3] in code and r1[3]!=code[3] and r1[0] not in code) or \ (r1[3] in code and r1[3]==code[3] and r1[1] in code and r1[1]==code[1] and r1[2] in code and r1[2]!=code[2] and r1[0] not in code) or \ (r1[2] in code and r1[2]==code[2] and r1[3] in code and r1[3]==code[3] and r1[1] in code and r1[1]!=code[1] and r1[0] not in code): print(" P=2"+","+"V=1"+","+"X=1") elif (r1[0] in code and r1[0]==code[0] and r1[1] in code and r1[1]==code[1] and r1[2] in code and r1[2]!=code[2] and r1[3] in code and r1[3]!=code[3]) or \ (r1[0] in code and r1[0]==code[0] and r1[2] in code and r1[2]==code[2] and r1[1] in code and r1[1]!=code[1] and r1[3] in code and r1[3]!=code[3]) or \ (r1[0] in code and r1[0]==code[0] and r1[3] in code and r1[3]==code[3] and r1[2] in code and r1[2]!=code[2] and r1[1] in code and r1[1]!=code[1]) or \ (r1[1] in code and r1[1]==code[1] and r1[2] in code and r1[2]==code[2] and r1[0] in code and r1[0]!=code[0] and r1[3] in code and r1[3]!=code[3]) or \ (r1[1] in code and r1[1]==code[1] and r1[3] in code and r1[3]==code[3] and r1[0] in code and r1[0]!=code[0] and r1[2] in code and r1[2]!=code[2]) or \ (r1[3] in code and r1[3]==code[3] and r1[2] in code and r1[2]==code[2] and r1[0] in code and r1[0]!=code[0] and r1[1] in code and r1[1]!=code[1]): print(" P=2"+","+"V=2"+","+"X=0") elif (r1[0] in code and r1[0]==code[0] and r1[1] in code and r1[1]==code[1] and r1[2] in code and r1[2]==code[2] and r1[3] not in code) or \ (r1[0] in code and r1[0]==code[0] and r1[1] in code and r1[1]==code[1] and r1[3] in code and r1[3]==code[3] and r1[2] not in code) or \ (r1[0] in code and r1[0]==code[0] and r1[2] in code and r1[2]==code[2] and r1[3] in code and r1[3]==code[3] and r1[1] not in code) or \ (r1[1] in code and r1[1]==code[1] and r1[2] in code and r1[2]==code[2] and r1[3] in code and r1[3]==code[3] and r1[0] not in code): print(" P=3"+","+"V=0"+","+"X=1") elif (r1[0] in code and r1[0]==code[0] and r1[1] in code and r1[1]==code[1] and r1[2] in code and r1[2]==code[2] and r1[3] in code and r1[3]!=code[3]) or \ (r1[0] in code and r1[0]==code[0] and r1[1] in code and r1[1]==code[1] and r1[3] in code and r1[3]==code[3] and r1[2] in code and r1[2]!=code[2]) or \ (r1[0] in code and r1[0]==code[0] and r1[3] in code and r1[3]==code[3] and r1[2] in code and r1[2]==code[2] and r1[1] in code and r1[1]!=code[1]) or \ (r1[3] in code and r1[3]==code[3] and r1[1] in code and r1[1]==code[1] and r1[2] in code and r1[2]==code[2] and r1[0] in code and r1[0]!=code[0]): print(" P=3"+","+"V=1"+","+"X=0") elif (r1[0] not in code and r1[1] not in code and r1[2] not in code and r1[3] not in code): print(" P=0"+","+"V=0"+","+"X=4") r1 = input("Turn #2 : ") if r1[0]==code[0] and r1[1]==code[1] and r1[2]==code[2] and r1[3]==code[3]: print(WINNING_MSG) elif r1[0] not in code and r1[1] not in code and r1[2] not in code and r1[3] not in code: print(" P=0"+","+"V=0"+","+"X=4") elif (r1[0] in code and r1[0]!=code[0] and r1[1] not in code and r1[2] not in code and r1[3] not in code) or \ (r1[1] in code and r1[1]!=code[1] and r1[0] not in code and r1[2] not in code and r1[3] not in code) or \ (r1[2] in code and r1[2]!=code[2] and r1[1] not in code and r1[0] not in code and r1[3] not in code) or \ (r1[3] in code and r1[3]!=code[3] and r1[1] not in code and r1[2] not in code and r1[0] not in code): print(" P=0"+","+"V=1"+","+"X=3") elif (r1[0] in code and r1[1] in code and r1[0]!=code[0] and r1[1]!=code[1] and r1[2] not in code and r1[3] not in code) or \ (r1[0] in code and r1[2] in code and r1[0]!=code[0] and r1[2]!=code[2] and r1[1] not in code and r1[3] not in code) or \ (r1[0] in code and r1[3] in code and r1[0]!=code[0] and r1[3]!=code[3] and r1[2] not in code and r1[1] not in code) or \ (r1[1] in code and r1[2] in code and r1[1]!=code[1] and r1[2]!=code[2] and r1[0] not in code and r1[3] not in code) or \ (r1[1] in code and r1[3] in code and r1[1]!=code[1] and r1[3]!=code[3] and r1[0] not in code and r1[2] not in code) or \ (r1[2] in code and r1[3] in code and r1[2]!=code[2] and r1[3]!=code[3] and r1[0] not in code and r1[1] not in code): print(" P=0"+","+"V=2"+","+"X=2") elif (r1[0] in code and r1[1] in code and r1[2] in code and r1[0]!=code[0] and r1[1]!=code[1] and r1[2]!=code[2] and r1[3] not in code) or \ (r1[0] in code and r1[1] in code and r1[3] in code and r1[0]!=code[0] and r1[1]!=code[1] and r1[3]!=code[3] and r1[2] not in code) or \ (r1[0] in code and r1[2] in code and r1[3] in code and r1[0]!=code[0] and r1[2]!=code[2] and r1[3]!=code[3] and r1[1] not in code) or \ (r1[1] in code and r1[2] in code and r1[3] in code and r1[1]!=code[1] and r1[2]!=code[2] and r1[3]!=code[3] and r1[0] not in code): print(" P=0"+","+"V=3"+","+"X=1") elif (r1[0] in code and r1[1] in code and r1[2] in code and r1[3] in code and r1[0]!=code[0] and r1[1]!=code[1] and r1[2]!=code[2] and r1[3]!=code[3]): print(" P=0"+","+"V=4"+","+"X=0") elif (r1[0]==code[0] and r1[1] not in code and r1[2] not in code and r1[3] not in code) or \ (r1[1]==code[1] and r1[0] not in code and r1[2] not in code and r1[3] not in code) or \ (r1[2]==code[2] and r1[1] not in code and r1[0] not in code and r1[3] not in code) or \ (r1[3]==code[3] and r1[1] not in code and r1[2] not in code and r1[0] not in code) : print(" P=1"+","+"V=0"+","+"X=3") elif (r1[0] in code and r1[0]==code[0] and r1[1] in code and r1[1]!=code[1] and r1[2] not in code and r1[3] not in code) or \ (r1[0] in code and r1[0]==code[0] and r1[2] in code and r1[2]!=code[2] and r1[1] not in code and r1[3] not in code) or \ (r1[0] in code and r1[0]==code[0] and r1[3] in code and r1[3]!=code[3] and r1[1] not in code and r1[2] not in code) or \ (r1[1] in code and r1[1]==code[1] and r1[0] in code and r1[0]!=code[0] and r1[2] not in code and r1[3] not in code) or \ (r1[1] in code and r1[1]==code[1] and r1[2] in code and r1[2]!=code[2] and r1[0] not in code and r1[3] not in code) or \ (r1[1] in code and r1[1]==code[1] and r1[3] in code and r1[3]!=code[3] and r1[0] not in code and r1[2] not in code) or \ (r1[2] in code and r1[2]==code[2] and r1[3] in code and r1[3]!=code[3] and r1[0] not in code and r1[1] not in code) or \ (r1[2] in code and r1[2]==code[2] and r1[0] in code and r1[0]!=code[0] and r1[1] not in code and r1[3] not in code) or \ (r1[2] in code and r1[2]==code[2] and r1[1] in code and r1[1]!=code[1] and r1[0] not in code and r1[3] not in code) or \ (r1[3] in code and r1[3]==code[3] and r1[0] in code and r1[0]!=code[0] and r1[1] not in code and r1[2] not in code) or \ (r1[3] in code and r1[3]==code[3] and r1[1] in code and r1[1]!=code[1] and r1[0] not in code and r1[2] not in code) or \ (r1[3] in code and r1[3]==code[3] and r1[2] in code and r1[2]!=code[2] and r1[0] not in code and r1[1] not in code): print(" P=1"+","+"V=1"+","+"X=2") elif (r1[0] in code and r1[0]==code[0] and r1[1] in code and r1[1]!=code[1] and r1[2] in code and r1[2]!=code[2] and r1[3] not in code) or \ (r1[0] in code and r1[0]==code[0] and r1[1] in code and r1[1]!=code[1] and r1[3] in code and r1[3]!=code[3] and r1[2] not in code) or \ (r1[0] in code and r1[0]==code[0] and r1[2] in code and r1[2]!=code[2] and r1[3] in code and r1[3]!=code[3] and r1[1] not in code) or \ (r1[1] in code and r1[1]==code[1] and r1[2] in code and r1[2]!=code[2] and r1[3] in code and r1[3]!=code[3] and r1[0] not in code) or \ (r1[1] in code and r1[1]==code[1] and r1[2] in code and r1[2]!=code[2] and r1[0] in code and r1[0]!=code[0] and r1[3] not in code) or \ (r1[1] in code and r1[1]==code[1] and r1[3] in code and r1[3]!=code[3] and r1[0] in code and r1[0]!=code[0] and r1[2] not in code) or \ (r1[2] in code and r1[2]==code[2] and r1[0] in code and r1[0]!=code[0] and r1[1] in code and r1[1]!=code[1] and r1[3] not in code) or \ (r1[2] in code and r1[2]==code[2] and r1[0] in code and r1[0]!=code[0] and r1[3] in code and r1[3]!=code[3] and r1[1] not in code) or \ (r1[2] in code and r1[2]==code[2] and r1[1] in code and r1[1]!=code[1] and r1[3] in code and r1[3]!=code[3] and r1[0] not in code) or \ (r1[3] in code and r1[3]==code[3] and r1[0] in code and r1[0]!=code[0] and r1[1] in code and r1[1]!=code[1] and r1[2] not in code) or \ (r1[3] in code and r1[3]==code[3] and r1[0] in code and r1[0]!=code[0] and r1[2] in code and r1[2]!=code[2] and r1[1] not in code) or \ (r1[3] in code and r1[3]==code[3] and r1[2] in code and r1[2]!=code[2] and r1[1] in code and r1[1]!=code[1] and r1[0] not in code): print(" P=1"+","+"V=2"+","+"X=1") elif (r1[0] in code and r1[0]==code[0] and r1[1] in code and r1[1]!=code[1] and r1[2] in code and r1[2]!=code[2] and r1[3] in code and r1[3]!=code[3]) or \ (r1[1] in code and r1[1]==code[1] and r1[0] in code and r1[0]!=code[0] and r1[2] in code and r1[2]!=code[2] and r1[3] in code and r1[3]!=code[3]) or \ (r1[2] in code and r1[2]==code[2] and r1[1] in code and r1[1]!=code[1] and r1[0] in code and r1[0]!=code[0] and r1[3] in code and r1[3]!=code[3]) or \ (r1[3] in code and r1[3]==code[3] and r1[1] in code and r1[1]!=code[1] and r1[2] in code and r1[2]!=code[2] and r1[0] in code and r1[0]!=code[0]): print(" P=1"+","+"V=3"+","+"X=0") elif (r1[0] in code and r1[0]==code[0] and r1[1] in code and r1[1]==code[1] and r1[2] not in code and r1[3] not in code) or \ (r1[0] in code and r1[0]==code[0] and r1[2] in code and r1[2]==code[2] and r1[1] not in code and r1[3] not in code) or \ (r1[0] in code and r1[0]==code[0] and r1[3] in code and r1[3]==code[3] and r1[1] not in code and r1[2] not in code) or \ (r1[1] in code and r1[1]==code[1] and r1[2] in code and r1[2]==code[2] and r1[0] not in code and r1[3] not in code) or \ (r1[1] in code and r1[1]==code[1] and r1[3] in code and r1[3]==code[3] and r1[0] not in code and r1[2] not in code) or \ (r1[2] in code and r1[2]==code[2] and r1[3] in code and r1[3]==code[3] and r1[0] not in code and r1[1] not in code): print(" P=2"+","+"V=0"+","+"X=2") elif (r1[0] in code and r1[0]==code[0] and r1[1] in code and r1[1]==code[1] and r1[2] in code and r1[2]!=code[2] and r1[3] not in code) or \ (r1[0] in code and r1[0]==code[0] and r1[2] in code and r1[2]==code[2] and r1[1] in code and r1[1]!=code[1] and r1[3] not in code) or \ (r1[2] in code and r1[2]==code[2] and r1[1] in code and r1[1]==code[1] and r1[0] in code and r1[0]!=code[0] and r1[3] not in code) or \ (r1[0] in code and r1[0]==code[0] and r1[1] in code and r1[1]==code[1] and r1[3] in code and r1[3]!=code[3] and r1[2] not in code) or \ (r1[0] in code and r1[0]==code[0] and r1[3] in code and r1[3]==code[3] and r1[1] in code and r1[1]!=code[1] and r1[2] not in code) or \ (r1[3] in code and r1[3]==code[3] and r1[1] in code and r1[1]==code[1] and r1[0] in code and r1[0]!=code[0] and r1[2] not in code) or \ (r1[0] in code and r1[0]==code[0] and r1[2] in code and r1[2]==code[2] and r1[3] in code and r1[3]!=code[3] and r1[1] not in code) or \ (r1[0] in code and r1[0]==code[0] and r1[3] in code and r1[3]==code[3] and r1[2] in code and r1[2]!=code[2] and r1[1] not in code) or \ (r1[2] in code and r1[2]==code[2] and r1[3] in code and r1[3]==code[3] and r1[0] in code and r1[0]!=code[0] and r1[1] not in code) or \ (r1[2] in code and r1[2]==code[2] and r1[1] in code and r1[1]==code[1] and r1[3] in code and r1[3]!=code[3] and r1[0] not in code) or \ (r1[3] in code and r1[3]==code[3] and r1[1] in code and r1[1]==code[1] and r1[2] in code and r1[2]!=code[2] and r1[0] not in code) or \ (r1[2] in code and r1[2]==code[2] and r1[3] in code and r1[3]==code[3] and r1[1] in code and r1[1]!=code[1] and r1[0] not in code): print(" P=2"+","+"V=1"+","+"X=1") elif (r1[0] in code and r1[0]==code[0] and r1[1] in code and r1[1]==code[1] and r1[2] in code and r1[2]!=code[2] and r1[3] in code and r1[3]!=code[3]) or \ (r1[0] in code and r1[0]==code[0] and r1[2] in code and r1[2]==code[2] and r1[1] in code and r1[1]!=code[1] and r1[3] in code and r1[3]!=code[3]) or \ (r1[0] in code and r1[0]==code[0] and r1[3] in code and r1[3]==code[3] and r1[2] in code and r1[2]!=code[2] and r1[1] in code and r1[1]!=code[1]) or \ (r1[1] in code and r1[1]==code[1] and r1[2] in code and r1[2]==code[2] and r1[0] in code and r1[0]!=code[0] and r1[3] in code and r1[3]!=code[3]) or \ (r1[1] in code and r1[1]==code[1] and r1[3] in code and r1[3]==code[3] and r1[0] in code and r1[0]!=code[0] and r1[2] in code and r1[2]!=code[2]) or \ (r1[3] in code and r1[3]==code[3] and r1[2] in code and r1[2]==code[2] and r1[0] in code and r1[0]!=code[0] and r1[1] in code and r1[1]!=code[1]): print(" P=2"+","+"V=2"+","+"X=0") elif (r1[0] in code and r1[0]==code[0] and r1[1] in code and r1[1]==code[1] and r1[2] in code and r1[2]==code[2] and r1[3] not in code) or \ (r1[0] in code and r1[0]==code[0] and r1[1] in code and r1[1]==code[1] and r1[3] in code and r1[3]==code[3] and r1[2] not in code) or \ (r1[0] in code and r1[0]==code[0] and r1[2] in code and r1[2]==code[2] and r1[3] in code and r1[3]==code[3] and r1[1] not in code) or \ (r1[1] in code and r1[1]==code[1] and r1[2] in code and r1[2]==code[2] and r1[3] in code and r1[3]==code[3] and r1[0] not in code): print(" P=3"+","+"V=0"+","+"X=1") elif (r1[0] in code and r1[0]==code[0] and r1[1] in code and r1[1]==code[1] and r1[2] in code and r1[2]==code[2] and r1[3] in code and r1[3]!=code[3]) or \ (r1[0] in code and r1[0]==code[0] and r1[1] in code and r1[1]==code[1] and r1[3] in code and r1[3]==code[3] and r1[2] in code and r1[2]!=code[2]) or \ (r1[0] in code and r1[0]==code[0] and r1[3] in code and r1[3]==code[3] and r1[2] in code and r1[2]==code[2] and r1[1] in code and r1[1]!=code[1]) or \ (r1[3] in code and r1[3]==code[3] and r1[1] in code and r1[1]==code[1] and r1[2] in code and r1[2]==code[2] and r1[0] in code and r1[0]!=code[0]): print(" P=3"+","+"V=1"+","+"X=0") r1 = input("Turn #3 : ") if r1[0]==code[0] and r1[1]==code[1] and r1[2]==code[2] and r1[3]==code[3]: print(WINNING_MSG) elif r1[0] not in code and r1[1] not in code and r1[2] not in code and r1[3] not in code: print(" P=0"+","+"V=0"+","+"X=4") elif (r1[0] in code and r1[0]!=code[0] and r1[1] not in code and r1[2] not in code and r1[3] not in code) or \ (r1[1] in code and r1[1]!=code[1] and r1[0] not in code and r1[2] not in code and r1[3] not in code) or \ (r1[2] in code and r1[2]!=code[2] and r1[1] not in code and r1[0] not in code and r1[3] not in code) or \ (r1[3] in code and r1[3]!=code[3] and r1[1] not in code and r1[2] not in code and r1[0] not in code): print(" P=0"+","+"V=1"+","+"X=3") elif (r1[0] in code and r1[1] in code and r1[0]!=code[0] and r1[1]!=code[1] and r1[2] not in code and r1[3] not in code) or \ (r1[0] in code and r1[2] in code and r1[0]!=code[0] and r1[2]!=code[2] and r1[1] not in code and r1[3] not in code) or \ (r1[0] in code and r1[3] in code and r1[0]!=code[0] and r1[3]!=code[3] and r1[2] not in code and r1[1] not in code) or \ (r1[1] in code and r1[2] in code and r1[1]!=code[1] and r1[2]!=code[2] and r1[0] not in code and r1[3] not in code) or \ (r1[1] in code and r1[3] in code and r1[1]!=code[1] and r1[3]!=code[3] and r1[0] not in code and r1[2] not in code) or \ (r1[2] in code and r1[3] in code and r1[2]!=code[2] and r1[3]!=code[3] and r1[0] not in code and r1[1] not in code): print(" P=0"+","+"V=2"+","+"X=2") elif (r1[0] in code and r1[1] in code and r1[2] in code and r1[0]!=code[0] and r1[1]!=code[1] and r1[2]!=code[2] and r1[3] not in code) or \ (r1[0] in code and r1[1] in code and r1[3] in code and r1[0]!=code[0] and r1[1]!=code[1] and r1[3]!=code[3] and r1[2] not in code) or \ (r1[0] in code and r1[2] in code and r1[3] in code and r1[0]!=code[0] and r1[2]!=code[2] and r1[3]!=code[3] and r1[1] not in code) or \ (r1[1] in code and r1[2] in code and r1[3] in code and r1[1]!=code[1] and r1[2]!=code[2] and r1[3]!=code[3] and r1[0] not in code): print(" P=0"+","+"V=3"+","+"X=1") elif (r1[0] in code and r1[1] in code and r1[2] in code and r1[3] in code and r1[0]!=code[0] and r1[1]!=code[1] and r1[2]!=code[2] and r1[3]!=code[3]): print(" P=0"+","+"V=4"+","+"X=0") elif (r1[0]==code[0] and r1[1] not in code and r1[2] not in code and r1[3] not in code) or \ (r1[1]==code[1] and r1[0] not in code and r1[2] not in code and r1[3] not in code) or \ (r1[2]==code[2] and r1[1] not in code and r1[0] not in code and r1[3] not in code) or \ (r1[3]==code[3] and r1[1] not in code and r1[2] not in code and r1[0] not in code) : print(" P=1"+","+"V=0"+","+"X=3") elif (r1[0] in code and r1[0]==code[0] and r1[1] in code and r1[1]!=code[1] and r1[2] not in code and r1[3] not in code) or \ (r1[0] in code and r1[0]==code[0] and r1[2] in code and r1[2]!=code[2] and r1[1] not in code and r1[3] not in code) or \ (r1[0] in code and r1[0]==code[0] and r1[3] in code and r1[3]!=code[3] and r1[1] not in code and r1[2] not in code) or \ (r1[1] in code and r1[1]==code[1] and r1[0] in code and r1[0]!=code[0] and r1[2] not in code and r1[3] not in code) or \ (r1[1] in code and r1[1]==code[1] and r1[2] in code and r1[2]!=code[2] and r1[0] not in code and r1[3] not in code) or \ (r1[1] in code and r1[1]==code[1] and r1[3] in code and r1[3]!=code[3] and r1[0] not in code and r1[2] not in code) or \ (r1[2] in code and r1[2]==code[2] and r1[3] in code and r1[3]!=code[3] and r1[0] not in code and r1[1] not in code) or \ (r1[2] in code and r1[2]==code[2] and r1[0] in code and r1[0]!=code[0] and r1[1] not in code and r1[3] not in code) or \ (r1[2] in code and r1[2]==code[2] and r1[1] in code and r1[1]!=code[1] and r1[0] not in code and r1[3] not in code) or \ (r1[3] in code and r1[3]==code[3] and r1[0] in code and r1[0]!=code[0] and r1[1] not in code and r1[2] not in code) or \ (r1[3] in code and r1[3]==code[3] and r1[1] in code and r1[1]!=code[1] and r1[0] not in code and r1[2] not in code) or \ (r1[3] in code and r1[3]==code[3] and r1[2] in code and r1[2]!=code[2] and r1[0] not in code and r1[1] not in code): print(" P=1"+","+"V=1"+","+"X=2") elif (r1[0] in code and r1[0]==code[0] and r1[1] in code and r1[1]!=code[1] and r1[2] in code and r1[2]!=code[2] and r1[3] not in code) or \ (r1[0] in code and r1[0]==code[0] and r1[1] in code and r1[1]!=code[1] and r1[3] in code and r1[3]!=code[3] and r1[2] not in code) or \ (r1[0] in code and r1[0]==code[0] and r1[2] in code and r1[2]!=code[2] and r1[3] in code and r1[3]!=code[3] and r1[1] not in code) or \ (r1[1] in code and r1[1]==code[1] and r1[2] in code and r1[2]!=code[2] and r1[3] in code and r1[3]!=code[3] and r1[0] not in code) or \ (r1[1] in code and r1[1]==code[1] and r1[2] in code and r1[2]!=code[2] and r1[0] in code and r1[0]!=code[0] and r1[3] not in code) or \ (r1[1] in code and r1[1]==code[1] and r1[3] in code and r1[3]!=code[3] and r1[0] in code and r1[0]!=code[0] and r1[2] not in code) or \ (r1[2] in code and r1[2]==code[2] and r1[0] in code and r1[0]!=code[0] and r1[1] in code and r1[1]!=code[1] and r1[3] not in code) or \ (r1[2] in code and r1[2]==code[2] and r1[0] in code and r1[0]!=code[0] and r1[3] in code and r1[3]!=code[3] and r1[1] not in code) or \ (r1[2] in code and r1[2]==code[2] and r1[1] in code and r1[1]!=code[1] and r1[3] in code and r1[3]!=code[3] and r1[0] not in code) or \ (r1[3] in code and r1[3]==code[3] and r1[0] in code and r1[0]!=code[0] and r1[1] in code and r1[1]!=code[1] and r1[2] not in code) or \ (r1[3] in code and r1[3]==code[3] and r1[0] in code and r1[0]!=code[0] and r1[2] in code and r1[2]!=code[2] and r1[1] not in code) or \ (r1[3] in code and r1[3]==code[3] and r1[2] in code and r1[2]!=code[2] and r1[1] in code and r1[1]!=code[1] and r1[0] not in code): print(" P=1"+","+"V=2"+","+"X=1") elif (r1[0] in code and r1[0]==code[0] and r1[1] in code and r1[1]!=code[1] and r1[2] in code and r1[2]!=code[2] and r1[3] in code and r1[3]!=code[3]) or \ (r1[1] in code and r1[1]==code[1] and r1[0] in code and r1[0]!=code[0] and r1[2] in code and r1[2]!=code[2] and r1[3] in code and r1[3]!=code[3]) or \ (r1[2] in code and r1[2]==code[2] and r1[1] in code and r1[1]!=code[1] and r1[0] in code and r1[0]!=code[0] and r1[3] in code and r1[3]!=code[3]) or \ (r1[3] in code and r1[3]==code[3] and r1[1] in code and r1[1]!=code[1] and r1[2] in code and r1[2]!=code[2] and r1[0] in code and r1[0]!=code[0]): print(" P=1"+","+"V=3"+","+"X=0") elif (r1[0] in code and r1[0]==code[0] and r1[1] in code and r1[1]==code[1] and r1[2] not in code and r1[3] not in code) or \ (r1[0] in code and r1[0]==code[0] and r1[2] in code and r1[2]==code[2] and r1[1] not in code and r1[3] not in code) or \ (r1[0] in code and r1[0]==code[0] and r1[3] in code and r1[3]==code[3] and r1[1] not in code and r1[2] not in code) or \ (r1[1] in code and r1[1]==code[1] and r1[2] in code and r1[2]==code[2] and r1[0] not in code and r1[3] not in code) or \ (r1[1] in code and r1[1]==code[1] and r1[3] in code and r1[3]==code[3] and r1[0] not in code and r1[2] not in code) or \ (r1[2] in code and r1[2]==code[2] and r1[3] in code and r1[3]==code[3] and r1[0] not in code and r1[1] not in code): print(" P=2"+","+"V=0"+","+"X=2") elif (r1[0] in code and r1[0]==code[0] and r1[1] in code and r1[1]==code[1] and r1[2] in code and r1[2]!=code[2] and r1[3] not in code) or \ (r1[0] in code and r1[0]==code[0] and r1[2] in code and r1[2]==code[2] and r1[1] in code and r1[1]!=code[1] and r1[3] not in code) or \ (r1[2] in code and r1[2]==code[2] and r1[1] in code and r1[1]==code[1] and r1[0] in code and r1[0]!=code[0] and r1[3] not in code) or \ (r1[0] in code and r1[0]==code[0] and r1[1] in code and r1[1]==code[1] and r1[3] in code and r1[3]!=code[3] and r1[2] not in code) or \ (r1[0] in code and r1[0]==code[0] and r1[3] in code and r1[3]==code[3] and r1[1] in code and r1[1]!=code[1] and r1[2] not in code) or \ (r1[3] in code and r1[3]==code[3] and r1[1] in code and r1[1]==code[1] and r1[0] in code and r1[0]!=code[0] and r1[2] not in code) or \ (r1[0] in code and r1[0]==code[0] and r1[2] in code and r1[2]==code[2] and r1[3] in code and r1[3]!=code[3] and r1[1] not in code) or \ (r1[0] in code and r1[0]==code[0] and r1[3] in code and r1[3]==code[3] and r1[2] in code and r1[2]!=code[2] and r1[1] not in code) or \ (r1[2] in code and r1[2]==code[2] and r1[3] in code and r1[3]==code[3] and r1[0] in code and r1[0]!=code[0] and r1[1] not in code) or \ (r1[2] in code and r1[2]==code[2] and r1[1] in code and r1[1]==code[1] and r1[3] in code and r1[3]!=code[3] and r1[0] not in code) or \ (r1[3] in code and r1[3]==code[3] and r1[1] in code and r1[1]==code[1] and r1[2] in code and r1[2]!=code[2] and r1[0] not in code) or \ (r1[2] in code and r1[2]==code[2] and r1[3] in code and r1[3]==code[3] and r1[1] in code and r1[1]!=code[1] and r1[0] not in code): print(" P=2"+","+"V=1"+","+"X=1") elif (r1[0] in code and r1[0]==code[0] and r1[1] in code and r1[1]==code[1] and r1[2] in code and r1[2]!=code[2] and r1[3] in code and r1[3]!=code[3]) or \ (r1[0] in code and r1[0]==code[0] and r1[2] in code and r1[2]==code[2] and r1[1] in code and r1[1]!=code[1] and r1[3] in code and r1[3]!=code[3]) or \ (r1[0] in code and r1[0]==code[0] and r1[3] in code and r1[3]==code[3] and r1[2] in code and r1[2]!=code[2] and r1[1] in code and r1[1]!=code[1]) or \ (r1[1] in code and r1[1]==code[1] and r1[2] in code and r1[2]==code[2] and r1[0] in code and r1[0]!=code[0] and r1[3] in code and r1[3]!=code[3]) or \ (r1[1] in code and r1[1]==code[1] and r1[3] in code and r1[3]==code[3] and r1[0] in code and r1[0]!=code[0] and r1[2] in code and r1[2]!=code[2]) or \ (r1[3] in code and r1[3]==code[3] and r1[2] in code and r1[2]==code[2] and r1[0] in code and r1[0]!=code[0] and r1[1] in code and r1[1]!=code[1]): print(" P=2"+","+"V=2"+","+"X=0") elif (r1[0] in code and r1[0]==code[0] and r1[1] in code and r1[1]==code[1] and r1[2] in code and r1[2]==code[2] and r1[3] not in code) or \ (r1[0] in code and r1[0]==code[0] and r1[1] in code and r1[1]==code[1] and r1[3] in code and r1[3]==code[3] and r1[2] not in code) or \ (r1[0] in code and r1[0]==code[0] and r1[2] in code and r1[2]==code[2] and r1[3] in code and r1[3]==code[3] and r1[1] not in code) or \ (r1[1] in code and r1[1]==code[1] and r1[2] in code and r1[2]==code[2] and r1[3] in code and r1[3]==code[3] and r1[0] not in code): print(" P=3"+","+"V=0"+","+"X=1") elif (r1[0] in code and r1[0]==code[0] and r1[1] in code and r1[1]==code[1] and r1[2] in code and r1[2]==code[2] and r1[3] in code and r1[3]!=code[3]) or \ (r1[0] in code and r1[0]==code[0] and r1[1] in code and r1[1]==code[1] and r1[3] in code and r1[3]==code[3] and r1[2] in code and r1[2]!=code[2]) or \ (r1[0] in code and r1[0]==code[0] and r1[3] in code and r1[3]==code[3] and r1[2] in code and r1[2]==code[2] and r1[1] in code and r1[1]!=code[1]) or \ (r1[3] in code and r1[3]==code[3] and r1[1] in code and r1[1]==code[1] and r1[2] in code and r1[2]==code[2] and r1[0] in code and r1[0]!=code[0]): print(" P=3"+","+"V=1"+","+"X=0") r1 = input("Turn #4 : ") if r1[0]==code[0] and r1[1]==code[1] and r1[2]==code[2] and r1[3]==code[3]: print(WINNING_MSG) elif r1[0] not in code and r1[1] not in code and r1[2] not in code and r1[3] not in code: print(" P=0"+","+"V=0"+","+"X=4") print(LOSING_MSG) print("The answer is",code) print("Please try again...") elif (r1[0] in code and r1[0]!=code[0] and r1[1] not in code and r1[2] not in code and r1[3] not in code) or \ (r1[1] in code and r1[1]!=code[1] and r1[0] not in code and r1[2] not in code and r1[3] not in code) or \ (r1[2] in code and r1[2]!=code[2] and r1[1] not in code and r1[0] not in code and r1[3] not in code) or \ (r1[3] in code and r1[3]!=code[3] and r1[1] not in code and r1[2] not in code and r1[0] not in code): print(" P=0"+","+"V=1"+","+"X=3") print(LOSING_MSG) print("The answer is",code) print("Please try again...") elif (r1[0] in code and r1[1] in code and r1[0]!=code[0] and r1[1]!=code[1] and r1[2] not in code and r1[3] not in code) or \ (r1[0] in code and r1[2] in code and r1[0]!=code[0] and r1[2]!=code[2] and r1[1] not in code and r1[3] not in code) or \ (r1[0] in code and r1[3] in code and r1[0]!=code[0] and r1[3]!=code[3] and r1[2] not in code and r1[1] not in code) or \ (r1[1] in code and r1[2] in code and r1[1]!=code[1] and r1[2]!=code[2] and r1[0] not in code and r1[3] not in code) or \ (r1[1] in code and r1[3] in code and r1[1]!=code[1] and r1[3]!=code[3] and r1[0] not in code and r1[2] not in code) or \ (r1[2] in code and r1[3] in code and r1[2]!=code[2] and r1[3]!=code[3] and r1[0] not in code and r1[1] not in code): print(" P=0"+","+"V=2"+","+"X=2") print(LOSING_MSG) print("The answer is",code) print("Please try again...") elif (r1[0] in code and r1[1] in code and r1[2] in code and r1[0]!=code[0] and r1[1]!=code[1] and r1[2]!=code[2] and r1[3] not in code) or \ (r1[0] in code and r1[1] in code and r1[3] in code and r1[0]!=code[0] and r1[1]!=code[1] and r1[3]!=code[3] and r1[2] not in code) or \ (r1[0] in code and r1[2] in code and r1[3] in code and r1[0]!=code[0] and r1[2]!=code[2] and r1[3]!=code[3] and r1[1] not in code) or \ (r1[1] in code and r1[2] in code and r1[3] in code and r1[1]!=code[1] and r1[2]!=code[2] and r1[3]!=code[3] and r1[0] not in code): print(" P=0"+","+"V=3"+","+"X=1") print(LOSING_MSG) print("The answer is",code) print("Please try again...") elif (r1[0] in code and r1[1] in code and r1[2] in code and r1[3] in code and r1[0]!=code[0] and r1[1]!=code[1] and r1[2]!=code[2] and r1[3]!=code[3]): print(" P=0"+","+"V=4"+","+"X=0") print(LOSING_MSG) print("The answer is",code) print("Please try again...") elif (r1[0]==code[0] and r1[1] not in code and r1[2] not in code and r1[3] not in code) or \ (r1[1]==code[1] and r1[0] not in code and r1[2] not in code and r1[3] not in code) or \ (r1[2]==code[2] and r1[1] not in code and r1[0] not in code and r1[3] not in code) or \ (r1[3]==code[3] and r1[1] not in code and r1[2] not in code and r1[0] not in code) : print(" P=1"+","+"V=0"+","+"X=3") print(LOSING_MSG) print("The answer is",code) print("Please try again...") elif (r1[0] in code and r1[0]==code[0] and r1[1] in code and r1[1]!=code[1] and r1[2] not in code and r1[3] not in code) or \ (r1[0] in code and r1[0]==code[0] and r1[2] in code and r1[2]!=code[2] and r1[1] not in code and r1[3] not in code) or \ (r1[0] in code and r1[0]==code[0] and r1[3] in code and r1[3]!=code[3] and r1[1] not in code and r1[2] not in code) or \ (r1[1] in code and r1[1]==code[1] and r1[0] in code and r1[0]!=code[0] and r1[2] not in code and r1[3] not in code) or \ (r1[1] in code and r1[1]==code[1] and r1[2] in code and r1[2]!=code[2] and r1[0] not in code and r1[3] not in code) or \ (r1[1] in code and r1[1]==code[1] and r1[3] in code and r1[3]!=code[3] and r1[0] not in code and r1[2] not in code) or \ (r1[2] in code and r1[2]==code[2] and r1[3] in code and r1[3]!=code[3] and r1[0] not in code and r1[1] not in code) or \ (r1[2] in code and r1[2]==code[2] and r1[0] in code and r1[0]!=code[0] and r1[1] not in code and r1[3] not in code) or \ (r1[2] in code and r1[2]==code[2] and r1[1] in code and r1[1]!=code[1] and r1[0] not in code and r1[3] not in code) or \ (r1[3] in code and r1[3]==code[3] and r1[0] in code and r1[0]!=code[0] and r1[1] not in code and r1[2] not in code) or \ (r1[3] in code and r1[3]==code[3] and r1[1] in code and r1[1]!=code[1] and r1[0] not in code and r1[2] not in code) or \ (r1[3] in code and r1[3]==code[3] and r1[2] in code and r1[2]!=code[2] and r1[0] not in code and r1[1] not in code): print(" P=1"+","+"V=1"+","+"X=2") print(LOSING_MSG) print("The answer is",code) print("Please try again...") elif (r1[0] in code and r1[0]==code[0] and r1[1] in code and r1[1]!=code[1] and r1[2] in code and r1[2]!=code[2] and r1[3] not in code) or \ (r1[0] in code and r1[0]==code[0] and r1[1] in code and r1[1]!=code[1] and r1[3] in code and r1[3]!=code[3] and r1[2] not in code) or \ (r1[0] in code and r1[0]==code[0] and r1[2] in code and r1[2]!=code[2] and r1[3] in code and r1[3]!=code[3] and r1[1] not in code) or \ (r1[1] in code and r1[1]==code[1] and r1[2] in code and r1[2]!=code[2] and r1[3] in code and r1[3]!=code[3] and r1[0] not in code) or \ (r1[1] in code and r1[1]==code[1] and r1[2] in code and r1[2]!=code[2] and r1[0] in code and r1[0]!=code[0] and r1[3] not in code) or \ (r1[1] in code and r1[1]==code[1] and r1[3] in code and r1[3]!=code[3] and r1[0] in code and r1[0]!=code[0] and r1[2] not in code) or \ (r1[2] in code and r1[2]==code[2] and r1[0] in code and r1[0]!=code[0] and r1[1] in code and r1[1]!=code[1] and r1[3] not in code) or \ (r1[2] in code and r1[2]==code[2] and r1[0] in code and r1[0]!=code[0] and r1[3] in code and r1[3]!=code[3] and r1[1] not in code) or \ (r1[2] in code and r1[2]==code[2] and r1[1] in code and r1[1]!=code[1] and r1[3] in code and r1[3]!=code[3] and r1[0] not in code) or \ (r1[3] in code and r1[3]==code[3] and r1[0] in code and r1[0]!=code[0] and r1[1] in code and r1[1]!=code[1] and r1[2] not in code) or \ (r1[3] in code and r1[3]==code[3] and r1[0] in code and r1[0]!=code[0] and r1[2] in code and r1[2]!=code[2] and r1[1] not in code) or \ (r1[3] in code and r1[3]==code[3] and r1[2] in code and r1[2]!=code[2] and r1[1] in code and r1[1]!=code[1] and r1[0] not in code): print(" P=1"+","+"V=2"+","+"X=1") print(LOSING_MSG) print("The answer is",code) print("Please try again...") elif (r1[0] in code and r1[0]==code[0] and r1[1] in code and r1[1]!=code[1] and r1[2] in code and r1[2]!=code[2] and r1[3] in code and r1[3]!=code[3]) or \ (r1[1] in code and r1[1]==code[1] and r1[0] in code and r1[0]!=code[0] and r1[2] in code and r1[2]!=code[2] and r1[3] in code and r1[3]!=code[3]) or \ (r1[2] in code and r1[2]==code[2] and r1[1] in code and r1[1]!=code[1] and r1[0] in code and r1[0]!=code[0] and r1[3] in code and r1[3]!=code[3]) or \ (r1[3] in code and r1[3]==code[3] and r1[1] in code and r1[1]!=code[1] and r1[2] in code and r1[2]!=code[2] and r1[0] in code and r1[0]!=code[0]): print(" P=1"+","+"V=3"+","+"X=0") print(LOSING_MSG) print("The answer is",code) print("Please try again...") elif (r1[0] in code and r1[0]==code[0] and r1[1] in code and r1[1]==code[1] and r1[2] not in code and r1[3] not in code) or \ (r1[0] in code and r1[0]==code[0] and r1[2] in code and r1[2]==code[2] and r1[1] not in code and r1[3] not in code) or \ (r1[0] in code and r1[0]==code[0] and r1[3] in code and r1[3]==code[3] and r1[1] not in code and r1[2] not in code) or \ (r1[1] in code and r1[1]==code[1] and r1[2] in code and r1[2]==code[2] and r1[0] not in code and r1[3] not in code) or \ (r1[1] in code and r1[1]==code[1] and r1[3] in code and r1[3]==code[3] and r1[0] not in code and r1[2] not in code) or \ (r1[2] in code and r1[2]==code[2] and r1[3] in code and r1[3]==code[3] and r1[0] not in code and r1[1] not in code): print(" P=2"+","+"V=0"+","+"X=2") print(LOSING_MSG) print("The answer is",code) print("Please try again...") elif (r1[0] in code and r1[0]==code[0] and r1[1] in code and r1[1]==code[1] and r1[2] in code and r1[2]!=code[2] and r1[3] not in code) or \ (r1[0] in code and r1[0]==code[0] and r1[2] in code and r1[2]==code[2] and r1[1] in code and r1[1]!=code[1] and r1[3] not in code) or \ (r1[2] in code and r1[2]==code[2] and r1[1] in code and r1[1]==code[1] and r1[0] in code and r1[0]!=code[0] and r1[3] not in code) or \ (r1[0] in code and r1[0]==code[0] and r1[1] in code and r1[1]==code[1] and r1[3] in code and r1[3]!=code[3] and r1[2] not in code) or \ (r1[0] in code and r1[0]==code[0] and r1[3] in code and r1[3]==code[3] and r1[1] in code and r1[1]!=code[1] and r1[2] not in code) or \ (r1[3] in code and r1[3]==code[3] and r1[1] in code and r1[1]==code[1] and r1[0] in code and r1[0]!=code[0] and r1[2] not in code) or \ (r1[0] in code and r1[0]==code[0] and r1[2] in code and r1[2]==code[2] and r1[3] in code and r1[3]!=code[3] and r1[1] not in code) or \ (r1[0] in code and r1[0]==code[0] and r1[3] in code and r1[3]==code[3] and r1[2] in code and r1[2]!=code[2] and r1[1] not in code) or \ (r1[2] in code and r1[2]==code[2] and r1[3] in code and r1[3]==code[3] and r1[0] in code and r1[0]!=code[0] and r1[1] not in code) or \ (r1[2] in code and r1[2]==code[2] and r1[1] in code and r1[1]==code[1] and r1[3] in code and r1[3]!=code[3] and r1[0] not in code) or \ (r1[3] in code and r1[3]==code[3] and r1[1] in code and r1[1]==code[1] and r1[2] in code and r1[2]!=code[2] and r1[0] not in code) or \ (r1[2] in code and r1[2]==code[2] and r1[3] in code and r1[3]==code[3] and r1[1] in code and r1[1]!=code[1] and r1[0] not in code): print(" P=2"+","+"V=1"+","+"X=1") print(LOSING_MSG) print("The answer is",code) print("Please try again...") elif (r1[0] in code and r1[0]==code[0] and r1[1] in code and r1[1]==code[1] and r1[2] in code and r1[2]!=code[2] and r1[3] in code and r1[3]!=code[3]) or \ (r1[0] in code and r1[0]==code[0] and r1[2] in code and r1[2]==code[2] and r1[1] in code and r1[1]!=code[1] and r1[3] in code and r1[3]!=code[3]) or \ (r1[0] in code and r1[0]==code[0] and r1[3] in code and r1[3]==code[3] and r1[2] in code and r1[2]!=code[2] and r1[1] in code and r1[1]!=code[1]) or \ (r1[1] in code and r1[1]==code[1] and r1[2] in code and r1[2]==code[2] and r1[0] in code and r1[0]!=code[0] and r1[3] in code and r1[3]!=code[3]) or \ (r1[1] in code and r1[1]==code[1] and r1[3] in code and r1[3]==code[3] and r1[0] in code and r1[0]!=code[0] and r1[2] in code and r1[2]!=code[2]) or \ (r1[3] in code and r1[3]==code[3] and r1[2] in code and r1[2]==code[2] and r1[0] in code and r1[0]!=code[0] and r1[1] in code and r1[1]!=code[1]): print(" P=2"+","+"V=2"+","+"X=0") print(LOSING_MSG) print("The answer is",code) print("Please try again...") elif (r1[0] in code and r1[0]==code[0] and r1[1] in code and r1[1]==code[1] and r1[2] in code and r1[2]==code[2] and r1[3] not in code) or \ (r1[0] in code and r1[0]==code[0] and r1[1] in code and r1[1]==code[1] and r1[3] in code and r1[3]==code[3] and r1[2] not in code) or \ (r1[0] in code and r1[0]==code[0] and r1[2] in code and r1[2]==code[2] and r1[3] in code and r1[3]==code[3] and r1[1] not in code) or \ (r1[1] in code and r1[1]==code[1] and r1[2] in code and r1[2]==code[2] and r1[3] in code and r1[3]==code[3] and r1[0] not in code): print(" P=3"+","+"V=0"+","+"X=1") print(LOSING_MSG) print("The answer is",code) print("Please try again...") elif (r1[0] in code and r1[0]==code[0] and r1[1] in code and r1[1]==code[1] and r1[2] in code and r1[2]==code[2] and r1[3] in code and r1[3]!=code[3]) or \ (r1[0] in code and r1[0]==code[0] and r1[1] in code and r1[1]==code[1] and r1[3] in code and r1[3]==code[3] and r1[2] in code and r1[2]!=code[2]) or \ (r1[0] in code and r1[0]==code[0] and r1[3] in code and r1[3]==code[3] and r1[2] in code and r1[2]==code[2] and r1[1] in code and r1[1]!=code[1]) or \ (r1[3] in code and r1[3]==code[3] and r1[1] in code and r1[1]==code[1] and r1[2] in code and r1[2]==code[2] and r1[0] in code and r1[0]!=code[0]): print(" P=3"+","+"V=1"+","+"X=0") print(LOSING_MSG) print("The answer is",code) print("Please try again...") |
# 6330471321 (19.11) 306 (2021-02-15 00:19) i=1 while i < 5 : a = input() if a[0] in code[0] and a[1] in code[1] and a[2] in code[2] and a[3] in code[3]: P=4 elif a[0] in code[0] and a[1] in code[1] and a[2] in code[2] and a[3] not in code[3]: P=3 elif a[0] in code[0] and a[1] in code[1] and a[2] not in code[2] and a[3] in code[3]: P=3 elif a[0] in code[0] and a[1] not in code[1] and a[2] in code[2] and a[3] in code[3]: P=3 elif a[0] not in code[0] and a[1] in code[1] and a[2] in code[2] and a[3] in code[3]: P=3 elif a[0] in code[0] and a[1] in code[1] and a[2] not in code[2] and a[3] not in code[3]: P=2 elif a[0] in code[0] and a[1] not in code[1] and a[2] in code[2] and a[3] not in code[3]: P=2 elif a[0] not in code[0] and a[1] in code[1] and a[2] in code[2] and a[3] not in code[3]: P=2 elif a[0] in code[0] and a[1] not in code[1] and a[2] not in code[2] and a[3] in code[3]: P=2 elif a[0] not in code[0] and a[1] in code[1] and a[2] not in code[2] and a[3] in code[3]: P=2 elif a[0] not in code[0] and a[1] not in code[1] and a[2] in code[2] and a[3] in code[3]: P=2 elif a[0] in code[0] and a[1] not in code[1] and a[2] not in code[2] and a[3] not in code[3]: P=1 elif a[0] not in code[0] and a[1] not in code[1] and a[2] not in code[2] and a[3] in code[3]: P=1 elif a[0] not in code[0] and a[1] not in code[1] and a[2] in code[2] and a[3] not in code[3]: P=1 elif a[0] not in code[0] and a[1] in code[1] and a[2] not in code[2] and a[3] not in code[3]: P=1 elif a[0] not in code[0] and a[1] not in code[1] and a[2] not in code[2] and a[3] not in code[3]: P=0 if a[0] in code[1:] and (a[1] not in code[1] and a[1] in code) and (a[2] not in code[2] and a[2] in code)and (a[3] not in code[3] and a[3] in code): V=4 elif a[0] in code[1:] and (a[1] not in code[1] and a[1] in code) and (a[2] not in code[2] and a[2] in code): V=3 elif a[0] in code[1:] and (a[1] not in code[1] and a[1] in code)and (a[3] not in code[3] and a[3] in code): V=3 elif a[0] in code[1:] and(a[2] not in code[2] and a[2] in code)and (a[3] not in code[3] and a[3] in code): V=3 elif (a[1] not in code[1] and a[1] in code) and (a[2] not in code[2] and a[2] in code)and (a[3] not in code[3] and a[3] in code): V=3 elif a[0] in code[1:] and (a[1] not in code[1] and a[1] in code): V=2 elif a[0] in code[1:] and (a[2] not in code[2] and a[2] in code): V=2 elif a[0] in code[1:] and (a[3] not in code[3] and a[3] in code): V=2 elif (a[1] not in code[1] and a[1] in code) and (a[2] not in code[2] and a[2] in code): V=2 elif (a[1] not in code[1] and a[1] in code) and (a[3] not in code[3] and a[3] in code): V=2 elif (a[2] not in code[2] and a[2] in code)and (a[3] not in code[3] and a[3] in code): V=2 elif a[0] in code[1:]: V=1 elif a[1] not in code[1] and a[1] in code: V=1 elif a[2] not in code[2] and a[2] in code: V=1 elif a[3] not in code[3] and a[3] in code: V=1 else: V=0 if a[0] not in code and a[1] not in code: X=2 elif a[0] not in code and a[2] not in code: X=2 elif a[0] not in code and a[3] not in code: X=2 elif a[1] not in code and a[2] not in code: X=2 elif a[1] not in code and a[3] not in code: X=2 elif a[2] not in code and a[3] not in code: X=2 elif a[0] not in code: X=1 elif a[1] not in code: X=1 elif a[2] not in code: X=1 elif a[3] not in code: X=1 else: X=0 if P == 4: break print('Turn #'+str(i), ':',a) print(' ','P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) i+=1 if P == 4: print('Congratulations! You won the game.') else: print('Sorry! You just lost it.') print('The answer is ', code) print('Please try again...') |
# 6330472021 (15.17) 307 (2021-02-15 12:50) text1=input("Turn #1 : ") X1=0 V1=0 P1=0 if not text1[0] in code : X1+=1 else: V1+=1 if not text1[0]==code[0]: V1=V1 else: P1+=1 if not text1[1] in code : X1+=1 else: V1+=1 if not text1[1]==code[1]: V1=V1 else: P1+=1 if not text1[2] in code: X1+=1 else: V1+=1 if not text1[2]==code[2]: V1=V1 else: P1+=1 if not text1[3] in code: X1+=1 else: V1+=1 if text1[3]==code[3]: print("Congratulations! You won the game.") else: if V1>=P1: V1-=P1 print(' '+'P='+str(P1)+','+'V='+str(V1)+','+'X='+str(X1)) text2=input("Turn #2 : ") X2=0 V2=0 P2=0 if not text2[0] in code : X2+=1 else: V2+=1 if not text2[0]==code[0]: V2=V2 else: P2+=1 if not text2[1] in code : X2+=1 else: V2+=1 if not text2[1]==code[1]: V2=V2 else: P2+=1 if not text2[2] in code: X2+=1 else: V2+=1 if not text2[2]==code[2]: V2=V2 else: P2+=1 if not text2[3] in code: X2+=1 else: V2+=1 if text2[3]==code[3]: print("Congratulations! You won the game.") else: if V2>=P2: V2-=P2 print(' '+'P='+str(P2)+','+'V='+str(V2)+','+'X='+str(X2)) text3=input("Turn #3 : ") X3=0 V3=0 P3=0 if not text3[0] in code : X3+=1 else: V3+=1 if not text3[0]==code[0]: V3=V3 else: P3+=1 if not text3[1] in code : X3+=1 else: V3+=1 if not text3[1]==code[1]: V3=V3 else: P3+=1 if not text3[2] in code: X3+=1 else: V3+=1 if not text3[2]==code[2]: V3=V3 else: P3+=1 if not text3[3] in code: X3+=1 else: V3+=1 if text3[3]==code[3]: print("Congratulations! You won the game.") else: if V3>=P3: V3-=P3 print(' '+'P='+str(P3)+','+'V='+str(V3)+','+'X='+str(X3)) text4=input("Turn #4 : ") X4=0 V4=0 P4=0 if not text4[0] in code : X4+=1 else: V4+=1 if not text4[0]==code[0]: V4=V4 else: P4+=1 if not text4[1] in code : X4+=1 else: V4+=1 if not text4[1]==code[1]: V4=V4 else: P4+=1 if not text4[2] in code: X4+=1 else: V4+=1 if not text4[2]==code[2]: V4=V4 else: P4+=1 if not text4[3] in code: X4+=1 else: V4+=1 if text4[3]==code[3]: print("Congratulations! You won the game.") else: if V4>=P4: V4-=P4 print(' '+'P='+str(P4)+','+'V='+str(V4)+','+'X='+str(X4)) print('Sorry! You just lost it.') print('The answer is '+code) print('Please try again...') |
# 6330473621 (20.00) 308 (2021-02-13 16:25) c = code name = input('Turn #1 : ') r = name if r[0] == c[0] and r[1] == c[1] and r[2] == c[2] and r[3] == c[3] : p = 4 if r[0] in c and r[1] in c and r[2] in c and r[3] in c : k = 4 elif r[0] in c and r[1] in c and r[2] in c and r[3] not in c \ or r[0] in c and r[1] in c and r[3] in c and r[2] not in c \ or r[0] in c and r[2] in c and r[3] in c and r[1] not in c \ or r[1] in c and r[2] in c and r[3] in c and r[0] not in c : k = 3 elif r[0] in c and r[1] in c and r[2] not in c and r[3] not in c \ or r[0] in c and r[2] in c and r[1] not in c and r[3] not in c \ or r[0] in c and r[3] in c and r[1] not in c and r[2] not in c \ or r[1] in c and r[2] in c and r[0] not in c and r[3] not in c \ or r[1] in c and r[3] in c and r[0] not in c and r[2] not in c \ or r[2] in c and r[3] in c and r[0] not in c and r[1] not in c : k = 2 elif r[0] in c and r[1] not in c and r[2] not in c and r[3] not in c \ or r[1] in c and r[0] not in c and r[2] not in c and r[3] not in c \ or r[2] in c and r[0] not in c and r[1] not in c and r[3] not in c \ or r[3] in c and r[0] not in c and r[1] not in c and r[2] not in c : k = 1 elif r[0] == c[0] and r[1] == c[1] and r[2] == c[2] and r[3] != c[3] \ or r[0] == c[0] and r[1] == c[1] and r[3] == c[3] and r[2] != c[2] \ or r[0] == c[0] and r[2] == c[2] and r[3] == c[3] and r[1] != c[1] \ or r[1] == c[1] and r[2] == c[2] and r[3] == c[3] and r[0] != c[0] : p = 3 if r[0] in c and r[1] in c and r[2] in c and r[3] in c : k = 4 elif r[0] in c and r[1] in c and r[2] in c and r[3] not in c \ or r[0] in c and r[1] in c and r[3] in c and r[2] not in c \ or r[0] in c and r[2] in c and r[3] in c and r[1] not in c \ or r[1] in c and r[2] in c and r[3] in c and r[0] not in c : k = 3 elif r[0] in c and r[1] in c and r[2] not in c and r[3] not in c \ or r[0] in c and r[2] in c and r[1] not in c and r[3] not in c \ or r[0] in c and r[3] in c and r[1] not in c and r[2] not in c \ or r[1] in c and r[2] in c and r[0] not in c and r[3] not in c \ or r[1] in c and r[3] in c and r[0] not in c and r[2] not in c \ or r[2] in c and r[3] in c and r[0] not in c and r[1] not in c : k = 2 elif r[0] in c and r[1] not in c and r[2] not in c and r[3] not in c \ or r[1] in c and r[0] not in c and r[2] not in c and r[3] not in c \ or r[2] in c and r[0] not in c and r[1] not in c and r[3] not in c \ or r[3] in c and r[0] not in c and r[1] not in c and r[2] not in c : k = 1 elif r[0] == c[0] and r[1] == c[1] and r[2] != c[2] and r[3] != c[3] \ or r[0] == c[0] and r[2] == c[2] and r[1] != c[1] and r[3] != c[3] \ or r[0] == c[0] and r[3] == c[3] and r[1] != c[1] and r[2] != c[2] \ or r[1] == c[1] and r[2] == c[2] and r[0] != c[0] and r[3] != c[3] \ or r[1] == c[1] and r[3] == c[3] and r[0] != c[0] and r[2] != c[2] \ or r[2] == c[2] and r[3] == c[3] and r[0] != c[0] and r[1] != c[1] : p = 2 if r[0] in c and r[1] in c and r[2] in c and r[3] in c : k = 4 elif r[0] in c and r[1] in c and r[2] in c and r[3] not in c \ or r[0] in c and r[1] in c and r[3] in c and r[2] not in c \ or r[0] in c and r[2] in c and r[3] in c and r[1] not in c \ or r[1] in c and r[2] in c and r[3] in c and r[0] not in c : k = 3 elif r[0] in c and r[1] in c and r[2] not in c and r[3] not in c \ or r[0] in c and r[2] in c and r[1] not in c and r[3] not in c \ or r[0] in c and r[3] in c and r[1] not in c and r[2] not in c \ or r[1] in c and r[2] in c and r[0] not in c and r[3] not in c \ or r[1] in c and r[3] in c and r[0] not in c and r[2] not in c \ or r[2] in c and r[3] in c and r[0] not in c and r[1] not in c : k = 2 elif r[0] in c and r[1] not in c and r[2] not in c and r[3] not in c \ or r[1] in c and r[0] not in c and r[2] not in c and r[3] not in c \ or r[2] in c and r[0] not in c and r[1] not in c and r[3] not in c \ or r[3] in c and r[0] not in c and r[1] not in c and r[2] not in c : k = 1 elif r[0] == c[0] and r[1] != c[1] and r[2] != c[2] and r[3] != c[3] \ or r[1] == c[1] and r[0] != c[0] and r[2] != c[2] and r[3] != c[3] \ or r[2] == c[2] and r[0] != c[0] and r[1] != c[1] and r[3] != c[3] \ or r[3] == c[3] and r[0] != c[0] and r[1] != c[1] and r[2] != c[2] : p = 1 if r[0] in c and r[1] in c and r[2] in c and r[3] in c : k = 4 elif r[0] in c and r[1] in c and r[2] in c and r[3] not in c \ or r[0] in c and r[1] in c and r[3] in c and r[2] not in c \ or r[0] in c and r[2] in c and r[3] in c and r[1] not in c \ or r[1] in c and r[2] in c and r[3] in c and r[0] not in c : k = 3 elif r[0] in c and r[1] in c and r[2] not in c and r[3] not in c \ or r[0] in c and r[2] in c and r[1] not in c and r[3] not in c \ or r[0] in c and r[3] in c and r[1] not in c and r[2] not in c \ or r[1] in c and r[2] in c and r[0] not in c and r[3] not in c \ or r[1] in c and r[3] in c and r[0] not in c and r[2] not in c \ or r[2] in c and r[3] in c and r[0] not in c and r[1] not in c : k = 2 elif r[0] in c and r[1] not in c and r[2] not in c and r[3] not in c \ or r[1] in c and r[0] not in c and r[2] not in c and r[3] not in c \ or r[2] in c and r[0] not in c and r[1] not in c and r[3] not in c \ or r[3] in c and r[0] not in c and r[1] not in c and r[2] not in c : k = 1 elif r[0] != c[0] and r[1] != c[1] and r[2] != c[2] and r[3] != c[3] : p = 0 if r[0] in c and r[1] in c and r[2] in c and r[3] in c : k = 4 elif r[0] in c and r[1] in c and r[2] in c and r[3] not in c \ or r[0] in c and r[1] in c and r[3] in c and r[2] not in c \ or r[0] in c and r[2] in c and r[3] in c and r[1] not in c \ or r[1] in c and r[2] in c and r[3] in c and r[0] not in c : k = 3 elif r[0] in c and r[1] in c and r[2] not in c and r[3] not in c \ or r[0] in c and r[2] in c and r[1] not in c and r[3] not in c \ or r[0] in c and r[3] in c and r[1] not in c and r[2] not in c \ or r[1] in c and r[2] in c and r[0] not in c and r[3] not in c \ or r[1] in c and r[3] in c and r[0] not in c and r[2] not in c \ or r[2] in c and r[3] in c and r[0] not in c and r[1] not in c : k = 2 elif r[0] in c and r[1] not in c and r[2] not in c and r[3] not in c \ or r[1] in c and r[0] not in c and r[2] not in c and r[3] not in c \ or r[2] in c and r[0] not in c and r[1] not in c and r[3] not in c \ or r[3] in c and r[0] not in c and r[1] not in c and r[2] not in c : k = 1 v = k-p x = 4-p-v if p==4 and v==0 and x==0 : print("Congratulations! You won the game.") else : print(" P="+str(p)+",V="+str(v)+",X="+str(x)) name = input('Turn #2 : ') r = name if r[0] == c[0] and r[1] == c[1] and r[2] == c[2] and r[3] == c[3] : p = 4 if r[0] in c and r[1] in c and r[2] in c and r[3] in c : k = 4 elif r[0] in c and r[1] in c and r[2] in c and r[3] not in c \ or r[0] in c and r[1] in c and r[3] in c and r[2] not in c \ or r[0] in c and r[2] in c and r[3] in c and r[1] not in c \ or r[1] in c and r[2] in c and r[3] in c and r[0] not in c : k = 3 elif r[0] in c and r[1] in c and r[2] not in c and r[3] not in c \ or r[0] in c and r[2] in c and r[1] not in c and r[3] not in c \ or r[0] in c and r[3] in c and r[1] not in c and r[2] not in c \ or r[1] in c and r[2] in c and r[0] not in c and r[3] not in c \ or r[1] in c and r[3] in c and r[0] not in c and r[2] not in c \ or r[2] in c and r[3] in c and r[0] not in c and r[1] not in c : k = 2 elif r[0] in c and r[1] not in c and r[2] not in c and r[3] not in c \ or r[1] in c and r[0] not in c and r[2] not in c and r[3] not in c \ or r[2] in c and r[0] not in c and r[1] not in c and r[3] not in c \ or r[3] in c and r[0] not in c and r[1] not in c and r[2] not in c : k = 1 elif r[0] == c[0] and r[1] == c[1] and r[2] == c[2] and r[3] != c[3] \ or r[0] == c[0] and r[1] == c[1] and r[3] == c[3] and r[2] != c[2] \ or r[0] == c[0] and r[2] == c[2] and r[3] == c[3] and r[1] != c[1] \ or r[1] == c[1] and r[2] == c[2] and r[3] == c[3] and r[0] != c[0] : p = 3 if r[0] in c and r[1] in c and r[2] in c and r[3] in c : k = 4 elif r[0] in c and r[1] in c and r[2] in c and r[3] not in c \ or r[0] in c and r[1] in c and r[3] in c and r[2] not in c \ or r[0] in c and r[2] in c and r[3] in c and r[1] not in c \ or r[1] in c and r[2] in c and r[3] in c and r[0] not in c : k = 3 elif r[0] in c and r[1] in c and r[2] not in c and r[3] not in c \ or r[0] in c and r[2] in c and r[1] not in c and r[3] not in c \ or r[0] in c and r[3] in c and r[1] not in c and r[2] not in c \ or r[1] in c and r[2] in c and r[0] not in c and r[3] not in c \ or r[1] in c and r[3] in c and r[0] not in c and r[2] not in c \ or r[2] in c and r[3] in c and r[0] not in c and r[1] not in c : k = 2 elif r[0] in c and r[1] not in c and r[2] not in c and r[3] not in c \ or r[1] in c and r[0] not in c and r[2] not in c and r[3] not in c \ or r[2] in c and r[0] not in c and r[1] not in c and r[3] not in c \ or r[3] in c and r[0] not in c and r[1] not in c and r[2] not in c : k = 1 elif r[0] == c[0] and r[1] == c[1] and r[2] != c[2] and r[3] != c[3] \ or r[0] == c[0] and r[2] == c[2] and r[1] != c[1] and r[3] != c[3] \ or r[0] == c[0] and r[3] == c[3] and r[1] != c[1] and r[2] != c[2] \ or r[1] == c[1] and r[2] == c[2] and r[0] != c[0] and r[3] != c[3] \ or r[1] == c[1] and r[3] == c[3] and r[0] != c[0] and r[2] != c[2] \ or r[2] == c[2] and r[3] == c[3] and r[0] != c[0] and r[1] != c[1] : p = 2 if r[0] in c and r[1] in c and r[2] in c and r[3] in c : k = 4 elif r[0] in c and r[1] in c and r[2] in c and r[3] not in c \ or r[0] in c and r[1] in c and r[3] in c and r[2] not in c \ or r[0] in c and r[2] in c and r[3] in c and r[1] not in c \ or r[1] in c and r[2] in c and r[3] in c and r[0] not in c : k = 3 elif r[0] in c and r[1] in c and r[2] not in c and r[3] not in c \ or r[0] in c and r[2] in c and r[1] not in c and r[3] not in c \ or r[0] in c and r[3] in c and r[1] not in c and r[2] not in c \ or r[1] in c and r[2] in c and r[0] not in c and r[3] not in c \ or r[1] in c and r[3] in c and r[0] not in c and r[2] not in c \ or r[2] in c and r[3] in c and r[0] not in c and r[1] not in c : k = 2 elif r[0] in c and r[1] not in c and r[2] not in c and r[3] not in c \ or r[1] in c and r[0] not in c and r[2] not in c and r[3] not in c \ or r[2] in c and r[0] not in c and r[1] not in c and r[3] not in c \ or r[3] in c and r[0] not in c and r[1] not in c and r[2] not in c : k = 1 elif r[0] == c[0] and r[1] != c[1] and r[2] != c[2] and r[3] != c[3] \ or r[1] == c[1] and r[0] != c[0] and r[2] != c[2] and r[3] != c[3] \ or r[2] == c[2] and r[0] != c[0] and r[1] != c[1] and r[3] != c[3] \ or r[3] == c[3] and r[0] != c[0] and r[1] != c[1] and r[2] != c[2] : p = 1 if r[0] in c and r[1] in c and r[2] in c and r[3] in c : k = 4 elif r[0] in c and r[1] in c and r[2] in c and r[3] not in c \ or r[0] in c and r[1] in c and r[3] in c and r[2] not in c \ or r[0] in c and r[2] in c and r[3] in c and r[1] not in c \ or r[1] in c and r[2] in c and r[3] in c and r[0] not in c : k = 3 elif r[0] in c and r[1] in c and r[2] not in c and r[3] not in c \ or r[0] in c and r[2] in c and r[1] not in c and r[3] not in c \ or r[0] in c and r[3] in c and r[1] not in c and r[2] not in c \ or r[1] in c and r[2] in c and r[0] not in c and r[3] not in c \ or r[1] in c and r[3] in c and r[0] not in c and r[2] not in c \ or r[2] in c and r[3] in c and r[0] not in c and r[1] not in c : k = 2 elif r[0] in c and r[1] not in c and r[2] not in c and r[3] not in c \ or r[1] in c and r[0] not in c and r[2] not in c and r[3] not in c \ or r[2] in c and r[0] not in c and r[1] not in c and r[3] not in c \ or r[3] in c and r[0] not in c and r[1] not in c and r[2] not in c : k = 1 elif r[0] != c[0] and r[1] != c[1] and r[2] != c[2] and r[3] != c[3] : p = 0 if r[0] in c and r[1] in c and r[2] in c and r[3] in c : k = 4 elif r[0] in c and r[1] in c and r[2] in c and r[3] not in c \ or r[0] in c and r[1] in c and r[3] in c and r[2] not in c \ or r[0] in c and r[2] in c and r[3] in c and r[1] not in c \ or r[1] in c and r[2] in c and r[3] in c and r[0] not in c : k = 3 elif r[0] in c and r[1] in c and r[2] not in c and r[3] not in c \ or r[0] in c and r[2] in c and r[1] not in c and r[3] not in c \ or r[0] in c and r[3] in c and r[1] not in c and r[2] not in c \ or r[1] in c and r[2] in c and r[0] not in c and r[3] not in c \ or r[1] in c and r[3] in c and r[0] not in c and r[2] not in c \ or r[2] in c and r[3] in c and r[0] not in c and r[1] not in c : k = 2 elif r[0] in c and r[1] not in c and r[2] not in c and r[3] not in c \ or r[1] in c and r[0] not in c and r[2] not in c and r[3] not in c \ or r[2] in c and r[0] not in c and r[1] not in c and r[3] not in c \ or r[3] in c and r[0] not in c and r[1] not in c and r[2] not in c : k = 1 v = k-p x = 4-p-v if p==4 and v==0 and x==0 : print("Congratulations! You won the game.") else : print(" P="+str(p)+",V="+str(v)+",X="+str(x)) name = input('Turn #3 : ') r = name if r[0] == c[0] and r[1] == c[1] and r[2] == c[2] and r[3] == c[3] : p = 4 if r[0] in c and r[1] in c and r[2] in c and r[3] in c : k = 4 elif r[0] in c and r[1] in c and r[2] in c and r[3] not in c \ or r[0] in c and r[1] in c and r[3] in c and r[2] not in c \ or r[0] in c and r[2] in c and r[3] in c and r[1] not in c \ or r[1] in c and r[2] in c and r[3] in c and r[0] not in c : k = 3 elif r[0] in c and r[1] in c and r[2] not in c and r[3] not in c \ or r[0] in c and r[2] in c and r[1] not in c and r[3] not in c \ or r[0] in c and r[3] in c and r[1] not in c and r[2] not in c \ or r[1] in c and r[2] in c and r[0] not in c and r[3] not in c \ or r[1] in c and r[3] in c and r[0] not in c and r[2] not in c \ or r[2] in c and r[3] in c and r[0] not in c and r[1] not in c : k = 2 elif r[0] in c and r[1] not in c and r[2] not in c and r[3] not in c \ or r[1] in c and r[0] not in c and r[2] not in c and r[3] not in c \ or r[2] in c and r[0] not in c and r[1] not in c and r[3] not in c \ or r[3] in c and r[0] not in c and r[1] not in c and r[2] not in c : k = 1 elif r[0] == c[0] and r[1] == c[1] and r[2] == c[2] and r[3] != c[3] \ or r[0] == c[0] and r[1] == c[1] and r[3] == c[3] and r[2] != c[2] \ or r[0] == c[0] and r[2] == c[2] and r[3] == c[3] and r[1] != c[1] \ or r[1] == c[1] and r[2] == c[2] and r[3] == c[3] and r[0] != c[0] : p = 3 if r[0] in c and r[1] in c and r[2] in c and r[3] in c : k = 4 elif r[0] in c and r[1] in c and r[2] in c and r[3] not in c \ or r[0] in c and r[1] in c and r[3] in c and r[2] not in c \ or r[0] in c and r[2] in c and r[3] in c and r[1] not in c \ or r[1] in c and r[2] in c and r[3] in c and r[0] not in c : k = 3 elif r[0] in c and r[1] in c and r[2] not in c and r[3] not in c \ or r[0] in c and r[2] in c and r[1] not in c and r[3] not in c \ or r[0] in c and r[3] in c and r[1] not in c and r[2] not in c \ or r[1] in c and r[2] in c and r[0] not in c and r[3] not in c \ or r[1] in c and r[3] in c and r[0] not in c and r[2] not in c \ or r[2] in c and r[3] in c and r[0] not in c and r[1] not in c : k = 2 elif r[0] in c and r[1] not in c and r[2] not in c and r[3] not in c \ or r[1] in c and r[0] not in c and r[2] not in c and r[3] not in c \ or r[2] in c and r[0] not in c and r[1] not in c and r[3] not in c \ or r[3] in c and r[0] not in c and r[1] not in c and r[2] not in c : k = 1 elif r[0] == c[0] and r[1] == c[1] and r[2] != c[2] and r[3] != c[3] \ or r[0] == c[0] and r[2] == c[2] and r[1] != c[1] and r[3] != c[3] \ or r[0] == c[0] and r[3] == c[3] and r[1] != c[1] and r[2] != c[2] \ or r[1] == c[1] and r[2] == c[2] and r[0] != c[0] and r[3] != c[3] \ or r[1] == c[1] and r[3] == c[3] and r[0] != c[0] and r[2] != c[2] \ or r[2] == c[2] and r[3] == c[3] and r[0] != c[0] and r[1] != c[1] : p = 2 if r[0] in c and r[1] in c and r[2] in c and r[3] in c : k = 4 elif r[0] in c and r[1] in c and r[2] in c and r[3] not in c \ or r[0] in c and r[1] in c and r[3] in c and r[2] not in c \ or r[0] in c and r[2] in c and r[3] in c and r[1] not in c \ or r[1] in c and r[2] in c and r[3] in c and r[0] not in c : k = 3 elif r[0] in c and r[1] in c and r[2] not in c and r[3] not in c \ or r[0] in c and r[2] in c and r[1] not in c and r[3] not in c \ or r[0] in c and r[3] in c and r[1] not in c and r[2] not in c \ or r[1] in c and r[2] in c and r[0] not in c and r[3] not in c \ or r[1] in c and r[3] in c and r[0] not in c and r[2] not in c \ or r[2] in c and r[3] in c and r[0] not in c and r[1] not in c : k = 2 elif r[0] in c and r[1] not in c and r[2] not in c and r[3] not in c \ or r[1] in c and r[0] not in c and r[2] not in c and r[3] not in c \ or r[2] in c and r[0] not in c and r[1] not in c and r[3] not in c \ or r[3] in c and r[0] not in c and r[1] not in c and r[2] not in c : k = 1 elif r[0] == c[0] and r[1] != c[1] and r[2] != c[2] and r[3] != c[3] \ or r[1] == c[1] and r[0] != c[0] and r[2] != c[2] and r[3] != c[3] \ or r[2] == c[2] and r[0] != c[0] and r[1] != c[1] and r[3] != c[3] \ or r[3] == c[3] and r[0] != c[0] and r[1] != c[1] and r[2] != c[2] : p = 1 if r[0] in c and r[1] in c and r[2] in c and r[3] in c : k = 4 elif r[0] in c and r[1] in c and r[2] in c and r[3] not in c \ or r[0] in c and r[1] in c and r[3] in c and r[2] not in c \ or r[0] in c and r[2] in c and r[3] in c and r[1] not in c \ or r[1] in c and r[2] in c and r[3] in c and r[0] not in c : k = 3 elif r[0] in c and r[1] in c and r[2] not in c and r[3] not in c \ or r[0] in c and r[2] in c and r[1] not in c and r[3] not in c \ or r[0] in c and r[3] in c and r[1] not in c and r[2] not in c \ or r[1] in c and r[2] in c and r[0] not in c and r[3] not in c \ or r[1] in c and r[3] in c and r[0] not in c and r[2] not in c \ or r[2] in c and r[3] in c and r[0] not in c and r[1] not in c : k = 2 elif r[0] in c and r[1] not in c and r[2] not in c and r[3] not in c \ or r[1] in c and r[0] not in c and r[2] not in c and r[3] not in c \ or r[2] in c and r[0] not in c and r[1] not in c and r[3] not in c \ or r[3] in c and r[0] not in c and r[1] not in c and r[2] not in c : k = 1 elif r[0] != c[0] and r[1] != c[1] and r[2] != c[2] and r[3] != c[3] : p = 0 if r[0] in c and r[1] in c and r[2] in c and r[3] in c : k = 4 elif r[0] in c and r[1] in c and r[2] in c and r[3] not in c \ or r[0] in c and r[1] in c and r[3] in c and r[2] not in c \ or r[0] in c and r[2] in c and r[3] in c and r[1] not in c \ or r[1] in c and r[2] in c and r[3] in c and r[0] not in c : k = 3 elif r[0] in c and r[1] in c and r[2] not in c and r[3] not in c \ or r[0] in c and r[2] in c and r[1] not in c and r[3] not in c \ or r[0] in c and r[3] in c and r[1] not in c and r[2] not in c \ or r[1] in c and r[2] in c and r[0] not in c and r[3] not in c \ or r[1] in c and r[3] in c and r[0] not in c and r[2] not in c \ or r[2] in c and r[3] in c and r[0] not in c and r[1] not in c : k = 2 elif r[0] in c and r[1] not in c and r[2] not in c and r[3] not in c \ or r[1] in c and r[0] not in c and r[2] not in c and r[3] not in c \ or r[2] in c and r[0] not in c and r[1] not in c and r[3] not in c \ or r[3] in c and r[0] not in c and r[1] not in c and r[2] not in c : k = 1 v = k-p x = 4-p-v if p==4 and v==0 and x==0 : print("Congratulations! You won the game.") else : print(" P="+str(p)+",V="+str(v)+",X="+str(x)) name = input('Turn #4 : ') r = name if r[0] == c[0] and r[1] == c[1] and r[2] == c[2] and r[3] == c[3] : p = 4 if r[0] in c and r[1] in c and r[2] in c and r[3] in c : k = 4 elif r[0] in c and r[1] in c and r[2] in c and r[3] not in c \ or r[0] in c and r[1] in c and r[3] in c and r[2] not in c \ or r[0] in c and r[2] in c and r[3] in c and r[1] not in c \ or r[1] in c and r[2] in c and r[3] in c and r[0] not in c : k = 3 elif r[0] in c and r[1] in c and r[2] not in c and r[3] not in c \ or r[0] in c and r[2] in c and r[1] not in c and r[3] not in c \ or r[0] in c and r[3] in c and r[1] not in c and r[2] not in c \ or r[1] in c and r[2] in c and r[0] not in c and r[3] not in c \ or r[1] in c and r[3] in c and r[0] not in c and r[2] not in c \ or r[2] in c and r[3] in c and r[0] not in c and r[1] not in c : k = 2 elif r[0] in c and r[1] not in c and r[2] not in c and r[3] not in c \ or r[1] in c and r[0] not in c and r[2] not in c and r[3] not in c \ or r[2] in c and r[0] not in c and r[1] not in c and r[3] not in c \ or r[3] in c and r[0] not in c and r[1] not in c and r[2] not in c : k = 1 elif r[0] == c[0] and r[1] == c[1] and r[2] == c[2] and r[3] != c[3] \ or r[0] == c[0] and r[1] == c[1] and r[3] == c[3] and r[2] != c[2] \ or r[0] == c[0] and r[2] == c[2] and r[3] == c[3] and r[1] != c[1] \ or r[1] == c[1] and r[2] == c[2] and r[3] == c[3] and r[0] != c[0] : p = 3 if r[0] in c and r[1] in c and r[2] in c and r[3] in c : k = 4 elif r[0] in c and r[1] in c and r[2] in c and r[3] not in c \ or r[0] in c and r[1] in c and r[3] in c and r[2] not in c \ or r[0] in c and r[2] in c and r[3] in c and r[1] not in c \ or r[1] in c and r[2] in c and r[3] in c and r[0] not in c : k = 3 elif r[0] in c and r[1] in c and r[2] not in c and r[3] not in c \ or r[0] in c and r[2] in c and r[1] not in c and r[3] not in c \ or r[0] in c and r[3] in c and r[1] not in c and r[2] not in c \ or r[1] in c and r[2] in c and r[0] not in c and r[3] not in c \ or r[1] in c and r[3] in c and r[0] not in c and r[2] not in c \ or r[2] in c and r[3] in c and r[0] not in c and r[1] not in c : k = 2 elif r[0] in c and r[1] not in c and r[2] not in c and r[3] not in c \ or r[1] in c and r[0] not in c and r[2] not in c and r[3] not in c \ or r[2] in c and r[0] not in c and r[1] not in c and r[3] not in c \ or r[3] in c and r[0] not in c and r[1] not in c and r[2] not in c : k = 1 elif r[0] == c[0] and r[1] == c[1] and r[2] != c[2] and r[3] != c[3] \ or r[0] == c[0] and r[2] == c[2] and r[1] != c[1] and r[3] != c[3] \ or r[0] == c[0] and r[3] == c[3] and r[1] != c[1] and r[2] != c[2] \ or r[1] == c[1] and r[2] == c[2] and r[0] != c[0] and r[3] != c[3] \ or r[1] == c[1] and r[3] == c[3] and r[0] != c[0] and r[2] != c[2] \ or r[2] == c[2] and r[3] == c[3] and r[0] != c[0] and r[1] != c[1] : p = 2 if r[0] in c and r[1] in c and r[2] in c and r[3] in c : k = 4 elif r[0] in c and r[1] in c and r[2] in c and r[3] not in c \ or r[0] in c and r[1] in c and r[3] in c and r[2] not in c \ or r[0] in c and r[2] in c and r[3] in c and r[1] not in c \ or r[1] in c and r[2] in c and r[3] in c and r[0] not in c : k = 3 elif r[0] in c and r[1] in c and r[2] not in c and r[3] not in c \ or r[0] in c and r[2] in c and r[1] not in c and r[3] not in c \ or r[0] in c and r[3] in c and r[1] not in c and r[2] not in c \ or r[1] in c and r[2] in c and r[0] not in c and r[3] not in c \ or r[1] in c and r[3] in c and r[0] not in c and r[2] not in c \ or r[2] in c and r[3] in c and r[0] not in c and r[1] not in c : k = 2 elif r[0] in c and r[1] not in c and r[2] not in c and r[3] not in c \ or r[1] in c and r[0] not in c and r[2] not in c and r[3] not in c \ or r[2] in c and r[0] not in c and r[1] not in c and r[3] not in c \ or r[3] in c and r[0] not in c and r[1] not in c and r[2] not in c : k = 1 elif r[0] == c[0] and r[1] != c[1] and r[2] != c[2] and r[3] != c[3] \ or r[1] == c[1] and r[0] != c[0] and r[2] != c[2] and r[3] != c[3] \ or r[2] == c[2] and r[0] != c[0] and r[1] != c[1] and r[3] != c[3] \ or r[3] == c[3] and r[0] != c[0] and r[1] != c[1] and r[2] != c[2] : p = 1 if r[0] in c and r[1] in c and r[2] in c and r[3] in c : k = 4 elif r[0] in c and r[1] in c and r[2] in c and r[3] not in c \ or r[0] in c and r[1] in c and r[3] in c and r[2] not in c \ or r[0] in c and r[2] in c and r[3] in c and r[1] not in c \ or r[1] in c and r[2] in c and r[3] in c and r[0] not in c : k = 3 elif r[0] in c and r[1] in c and r[2] not in c and r[3] not in c \ or r[0] in c and r[2] in c and r[1] not in c and r[3] not in c \ or r[0] in c and r[3] in c and r[1] not in c and r[2] not in c \ or r[1] in c and r[2] in c and r[0] not in c and r[3] not in c \ or r[1] in c and r[3] in c and r[0] not in c and r[2] not in c \ or r[2] in c and r[3] in c and r[0] not in c and r[1] not in c : k = 2 elif r[0] in c and r[1] not in c and r[2] not in c and r[3] not in c \ or r[1] in c and r[0] not in c and r[2] not in c and r[3] not in c \ or r[2] in c and r[0] not in c and r[1] not in c and r[3] not in c \ or r[3] in c and r[0] not in c and r[1] not in c and r[2] not in c : k = 1 elif r[0] != c[0] and r[1] != c[1] and r[2] != c[2] and r[3] != c[3] : p = 0 if r[0] in c and r[1] in c and r[2] in c and r[3] in c : k = 4 elif r[0] in c and r[1] in c and r[2] in c and r[3] not in c \ or r[0] in c and r[1] in c and r[3] in c and r[2] not in c \ or r[0] in c and r[2] in c and r[3] in c and r[1] not in c \ or r[1] in c and r[2] in c and r[3] in c and r[0] not in c : k = 3 elif r[0] in c and r[1] in c and r[2] not in c and r[3] not in c \ or r[0] in c and r[2] in c and r[1] not in c and r[3] not in c \ or r[0] in c and r[3] in c and r[1] not in c and r[2] not in c \ or r[1] in c and r[2] in c and r[0] not in c and r[3] not in c \ or r[1] in c and r[3] in c and r[0] not in c and r[2] not in c \ or r[2] in c and r[3] in c and r[0] not in c and r[1] not in c : k = 2 elif r[0] in c and r[1] not in c and r[2] not in c and r[3] not in c \ or r[1] in c and r[0] not in c and r[2] not in c and r[3] not in c \ or r[2] in c and r[0] not in c and r[1] not in c and r[3] not in c \ or r[3] in c and r[0] not in c and r[1] not in c and r[2] not in c : k = 1 v = k-p x = 4-p-v if p==4 and v==0 and x==0 : print("Congratulations! You won the game.") else : print(" P="+str(p)+",V="+str(v)+",X="+str(x)) print("Sorry! You just lost it.") print("The answer is "+code) print("Please try again...") |
# 6330474221 (20.00) 309 (2021-02-15 18:08) x= input("Turn #1 : ") y=[code[0],code[1],code[2],code[3]] P=0 V=0 X=0 if x[0] in y: if x[0] == y[0]: P +=1 else: V +=1 else: X +=1 if x[1] in y: if x[1] == y[1]: P +=1 else: V +=1 else: X +=1 if x[2] in y: if x[2] == y[2]: P +=1 else: V +=1 else: X +=1 if x[3] in y: if x[3] == y[3]: P +=1 else: V +=1 else: X +=1 if x == code: print(WINNING_MSG) else: print(" "+"P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) x=input("Turn #2 : ") P=0 V=0 X=0 if x[0] in y: if x[0] == y[0]: P +=1 else: V +=1 else: X +=1 if x[1] in y: if x[1] == y[1]: P +=1 else: V +=1 else: X +=1 if x[2] in y: if x[2] == y[2]: P +=1 else: V +=1 else: X +=1 if x[3] in y: if x[3] == y[3]: P +=1 else: V +=1 else: X +=1 if x == code: print(WINNING_MSG) else: print(" "+"P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) x=input("Turn #3 : ") P=0 V=0 X=0 if x[0] in y: if x[0] == y[0]: P +=1 else: V +=1 else: X +=1 if x[1] in y: if x[1] == y[1]: P +=1 else: V +=1 else: X +=1 if x[2] in y: if x[2] == y[2]: P +=1 else: V +=1 else: X +=1 if x[3] in y: if x[3] == y[3]: P +=1 else: V +=1 else: X +=1 if x == code: print(WINNING_MSG) else: print(" "+"P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) x=input("Turn #4 : ") P=0 V=0 X=0 if x[0] in y: if x[0] == y[0]: P +=1 else: V +=1 else: X +=1 if x[1] in y: if x[1] == y[1]: P +=1 else: V +=1 else: X +=1 if x[2] in y: if x[2] == y[2]: P +=1 else: V +=1 else: X +=1 if x[3] in y: if x[3] == y[3]: P +=1 else: V +=1 else: X +=1 if x == code: print(WINNING_MSG) else: print(" "+"P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) print(LOSING_MSG) print("The answer is",code) print("Please try again...") |
# 6330475921 (20.00) 310 (2021-02-15 21:34) setzero=[""]*4 #print(setzero) P=0 V=0 X=0 setzero[0]=code[0] setzero[1]=code[1] setzero[2]=code[2] setzero[3]=code[3] a=input("Turn #1 : ") if a[0]==setzero[0]: P+=1 if a[0] in setzero: V+=1 if a[1]==setzero[1]: P+=1 if a[1] in setzero: V+=1 if a[2]==setzero[2]: P+=1 if a[2] in setzero: V+=1 if a[3]==setzero[3]: P+=1 if a[3] in setzero: V+=1 V=V-P X=4-V-P if P==4: print(WINNING_MSG) else : print(" "*len("Turn #2 :"),"P="+str(P)+",V="+str(V)+",X="+str(X)) P=0 V=0 X=0 a=input("Turn #2 : ") if a[0]==setzero[0]: P+=1 if a[0] in setzero: V+=1 if a[1]==setzero[1]: P+=1 if a[1] in setzero: V+=1 if a[2]==setzero[2]: P+=1 if a[2] in setzero: V+=1 if a[3]==setzero[3]: P+=1 if a[3] in setzero: V+=1 V=V-P X=4-V-P if P==4: print(WINNING_MSG) else : print(" "*len("Turn #2 :"),"P="+str(P)+",V="+str(V)+",X="+str(X)) P=0 V=0 X=0 a=input("Turn #3 : ") if a[0]==setzero[0]: P+=1 if a[0] in setzero: V+=1 if a[1]==setzero[1]: P+=1 if a[1] in setzero: V+=1 if a[2]==setzero[2]: P+=1 if a[2] in setzero: V+=1 if a[3]==setzero[3]: P+=1 if a[3] in setzero: V+=1 V=V-P X=4-V-P if P==4: print(WINNING_MSG) else : print(" "*len("Turn #2 :"),"P="+str(P)+",V="+str(V)+",X="+str(X)) P=0 V=0 X=0 a=input("Turn #4 : ") if a[0]==setzero[0]: P+=1 if a[0] in setzero: V+=1 if a[1]==setzero[1]: P+=1 if a[1] in setzero: V+=1 if a[2]==setzero[2]: P+=1 if a[2] in setzero: V+=1 if a[3]==setzero[3]: P+=1 if a[3] in setzero: V+=1 V=V-P X=4-V-P if P==4: print(WINNING_MSG) else : print(" "*len("Turn #2 :"),"P="+str(P)+",V="+str(V)+",X="+str(X)) print(LOSING_MSG) print("The answer is ",code) print("Please try again...") |
# 6330476521 (19.74) 311 (2021-02-14 01:25) P = 0; V = 0; X = 4 chance = 4 if chance == 4: cb = input("TURN #1 : ") chance -= 1 if code == cb : print(WINNING_MSG) if cb[0] in code: V += 1 X -= 1 if cb[0] == code[0]: P += 1 V -= 1 if cb[1] in code: V += 1 X -= 1 if cb[1] == code[1]: P += 1 V -= 1 if cb[2] in code: V += 1 X -= 1 if cb[2] == code[2]: P += 1 V -= 1 if cb[3] in code: V += 1 X -= 1 if cb[3] == code[3]: P += 1 V -= 1 if P != 4: print(" "+"P="+str(P)+",V="+str(V)+",X="+str(X)) P = 0; V = 0; X = 4 if chance == 3 and P != 4: cb = input("TURN #2 : ") chance -= 1 if code == cb : print(WINNING_MSG) if cb[0] in code: V += 1 X -= 1 if cb[0] == code[0]: P += 1 V -= 1 if cb[1] in code: V += 1 X -= 1 if cb[1] == code[1]: P += 1 V -= 1 if cb[2] in code: V += 1 X -= 1 if cb[2] == code[2]: P += 1 V -= 1 if cb[3] in code: V += 1 X -= 1 if cb[3] == code[3]: P += 1 V -= 1 if P != 4: print(" "+"P="+str(P)+",V="+str(V)+",X="+str(X)) P = 0; V = 0; X = 4 if chance == 2 and P != 4: cb = input("TURN #3 : ") chance -= 1 if code == cb : print(WINNING_MSG) if cb[0] in code: V += 1 X -= 1 if cb[0] == code[0]: P += 1 V -= 1 if cb[1] in code: V += 1 X -= 1 if cb[1] == code[1]: P += 1 V -= 1 if cb[2] in code: V += 1 X -= 1 if cb[2] == code[2]: P += 1 V -= 1 if cb[3] in code: V += 1 X -= 1 if cb[3] == code[3]: P += 1 V -= 1 if P != 4: print(" "+"P="+str(P)+",V="+str(V)+",X="+str(X)) P = 0; V = 0; X = 4 if chance == 1 and P != 4: cb = input("TURN #4 : ") chance -= 1 if code == cb : print(WINNING_MSG) if cb[0] in code: V += 1 X -= 1 if cb[0] == code[0]: P += 1 V -= 1 if cb[1] in code: V += 1 X -= 1 if cb[1] == code[1]: P += 1 V -= 1 if cb[2] in code: V += 1 X -= 1 if cb[2] == code[2]: P += 1 V -= 1 if cb[3] in code: V += 1 X -= 1 if cb[3] == code[3]: P += 1 V -= 1 if P != 4: print(" "+"P="+str(P)+",V="+str(V)+",X="+str(X)) print(LOSING_MSG) print("The answer is",code) print("Please try again...") |
# 6330477121 (20.00) 312 (2021-02-15 23:00) play = input('Turn #1 : ') if play == code: print(WINNING_MSG) else: p = 0 if play[0] == code[0]: p = p+1 if play[1] == code[1]: p = p+1 if play[2] == code[2]: p = p+1 if play[3] == code[3]: p = p+1 v = 0 if (play[0] == code[1]) or (play[0] == code[2]) or (play[0] == code[3]): v = v+1 if (play[1] == code[0]) or (play[1] == code[2]) or (play[1] == code[3]): v = v+1 if (play[2] == code[0]) or (play[2] == code[1]) or (play[2] == code[3]): v = v+1 if (play[3] == code[0]) or (play[3] == code[1]) or (play[3] == code[2]): v = v+1 x = 4-(p+v) print(' ' + 'P=' + str(p) + ',V=' + str(v) + ',X=' + str(x)) play = input('Turn #2 : ') if play == code: print(WINNING_MSG) else: p = 0 if play[0] == code[0]: p = p+1 if play[1] == code[1]: p = p+1 if play[2] == code[2]: p = p+1 if play[3] == code[3]: p = p+1 v = 0 if (play[0] == code[1]) or (play[0] == code[2]) or (play[0] == code[3]): v = v+1 if (play[1] == code[0]) or (play[1] == code[2]) or (play[1] == code[3]): v = v+1 if (play[2] == code[0]) or (play[2] == code[1]) or (play[2] == code[3]): v = v+1 if (play[3] == code[0]) or (play[3] == code[1]) or (play[3] == code[2]): v = v+1 x = 4-(p+v) print(' ' + 'P=' + str(p) + ',V=' + str(v) + ',X=' + str(x)) play = input('Turn #3 : ') if play == code: print(WINNING_MSG) else: p = 0 if play[0] == code[0]: p = p+1 if play[1] == code[1]: p = p+1 if play[2] == code[2]: p = p+1 if play[3] == code[3]: p = p+1 v = 0 if (play[0] == code[1]) or (play[0] == code[2]) or (play[0] == code[3]): v = v+1 if (play[1] == code[0]) or (play[1] == code[2]) or (play[1] == code[3]): v = v+1 if (play[2] == code[0]) or (play[2] == code[1]) or (play[2] == code[3]): v = v+1 if (play[3] == code[0]) or (play[3] == code[1]) or (play[3] == code[2]): v = v+1 x =4-(p+v) print(' ' + 'P=' + str(p) + ',V=' + str(v) + ',X=' + str(x)) play = input('Turn #4 : ') # เดาแค่สี่ครั้ง if play == code: print(WINNING_MSG) else: p = 0 if play[0] == code[0]: p = p+1 if play[1] == code[1]: p = p+1 if play[2] == code[2]: p = p+1 if play[3] == code[3]: p = p+1 v = 0 if (play[0] == code[1]) or (play[0] == code[2]) or (play[0] == code[3]): v = v+1 if (play[1] == code[0]) or (play[1] == code[2]) or (play[1] == code[3]): v = v+1 if (play[2] == code[0]) or (play[2] == code[1]) or (play[2] == code[3]): v = v+1 if (play[3] == code[0]) or (play[3] == code[1]) or (play[3] == code[2]): v = v+1 x =4-(p+v) print(' ' + 'P=' + str(p) + ',V=' + str(v) + ',X=' + str(x)) print(LOSING_MSG) print('The answer is ' + code) print('Please try again...') |
# 6330478821 (19.90) 313 (2021-02-15 01:08) P=0 V=0 X=0 m=input("Turn #1 :") if m[0]==code[0]: P+=1 else: if m[0]in code: V+=1 else: X+=1 if m[1]==code[1]: P+=1 else: if m[1]in code: V+=1 else: X+=1 if m[2]==code[2]: P+=1 else: if m[2]in code: V+=1 else: X+=1 if m[3]==code[3]: P+=1 else: if m[3]in code: V+=1 else: X+=1 if m==code: print(WINNING_MSG) else: print(" " + "P=" + str(P) + ",V=" + str(V) + ",X=" + str(X)) P=0 V=0 X=0 n=input("Turn #2 :") if n[0]==code[0]: P+=1 else: if n[0]in code: V+=1 else: X+=1 if n[1]==code[1]: P+=1 else: if n[1]in code: V+=1 else: X+=1 if n[2]==code[2]: P+=1 else: if n[2]in code: V+=1 else: X+=1 if n[3]==code[3]: P+=1 else: if n[3]in code: V+=1 else: X+=1 if n==code: print(WINNING_MSG) else: print(" " + "P=" + str(P) + ",V=" + str(V) + ",X=" + str(X)) P=0 V=0 X=0 q=input("Turn #3 :") if q[0]==code[0]: P+=1 else: if q[0]in code: V+=1 else: X+=1 if q[1]==code[1]: P+=1 else: if q[1]in code: V+=1 else: X+=1 if q[2]==code[2]: P+=1 else: if q[2]in code: V+=1 else: X+=1 if q[3]==code[3]: P+=1 else: if q[3]in code: V+=1 else: X+=1 if q==code: print(WINNING_MSG) else: print(" " + "P=" + str(P) + ",V=" + str(V) + ",X=" + str(X)) P=0 V=0 X=0 s=input("Turn #4 :") if s[0]==code[0]: P+=1 else: if s[0]in code: V+=1 else: X+=1 if s[1]==code[1]: P+=1 else: if s[1]in code: V+=1 else: X+=1 if s[2]==code[2]: P+=1 else: if s[2]in code: V+=1 else: X+=1 if s[3]==code[3]: P+=1 else: if s[3]in code: V+=1 else: X+=1 if s==code: print(WINNING_MSG) else: print(" " + "P=" + str(P) + ",V=" + str(V) + ",X=" + str(X)) print(LOSING_MSG) print('The answer is ' + code) print('Please try again...') |
# 6330481621 (19.81) 314 (2021-02-15 21:30) a=input("Turn 1# : ") P=0 V=0 X=0 if a[0] == code[0]: P+=1 if a[0] in code: V+=1 if a[1] == code[1]: P+=1 if a[1] in code: V+=1 if a[2] == code[2]: P+=1 if a[2] in code: V+=1 if a[3] == code[3]: P+=1 if a[3] in code: V+=1 V=V-P X=4-V-P if P==4: print(WINNING_MSG) else : print(" "*len("Turn i# : ")+"P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) b=input("Turn 2# : ") P=0 V=0 X=0 if b[0] == code[0]: P+=1 if b[0] in code: V+=1 if b[1] == code[1]: P+=1 if b[1] in code: V+=1 if b[2] == code[2]: P+=1 if b[2] in code: V+=1 if b[3] == code[3]: P+=1 if b[3] in code: V+=1 V=V-P X=4-V-P if P==4: print(WINNING_MSG) else: print(" "*len("Turn i# : ")+"P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) c=input("Turn 3# : ") P=0 V=0 X=0 if c[0] == code[0]: P+=1 if c[0] in code: V+=1 if c[1] == code[1]: P+=1 if c[1] in code: V+=1 if c[2] == code[2]: P+=1 if c[2] in code: V+=1 if c[3] == code[3]: P+=1 if c[3] in code: V+=1 V=V-P X=4-V-P if P==4: print(WINNING_MSG) else: print(" "*len("Turn i# : ")+"P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) d=input("Turn 4# : ") P=0 V=0 X=0 if d[0] == code[0]: P+=1 if d[0] in code: V+=1 if d[1] == code[1]: P+=1 if d[1] in code: V+=1 if d[2] == code[2]: P+=1 if d[2] in code: V+=1 if d[3] == code[3]: P+=1 if d[3] in code: V+=1 V=V-P X=4-V-P if P==4: print(WINNING_MSG) else: print(" "*len("Turn i# : ")+"P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) print(LOSING_MSG) print("The answer is "+code) print("Please try again...") |
# 6330482221 (20.00) 315 (2021-02-13 16:45) l = ['']*4 l[0] = code[0];l[1] = code[1];l[2] = code[2];l[3] = code[3] ans = input("Turn #1 : ") P = 0;V = 0;X = 0 if ans == code : print(WINNING_MSG) else: if ans[0] == l[0]: P += 1 elif ans[0] in l: V += 1 elif ans[0] not in l:X += 1 if ans[1] == l[1]: P += 1 elif ans[1] in l: V += 1 elif ans[1] not in l:X += 1 if ans[2] == l[2]: P += 1 elif ans[2] in l: V += 1 elif ans[2] not in l:X += 1 if ans[3] == l[3]: P += 1 elif ans[3] in l: V += 1 elif ans[3] not in l:X += 1 print(len("Turn #1 : ")*" "+"P="+str(P)+","+"V="+str(V)+",""X="+str(X)) ans = input("Turn #2 : ") P = 0;V = 0;X = 0 if ans == code : print(WINNING_MSG) else: if ans[0] == l[0]: P += 1 elif ans[0] in l: V += 1 elif ans[0] not in l:X += 1 if ans[1] == l[1]: P += 1 elif ans[1] in l: V += 1 elif ans[1] not in l:X += 1 if ans[2] == l[2]: P += 1 elif ans[2] in l: V += 1 elif ans[2] not in l:X += 1 if ans[3] == l[3]: P += 1 elif ans[3] in l: V += 1 elif ans[3] not in l:X += 1 print(len("Turn #1 : ")*" "+"P="+str(P)+","+"V="+str(V)+",""X="+str(X)) ans = input("Turn #3 : ") P = 0;V = 0;X = 0 if ans == code : print(WINNING_MSG) else: if ans[0] == l[0]: P += 1 elif ans[0] in l: V += 1 elif ans[0] not in l:X += 1 if ans[1] == l[1]: P += 1 elif ans[1] in l: V += 1 elif ans[1] not in l:X += 1 if ans[2] == l[2]: P += 1 elif ans[2] in l: V += 1 elif ans[2] not in l:X += 1 if ans[3] == l[3]: P += 1 elif ans[3] in l: V += 1 elif ans[3] not in l:X += 1 print(len("Turn #1 : ")*" "+"P="+str(P)+","+"V="+str(V)+",""X="+str(X)) ans = input("Turn #4 : ") P = 0;V = 0;X = 0 if ans == code : print(WINNING_MSG) else: if ans[0] == l[0]: P += 1 elif ans[0] in l: V += 1 elif ans[0] not in l:X += 1 if ans[1] == l[1]: P += 1 elif ans[1] in l: V += 1 elif ans[1] not in l:X += 1 if ans[2] == l[2]: P += 1 elif ans[2] in l: V += 1 elif ans[2] not in l:X += 1 if ans[3] == l[3]: P += 1 elif ans[3] in l: V += 1 elif ans[3] not in l:X += 1 print(len("Turn #1 : ")*" "+"P="+str(P)+","+"V="+str(V)+",""X="+str(X)) print(LOSING_MSG) print("The answer is ",code) print("Please try again"+"...") # %% |
# 6330483921 (19.11) 316 (2021-02-15 23:16) a=input('Turn #1 : ') V=0 U=0 if a[0] != code[0] and a[1] != code[1] and a[2] != code[2] and a[3] != code[3] : if a[0] in code : V=V+1 if a[1] in code : V=V+1 if a[2] in code : V=V+1 if a[3] in code : V=V+1 if code[0] in a : U=U+1 if code[1] in a : U=U+1 if code[2] in a : U=U+1 if code[3] in a : U=U+1 P=0 V=min(V,U) X=4-P-V if a[0] == code[0] and a[1] != code[1] and a[2] != code[2] and a[3] != code[3] : a1=a[1::] code1=code[1::] if a1[0] in code1 : V=V+1 if a1[1] in code1 : V=V+1 if a1[2] in code1 : V=V+1 if code1[0] in a1 : U=U+1 if code1[1] in a1 : U=U+1 if code1[2] in a1 : U=U+1 P=1 V=min(V,U) X=4-P-V if a[1] == code[1] and a[0] != code[0] and a[2] != code[2] and a[3] != code[3] : a2=a[0]+a[2::] code2=code[0]+code[2::] if a2[0] in code2 : V=V+1 if a2[1] in code2 : V=V+1 if a2[2] in code2 : V=V+1 if code2[0] in a2 : U=U+1 if code2[1] in a2 : U=U+1 if code2[2] in a2 : U=U+1 P=1 V=min(V,U) X=4-P-V if a[2] == code[2] and a[1] != code[1] and a[0] != code[0] and a[3] != code[3] : a3=a[:2:]+a[3] code3=code[:2:]+code[3] if a3[0] in code3 : V=V+1 if a3[1] in code3 : V=V+1 if a3[2] in code3 : V=V+1 if code3[0] in a3 : U=U+1 if code3[1] in a3 : U=U+1 if code3[2] in a3 : U=U+1 P=1 V=min(V,U) X=4-P-V if a[1] != code[1] and a[3] == code[3] and a[2] != code[2] and a[0] != code[0] : a4=a[:3:] code4=code[:3:] if a4[0] in code4 : V=V+1 if a4[1] in code4 : V=V+1 if a4[2] in code4 : V=V+1 if code4[0] in a4 : U=U+1 if code4[1] in a4 : U=U+1 if code4[2] in a4 : U=U+1 P=1 V=min(V,U) X=4-P-V if a[0] == code[0] and a[1] == code[1] and a[2] != code[2] and a[3] != code[3] : a5=a[2::] code5=code[2::] if a5[0] in code5 : V=V+1 if a5[1] in code5 : V=V+1 if code5[0] in a5 : U=U+1 if code5[1] in a5 : U=U+1 P=2 V=min(V,U) X=4-P-V if a[0] == code[0] and a[2] == code[2] and a[1] != code[1] and a[3] != code[3] : a6=a[1]+a[3] code6=code[1]+code[3] if a6[0] in code6 : V=V+1 if a6[1] in code6 : V=V+1 if code6[0] in a6 : U=U+1 if code6[1] in a6 : U=U+1 P=2 V=min(V,U) X=4-P-V if a[0] == code[0] and a[3] == code[3] and a[2] != code[2] and a[1] != code[1] : a7=a[1:3:] code7=code[1:3:] if a7[0] in code7 : V=V+1 if a7[1] in code7 : V=V+1 if code7[0] in a7 : U=U+1 if code7[1] in a7 : U=U+1 P=2 V=min(V,U) X=4-P-V if a[1] == code[1] and a[2] == code[2] and a[0] != code[0] and a[3] != code[3] : a8=a[0]+a[3] code8=code[0]+code[3] if a8[0] in code8 : V=V+1 if a8[1] in code8 : V=V+1 if code8[0] in a8 : U=U+1 if code8[1] in a8 : U=U+1 P=2 V=min(V,U) X=4-P-V if a[1] == code[1] and a[3] == code[3] and a[2] != code[2] and a[0] != code[0] : a9=a[0]+a[2] code9=code[0]+code[2] if a9[0] in code9 : V=V+1 if a9[1] in code9 : V=V+1 if code9[0] in a9 : U=U+1 if code9[1] in a9 : U=U+1 P=2 V=min(V,U) X=4-P-V if a[2] == code[2] and a[3] == code[3] and a[1] != code[1] and a[0] != code[0] : a11=a[0:2:] code11=code[0:2:] if a11[0] in code11 : V=V+1 if a11[1] in code11 : V=V+1 if code11[0] in a11 : U=U+1 if code11[1] in a11 : U=U+1 P=2 V=min(V,U) X=4-P-V if a[0] == code[0] and a[1] == code[1] and a[2] == code[2] and a[3] != code[3] : P=3 X=4-P-V if a[0] == code[0] and a[1] == code[1] and a[3] == code[3] and a[2] != code[2] : P=3 X=4-P-V if a[0] == code[0] and a[3] == code[3] and a[2] == code[2] and a[1] != code[1] : P=3 X=4-P-V if a[1] == code[1] and a[3] == code[3] and a[2] == code[2] and a[0] != code[0] : P=3 X=4-P-V if a[0] == code[0] and a[1] == code[1] and a[2] == code[2] and a[3] == code[3] : P=4 X=4-P-V print(' P='+str(P)+',V='+str(V)+',X='+str(X)) if a != code : a=input('Turn #2 : ') V=0 U=0 if a[0] != code[0] and a[1] != code[1] and a[2] != code[2] and a[3] != code[3] : if a[0] in code : V=V+1 if a[1] in code : V=V+1 if a[2] in code : V=V+1 if a[3] in code : V=V+1 if code[0] in a : U=U+1 if code[1] in a : U=U+1 if code[2] in a : U=U+1 if code[3] in a : U=U+1 P=0 V=min(V,U) X=4-P-V if a[0] == code[0] and a[1] != code[1] and a[2] != code[2] and a[3] != code[3] : a1=a[1::] code1=code[1::] if a1[0] in code1 : V=V+1 if a1[1] in code1 : V=V+1 if a1[2] in code1 : V=V+1 if code1[0] in a1 : U=U+1 if code1[1] in a1 : U=U+1 if code1[2] in a1 : U=U+1 P=1 V=min(V,U) X=4-P-V if a[1] == code[1] and a[0] != code[0] and a[2] != code[2] and a[3] != code[3] : a2=a[0]+a[2::] code2=code[0]+code[2::] if a2[0] in code2 : V=V+1 if a2[1] in code2 : V=V+1 if a2[2] in code2 : V=V+1 if code2[0] in a2 : U=U+1 if code2[1] in a2 : U=U+1 if code2[2] in a2 : U=U+1 P=1 V=min(V,U) X=4-P-V if a[2] == code[2] and a[1] != code[1] and a[0] != code[0] and a[3] != code[3] : a3=a[:2:]+a[3] code3=code[:2:]+code[3] if a3[0] in code3 : V=V+1 if a3[1] in code3 : V=V+1 if a3[2] in code3 : V=V+1 if code3[0] in a3 : U=U+1 if code3[1] in a3 : U=U+1 if code3[2] in a3 : U=U+1 P=1 V=min(V,U) X=4-P-V if a[1] != code[1] and a[3] == code[3] and a[2] != code[2] and a[0] != code[0] : a4=a[:3:] code4=code[:3:] if a4[0] in code4 : V=V+1 if a4[1] in code4 : V=V+1 if a4[2] in code4 : V=V+1 if code4[0] in a4 : U=U+1 if code4[1] in a4 : U=U+1 if code4[2] in a4 : U=U+1 P=1 V=min(V,U) X=4-P-V if a[0] == code[0] and a[1] == code[1] and a[2] != code[2] and a[3] != code[3] : a5=a[2::] code5=code[2::] if a5[0] in code5 : V=V+1 if a5[1] in code5 : V=V+1 if code5[0] in a5 : U=U+1 if code5[1] in a5 : U=U+1 P=2 V=min(V,U) X=4-P-V if a[0] == code[0] and a[2] == code[2] and a[1] != code[1] and a[3] != code[3] : a6=a[1]+a[3] code6=code[1]+code[3] if a6[0] in code6 : V=V+1 if a6[1] in code6 : V=V+1 if code6[0] in a6 : U=U+1 if code6[1] in a6 : U=U+1 P=2 V=min(V,U) X=4-P-V if a[0] == code[0] and a[3] == code[3] and a[2] != code[2] and a[1] != code[1] : a7=a[1:3:] code7=code[1:3:] if a7[0] in code7 : V=V+1 if a7[1] in code7 : V=V+1 if code7[0] in a7 : U=U+1 if code7[1] in a7 : U=U+1 P=2 V=min(V,U) X=4-P-V if a[1] == code[1] and a[2] == code[2] and a[0] != code[0] and a[3] != code[3] : a8=a[0]+a[3] code8=code[0]+code[3] if a8[0] in code8 : V=V+1 if a8[1] in code8 : V=V+1 if code8[0] in a8 : U=U+1 if code8[1] in a8 : U=U+1 P=2 V=min(V,U) X=4-P-V if a[1] == code[1] and a[3] == code[3] and a[2] != code[2] and a[0] != code[0] : a9=a[0]+a[2] code9=code[0]+code[2] if a9[0] in code9 : V=V+1 if a9[1] in code9 : V=V+1 if code9[0] in a9 : U=U+1 if code9[1] in a9 : U=U+1 P=2 V=min(V,U) X=4-P-V if a[2] == code[2] and a[3] == code[3] and a[1] != code[1] and a[0] != code[0] : a11=a[0:2:] code11=code[0:2:] if a11[0] in code11 : V=V+1 if a11[1] in code11 : V=V+1 if code11[0] in a11 : U=U+1 if code11[1] in a11 : U=U+1 P=2 V=min(V,U) X=4-P-V if a[0] == code[0] and a[1] == code[1] and a[2] == code[2] and a[3] != code[3] : P=3 X=4-P-V if a[0] == code[0] and a[1] == code[1] and a[3] == code[3] and a[2] != code[2] : P=3 X=4-P-V if a[0] == code[0] and a[3] == code[3] and a[2] == code[2] and a[1] != code[1] : P=3 X=4-P-V if a[1] == code[1] and a[3] == code[3] and a[2] == code[2] and a[0] != code[0] : P=3 X=4-P-V if a[0] == code[0] and a[1] == code[1] and a[2] == code[2] and a[3] == code[3] : P=4 X=4-P-V print(' P='+str(P)+',V='+str(V)+',X='+str(X)) if a != code : a=input('Turn #3 : ') V=0 U=0 if a[0] != code[0] and a[1] != code[1] and a[2] != code[2] and a[3] != code[3] : if a[0] in code : V=V+1 if a[1] in code : V=V+1 if a[2] in code : V=V+1 if a[3] in code : V=V+1 if code[0] in a : U=U+1 if code[1] in a : U=U+1 if code[2] in a : U=U+1 if code[3] in a : U=U+1 P=0 V=min(V,U) X=4-P-V if a[0] == code[0] and a[1] != code[1] and a[2] != code[2] and a[3] != code[3] : a1=a[1::] code1=code[1::] if a1[0] in code1 : V=V+1 if a1[1] in code1 : V=V+1 if a1[2] in code1 : V=V+1 if code1[0] in a1 : U=U+1 if code1[1] in a1 : U=U+1 if code1[2] in a1 : U=U+1 P=1 V=min(V,U) X=4-P-V if a[1] == code[1] and a[0] != code[0] and a[2] != code[2] and a[3] != code[3] : a2=a[0]+a[2::] code2=code[0]+code[2::] if a2[0] in code2 : V=V+1 if a2[1] in code2 : V=V+1 if a2[2] in code2 : V=V+1 if code2[0] in a2 : U=U+1 if code2[1] in a2 : U=U+1 if code2[2] in a2 : U=U+1 P=1 V=min(V,U) X=4-P-V if a[2] == code[2] and a[1] != code[1] and a[0] != code[0] and a[3] != code[3] : a3=a[:2:]+a[3] code3=code[:2:]+code[3] if a3[0] in code3 : V=V+1 if a3[1] in code3 : V=V+1 if a3[2] in code3 : V=V+1 if code3[0] in a3 : U=U+1 if code3[1] in a3 : U=U+1 if code3[2] in a3 : U=U+1 P=1 V=min(V,U) X=4-P-V if a[1] != code[1] and a[3] == code[3] and a[2] != code[2] and a[0] != code[0] : a4=a[:3:] code4=code[:3:] if a4[0] in code4 : V=V+1 if a4[1] in code4 : V=V+1 if a4[2] in code4 : V=V+1 if code4[0] in a4 : U=U+1 if code4[1] in a4 : U=U+1 if code4[2] in a4 : U=U+1 P=1 V=min(V,U) X=4-P-V if a[0] == code[0] and a[1] == code[1] and a[2] != code[2] and a[3] != code[3] : a5=a[2::] code5=code[2::] if a5[0] in code5 : V=V+1 if a5[1] in code5 : V=V+1 if code5[0] in a5 : U=U+1 if code5[1] in a5 : U=U+1 P=2 V=min(V,U) X=4-P-V if a[0] == code[0] and a[2] == code[2] and a[1] != code[1] and a[3] != code[3] : a6=a[1]+a[3] code6=code[1]+code[3] if a6[0] in code6 : V=V+1 if a6[1] in code6 : V=V+1 if code6[0] in a6 : U=U+1 if code6[1] in a6 : U=U+1 P=2 V=min(V,U) X=4-P-V if a[0] == code[0] and a[3] == code[3] and a[2] != code[2] and a[1] != code[1] : a7=a[1:3:] code7=code[1:3:] if a7[0] in code7 : V=V+1 if a7[1] in code7 : V=V+1 if code7[0] in a7 : U=U+1 if code7[1] in a7 : U=U+1 P=2 V=min(V,U) X=4-P-V if a[1] == code[1] and a[2] == code[2] and a[0] != code[0] and a[3] != code[3] : a8=a[0]+a[3] code8=code[0]+code[3] if a8[0] in code8 : V=V+1 if a8[1] in code8 : V=V+1 if code8[0] in a8 : U=U+1 if code8[1] in a8 : U=U+1 P=2 V=min(V,U) X=4-P-V if a[1] == code[1] and a[3] == code[3] and a[2] != code[2] and a[0] != code[0] : a9=a[0]+a[2] code9=code[0]+code[2] if a9[0] in code9 : V=V+1 if a9[1] in code9 : V=V+1 if code9[0] in a9 : U=U+1 if code9[1] in a9 : U=U+1 P=2 V=min(V,U) X=4-P-V if a[2] == code[2] and a[3] == code[3] and a[1] != code[1] and a[0] != code[0] : a11=a[0:2:] code11=code[0:2:] if a11[0] in code11 : V=V+1 if a11[1] in code11 : V=V+1 if code11[0] in a11 : U=U+1 if code11[1] in a11 : U=U+1 P=2 V=min(V,U) X=4-P-V if a[0] == code[0] and a[1] == code[1] and a[2] == code[2] and a[3] != code[3] : P=3 X=4-P-V if a[0] == code[0] and a[1] == code[1] and a[3] == code[3] and a[2] != code[2] : P=3 X=4-P-V if a[0] == code[0] and a[3] == code[3] and a[2] == code[2] and a[1] != code[1] : P=3 X=4-P-V if a[1] == code[1] and a[3] == code[3] and a[2] == code[2] and a[0] != code[0] : P=3 X=4-P-V if a[0] == code[0] and a[1] == code[1] and a[2] == code[2] and a[3] == code[3] : P=4 X=4-P-V print(' P='+str(P)+',V='+str(V)+',X='+str(X)) if a != code : a=input('Turn #4 : ') V=0 U=0 if a[0] != code[0] and a[1] != code[1] and a[2] != code[2] and a[3] != code[3] : if a[0] in code : V=V+1 if a[1] in code : V=V+1 if a[2] in code : V=V+1 if a[3] in code : V=V+1 if code[0] in a : U=U+1 if code[1] in a : U=U+1 if code[2] in a : U=U+1 if code[3] in a : U=U+1 P=0 V=min(V,U) X=4-P-V if a[0] == code[0] and a[1] != code[1] and a[2] != code[2] and a[3] != code[3] : a1=a[1::] code1=code[1::] if a1[0] in code1 : V=V+1 if a1[1] in code1 : V=V+1 if a1[2] in code1 : V=V+1 if code1[0] in a1 : U=U+1 if code1[1] in a1 : U=U+1 if code1[2] in a1 : U=U+1 P=1 V=min(V,U) X=4-P-V if a[1] == code[1] and a[0] != code[0] and a[2] != code[2] and a[3] != code[3] : a2=a[0]+a[2::] code2=code[0]+code[2::] if a2[0] in code2 : V=V+1 if a2[1] in code2 : V=V+1 if a2[2] in code2 : V=V+1 if code2[0] in a2 : U=U+1 if code2[1] in a2 : U=U+1 if code2[2] in a2 : U=U+1 P=1 V=min(V,U) X=4-P-V if a[2] == code[2] and a[1] != code[1] and a[0] != code[0] and a[3] != code[3] : a3=a[:2:]+a[3] code3=code[:2:]+code[3] if a3[0] in code3 : V=V+1 if a3[1] in code3 : V=V+1 if a3[2] in code3 : V=V+1 if code3[0] in a3 : U=U+1 if code3[1] in a3 : U=U+1 if code3[2] in a3 : U=U+1 P=1 V=min(V,U) X=4-P-V if a[1] != code[1] and a[3] == code[3] and a[2] != code[2] and a[0] != code[0] : a4=a[:3:] code4=code[:3:] if a4[0] in code4 : V=V+1 if a4[1] in code4 : V=V+1 if a4[2] in code4 : V=V+1 if code4[0] in a4 : U=U+1 if code4[1] in a4 : U=U+1 if code4[2] in a4 : U=U+1 P=1 V=min(V,U) X=4-P-V if a[0] == code[0] and a[1] == code[1] and a[2] != code[2] and a[3] != code[3] : a5=a[2::] code5=code[2::] if a5[0] in code5 : V=V+1 if a5[1] in code5 : V=V+1 if code5[0] in a5 : U=U+1 if code5[1] in a5 : U=U+1 P=2 V=min(V,U) X=4-P-V if a[0] == code[0] and a[2] == code[2] and a[1] != code[1] and a[3] != code[3] : a6=a[1]+a[3] code6=code[1]+code[3] if a6[0] in code6 : V=V+1 if a6[1] in code6 : V=V+1 if code6[0] in a6 : U=U+1 if code6[1] in a6 : U=U+1 P=2 V=min(V,U) X=4-P-V if a[0] == code[0] and a[3] == code[3] and a[2] != code[2] and a[1] != code[1] : a7=a[1:3:] code7=code[1:3:] if a7[0] in code7 : V=V+1 if a7[1] in code7 : V=V+1 if code7[0] in a7 : U=U+1 if code7[1] in a7 : U=U+1 P=2 V=min(V,U) X=4-P-V if a[1] == code[1] and a[2] == code[2] and a[0] != code[0] and a[3] != code[3] : a8=a[0]+a[3] code8=code[0]+code[3] if a8[0] in code8 : V=V+1 if a8[1] in code8 : V=V+1 if code8[0] in a8 : U=U+1 if code8[1] in a8 : U=U+1 P=2 V=min(V,U) X=4-P-V if a[1] == code[1] and a[3] == code[3] and a[2] != code[2] and a[0] != code[0] : a9=a[0]+a[2] code9=code[0]+code[2] if a9[0] in code9 : V=V+1 if a9[1] in code9 : V=V+1 if code9[0] in a9 : U=U+1 if code9[1] in a9 : U=U+1 P=2 V=min(V,U) X=4-P-V if a[2] == code[2] and a[3] == code[3] and a[1] != code[1] and a[0] != code[0] : a11=a[0:2:] code11=code[0:2:] if a11[0] in code11 : V=V+1 if a11[1] in code11 : V=V+1 if code11[0] in a11 : U=U+1 if code11[1] in a11 : U=U+1 P=2 V=min(V,U) X=4-P-V if a[0] == code[0] and a[1] == code[1] and a[2] == code[2] and a[3] != code[3] : P=3 X=4-P-V if a[0] == code[0] and a[1] == code[1] and a[3] == code[3] and a[2] != code[2] : P=3 X=4-P-V if a[0] == code[0] and a[3] == code[3] and a[2] == code[2] and a[1] != code[1] : P=3 X=4-P-V if a[1] == code[1] and a[3] == code[3] and a[2] == code[2] and a[0] != code[0] : P=3 X=4-P-V if a[0] == code[0] and a[1] == code[1] and a[2] == code[2] and a[3] == code[3] : P=4 X=4-P-V print(' P='+str(P)+',V='+str(V)+',X='+str(X)) if a != code : print(LOSING_MSG) print('The answer is',code) print('Please try again...') else : print(WINNING_MSG) |
# 6330484521 (19.11) 317 (2021-02-15 19:53) def select_card_number(c): P=0 V=0 X=0 if code[0]==c[0]: P=P+1 elif c[0] in code: V=V+1 else: X=X+1 if code[1]==c[1]: P=P+1 elif c[1] in code: V=V+1 else: X=X+1 if code[2]==c[2]: P=P+1 elif c[2] in code: V=V+1 else: X=X+1 if code[3]==c[3]: P=P+1 elif c[3] in code: V=V+1 else: X=X+1 print(' P={},V={},X={}'.format(P,V,X)) return P #--------------------------------------------------- c=input("Turn #1 : ") P=select_card_number(c) if P==4: print("Congratulations! You won the game.") else: c=input("Turn #2 : ") P=select_card_number(c) if P==4: print("Congratulations! You won the game.") else: c=input("Turn #3 : ") P=select_card_number(c) if P==4: print("Congratulations! You won the game.") else: c=input("Turn #4 : ") P=select_card_number(c) if P==4: print("Congratulations! You won the game.") else: print("Sorry! You just lost it.") print("The answer is ", code) print("Please try again...") |
# 6330485121 (20.00) 318 (2021-02-15 17:30) turn1 = input('Turn #1 : ') P=0 V=0 X=0 if turn1 == code: print(WINNING_MSG) else: if turn1[0] == code[0]: P += 1 elif turn1[0] in code: V += 1 else: X += 1 if turn1[1] == code[1]: P += 1 elif turn1[1] in code: V += 1 else: X += 1 if turn1[2] == code[2]: P += 1 elif turn1[2] in code: V += 1 else: X += 1 if turn1[3] == code[3]: P += 1 elif turn1[3] in code: V += 1 else: X += 1 print(' '*10 + 'P=' + str(P) + ',' + 'V=' + str(V) + ',' + 'X=' + str(X)) turn2 = input('Turn #2 : ') P=0 V=0 X=0 if turn2 == code: print(WINNING_MSG) else: if turn2[0] == code[0]: P += 1 elif turn2[0] in code: V += 1 else: X += 1 if turn2[1] == code[1]: P += 1 elif turn2[1] in code: V += 1 else: X += 1 if turn2[2] == code[2]: P += 1 elif turn2[2] in code: V += 1 else: X += 1 if turn2[3] == code[3]: P += 1 elif turn2[3] in code: V += 1 else: X += 1 print(' '*10 + 'P=' + str(P) + ',' + 'V=' + str(V) + ',' + 'X=' + str(X)) turn3 = input('Turn #3 : ') P=0 V=0 X=0 if turn3 == code: print(WINNING_MSG) else: if turn3[0] == code[0]: P += 1 elif turn3[0] in code: V += 1 else: X += 1 if turn3[1] == code[1]: P += 1 elif turn3[1] in code: V += 1 else: X += 1 if turn3[2] == code[2]: P += 1 elif turn3[2] in code: V += 1 else: X += 1 if turn3[3] == code[3]: P += 1 elif turn3[3] in code: V += 1 else: X += 1 print(' '*10 + 'P=' + str(P) + ',' + 'V=' + str(V) + ',' + 'X=' + str(X)) turn4 = input('Turn #4 : ') P=0 V=0 X=0 if turn4 == code: print(WINNING_MSG) else: if turn4[0] == code[0]: P += 1 elif turn4[0] in code: V += 1 else: X += 1 if turn4[1] == code[1]: P += 1 elif turn4[1] in code: V += 1 else: X += 1 if turn4[2] == code[2]: P += 1 elif turn4[2] in code: V += 1 else: X += 1 if turn4[3] == code[3]: P += 1 elif turn4[3] in code: V += 1 else: X += 1 print(' '*10 + 'P=' + str(P) + ',' + 'V=' + str(V) + ',' + 'X=' + str(X)) print(LOSING_MSG) print('The answer is ',code) print('Please try again...') |
# 6330486821 (20.00) 319 (2021-02-12 23:14) check = True if check: p,v = 0,0 dcode = input('Turn #1 : ') if dcode[0]==code[0]: p += 1 elif dcode[0] in code: v += 1 if dcode[1]==code[1]: p += 1 elif dcode[1] in code: v += 1 if dcode[2]==code[2]: p += 1 elif dcode[2] in code: v += 1 if dcode[3]==code[3]: p += 1 elif dcode[3] in code: v += 1 if p==4: print(WINNING_MSG) check = False else: print(' '*10+'P='+str(p)+',V='+str(v)+',X='+str(4-p-v)) if check: p,v = 0,0 dcode = input('Turn #2 : ') if dcode[0]==code[0]: p += 1 elif dcode[0] in code: v += 1 if dcode[1]==code[1]: p += 1 elif dcode[1] in code: v += 1 if dcode[2]==code[2]: p += 1 elif dcode[2] in code: v += 1 if dcode[3]==code[3]: p += 1 elif dcode[3] in code: v += 1 if p==4: print(WINNING_MSG) check = False else: print(' '*10+'P='+str(p)+',V='+str(v)+',X='+str(4-p-v)) if check: p,v = 0,0 dcode = input('Turn #3 : ') if dcode[0]==code[0]: p += 1 elif dcode[0] in code: v += 1 if dcode[1]==code[1]: p += 1 elif dcode[1] in code: v += 1 if dcode[2]==code[2]: p += 1 elif dcode[2] in code: v += 1 if dcode[3]==code[3]: p += 1 elif dcode[3] in code: v += 1 if p==4: print(WINNING_MSG) check = False else: print(' '*10+'P='+str(p)+',V='+str(v)+',X='+str(4-p-v)) if check: p,v = 0,0 dcode = input('Turn #4 : ') if dcode[0]==code[0]: p += 1 elif dcode[0] in code: v += 1 if dcode[1]==code[1]: p += 1 elif dcode[1] in code: v += 1 if dcode[2]==code[2]: p += 1 elif dcode[2] in code: v += 1 if dcode[3]==code[3]: p += 1 elif dcode[3] in code: v += 1 if p==4: print(WINNING_MSG) check = False else: print(' '*10+'P='+str(p)+',V='+str(v)+',X='+str(4-p-v)) if check: print(LOSING_MSG) print('The answer is ',code) print('Please try again...') |
# 6330487421 (20.00) 320 (2021-02-15 23:09) ans=input('Turn #1 : ') if ans==code: print(WINNING_MSG) else: p=0 if ans[0] == code[0]: p+=1 if ans[1] == code[1]: p+=1 if ans[2] == code[2]: p+=1 if ans[3] == code[3]: p+=1 w=0 if ans[0] in code: w+=1 if ans[1] in code: w+=1 if ans[2] in code: w+=1 if ans[3] in code: w+=1 v=w-p x=4-v-p print(' ' + 'P=' + str(p) + ',V=' + str(v) + ',X=' + str(x)) ans=input('Turn #2 : ') if ans==code: print(WINNING_MSG) else: p=0 if ans[0] == code[0]: p+=1 if ans[1] == code[1]: p+=1 if ans[2] == code[2]: p+=1 if ans[3] == code[3]: p+=1 w=0 if ans[0] in code: w+=1 if ans[1] in code: w+=1 if ans[2] in code: w+=1 if ans[3] in code: w+=1 v=w-p x=4-v-p print(' ' + 'P=' + str(p) + ',V=' + str(v) + ',X=' + str(x)) ans=input('Turn #3 : ') if ans==code: print(WINNING_MSG) else: p=0 if ans[0] == code[0]: p+=1 if ans[1] == code[1]: p+=1 if ans[2] == code[2]: p+=1 if ans[3] == code[3]: p+=1 w=0 if ans[0] in code: w+=1 if ans[1] in code: w+=1 if ans[2] in code: w+=1 if ans[3] in code: w+=1 v=w-p x=4-v-p print(' ' + 'P=' + str(p) + ',V=' + str(v) + ',X=' + str(x)) ans=input('Turn #4 : ') if ans==code: print(WINNING_MSG) else: p=0 if ans[0] == code[0]: p+=1 if ans[1] == code[1]: p+=1 if ans[2] == code[2]: p+=1 if ans[3] == code[3]: p+=1 w=0 if ans[0] in code: w+=1 if ans[1] in code: w+=1 if ans[2] in code: w+=1 if ans[3] in code: w+=1 v=w-p x=4-v-p print(' ' + 'P=' + str(p) + ',V=' + str(v) + ',X=' + str(x)) print(LOSING_MSG) print('The answer is ' + code) print('Please try again...') |
# 6330488021 (20.00) 321 (2021-02-12 13:47) p=0 v=0 x=0 a=input('Turn #1 : ') if a[0]in code[0] : p+=1 else: if a[0] in code: v+=1 else: x+=1 if a[1] in code[1] : p+=1 else: if a[1] in code: v+=1 else: x+=1 if a[2] in code[2] : p+=1 else: if a[2] in code: v+=1 else: x+=1 if a[3] in code[3] : p+=1 else: if a[3] in code: v+=1 else: x+=1 if p==4: print(WINNING_MSG) else: print(' '*len('Turn #1 : ')+'P='+str(p)+','+'V='+str(v)+','+'X='+str(x)) b=input('Turn #2 : ') p=0 v=0 x=0 if b[0]in code[0] : p+=1 else: if b[0] in code: v+=1 else: x+=1 if b[1] in code[1] : p+=1 else: if b[1] in code: v+=1 else: x+=1 if b[2] in code[2] : p+=1 else: if b[2] in code: v+=1 else: x+=1 if b[3] in code[3] : p+=1 else: if b[3] in code: v+=1 else: x+=1 if p==4: print(WINNING_MSG) else: print(' '*len('Turn #1 : ')+'P='+str(p)+','+'V='+str(v)+','+'X='+str(x)) c=input('Turn #3 : ') p=0 v=0 x=0 if c[0]in code[0] : p+=1 else: if c[0] in code: v+=1 else: x+=1 if c[1] in code[1] : p+=1 else: if c[1] in code: v+=1 else: x+=1 if c[2] in code[2] : p+=1 else: if c[2] in code: v+=1 else: x+=1 if c[3] in code[3] : p+=1 else: if c[3] in code: v+=1 else: x+=1 if p==4: print(WINNING_MSG) else: print(' '*len('Turn #1 : ')+'P='+str(p)+','+'V='+str(v)+','+'X='+str(x)) if p!=4: d=input('Turn #4 : ') p=0 v=0 x=0 if d[0]in code[0] : p+=1 else: if d[0] in code: v+=1 else: x+=1 if d[1] in code[1] : p+=1 else: if d[1] in code: v+=1 else: x+=1 if d[2] in code[2] : p+=1 else: if d[2] in code: v+=1 else: x+=1 if d[3] in code[3] : p+=1 else: if d[3] in code: v+=1 else: x+=1 if p==4: print(WINNING_MSG) else: print(' '*len('Turn #1 : ')+'P='+str(p)+','+'V='+str(v)+','+'X='+str(x)) print(LOSING_MSG) print('The answer is '+code) print('Please try again...') |
# 6330489721 (13.16) 322 (2021-02-15 17:54) w = input('Turn #1 : ') p = 0 v = 0 x = 0 if w in code: print("Congratulations! You won the game.") else: if w[0] in code[0] : p +=1 else: if w[0] in code: v +=1 else: x +=1 if w[1] in code[1] : p +=1 else: if w[1] in code: v +=1 else: x +=1 if w[2] in code[2] : p +=1 else: if w[2] in code: v +=1 else: x +=1 if w[3] in code[3] : p +=1 else: if w[3] in code: v +=1 else: x +=1 print(" "*10 + "P=" +str(p)+ "," + "V=" +str(v)+ "," + "X=" +str(x)) l = input('Turn #2 : ') p = 0 v = 0 x = 0 if l in code: print("Congratulations! You won the game.") if l[0] in code[0] : p +=1 else: if l[0] in code: v +=1 else: x +=1 if l[1] in code[1] : p +=1 else: if l[1] in code: v +=1 else: x +=1 if l[2] in code[2] : p +=1 else: if l[2] in code: v +=1 else: x +=1 if l[3] in code[3] : p +=1 else: if l[3] in code: v +=1 else: x +=1 print(" "*10 + "P=" +str(p)+ "," + "V=" +str(v)+ "," + "X=" +str(x)) m = input('Turn #3 : ') p = 0 v = 0 x = 0 if m in code: print("Congratulations! You won the game.") if m[0] in code[0] : p +=1 else: if m[0] in code: v +=1 else: x +=1 if m[1] in code[1] : p +=1 else: if m[1] in code: v +=1 else: x +=1 if m[2] in code[2] : p +=1 else: if m[2] in code: v +=1 else: x +=1 if m[3] in code[3] : p +=1 else: if m[3] in code: v +=1 else: x +=1 print(" "*10 + "P=" +str(p)+ "," + "V=" +str(v)+ "," + "X=" +str(x)) n = input('Turn #4 : ') p = 0 v = 0 x = 0 if n in code: print("Congratulations! You won the game.") if n[0] in code[0] : p +=1 else: if n[0] in code: v +=1 else: x +=1 if n[1] in code[1] : p +=1 else: if n[1] in code: v +=1 else: x +=1 if n[2] in code[2] : p +=1 else: if n[2] in code: v +=1 else: x +=1 if n[3] in code[3] : p +=1 else: if n[3] in code: v +=1 else: x +=1 print(" "*10 + "P=" +str(p)+ "," + "V=" +str(v)+ "," + "X=" +str(x)) print("Sorry! You just lost it") print("The answer is",code) print("Please try again...") |
# 6330491921 (20.00) 323 (2021-02-12 19:19) guess = input("Turn #1 : ") p,v,x = 0,0,0 if guess == code: print(WINNING_MSG) if guess != code: if guess[0] == code[0]: p+=1 if guess[1] == code[1]: p+=1 if guess[2] == code[2]: p+=1 if guess[3] == code[3]: p+=1 if guess[0] in code: v+=1 if guess[1] in code: v+=1 if guess[2] in code: v+=1 if guess[3] in code: v+=1 v = v-p x = 4-(p+v) print(" P="+str(p)+','+'V='+str(v)+','+'X='+str(x)) if guess != code: guess = input("Turn #2 : ") p,v,x = 0,0,0 if guess == code: print(WINNING_MSG) if guess != code: if guess[0] == code[0]: p+=1 if guess[1] == code[1]: p+=1 if guess[2] == code[2]: p+=1 if guess[3] == code[3]: p+=1 if guess[0] in code: v+=1 if guess[1] in code: v+=1 if guess[2] in code: v+=1 if guess[3] in code: v+=1 v = v-p x = 4-(p+v) print(" P="+str(p)+','+'V='+str(v)+','+'X='+str(x)) if guess != code: guess = input("Turn #3 : ") p,v,x = 0,0,0 if guess == code: print(WINNING_MSG) if guess != code: if guess[0] == code[0]: p+=1 if guess[1] == code[1]: p+=1 if guess[2] == code[2]: p+=1 if guess[3] == code[3]: p+=1 if guess[0] in code: v+=1 if guess[1] in code: v+=1 if guess[2] in code: v+=1 if guess[3] in code: v+=1 v = v-p x = 4-(p+v) print(" P="+str(p)+','+'V='+str(v)+','+'X='+str(x)) if guess != code: guess = input("Turn #4 : ") p,v,x = 0,0,0 if guess == code: print(WINNING_MSG) if guess != code: if guess[0] == code[0]: p+=1 if guess[1] == code[1]: p+=1 if guess[2] == code[2]: p+=1 if guess[3] == code[3]: p+=1 if guess[0] in code: v+=1 if guess[1] in code: v+=1 if guess[2] in code: v+=1 if guess[3] in code: v+=1 v = v-p x = 4-(p+v) print(" P="+str(p)+','+'V='+str(v)+','+'X='+str(x)) print(LOSING_MSG) print('The answer is '+code) print("Please try again...") |
# 6330492521 (19.90) 324 (2021-02-11 16:28) ch = 1 a = input('Turn #1 : ') p,v,x = 0,0,0 if a == code: print(WINNING_MSG) ch = 0 if a != code: if a[0]==code[0]: p=p+1 if a[1]==code[1]: p=p+1 if a[2]==code[2]: p=p+1 if a[3]==code[3]: p=p+1 if a[0] in code: v=v+1 if a[1] in code: v=v+1 if a[2] in code: v=v+1 if a[3] in code: v=v+1 v = v-p x = 4-(v+p) print(' P='+str(p)+','+'V='+str(v)+','+'X='+str(x)) if ch !=0: a = input('Turn #2 : ') p,v,x = 0,0,0 if a == code and ch !=0 : print(WINNING_MSG) ch = 0 if a != code and ch !=0: if a[0]==code[0]: p=p+1 if a[1]==code[1]: p=p+1 if a[2]==code[2]: p=p+1 if a[3]==code[3]: p=p+1 if a[0] in code: v=v+1 if a[1] in code: v=v+1 if a[2] in code: v=v+1 if a[3] in code: v=v+1 v = v-p x = 4-(v+p) print(' P='+str(p)+','+'V='+str(v)+','+'X='+str(x)) if ch !=0: a = input('Turn #3 : ') p,v,x = 0,0,0 if a == code and ch !=0: print(WINNING_MSG) ch = 0 if a != code and ch !=0: if a[0]==code[0]: p=p+1 if a[1]==code[1]: p=p+1 if a[2]==code[2]: p=p+1 if a[3]==code[3]: p=p+1 if a[0] in code: v=v+1 if a[1] in code: v=v+1 if a[2] in code: v=v+1 if a[3] in code: v=v+1 v = v-p x = 4-(v+p) print(' P='+str(p)+','+'V='+str(v)+','+'X='+str(x)) if ch !=0: a = input('Turn #4 : ') p,v,x = 0,0,0 if a == code and ch !=0: print(WINNING_MSG) ch = 0 if a != code and ch !=0: if a[0]==code[0]: p=p+1 if a[1]==code[1]: p=p+1 if a[2]==code[2]: p=p+1 if a[3]==code[3]: p=p+1 if a[0] in code: v=v+1 if a[1] in code: v=v+1 if a[2] in code: v=v+1 if a[3] in code: v=v+1 v = v-p x = 4-(v+p) print(' P='+str(p)+','+'V='+str(v)+','+'X='+str(x)) print(LOSING_MSG) print('The answer is '+code) print('Please try again...') |
# 6330494821 (20.00) 325 (2021-02-11 13:29) a=input('Turn #1 : ') p=0 v=0 if a[0] in code: v+=1 if a[1] in code: v+=1 if a[2] in code: v+=1 if a[3] in code: v+=1 if a[0]==code[0]: p+=1 v-=1 if a[1]==code[1]: p+=1 v-=1 if a[2]==code[2]: p+=1 v-=1 if a[3]==code[3]: p+=1 v-=1 x=4-p-v if a==code: print(WINNING_MSG) else: print(' ','P='+str(p)+',V='+str(v)+',X='+str(x)) a=input('Turn #2 : ') p=0 v=0 if a[0] in code: v+=1 if a[1] in code: v+=1 if a[2] in code: v+=1 if a[3] in code: v+=1 if a[0]==code[0]: p+=1 v-=1 if a[1]==code[1]: p+=1 v-=1 if a[2]==code[2]: p+=1 v-=1 if a[3]==code[3]: p+=1 v-=1 x=4-p-v if a==code: print(WINNING_MSG) else: print(' ','P='+str(p)+',V='+str(v)+',X='+str(x)) a=input('Turn #3 : ') p=0 v=0 if a[0] in code: v+=1 if a[1] in code: v+=1 if a[2] in code: v+=1 if a[3] in code: v+=1 if a[0]==code[0]: p+=1 v-=1 if a[1]==code[1]: p+=1 v-=1 if a[2]==code[2]: p+=1 v-=1 if a[3]==code[3]: p+=1 v-=1 x=4-p-v if a==code: print(WINNING_MSG) else: print(' ','P='+str(p)+',V='+str(v)+',X='+str(x)) a=input('Turn #4 : ') p=0 v=0 if a[0] in code: v+=1 if a[1] in code: v+=1 if a[2] in code: v+=1 if a[3] in code: v+=1 if a[0]==code[0]: p+=1 v-=1 if a[1]==code[1]: p+=1 v-=1 if a[2]==code[2]: p+=1 v-=1 if a[3]==code[3]: p+=1 v-=1 x=4-p-v if a==code: print(WINNING_MSG) else: print(' ','P='+str(p)+',V='+str(v)+',X='+str(x)) print(LOSING_MSG) print('The answer is','',code) print('Please try again...') |
# 6330495421 (17.23) 326 (2021-02-15 13:19) guess=input() p=0 v=0 x=0 a=1 if guess[0] == code[0]: p+=1 elif guess[0] in code: v+=1 else : x+=1 if guess[1] == code[1]: p+=1 elif guess[1] in code: v+=1 else : x+=1 if guess[2] == code[2]: p+=1 elif guess[2] in code: v+=1 else : x+=1 if guess[3] == code[3]: p+=1 elif guess[3] in code: v+=1 else : x+=1 print ("Turn #"+str(a)+" : "+guess) if guess!= code: a+=1 print(" "*len("Turn #"+str(a)+" : ")+"P="+str(p)+","+"V="+str(v)+","+"X="+str(x)) else: print (WINNING_MSG) guess=input() p=0 v=0 x=0 if guess[0] == code[0]: p+=1 elif guess[0] in code: v+=1 else : x+=1 if guess[1] == code[1]: p+=1 elif guess[1] in code: v+=1 else : x+=1 if guess[2] == code[2]: p+=1 elif guess[2] in code: v+=1 else : x+=1 if guess[3] == code[3]: p+=1 elif guess[3] in code: v+=1 else : x+=1 print ("Turn #"+str(a)+" : "+guess) if guess!= code: a+=1 print(" "*len("Turn #"+str(a)+" : ")+"P="+str(p)+","+"V="+str(v)+","+"X="+str(x)) else: print (WINNING_MSG) guess=input() p=0 v=0 x=0 if guess[0] == code[0]: p+=1 elif guess[0] in code: v+=1 else : x+=1 if guess[1] == code[1]: p+=1 elif guess[1] in code: v+=1 else : x+=1 if guess[2] == code[2]: p+=1 elif guess[2] in code: v+=1 else : x+=1 if guess[3] == code[3]: p+=1 elif guess[3] in code: v+=1 else : x+=1 print ("Turn #"+str(a)+" : "+guess) if guess!= code: a+=1 print(" "*len("Turn #"+str(a)+" : ")+"P="+str(p)+","+"V="+str(v)+","+"X="+str(x)) else: print (WINNING_MSG) guess=input() p=0 v=0 x=0 if guess[0] == code[0]: p+=1 elif guess[0] in code: v+=1 else : x+=1 if guess[1] == code[1]: p+=1 elif guess[1] in code: v+=1 else : x+=1 if guess[2] == code[2]: p+=1 elif guess[2] in code: v+=1 else : x+=1 if guess[3] == code[3]: p+=1 elif guess[3] in code: v+=1 else : x+=1 print ("Turn #"+str(a)+" : "+guess) if guess!= code: print(" "*len("Turn #"+str(a)+" : ")+"P="+str(p)+","+"V="+str(v)+","+"X="+str(x)) print (LOSING_MSG) print("The answer is "+code) print("Please try again...") else: print (WINNING_MSG) |
# 6330496021 (20.00) 327 (2021-02-15 12:15) a = input('Turn #1 : ') p=0 if a[0] == code[0]: p = p+1 else: p = p+0 if a[1] == code[1]: p = p+1 else: p = p+0 if a[2] == code[2]: p = p+1 else: p = p+0 if a[3] == code[3]: p = p+1 else: p = p+0 v = 0 if a[0] in code: v = v+1 else: v = v+0 if a[1] in code: v = v+1 else: v = v+0 if a[2] in code: v = v+1 else: v = v+0 if a[3] in code: v = v+1 else: v = v+0 v = v-p x = 4-(v+p) if p == 4 : print('Congratulations! You won the game.') exit() else: print(" "+'P='+str(p)+','+'V='+str(v)+','+'X='+str(x)) #-------------------------------------------------------------- a = input('Turn #2 : ') p=0 if a[0] == code[0]: p = p+1 else: p = p+0 if a[1] == code[1]: p = p+1 else: p = p+0 if a[2] == code[2]: p = p+1 else: p = p+0 if a[3] == code[3]: p = p+1 else: p = p+0 v = 0 if a[0] in code: v = v+1 else: v = v+0 if a[1] in code: v = v+1 else: v = v+0 if a[2] in code: v = v+1 else: v = v+0 if a[3] in code: v = v+1 else: v = v+0 v = v-p x = 4-(v+p) if p == 4 : print('Congratulations! You won the game.') exit() else: print(" "+'P='+str(p)+','+'V='+str(v)+','+'X='+str(x)) #-------------------------------------------------------------- a = input('Turn #3 : ') p=0 if a[0] == code[0]: p = p+1 else: p = p+0 if a[1] == code[1]: p = p+1 else: p = p+0 if a[2] == code[2]: p = p+1 else: p = p+0 if a[3] == code[3]: p = p+1 else: p = p+0 v = 0 if a[0] in code: v = v+1 else: v = v+0 if a[1] in code: v = v+1 else: v = v+0 if a[2] in code: v = v+1 else: v = v+0 if a[3] in code: v = v+1 else: v = v+0 v = v-p x = 4-(v+p) if p == 4 : print('Congratulations! You won the game.') exit() else: print(" "+'P='+str(p)+','+'V='+str(v)+','+'X='+str(x)) #-------------------------------------------------------------- a = input('Turn #4 : ') p=0 if a[0] == code[0]: p = p+1 else: p = p+0 if a[1] == code[1]: p = p+1 else: p = p+0 if a[2] == code[2]: p = p+1 else: p = p+0 if a[3] == code[3]: p = p+1 else: p = p+0 v = 0 if a[0] in code: v = v+1 else: v = v+0 if a[1] in code: v = v+1 else: v = v+0 if a[2] in code: v = v+1 else: v = v+0 if a[3] in code: v = v+1 else: v = v+0 v = v-p x = 4-(v+p) if p == 4 : print('Congratulations! You won the game.') exit() else: print(" "+'P='+str(p)+','+'V='+str(v)+','+'X='+str(x)) print('Sorry! You just lost it.') print('The answer is',code) print('Please try again...') |
# 6330497721 (20.00) 328 (2021-02-12 14:17) n=1 guess=input('Turn #'+str(n)+' : ').upper() if str(code)==guess: print('Congratulations! You won the game.') exit() else: p=0 v=0 x=4 if guess[0]==code[0]: p+=1 x-=1 elif guess[0] in code: if guess[0]==guess[1] and guess[1]==code[1]: pass elif guess[0]==guess[2] and guess[2]==code[2]: pass elif guess[0]==guess[3] and guess[3]==code[3]: pass else: v+=1 x-=1 if guess[1]==code[1]: p+=1 x-=1 elif guess[1] in code: if guess[1]==guess[2] and guess[2]==code[2]: pass elif guess[1]==guess[3] and guess[3]==code[3]: pass elif guess[1] == guess[0]: pass else: v+=1 x-=1 if guess[2]==code[2]: p+=1 x-=1 elif guess[2] in code: if guess[2]==guess[3] and guess[3]==code[3]: pass elif guess[2] == guess[0]: pass elif guess[2] == guess[1]: pass else: v+=1 x-=1 if guess[3]==code[3]: p+=1 x-=1 elif guess[3] in code: if guess[3] == guess[0]: pass elif guess[3] == guess[1]: pass elif guess[3] == guess[2]: pass else: v+=1 x-=1 print(' '*10+'P='+str(p)+',V='+str(v)+',X='+str(x)) n+=1 guess=input('Turn #'+str(n)+' : ').upper() if str(code)==guess: print('Congratulations! You won the game.') exit() else: p=0 v=0 x=4 if guess[0]==code[0]: p+=1 x-=1 elif guess[0] in code: if guess[0]==guess[1] and guess[1]==code[1]: pass elif guess[0]==guess[2] and guess[2]==code[2]: pass elif guess[0]==guess[3] and guess[3]==code[3]: pass else: v+=1 x-=1 if guess[1]==code[1]: p+=1 x-=1 elif guess[1] in code: if guess[1]==guess[2] and guess[2]==code[2]: pass elif guess[1]==guess[3] and guess[3]==code[3]: pass elif guess[1] == guess[0]: pass else: v+=1 x-=1 if guess[2]==code[2]: p+=1 x-=1 elif guess[2] in code: if guess[2]==guess[3] and guess[3]==code[3]: pass elif guess[2] == guess[0]: pass elif guess[2] == guess[1]: pass else: v+=1 x-=1 if guess[3]==code[3]: p+=1 x-=1 elif guess[3] in code: if guess[3] == guess[0]: pass elif guess[3] == guess[1]: pass elif guess[3] == guess[2]: pass else: v+=1 x-=1 print(' '*10+'P='+str(p)+',V='+str(v)+',X='+str(x)) n+=1 guess=input('Turn #'+str(n)+' : ').upper() if str(code)==guess: print('Congratulations! You won the game.') exit() else: p=0 v=0 x=4 if guess[0]==code[0]: p+=1 x-=1 elif guess[0] in code: if guess[0]==guess[1] and guess[1]==code[1]: pass elif guess[0]==guess[2] and guess[2]==code[2]: pass elif guess[0]==guess[3] and guess[3]==code[3]: pass else: v+=1 x-=1 if guess[1]==code[1]: p+=1 x-=1 elif guess[1] in code: if guess[1]==guess[2] and guess[2]==code[2]: pass elif guess[1]==guess[3] and guess[3]==code[3]: pass elif guess[1] == guess[0]: pass else: v+=1 x-=1 if guess[2]==code[2]: p+=1 x-=1 elif guess[2] in code: if guess[2]==guess[3] and guess[3]==code[3]: pass elif guess[2] == guess[0]: pass elif guess[2] == guess[1]: pass else: v+=1 x-=1 if guess[3]==code[3]: p+=1 x-=1 elif guess[3] in code: if guess[3] == guess[0]: pass elif guess[3] == guess[1]: pass elif guess[3] == guess[2]: pass else: v+=1 x-=1 print(' '*10+'P='+str(p)+',V='+str(v)+',X='+str(x)) n+=1 guess=input('Turn #'+str(n)+' : ').upper() if str(code)==guess: print('Congratulations! You won the game.') exit() else: p=0 v=0 x=4 if guess[0]==code[0]: p+=1 x-=1 elif guess[0] in code: if guess[0]==guess[1] and guess[1]==code[1]: pass elif guess[0]==guess[2] and guess[2]==code[2]: pass elif guess[0]==guess[3] and guess[3]==code[3]: pass else: v+=1 x-=1 if guess[1]==code[1]: p+=1 x-=1 elif guess[1] in code: if guess[1]==guess[2] and guess[2]==code[2]: pass elif guess[1]==guess[3] and guess[3]==code[3]: pass elif guess[1] == guess[0]: pass else: v+=1 x-=1 if guess[2]==code[2]: p+=1 x-=1 elif guess[2] in code: if guess[2]==guess[3] and guess[3]==code[3]: pass elif guess[2] == guess[0]: pass elif guess[2] == guess[1]: pass else: v+=1 x-=1 if guess[3]==code[3]: p+=1 x-=1 elif guess[3] in code: if guess[3] == guess[0]: pass elif guess[3] == guess[1]: pass elif guess[3] == guess[2]: pass else: v+=1 x-=1 print(' '*10+'P='+str(p)+',V='+str(v)+',X='+str(x)) n+=1 if n>4: print('Sorry! You just lost it.') print('The answer is'+' '+code) print('Please try again...') |
# 6330498321 (20.00) 329 (2021-02-15 10:10) crack=input('Turn #1 : ') if crack == code : print(WINNING_MSG) else: p=0 v=0 x=0 if crack[0]==code[0]: p+=1 if crack[1]==code[1]: p+=1 if crack[2]==code[2]: p+=1 if crack[3]==code[3]: p+=1 if crack[0] in code and crack[0]!=code[0]: v+=1 if crack[1] in code and crack[1]!=code[1]: v+=1 if crack[2] in code and crack[2]!=code[2]: v+=1 if crack[3] in code and crack[3]!=code[3]: v+=1 if crack[0] not in code: x+=1 if crack[1] not in code: x+=1 if crack[2] not in code: x+=1 if crack[3] not in code: x+=1 print(' '+'P='+str(p)+','+'V='+str(v)+','+'X='+str(x)) crack=input('Turn #2 : ') if crack == code : print(WINNING_MSG) else: p=0 v=0 x=0 if crack[0]==code[0]: p+=1 if crack[1]==code[1]: p+=1 if crack[2]==code[2]: p+=1 if crack[3]==code[3]: p+=1 if crack[0] in code and crack[0]!=code[0]: v+=1 if crack[1] in code and crack[1]!=code[1]: v+=1 if crack[2] in code and crack[2]!=code[2]: v+=1 if crack[3] in code and crack[3]!=code[3]: v+=1 if crack[0] not in code: x+=1 if crack[1] not in code: x+=1 if crack[2] not in code: x+=1 if crack[3] not in code: x+=1 print(' '+'P='+str(p)+','+'V='+str(v)+','+'X='+str(x)) crack=input('Turn #3 : ') if crack == code : print(WINNING_MSG) else: p=0 v=0 x=0 if crack[0]==code[0]: p+=1 if crack[1]==code[1]: p+=1 if crack[2]==code[2]: p+=1 if crack[3]==code[3]: p+=1 if crack[0] in code and crack[0]!=code[0]: v+=1 if crack[1] in code and crack[1]!=code[1]: v+=1 if crack[2] in code and crack[2]!=code[2]: v+=1 if crack[3] in code and crack[3]!=code[3]: v+=1 if crack[0] not in code: x+=1 if crack[1] not in code: x+=1 if crack[2] not in code: x+=1 if crack[3] not in code: x+=1 print(' '+'P='+str(p)+','+'V='+str(v)+','+'X='+str(x)) crack=input('Turn #4 : ') if crack==code: print(WINNING_MSG) elif crack!=code: p=0 v=0 x=0 if crack[0]==code[0]: p+=1 if crack[1]==code[1]: p+=1 if crack[2]==code[2]: p+=1 if crack[3]==code[3]: p+=1 if crack[0] in code and crack[0]!=code[0]: v+=1 if crack[1] in code and crack[1]!=code[1]: v+=1 if crack[2] in code and crack[2]!=code[2]: v+=1 if crack[3] in code and crack[3]!=code[3]: v+=1 if crack[0] not in code: x+=1 if crack[1] not in code: x+=1 if crack[2] not in code: x+=1 if crack[3] not in code: x+=1 print(' '+'P='+str(p)+','+'V='+str(v)+','+'X='+str(x)) print(LOSING_MSG) print('The answer is '+code) print('Please try again...') |
# 6330499021 (20.00) 330 (2021-02-15 01:57) code_break=input('Turn #1 : ') win=False p=0 v=0 x=0 turn=0 if code_break.__eq__(code): win=True print(WINNING_MSG) else: if code_break[0].__eq__(code[0]): p+=1 if code_break[1].__eq__(code[1]): p+=1 if code_break[2].__eq__(code[2]): p+=1 if code_break[3].__eq__(code[3]): p+=1 if code_break[0] in code and code_break[0].__ne__(code[0]): v+=1 if code_break[1] in code and code_break[1].__ne__(code[1]): v+=1 if code_break[2] in code and code_break[2].__ne__(code[2]): v+=1 if code_break[3] in code and code_break[3].__ne__(code[3]): v+=1 if code_break[0] not in code: x+=1 if code_break[1] not in code: x+=1 if code_break[2] not in code: x+=1 if code_break[3] not in code: x+=1 print(' ' + 'P={},V={},X={}'.format(p, v, x)) turn+=1 code_break = input('Turn #2 : ') p = 0 v = 0 x = 0 if code_break.__eq__(code): win = True print(WINNING_MSG) else: if code_break[0].__eq__(code[0]): p += 1 if code_break[1].__eq__(code[1]): p += 1 if code_break[2].__eq__(code[2]): p += 1 if code_break[3].__eq__(code[3]): p += 1 if code_break[0] in code and code_break[0].__ne__(code[0]): v += 1 if code_break[1] in code and code_break[1].__ne__(code[1]): v += 1 if code_break[2] in code and code_break[2].__ne__(code[2]): v += 1 if code_break[3] in code and code_break[3].__ne__(code[3]): v += 1 if code_break[0] not in code: x += 1 if code_break[1] not in code: x += 1 if code_break[2] not in code: x += 1 if code_break[3] not in code: x += 1 print(' ' + 'P={},V={},X={}'.format(p, v, x)) code_break = input('Turn #3 : ') turn+=1 p = 0 v = 0 x = 0 if code_break.__eq__(code): win = True print(WINNING_MSG) else: if code_break[0].__eq__(code[0]): p += 1 if code_break[1].__eq__(code[1]): p += 1 if code_break[2].__eq__(code[2]): p += 1 if code_break[3].__eq__(code[3]): p += 1 if code_break[0] in code and code_break[0].__ne__(code[0]): v += 1 if code_break[1] in code and code_break[1].__ne__(code[1]): v += 1 if code_break[2] in code and code_break[2].__ne__(code[2]): v += 1 if code_break[3] in code and code_break[3].__ne__(code[3]): v += 1 if code_break[0] not in code: x += 1 if code_break[1] not in code: x += 1 if code_break[2] not in code: x += 1 if code_break[3] not in code: x += 1 print(' ' + 'P={},V={},X={}'.format(p, v, x)) code_break = input('Turn #4 : ') turn+=1 p = 0 v = 0 x = 0 if code.__eq__(code_break): win = True print(WINNING_MSG) else: if code_break[0].__eq__(code[0]): p += 1 if code_break[1].__eq__(code[1]): p += 1 if code_break[2].__eq__(code[2]): p += 1 if code_break[3].__eq__(code[3]): p += 1 if code_break[0] in code and code_break[0].__ne__(code[0]): v += 1 if code_break[1] in code and code_break[1].__ne__(code[1]): v += 1 if code_break[2] in code and code_break[2].__ne__(code[2]): v += 1 if code_break[3] in code and code_break[3].__ne__(code[3]): v += 1 if code_break[0] not in code: x += 1 if code_break[1] not in code: x += 1 if code_break[2] not in code: x += 1 if code_break[3] not in code: x += 1 turn+=1 if turn==4: print(' ' + 'P={},V={},X={}'.format(p, v, x)) print(LOSING_MSG) print('The answer is', code, ) print('Please try again...') |
# 6330500921 (20.00) 331 (2021-02-12 00:28) a=input('Turn #1 : ') b1,b2,b3,b4=list(a) c1,c2,c3,c4=list(code) if a==code : print(WINNING_MSG) else : if b1==c1 : f=1 else : f=0 if b2==c2 : g=1 else : g=0 if b3==c3 : h=1 else : h=0 if b4==c4 : i=1 else : i=0 if b1 in list(code) : j=1 else : j=0 if b2 in list(code) : k=1 else : k=0 if b3 in list(code) : l=1 else : l=0 if b4 in list(code) : m=1 else : m=0 P=f+g+h+i V=(j+k+l+m)-P X=4-P-V print(' '+'P='+str(P)+',V='+str(V)+',X='+str(X)) b=input('Turn #2 : ') b1,b2,b3,b4=list(b) c1,c2,c3,c4=list(code) if b==code : print(WINNING_MSG) else : if b1==c1 : f=1 else : f=0 if b2==c2 : g=1 else : g=0 if b3==c3 : h=1 else : h=0 if b4==c4 : i=1 else : i=0 if b1 in list(code) : j=1 else : j=0 if b2 in list(code) : k=1 else : k=0 if b3 in list(code) : l=1 else : l=0 if b4 in list(code) : m=1 else : m=0 P=f+g+h+i V=(j+k+l+m)-P X=4-P-V print(' '+'P='+str(P)+',V='+str(V)+',X='+str(X)) z=input('Turn #3 : ') b1,b2,b3,b4=list(z) c1,c2,c3,c4=list(code) if z==code : print(WINNING_MSG) else : if b1==c1 : f=1 else : f=0 if b2==c2 : g=1 else : g=0 if b3==c3 : h=1 else : h=0 if b4==c4 : i=1 else : i=0 if b1 in list(code) : j=1 else : j=0 if b2 in list(code) : k=1 else : k=0 if b3 in list(code) : l=1 else : l=0 if b4 in list(code) : m=1 else : m=0 P=f+g+h+i V=(j+k+l+m)-P X=4-P-V print(' '+'P='+str(P)+',V='+str(V)+',X='+str(X)) y=input('Turn #4 : ') b1,b2,b3,b4=list(y) c1,c2,c3,c4=list(code) if y==code : print(WINNING_MSG) else : if b1==c1 : f=1 else : f=0 if b2==c2 : g=1 else : g=0 if b3==c3 : h=1 else : h=0 if b4==c4 : i=1 else : i=0 if b1 in list(code) : j=1 else : j=0 if b2 in list(code) : k=1 else : k=0 if b3 in list(code) : l=1 else : l=0 if b4 in list(code) : m=1 else : m=0 P=f+g+h+i V=(j+k+l+m)-P X=4-P-V print(' '+'P='+str(P)+',V='+str(V)+',X='+str(X)) print(LOSING_MSG) print('The answer is '+str(code)) print('Please try again...') |
# 6330501521 (20.00) 332 (2021-02-14 11:42) A1=input('Turn #1 : ').upper() a1=list(A1) v0=v1=v2=v3=0 x0=x1=x2=x3=0 #first index# if a1[0]==code[0]: p0=1 else: p0=0 if a1[0] in code[1::]: v0=1 else: x0=1 #second index# if a1[1]==code[1]: p1=1 else: p1=0 if a1[1] in code[0]+code[2::]: v1=1 else: x1=1 #third index# if a1[2]==code[2]: p2=1 else: p2=0 if a1[2] in code[:2:]+code[3]: v2=1 else: x2=1 #forth index# if a1[3]==code[3]: p3=1 else: p3=0 if a1[3] in code[:3:]: v3=1 else: x3=1 if A1==code: print(WINNING_MSG) exit() else: print(' P='+str(p0+p1+p2+p3)+',V='+str(v0+v1+v2+v3)+',X='+str(x0+x1+x2+x3)) #--------------END TURN1-----------------# A2=input('Turn #2 : ').upper() a2=list(A2) v00=v01=v02=v03=0 x00=x01=x02=x03=0 if a2[0]==code[0]: p00=1 else: p00=0 if a2[0] in code[1::]: v00=1 else: x00=1 if a2[1]==code[1]: p01=1 else: p01=0 if a2[1] in code[0]+code[2::]: v01=1 else: x01=1 if a2[2]==code[2]: p02=1 else: p02=0 if a2[2] in code[:2:]+code[3]: v02=1 else: x02=1 if a2[3]==code[3]: p03=1 else: p03=0 if a2[3] in code[:3:]: v03=1 else: x03=1 if A2==code: print(WINNING_MSG) exit() else: print(' P='+str(p00+p01+p02+p03)+',V='+str(v00+v01+v02+v03)+',X='+str(x00+x01+x02+x03)) A3=input('Turn #3 : ').upper() a3=list(A3) v000=v001=v002=v003=0 x000=x001=x002=x003=0 if a3[0]==code[0]: p000=1 else: p000=0 if a3[0] in code[1::]: v000=1 else: x000=1 if a3[1]==code[1]: p001=1 else: p001=0 if a3[1] in code[0]+code[2::]: v001=1 else: x001=1 if a3[2]==code[2]: p002=1 else: p002=0 if a3[2] in code[:2:]+code[3]: v002=1 else: x002=1 if a3[3]==code[3]: p003=1 else: p003=0 if a3[3] in code[:3:]: v003=1 else: x003=1 if A3==code: print(WINNING_MSG) exit() else: print(' P='+str(p000+p001+p002+p003)+',V='+str(v000+v001+v002+v003)+',X='+str(x000+x001+x002+x003)) A4=input('Turn #4 : ').upper() a4=list(A4) v0000=v0001=v0002=v0003=0 x0000=x0001=x0002=x0003=0 if a4[0]==code[0]: p0000=1 else: p0000=0 if a4[0] in code[1::]: v0000=1 else: x0000=1 if a4[1]==code[1]: p0001=1 else: p0001=0 if a4[1] in code[0]+code[2::]: v0001=1 else: x0001=1 if a4[2]==code[2]: p0002=1 else: p0002=0 if a4[2] in code[:2:]+code[3]: v0002=1 else: x0002=1 if a4[3]==code[3]: p0003=1 else: p0003=0 if a4[3] in code[:3:]: v0003=1 else: x0003=1 if A4==code: print(WINNING_MSG) exit() else: print(' P='+str(p0000+p0001+p0002+p0003)+',V='+str(v0000+v0001+v0002+v0003)+',X='+str(x0000+x0001+x0002+x0003)) print(LOSING_MSG) print('The answer is '+code) print('Please try again...') |
# 6330502121 (19.29) 333 (2021-02-14 23:57) b='' a=0 def check(b): p=0 v=0 x=0 if g[0]==code[0]: p+=1 elif g[0]==code[1]: v+=1 elif g[0]==code[2]: v+=1 elif g[0]==code[3]: v+=1 else: x+=1 if g[1]==code[0]: v+=1 elif g[1]==code[1]: p+=1 elif g[1]==code[2]: v+=1 elif g[1]==code[3]: v+=1 else: x+=1 if g[2]==code[0]: v+=1 elif g[2]==code[1]: v+=1 elif g[2]==code[2]: p+=1 elif g[2]==code[3]: v+=1 else: x+=1 if g[3]==code[0]: v+=1 elif g[3]==code[1]: v+=1 elif g[3]==code[2]: v+=1 elif g[3]==code[3]: p+=1 else: x+=1 if p==4: print('Congratulations! You won the game.') else: print(' '*len('Turn #'+str(a)+': '),'P='+str(p)+',V='+str(v)+',X='+str(x)) return(b) a+=1 if a==1: g=input('Turn #'+str(a)+' : ') check(b) a+=1 if a==2 and g!=code: g=input('Turn #'+str(a)+' : ') check(b) a+=1 if a==3 and g!=code: g=input('Turn #'+str(a)+' : ') check(b) a+=1 if a==4 and g!=code: g=input('Turn #'+str(a)+' : ') check(b) print('Sorry! You just lost it.') print('The answer is',code) print("Please try again...") |
# 6330503821 (20.00) 334 (2021-02-13 23:07) for turn in range(4): guess = input(f"Turn #{turn+1} : ") p = 0 v = 0 x = 0 for i in range(len(guess)): character = guess[i] if character in code: if code.index(character) == i: p += 1 else: v += 1 else: x += 1 if p == 4: print(WINNING_MSG) exit() else: print(" "+f"P={p},V={v},X={x}") print(LOSING_MSG) print(f"The answer is {code}") print("Please try again...") |
# 6330504421 (20.00) 335 (2021-02-14 02:11) code = ' '.join(code) code = code.split() a = ' '.join(input("Turn #1 : ")) a = a.split() p = 0 v = 0 x = 0 if a[0] in code: if a[0] == code[0]: p = p+1 else: v = v+1 else : x = x+1 if a[1] in code: if a[1] == code[1]: p = p+1 else: v = v+1 else : x = x+1 if a[2] in code: if a[2] == code[2]: p = p+1 else: v = v+1 else : x = x+1 if a[3] in code: if a[3] == code[3]: p = p+1 else: v = v+1 else : x = x+1 if p == 4: print(WINNING_MSG) else : print(" P="+str(p)+","+"V="+str(v)+","+"X="+str(x)) a = ' '.join(input("Turn #2 : ")) a = a.split() p = 0 v = 0 x = 0 if a[0] in code: if a[0] == code[0]: p = p+1 else: v = v+1 else : x = x+1 if a[1] in code: if a[1] == code[1]: p = p+1 else: v = v+1 else : x = x+1 if a[2] in code: if a[2] == code[2]: p = p+1 else: v = v+1 else : x = x+1 if a[3] in code: if a[3] == code[3]: p = p+1 else: v = v+1 else : x = x+1 if p == 4: print(WINNING_MSG) else : print(" P="+str(p)+","+"V="+str(v)+","+"X="+str(x)) a = ' '.join(input("Turn #3 : ")) a = a.split() p = 0 v = 0 x = 0 if a[0] in code: if a[0] == code[0]: p = p+1 else: v = v+1 else : x = x+1 if a[1] in code: if a[1] == code[1]: p = p+1 else: v = v+1 else : x = x+1 if a[2] in code: if a[2] == code[2]: p = p+1 else: v = v+1 else : x = x+1 if a[3] in code: if a[3] == code[3]: p = p+1 else: v = v+1 else : x = x+1 if p == 4: print(WINNING_MSG) else : print(" P="+str(p)+","+"V="+str(v)+","+"X="+str(x)) a = ' '.join(input("Turn #4 : ")) a = a.split() p = 0 v = 0 x = 0 if a[0] in code: if a[0] == code[0]: p = p+1 else: v = v+1 else : x = x+1 if a[1] in code: if a[1] == code[1]: p = p+1 else: v = v+1 else : x = x+1 if a[2] in code: if a[2] == code[2]: p = p+1 else: v = v+1 else : x = x+1 if a[3] in code: if a[3] == code[3]: p = p+1 else: v = v+1 else : x = x+1 if p == 4: print(WINNING_MSG) else : print(" P="+str(p)+","+"V="+str(v)+","+"X="+str(x)) print(LOSING_MSG) print("The answer is" +" "+str(''.join(code))) print("Please try again...") |
# 6330505021 (8.13) 336 (2021-02-15 01:00) t1 = input() print('Turn #1 : ' + t1) if t1[0] in code and t1[1] not in code and t1[2] not in code and t1[3] not in code: print(" p=0,v=1,x=3") elif t1[1] in code and t1[0] not in code and t1[2] not in code and t1[3] not in code: print(' p=0,v=1,x=3') elif t1[2] in code and t1[0] not in code and t1[1] not in code and t1[3] not in code: print(" p=0,v=1,x=3") elif t1[3] in code and t1[0] not in code and t1[1] not in code and t1[2] not in code: print(' p=0,v=1,x=3') elif t1[0] == code[1] and t1[1] not in code and t1[2] not in code and t1[3] not in code: print(' p=1,v=0,x=3') elif t1[1] == code[1] and t1[0] not in code and t1[2] not in code and t1[3] not in code: print(' p=1,v=0,x=3') elif t1[2] == code[2] and t1[0] not in code and t1[1] not in code and t1[3] not in code: print(' p=1,v=0,x=3') elif t1[3] == code[3] and t1[1] not in code and t1[2] not in code and t1[0] not in code: print(' p=1,v=0,x=3') elif t1[0] == code[0] and t1[2] in code and t1[1] not in code and t1[3] not in code: print(' p=1,v=1,x=2') elif t1[2] == code[2] and t1[1] in code and t1[0] not in code and t1[3] not in code: print(' p=1,v=1,x=2') elif t1[1] == code[1] and t1[2] in code and t1[0] not in code and t1[3] not in code: print(' p=1,v=1,x=2') elif t1[0] == code[0] and t1[1] in code and t1[2] not in code and t1[3] not in code: print(' p=1,v=1,x=2') elif t1[0] == code[0] and t1[3] in code and t1[0] not in code and t1[2] not in code: print(' p=1,v=1,x=2') elif t1[1] == code[1] and t1[0] in code and t1[2] not in code and t1[3] not in code: print(' p=1,v=1,x=2') elif t1[1] == code[1] and t1[3] in code and t1[0] not in code and t1[2] not in code: print(' p=1,v=1,x=2') elif t1[2] == code[2] and t1[0] in code and t1[1] not in code and t1[3] not in code: print(' p=1,v=1,x=2') elif t1[2] == code[2] and t1[3] in code and t1[0] not in code and t1[1] not in code: print(' p=1,v=1,x=2') elif t1[3] == code[3] and t1[0] in code and t1[1] not in code and t1[2] not in code: print(' p=1,v=1,x=2') elif t1[3] == code[3] and t1[1] in code and t1[0] not in code and t1[2] not in code: print(' p=1,v=1,x=2') elif t1[3] == code[3] and t1[2] in code and t1[0] not in code and t1[1] not in code: print(' p=1,v=1,x=2') elif t1[0] == code[0] and t1[1] in code and t1[2] in code and t1[3] not in code: print(" p=1,v=2,x=1") elif t1[0] == code[0] and t1[1] in code and t1[3] in code and t1[2] not in code: print(" p=1,v=2,x=1") elif t1[0] == code[0] and t1[3] in code and t1[2] in code and t1[1] not in code: print(" p=1,v=2,x=1") elif t1[1] == code[1] and t1[0] in code and t1[2] in code and t1[3] not in code: print(" p=1,v=2,x=1") elif t1[1] == code[1] and t1[0] in code and t1[3] in code and t1[2] not in code: print(" p=1,v=2,x=1") elif t1[1] == code[1] and t1[2] in code and t1[3] in code and t1[0] not in code: print(" p=1,v=2,x=1") elif t1[2] == code[2] and t1[0] in code and t1[1] in code and t1[3] not in code: print(" p=1,v=2,x=1") elif t1[2] == code[2] and t1[0] in code and t1[3] in code and t1[1] not in code: print(" p=1,v=2,x=1") elif t1[2] == code[2] and t1[1] in code and t1[3] in code and t1[0] not in code: print(" p=1,v=2,x=1") elif t1[3] == code[3] and t1[0] in code and t1[1] in code and t1[2] not in code: print(" p=1,v=2,x=1") elif t1[3] == code[3] and t1[0] in code and t1[2] in code and t1[1] not in code: print(" p=1,v=2,x=1") elif t1[3] == code[3] and t1[1] in code and t1[2] in code and t1[0] not in code: print(" p=1,v=2,x=1") elif t1[0] == code[0] and t1[1] in code and t1[2] in code and t1[3] in code: print(' p=1,v=3,x=0') elif t1[1] == code[1] and t1[0] in code and t1[2] in code and t1[3] in code: print(' p=1,v=3,x=0') elif t1[2] == code[2] and t1[1] in code and t1[0] in code and t1[3] in code: print(' p=1,v=3,x=0') elif t1[3] == code[3] and t1[1] in code and t1[2] in code and t1[0] in code: print(' p=1,v=3,x=0') elif t1[0] in code and t1[1] in code and t1[2] not in code and t1[3] not in code: print(" p=0,v=2,x=2") elif t1[0] in code and t1[2] in code and t1[1] not in code and t1[3] not in code: print(" p=0,v=2,x=2") elif t1[0] in code and t1[3] in code and t1[2] not in code and t1[1] not in code: print(" p=0,v=2,x=2") elif t1[1] in code and t1[2] in code and t1[0] not in code and t1[3] not in code: print(" p=0,v=2,x=2") elif t1[1] in code and t1[3] in code and t1[2] not in code and t1[0] not in code: print(" p=0,v=2,x=2") elif t1[2] in code and t1[3] in code and t1[1] not in code and t1[0] not in code: print(" p=0,v=2,x=2") elif t1[0] in code and t1[1] in code and t1[2] in code and t1[3] not in code: print(' p=0,v=3,x=1') elif t1[0] in code and t1[1] in code and t1[3] in code and t1[2] not in code: print(' p=0,v=3,x=1') elif t1[0] in code and t1[2] in code and t1[3] in code and t1[1] not in code: print(' p=0,v=3,x=1') elif t1[1] in code and t1[2] in code and t1[3] in code and t1[0] not in code: print(' p=0,v=3,x=1') elif t1[1] in code and t1[2] in code and t1[3] in code and t1[0] in code: print(' p=0,v=4,x=0') elif t1[0] == code[0] and t1[1] == code[1] and t1[2] not in code and t1[3] not in code: print(" p=2,v=0,x=2") elif t1[0] == code[0] and t1[2] == code[2] and t1[1] not in code and t1[3] not in code: print(" p=2,v=0,x=2") elif t1[0] == code[0] and t1[3] == code[3] and t1[2] not in code and t1[1] not in code: print(" p=2,v=0,x=2") elif t1[1] == code[1] and t1[2] == code[2] and t1[0] not in code and t1[3] not in code: print(" p=2,v=0,x=2") elif t1[1] == code[1] and t1[3] == code[3] and t1[2] not in code and t1[0] not in code: print(" p=2,v=0,x=2") elif t1[2] == code[2] and t1[3] == code[3] and t1[1] not in code and t1[0] not in code: print(" p=2,v=0,x=2") elif t1[0] == code[0] and t1[1] == code[1] and t1[2] in code and t1[3] not in code: print(' p=2,v=1,x=1') elif t1[0] == code[0] and t1[2] == code[2] and t1[1] in code and t1[3] not in code: print(' p=2,v=1,x=1') elif t1[0] == code[0] and t1[3] == code[3] and t1[1] in code and t1[2] not in code: print(' p=2,v=1,x=1') elif t1[0] == code[0] and t1[1] == code[1] and t1[3] in code and t1[2] not in code: print(' p=2,v=1,x=1') elif t1[0] == code[0] and t1[2] == code[2] and t1[3] in code and t1[1] not in code: print(' p=2,v=1,x=1') elif t1[0] == code[0] and t1[3] == code[3] and t1[2] in code and t1[1] not in code: print(' p=2,v=1,x=1') elif t1[1] == code[1] and t1[2] == code[2] and t1[0] in code and t1[3] not in code: print(' p=2,v=1,x=1') elif t1[1] == code[1] and t1[3] == code[3] and t1[2] in code and t1[0] not in code: print(' p=2,v=1,x=1') elif t1[1] == code[1] and t1[2] == code[2] and t1[3] in code and t1[0] not in code: print(' p=2,v=1,x=1') elif t1[1] == code[1] and t1[3] == code[3] and t1[0] in code and t1[2] not in code: print(' p=2,v=1,x=1') elif t1[2] == code[2] and t1[3] == code[3] and t1[0] in code and t1[1] not in code: print(' p=2,v=1,x=1') elif t1[2] == code[2] and t1[3] == code[3] and t1[1] in code and t1[0] not in code: print(' p=2,v=1,x=1') elif t1[0] == code[0] and t1[1] == code[1] and t1[2] in code and t1[3] in code: print(" p=2,v=2,x=0") elif t1[0] == code[0] and t1[2] == code[2] and t1[1] in code and t1[3] in code: print(" p=2,v=2,x=0") elif t1[0] == code[0] and t1[3] == code[3] and t1[2] in code and t1[1] in code: print(" p=2,v=2,x=0") elif t1[1] == code[1] and t1[2] == code[2] and t1[0] in code and t1[3] in code: print(" p=2,v=2,x=0") elif t1[1] == code[1] and t1[3] == code[3] and t1[2] in code and t1[0] in code: print(" p=2,v=2,x=0") elif t1[2] == code[2] and t1[3] == code[3] and t1[0] in code and t1[1] in code: print(" p=2,v=2,x=0") elif t1[0] == code[0] and t1[1] == code[1] and t1[2] == code[2] and t1[3] not in code: print(' p=3,v=0,x=1') elif t1[0] == code[0] and t1[1] == code[1] and t1[3] == code[3] and t1[2] not in code: print(' p=3,v=0,x=1') elif t1[1] == code[1] and t1[2] == code[2] and t1[3] == code[3] and t1[0] not in code: print(' p=3,v=0,x=1') elif t1[2] == code[2] and t1[3] == code[3] and t1[0] == code[0] and t1[1] not in code: print(' p=3,v=0,x=1') elif t1[0] == code[0] and t1[1] == code[1] and t1[2] == code[2] and t1[3] in code: print(' p=3,v=1,x=0') elif t1[0] == code[0] and t1[1] == code[1] and t1[3] == code[3] and t1[2] in code: print(' p=3,v=1,x=0') elif t1[1] == code[1] and t1[2] == code[2] and t1[3] == code[3] and t1[0] in code: print(' p=3,v=1,x=0') elif t1[2] == code[2] and t1[3] == code[3] and t1[0] == code[0] and t1[1] in code: print(' p=3,v=1,x=0') elif t1[0] not in code and t1[1] not in code and t1[2] not in code and t1[3] not in code: print(' p=0,v=0,x=4') elif t1[0] == code[0] and t1[1] == code[1] and t1[2] == code[2] and t1[3] == code[3]: print(WINNING_MSG) t2 = input() print('Turn #2 : ' + t2) if t2[0] in code and t2[1] not in code and t2[2] not in code and t2[3] not in code: print(" p=0,v=1,x=3") elif t2[1] in code and t2[0] not in code and t2[2] not in code and t2[3] not in code: print(' p=0,v=1,x=3') elif t2[2] in code and t2[0] not in code and t2[1] not in code and t2[3] not in code: print(" p=0,v=1,x=3") elif t2[3] in code and t2[0] not in code and t2[1] not in code and t2[2] not in code: print(' p=0,v=1,x=3') elif t2[0] == code[1] and t2[1] not in code and t2[2] not in code and t2[3] not in code: print(' p=1,v=0,x=3') elif t2[1] == code[1] and t2[0] not in code and t2[2] not in code and t2[3] not in code: print(' p=1,v=0,x=3') elif t2[2] == code[2] and t2[0] not in code and t2[1] not in code and t2[3] not in code: print(' p=1,v=0,x=3') elif t2[3] == code[3] and t2[1] not in code and t2[2] not in code and t2[0] not in code: print(' p=1,v=0,x=3') elif t2[0] == code[0] and t2[2] in code and t2[1] not in code and t2[3] not in code: print(' p=1,v=1,x=2') elif t2[2] == code[2] and t2[1] in code and t2[0] not in code and t2[3] not in code: print(' p=1,v=1,x=2') elif t2[1] == code[1] and t2[2] in code and t2[0] not in code and t2[3] not in code: print(' p=1,v=1,x=2') elif t2[0] == code[0] and t2[1] in code and t2[2] not in code and t2[3] not in code: print(' p=1,v=1,x=2') elif t2[0] == code[0] and t2[3] in code and t2[0] not in code and t2[2] not in code: print(' p=1,v=1,x=2') elif t2[1] == code[1] and t2[0] in code and t2[2] not in code and t2[3] not in code: print(' p=1,v=1,x=2') elif t2[1] == code[1] and t2[3] in code and t2[0] not in code and t2[2] not in code: print(' p=1,v=1,x=2') elif t2[2] == code[2] and t2[0] in code and t2[1] not in code and t2[3] not in code: print(' p=1,v=1,x=2') elif t2[2] == code[2] and t2[3] in code and t2[0] not in code and t2[1] not in code: print(' p=1,v=1,x=2') elif t2[3] == code[3] and t2[0] in code and t2[1] not in code and t2[2] not in code: print(' p=1,v=1,x=2') elif t2[3] == code[3] and t2[1] in code and t2[0] not in code and t2[2] not in code: print(' p=1,v=1,x=2') elif t2[3] == code[3] and t2[2] in code and t2[0] not in code and t2[1] not in code: print(' p=1,v=1,x=2') elif t2[0] == code[0] and t2[1] in code and t2[2] in code and t2[3] not in code: print(" p=1,v=2,x=1") elif t2[0] == code[0] and t2[1] in code and t2[3] in code and t2[2] not in code: print(" p=1,v=2,x=1") elif t2[0] == code[0] and t2[3] in code and t2[2] in code and t2[1] not in code: print(" p=1,v=2,x=1") elif t2[1] == code[1] and t2[0] in code and t2[2] in code and t2[3] not in code: print(" p=1,v=2,x=1") elif t2[1] == code[1] and t2[0] in code and t2[3] in code and t2[2] not in code: print(" p=1,v=2,x=1") elif t2[1] == code[1] and t2[2] in code and t2[3] in code and t2[0] not in code: print(" p=1,v=2,x=1") elif t2[2] == code[2] and t2[0] in code and t2[1] in code and t2[3] not in code: print(" p=1,v=2,x=1") elif t2[2] == code[2] and t2[0] in code and t2[3] in code and t2[1] not in code: print(" p=1,v=2,x=1") elif t2[2] == code[2] and t2[1] in code and t2[3] in code and t2[0] not in code: print(" p=1,v=2,x=1") elif t2[3] == code[3] and t2[0] in code and t2[1] in code and t2[2] not in code: print(" p=1,v=2,x=1") elif t2[3] == code[3] and t2[0] in code and t2[2] in code and t2[1] not in code: print(" p=1,v=2,x=1") elif t2[3] == code[3] and t2[1] in code and t2[2] in code and t2[0] not in code: print(" p=1,v=2,x=1") elif t2[0] == code[0] and t2[1] in code and t2[2] in code and t2[3] in code: print(' p=1,v=3,x=0') elif t2[1] == code[1] and t2[0] in code and t2[2] in code and t2[3] in code: print(' p=1,v=3,x=0') elif t2[2] == code[2] and t2[1] in code and t2[0] in code and t2[3] in code: print(' p=1,v=3,x=0') elif t2[3] == code[3] and t2[1] in code and t2[2] in code and t2[0] in code: print(' p=1,v=3,x=0') elif t2[0] in code and t2[1] in code and t2[2] not in code and t2[3] not in code: print(" p=0,v=2,x=2") elif t2[0] in code and t2[2] in code and t2[1] not in code and t2[3] not in code: print(" p=0,v=2,x=2") elif t2[0] in code and t2[3] in code and t2[2] not in code and t2[1] not in code: print(" p=0,v=2,x=2") elif t2[1] in code and t2[2] in code and t2[0] not in code and t2[3] not in code: print(" p=0,v=2,x=2") elif t2[1] in code and t2[3] in code and t2[2] not in code and t2[0] not in code: print(" p=0,v=2,x=2") elif t2[2] in code and t2[3] in code and t2[1] not in code and t2[0] not in code: print(" p=0,v=2,x=2") elif t2[0] in code and t2[1] in code and t2[2] in code and t2[3] not in code: print(' p=0,v=3,x=1') elif t2[0] in code and t2[1] in code and t2[3] in code and t2[2] not in code: print(' p=0,v=3,x=1') elif t2[0] in code and t2[2] in code and t2[3] in code and t2[1] not in code: print(' p=0,v=3,x=1') elif t2[1] in code and t2[2] in code and t2[3] in code and t2[0] not in code: print(' p=0,v=3,x=1') elif t2[1] in code and t2[2] in code and t2[3] in code and t2[0] in code: print(' p=0,v=4,x=0') elif t2[0] == code[0] and t2[1] == code[1] and t2[2] not in code and t2[3] not in code: print(" p=2,v=0,x=2") elif t2[0] == code[0] and t2[2] == code[2] and t2[1] not in code and t2[3] not in code: print(" p=2,v=0,x=2") elif t2[0] == code[0] and t2[3] == code[3] and t2[2] not in code and t2[1] not in code: print(" p=2,v=0,x=2") elif t2[1] == code[1] and t2[2] == code[2] and t2[0] not in code and t2[3] not in code: print(" p=2,v=0,x=2") elif t2[1] == code[1] and t2[3] == code[3] and t2[2] not in code and t2[0] not in code: print(" p=2,v=0,x=2") elif t2[2] == code[2] and t2[3] == code[3] and t2[1] not in code and t2[0] not in code: print(" p=2,v=0,x=2") elif t2[0] == code[0] and t2[1] == code[1] and t2[2] in code and t2[3] not in code: print(' p=2,v=1,x=1') elif t2[0] == code[0] and t2[2] == code[2] and t2[1] in code and t2[3] not in code: print(' p=2,v=1,x=1') elif t2[0] == code[0] and t2[3] == code[3] and t2[1] in code and t2[2] not in code: print(' p=2,v=1,x=1') elif t2[0] == code[0] and t2[1] == code[1] and t2[3] in code and t2[2] not in code: print(' p=2,v=1,x=1') elif t2[0] == code[0] and t2[2] == code[2] and t2[3] in code and t2[1] not in code: print(' p=2,v=1,x=1') elif t2[0] == code[0] and t2[3] == code[3] and t2[2] in code and t2[1] not in code: print(' v p=2,v=1,x=1') elif t2[1] == code[1] and t2[2] == code[2] and t2[0] in code and t2[3] not in code: print(' p=2,v=1,x=1') elif t2[1] == code[1] and t2[3] == code[3] and t2[2] in code and t2[0] not in code: print(' p=2,v=1,x=1') elif t2[1] == code[1] and t2[2] == code[2] and t2[3] in code and t2[0] not in code: print(' p=2,v=1,x=1') elif t2[1] == code[1] and t2[3] == code[3] and t2[0] in code and t2[2] not in code: print(' p=2,v=1,x=1') elif t2[2] == code[2] and t2[3] == code[3] and t2[0] in code and t2[1] not in code: print(' p=2,v=1,x=1') elif t2[2] == code[2] and t2[3] == code[3] and t2[1] in code and t2[0] not in code: print(' p=2,v=1,x=1') elif t2[0] == code[0] and t2[1] == code[1] and t2[2] in code and t2[3] in code: print(" p=2,v=2,x=0") elif t2[0] == code[0] and t2[2] == code[2] and t2[1] in code and t2[3] in code: print(" p=2,v=2,x=0") elif t2[0] == code[0] and t2[3] == code[3] and t2[2] in code and t2[1] in code: print(" p=2,v=2,x=0") elif t2[1] == code[1] and t2[2] == code[2] and t2[0] in code and t2[3] in code: print(" p=2,v=2,x=0") elif t2[1] == code[1] and t2[3] == code[3] and t2[2] in code and t2[0] in code: print(" p=2,v=2,x=0") elif t2[2] == code[2] and t2[3] == code[3] and t2[0] in code and t2[1] in code: print(" p=2,v=2,x=0") elif t2[0] == code[0] and t2[1] == code[1] and t2[2] == code[2] and t2[3] not in code: print(' p=3,v=0,x=1') elif t2[0] == code[0] and t2[1] == code[1] and t2[3] == code[3] and t2[2] not in code: print(' p=3,v=0,x=1') elif t2[1] == code[1] and t2[2] == code[2] and t2[3] == code[3] and t2[0] not in code: print(' p=3,v=0,x=1') elif t2[2] == code[2] and t2[3] == code[3] and t2[0] == code[0] and t2[1] not in code: print(' p=3,v=0,x=1') elif t2[0] == code[0] and t2[1] == code[1] and t2[2] == code[2] and t2[3] in code: print(' p=3,v=1,x=0') elif t2[0] == code[0] and t2[1] == code[1] and t2[3] == code[3] and t2[2] in code: print(' p=3,v=1,x=0') elif t2[1] == code[1] and t2[2] == code[2] and t2[3] == code[3] and t2[0] in code: print(' p=3,v=1,x=0') elif t2[2] == code[2] and t2[3] == code[3] and t2[0] == code[0] and t2[1] in code: print(' p=3,v=1,x=0') elif t2[0] not in code and t2[1] not in code and t2[2] not in code and t2[3] not in code: print(' p=0,v=0,x=4') elif t2[0] == code[0] and t2[1] == code[1] and t2[2] == code[2] and t2[3] == code[3]: print(WINNING_MSG) t3 = input() print('Turn #3 : ' + t3) if t3[0] in code and t3[1] not in code and t3[2] not in code and t3[3] not in code: print(" p=0,v=1,x=3") elif t3[1] in code and t3[0] not in code and t3[2] not in code and t3[3] not in code: print(' p=0,v=1,x=3') elif t3[2] in code and t3[0] not in code and t3[1] not in code and t3[3] not in code: print(" p=0,v=1,x=3") elif t3[3] in code and t3[0] not in code and t3[1] not in code and t3[2] not in code: print(' p=0,v=1,x=3') elif t3[0] == code[1] and t3[1] not in code and t3[2] not in code and t3[3] not in code: print(' p=1,v=0,x=3') elif t3[1] == code[1] and t3[0] not in code and t3[2] not in code and t3[3] not in code: print(' p=1,v=0,x=3') elif t3[2] == code[2] and t3[0] not in code and t3[1] not in code and t3[3] not in code: print(' p=1,v=0,x=3') elif t3[3] == code[3] and t3[1] not in code and t3[2] not in code and t3[0] not in code: print(' p=1,v=0,x=3') elif t3[0] == code[0] and t3[2] in code and t3[1] not in code and t3[3] not in code: print(' p=1,v=1,x=2') elif t3[2] == code[2] and t3[1] in code and t3[0] not in code and t3[3] not in code: print(' p=1,v=1,x=2') elif t3[1] == code[1] and t3[2] in code and t3[0] not in code and t3[3] not in code: print(' p=1,v=1,x=2') elif t3[0] == code[0] and t3[1] in code and t3[2] not in code and t3[3] not in code: print(' p=1,v=1,x=2') elif t3[0] == code[0] and t3[3] in code and t3[0] not in code and t3[2] not in code: print(' p=1,v=1,x=2') elif t3[1] == code[1] and t3[0] in code and t3[2] not in code and t3[3] not in code: print(' p=1,v=1,x=2') elif t3[1] == code[1] and t3[3] in code and t3[0] not in code and t3[2] not in code: print(' p=1,v=1,x=2') elif t3[2] == code[2] and t3[0] in code and t3[1] not in code and t3[3] not in code: print(' p=1,v=1,x=2') elif t3[2] == code[2] and t3[3] in code and t3[0] not in code and t3[1] not in code: print(' p=1,v=1,x=2') elif t3[3] == code[3] and t3[0] in code and t3[1] not in code and t3[2] not in code: print(' p=1,v=1,x=2') elif t3[3] == code[3] and t3[1] in code and t3[0] not in code and t3[2] not in code: print(' p=1,v=1,x=2') elif t3[3] == code[3] and t3[2] in code and t3[0] not in code and t3[1] not in code: print(' p=1,v=1,x=2') elif t3[0] == code[0] and t3[1] in code and t3[2] in code and t3[3] not in code: print(" p=1,v=2,x=1") elif t3[0] == code[0] and t3[1] in code and t3[3] in code and t3[2] not in code: print(" p=1,v=2,x=1") elif t3[0] == code[0] and t3[3] in code and t3[2] in code and t3[1] not in code: print(" p=1,v=2,x=1") elif t3[1] == code[1] and t3[0] in code and t3[2] in code and t3[3] not in code: print(" p=1,v=2,x=1") elif t3[1] == code[1] and t3[0] in code and t3[3] in code and t3[2] not in code: print(" p=1,v=2,x=1") elif t3[1] == code[1] and t3[2] in code and t3[3] in code and t3[0] not in code: print(" p=1,v=2,x=1") elif t3[2] == code[2] and t3[0] in code and t3[1] in code and t3[3] not in code: print(" p=1,v=2,x=1") elif t3[2] == code[2] and t3[0] in code and t3[3] in code and t3[1] not in code: print(" p=1,v=2,x=1") elif t3[2] == code[2] and t3[1] in code and t3[3] in code and t3[0] not in code: print(" p=1,v=2,x=1") elif t3[3] == code[3] and t3[0] in code and t3[1] in code and t3[2] not in code: print(" p=1,v=2,x=1") elif t3[3] == code[3] and t3[0] in code and t3[2] in code and t3[1] not in code: print(" p=1,v=2,x=1") elif t3[3] == code[3] and t3[1] in code and t3[2] in code and t3[0] not in code: print(" p=1,v=2,x=1") elif t3[0] == code[0] and t3[1] in code and t3[2] in code and t3[3] in code: print(' p=1,v=3,x=0') elif t3[1] == code[1] and t3[0] in code and t3[2] in code and t3[3] in code: print(' p=1,v=3,x=0') elif t3[2] == code[2] and t3[1] in code and t3[0] in code and t3[3] in code: print(' p=1,v=3,x=0') elif t3[3] == code[3] and t3[1] in code and t3[2] in code and t3[0] in code: print(' p=1,v=3,x=0') elif t3[0] in code and t1[1] in code and t3[2] not in code and t3[3] not in code: print(" p=0,v=2,x=2") elif t3[0] in code and t3[2] in code and t3[1] not in code and t3[3] not in code: print(" p=0,v=2,x=2") elif t3[0] in code and t3[3] in code and t3[2] not in code and t3[1] not in code: print(" p=0,v=2,x=2") elif t3[1] in code and t3[2] in code and t3[0] not in code and t3[3] not in code: print(" p=0,v=2,x=2") elif t3[1] in code and t3[3] in code and t3[2] not in code and t3[0] not in code: print(" p=0,v=2,x=2") elif t3[2] in code and t3[3] in code and t3[1] not in code and t3[0] not in code: print(" p=0,v=2,x=2") elif t3[0] in code and t3[1] in code and t3[2] in code and t3[3] not in code: print(' p=0,v=3,x=1') elif t3[0] in code and t3[1] in code and t3[3] in code and t3[2] not in code: print(' p=0,v=3,x=1') elif t3[0] in code and t3[2] in code and t3[3] in code and t3[1] not in code: print(' p=0,v=3,x=1') elif t3[1] in code and t3[2] in code and t3[3] in code and t3[0] not in code: print(' p=0,v=3,x=1') elif t3[1] in code and t3[2] in code and t3[3] in code and t3[0] in code: print(' p=0,v=4,x=0') elif t3[0] == code[0] and t3[1] == code[1] and t3[2] not in code and t3[3] not in code: print(" p=2,v=0,x=2") elif t3[0] == code[0] and t3[2] == code[2] and t3[1] not in code and t3[3] not in code: print(" p=2,v=0,x=2") elif t3[0] == code[0] and t3[3] == code[3] and t3[2] not in code and t3[1] not in code: print(" p=2,v=0,x=2") elif t3[1] == code[1] and t3[2] == code[2] and t3[0] not in code and t3[3] not in code: print(" p=2,v=0,x=2") elif t3[1] == code[1] and t3[3] == code[3] and t3[2] not in code and t3[0] not in code: print(" p=2,v=0,x=2") elif t3[2] == code[2] and t3[3] == code[3] and t3[1] not in code and t3[0] not in code: print(" p=2,v=0,x=2") elif t3[0] == code[0] and t3[1] == code[1] and t3[2] in code and t3[3] not in code: print(' p=2,v=1,x=1') elif t3[0] == code[0] and t3[2] == code[2] and t3[1] in code and t3[3] not in code: print(' p=2,v=1,x=1') elif t3[0] == code[0] and t3[3] == code[3] and t3[1] in code and t3[2] not in code: print(' p=2,v=1,x=1') elif t3[0] == code[0] and t3[1] == code[1] and t3[3] in code and t3[2] not in code: print(' p=2,v=1,x=1') elif t3[0] == code[0] and t3[2] == code[2] and t3[3] in code and t3[1] not in code: print(' p=2,v=1,x=1') elif t3[0] == code[0] and t3[3] == code[3] and t3[2] in code and t3[1] not in code: print(' p=2,v=1,x=1') elif t3[1] == code[1] and t3[2] == code[2] and t3[0] in code and t3[3] not in code: print(' p=2,v=1,x=1') elif t3[1] == code[1] and t3[3] == code[3] and t3[2] in code and t3[0] not in code: print(' p=2,v=1,x=1') elif t3[1] == code[1] and t3[2] == code[2] and t3[3] in code and t3[0] not in code: print(' p=2,v=1,x=1') elif t3[1] == code[1] and t3[3] == code[3] and t3[0] in code and t3[2] not in code: print(' p=2,v=1,x=1') elif t3[2] == code[2] and t3[3] == code[3] and t3[0] in code and t3[1] not in code: print(' p=2,v=1,x=1') elif t3[2] == code[2] and t3[3] == code[3] and t3[1] in code and t3[0] not in code: print(' p=2,v=1,x=1') elif t3[0] == code[0] and t3[1] == code[1] and t3[2] in code and t3[3] in code: print(" p=2,v=2,x=0") elif t3[0] == code[0] and t3[2] == code[2] and t3[1] in code and t3[3] in code: print(" p=2,v=2,x=0") elif t3[0] == code[0] and t3[3] == code[3] and t3[2] in code and t3[1] in code: print(" p=2,v=2,x=0") elif t3[1] == code[1] and t3[2] == code[2] and t3[0] in code and t3[3] in code: print(" p=2,v=2,x=0") elif t3[1] == code[1] and t3[3] == code[3] and t3[2] in code and t3[0] in code: print(" p=2,v=2,x=0") elif t3[2] == code[2] and t3[3] == code[3] and t3[0] in code and t3[1] in code: print(" p=2,v=2,x=0") elif t3[0] == code[0] and t3[1] == code[1] and t3[2] == code[2] and t3[3] not in code: print(' p=3,v=0,x=1') elif t3[0] == code[0] and t3[1] == code[1] and t3[3] == code[3] and t3[2] not in code: print(' p=3,v=0,x=1') elif t3[1] == code[1] and t3[2] == code[2] and t3[3] == code[3] and t3[0] not in code: print(' p=3,v=0,x=1') elif t3[2] == code[2] and t3[3] == code[3] and t3[0] == code[0] and t3[1] not in code: print(' p=3,v=0,x=1') elif t3[0] == code[0] and t3[1] == code[1] and t3[2] == code[2] and t3[3] in code: print(' p=3,v=1,x=0') elif t3[0] == code[0] and t3[1] == code[1] and t3[3] == code[3] and t3[2] in code: print(' p=3,v=1,x=0') elif t3[1] == code[1] and t3[2] == code[2] and t3[3] == code[3] and t3[0] in code: print(' p=3,v=1,x=0') elif t3[2] == code[2] and t3[3] == code[3] and t3[0] == code[0] and t3[1] in code: print(' p=3,v=1,x=0') elif t3[0] not in code and t3[1] not in code and t3[2] not in code and t3[3] not in code: print(' p=0,v=0,x=4') elif t3[0] == code[0] and t3[1] == code[1] and t3[2] == code[2] and t3[3] == code[3]: print(WINNING_MSG) t4 = input() print('Turn #4 : ' + t4) if t4[0] in code and t4[1] not in code and t4[2] not in code and t4[3] not in code: print(" p=0,v=1,x=3") elif t4[1] in code and t4[0] not in code and t4[2] not in code and t4[3] not in code: print(' p=0,v=1,x=3') elif t4[2] in code and t4[0] not in code and t4[1] not in code and t4[3] not in code: print(" p=0,v=1,x=3") elif t4[3] in code and t4[0] not in code and t4[1] not in code and t4[2] not in code: print(' p=0,v=1,x=3') elif t4[0] == code[1] and t4[1] not in code and t4[2] not in code and t4[3] not in code: print(' p=1,v=0,x=3') elif t4[1] == code[1] and t4[0] not in code and t4[2] not in code and t4[3] not in code: print(' p=1,v=0,x=3') elif t4[2] == code[2] and t4[0] not in code and t4[1] not in code and t4[3] not in code: print(' p=1,v=0,x=3') elif t4[3] == code[3] and t4[1] not in code and t4[2] not in code and t4[0] not in code: print(' p=1,v=0,x=3') elif t4[0] == code[0] and t4[2] in code and t4[1] not in code and t4[3] not in code: print(' p=1,v=1,x=2') elif t4[2] == code[2] and t4[1] in code and t4[0] not in code and t4[3] not in code: print(' p=1,v=1,x=2') elif t4[1] == code[1] and t4[2] in code and t4[0] not in code and t4[3] not in code: print(' p=1,v=1,x=2') elif t4[0] == code[0] and t4[1] in code and t4[2] not in code and t4[3] not in code: print(' p=1,v=1,x=2') elif t4[0] == code[0] and t4[3] in code and t4[0] not in code and t4[2] not in code: print(' p=1,v=1,x=2') elif t4[1] == code[1] and t4[0] in code and t4[2] not in code and t4[3] not in code: print(' p=1,v=1,x=2') elif t4[1] == code[1] and t4[3] in code and t4[0] not in code and t4[2] not in code: print(' p=1,v=1,x=2') elif t4[2] == code[2] and t4[0] in code and t4[1] not in code and t4[3] not in code: print(' p=1,v=1,x=2') elif t4[2] == code[2] and t4[3] in code and t4[0] not in code and t4[1] not in code: print(' p=1,v=1,x=2') elif t4[3] == code[3] and t4[0] in code and t4[1] not in code and t4[2] not in code: print(' p=1,v=1,x=2') elif t4[3] == code[3] and t4[1] in code and t4[0] not in code and t4[2] not in code: print(' p=1,v=1,x=2') elif t4[3] == code[3] and t4[2] in code and t4[0] not in code and t4[1] not in code: print(' p=1,v=1,x=2') elif t4[0] == code[0] and t4[1] in code and t4[2] in code and t4[3] not in code: print(" p=1,v=2,x=1") elif t4[0] == code[0] and t4[1] in code and t4[3] in code and t4[2] not in code: print(" p=1,v=2,x=1") elif t4[0] == code[0] and t4[3] in code and t4[2] in code and t4[1] not in code: print(" p=1,v=2,x=1") elif t4[1] == code[1] and t4[0] in code and t4[2] in code and t4[3] not in code: print(" p=1,v=2,x=1") elif t4[1] == code[1] and t4[0] in code and t4[3] in code and t4[2] not in code: print(" p=1,v=2,x=1") elif t4[1] == code[1] and t4[2] in code and t4[3] in code and t4[0] not in code: print(" p=1,v=2,x=1") elif t4[2] == code[2] and t4[0] in code and t4[1] in code and t4[3] not in code: print(" p=1,v=2,x=1") elif t4[2] == code[2] and t4[0] in code and t4[3] in code and t4[1] not in code: print(" p=1,v=2,x=1") elif t4[2] == code[2] and t4[1] in code and t4[3] in code and t4[0] not in code: print(" p=1,v=2,x=1") elif t4[3] == code[3] and t4[0] in code and t4[1] in code and t4[2] not in code: print(" p=1,v=2,x=1") elif t4[3] == code[3] and t4[0] in code and t4[2] in code and t4[1] not in code: print(" p=1,v=2,x=1") elif t4[3] == code[3] and t4[1] in code and t4[2] in code and t4[0] not in code: print(" p=1,v=2,x=1") elif t4[0] == code[0] and t4[1] in code and t4[2] in code and t4[3] in code: print(' p=1,v=3,x=0') elif t4[1] == code[1] and t4[0] in code and t4[2] in code and t4[3] in code: print(' p=1,v=3,x=0') elif t4[2] == code[2] and t4[1] in code and t4[0] in code and t4[3] in code: print(' p=1,v=3,x=0') elif t4[3] == code[3] and t4[1] in code and t4[2] in code and t4[0] in code: print(' p=1,v=3,x=0') elif t4[0] in code and t4[1] in code and t4[2] not in code and t4[3] not in code: print(" p=0,v=2,x=2") elif t4[0] in code and t4[2] in code and t4[1] not in code and t4[3] not in code: print(" p=0,v=2,x=2") elif t4[0] in code and t4[3] in code and t4[2] not in code and t4[1] not in code: print(" p=0,v=2,x=2") elif t4[1] in code and t4[2] in code and t4[0] not in code and t4[3] not in code: print(" p=0,v=2,x=2") elif t4[1] in code and t4[3] in code and t4[2] not in code and t4[0] not in code: print(" p=0,v=2,x=2") elif t4[2] in code and t4[3] in code and t4[1] not in code and t4[0] not in code: print(" p=0,v=2,x=2") elif t4[0] in code and t4[1] in code and t4[2] in code and t4[3] not in code: print(' p=0,v=3,x=1') elif t4[0] in code and t4[1] in code and t4[3] in code and t4[2] not in code: print(' p=0,v=3,x=1') elif t4[0] in code and t4[2] in code and t4[3] in code and t4[1] not in code: print(' p=0,v=3,x=1') elif t4[1] in code and t4[2] in code and t4[3] in code and t4[0] not in code: print(' p=0,v=3,x=1') elif t4[1] in code and t4[2] in code and t4[3] in code and t4[0] in code: print(' p=0,v=4,x=0') elif t4[0] == code[0] and t4[1] == code[1] and t4[2] not in code and t4[3] not in code: print(" p=2,v=0,x=2") elif t4[0] == code[0] and t4[2] == code[2] and t4[1] not in code and t4[3] not in code: print(" p=2,v=0,x=2") elif t4[0] == code[0] and t4[3] == code[3] and t4[2] not in code and t4[1] not in code: print(" p=2,v=0,x=2") elif t4[1] == code[1] and t4[2] == code[2] and t4[0] not in code and t4[3] not in code: print(" p=2,v=0,x=2") elif t4[1] == code[1] and t4[3] == code[3] and t4[2] not in code and t4[0] not in code: print(" p=2,v=0,x=2") elif t4[2] == code[2] and t4[3] == code[3] and t4[1] not in code and t4[0] not in code: print(" p=2,v=0,x=2") elif t4[0] == code[0] and t4[1] == code[1] and t4[2] in code and t4[3] not in code: print(' p=2,v=1,x=1') elif t4[0] == code[0] and t4[2] == code[2] and t4[1] in code and t4[3] not in code: print(' p=2,v=1,x=1') elif t4[0] == code[0] and t4[3] == code[3] and t4[1] in code and t4[2] not in code: print(' p=2,v=1,x=1') elif t4[0] == code[0] and t4[1] == code[1] and t4[3] in code and t4[2] not in code: print(' p=2,v=1,x=1') elif t4[0] == code[0] and t4[2] == code[2] and t4[3] in code and t4[1] not in code: print(' p=2,v=1,x=1') elif t4[0] == code[0] and t4[3] == code[3] and t4[2] in code and t4[1] not in code: print(' p=2,v=1,x=1') elif t4[1] == code[1] and t4[2] == code[2] and t4[0] in code and t4[3] not in code: print(' p=2,v=1,x=1') elif t4[1] == code[1] and t4[3] == code[3] and t4[2] in code and t4[0] not in code: print(' p=2,v=1,x=1') elif t4[1] == code[1] and t4[2] == code[2] and t4[3] in code and t4[0] not in code: print(' p=2,v=1,x=1') elif t4[1] == code[1] and t4[3] == code[3] and t4[0] in code and t4[2] not in code: print(' p=2,v=1,x=1') elif t4[2] == code[2] and t4[3] == code[3] and t4[0] in code and t4[1] not in code: print(' p=2,v=1,x=1') elif t4[2] == code[2] and t4[3] == code[3] and t4[1] in code and t4[0] not in code: print(' p=2,v=1,x=1') elif t4[0] == code[0] and t4[1] == code[1] and t4[2] in code and t4[3] in code: print(" p=2,v=2,x=0") elif t4[0] == code[0] and t4[2] == code[2] and t4[1] in code and t4[3] in code: print(" p=2,v=2,x=0") elif t4[0] == code[0] and t4[3] == code[3] and t4[2] in code and t4[1] in code: print(" p=2,v=2,x=0") elif t4[1] == code[1] and t4[2] == code[2] and t4[0] in code and t4[3] in code: print(" p=2,v=2,x=0") elif t4[1] == code[1] and t4[3] == code[3] and t4[2] in code and t4[0] in code: print(" p=2,v=2,x=0") elif t4[2] == code[2] and t4[3] == code[3] and t4[0] in code and t4[1] in code: print(" p=2,v=2,x=0") elif t4[0] == code[0] and t4[1] == code[1] and t4[2] == code[2] and t4[3] not in code: print(' p=3,v=0,x=1') elif t4[0] == code[0] and t4[1] == code[1] and t4[3] == code[3] and t4[2] not in code: print(' p=3,v=0,x=1') elif t4[1] == code[1] and t4[2] == code[2] and t4[3] == code[3] and t4[0] not in code: print(' p=3,v=0,x=1') elif t4[2] == code[2] and t4[3] == code[3] and t4[0] == code[0] and t4[1] not in code: print(' p=3,v=0,x=1') elif t4[0] == code[0] and t4[1] == code[1] and t4[2] == code[2] and t4[3] in code: print(' p=3,v=1,x=0') elif t4[0] == code[0] and t4[1] == code[1] and t4[3] == code[3] and t4[2] in code: print(' p=3,v=1,x=0') elif t4[1] == code[1] and t4[2] == code[2] and t4[3] == code[3] and t4[0] in code: print(' p=3,v=1,x=0') elif t4[2] == code[2] and t4[3] == code[3] and t4[0] == code[0] and t4[1] in code: print(' p=3,v=1,x=0') elif t4[0] not in code and t4[1] not in code and t4[2] not in code and t4[3] not in code: print(' p=0,v=0,x=4') elif t4[0] == code[0] and t4[1] == code[1] and t4[2] == code[2] and t4[3] == code[3]: print(WINNING_MSG) print(LOSING_MSG) print('The answer is ' + code ) print('Please try again...') |
# 6330507321 (17.21) 337 (2021-02-14 01:18) c=input('Turn #1 : ') if c != code: if c[1] in code: if c[1]==code[1]: p1=1 v1=0 x1=0 else: p1=0 v1=1 x1=0 else: p1=0 v1=0 x1=1 if c[2] in code: if c[2]==code[2]: p2=1 v2=0 x2=0 else: p2=0 v2=1 x2=0 else: p2=0 v2=0 x2=1 if c[3] in code: if c[3]==code[3]: p3=1 v3=0 x3=0 else: p3=0 v3=1 x3=0 else: p3=0 v3=0 x3=1 if c[0] in code: if c[0]==code[0]: p0=1 v0=0 x0=0 else: p0=0 v0=1 x0=0 else: p0=0 v0=0 x0=1 ps=str(p1+p2+p3+p0) vs=str(v1+v2+v3+v0) xs=str(x1+x2+x3+x0) z='p=',ps+','+'v=',vs+','+'x=',xs z=z[0]+z[1]+z[2]+z[3] print(' ',z) c=input('Turn #2 : ') if c != code: if c[1] in code: if c[1]==code[1]: p1=1 v1=0 x1=0 else: p1=0 v1=1 x1=0 else: p1=0 v1=0 x1=1 if c[2] in code: if c[2]==code[2]: p2=1 v2=0 x2=0 else: p2=0 v2=1 x2=0 else: p2=0 v2=0 x2=1 if c[3] in code: if c[3]==code[3]: p3=1 v3=0 x3=0 else: p3=0 v3=1 x3=0 else: p3=0 v3=0 x3=1 if c[0] in code: if c[0]==code[0]: p0=1 v0=0 x0=0 else: p0=0 v0=1 x0=0 else: p0=0 v0=0 x0=1 ps=str(p1+p2+p3+p0) vs=str(v1+v2+v3+v0) xs=str(x1+x2+x3+x0) z='p=',ps+','+'v=',vs+','+'x=',xs z=z[0]+z[1]+z[2]+z[3] print(' ',z) c=input('Turn #3 : ') if c != code: if c[1] in code: if c[1]==code[1]: p1=1 v1=0 x1=0 else: p1=0 v1=1 x1=0 else: p1=0 v1=0 x1=1 if c[2] in code: if c[2]==code[2]: p2=1 v2=0 x2=0 else: p2=0 v2=1 x2=0 else: p2=0 v2=0 x2=1 if c[3] in code: if c[3]==code[3]: p3=1 v3=0 x3=0 else: p3=0 v3=1 x3=0 else: p3=0 v3=0 x3=1 if c[0] in code: if c[0]==code[0]: p0=1 v0=0 x0=0 else: p0=0 v0=1 x0=0 else: p0=0 v0=0 x0=1 ps=str(p1+p2+p3+p0) vs=str(v1+v2+v3+v0) xs=str(x1+x2+x3+x0) z='p=',ps+','+'v=',vs+','+'x=',xs z=z[0]+z[1]+z[2]+z[3] print(' ',z) c=input('Turn #4 : ') if c != code: if c[1] in code: if c[1]==code[1]: p1=1 v1=0 x1=0 else: p1=0 v1=1 x1=0 else: p1=0 v1=0 x1=1 if c[2] in code: if c[2]==code[2]: p2=1 v2=0 x2=0 else: p2=0 v2=1 x2=0 else: p2=0 v2=0 x2=1 if c[3] in code: if c[3]==code[3]: p3=1 v3=0 x3=0 else: p3=0 v3=1 x3=0 else: p3=0 v3=0 x3=1 if c[0] in code: if c[0]==code[0]: p0=1 v0=0 x0=0 else: p0=0 v0=1 x0=0 else: p0=0 v0=0 x0=1 ps=str(p1+p2+p3+p0) vs=str(v1+v2+v3+v0) xs=str(x1+x2+x3+x0) z='p=',ps+','+'v=',vs+','+'x=',xs z=z[0]+z[1]+z[2]+z[3] print(' ',z) print('Sorry! You just lost it.') print('The answer is'+' ',code ) print('Please try again...') else: print('Congratulations! You won the game.') |
# 6330508021 (20.00) 338 (2021-02-12 23:30) a = input("Turn #1 : ") P= 0 V= 0 if a[0] == code[0]: P +=1 elif a[0] in code: V +=1 if a[1] == code[1]: P +=1 elif a[1] in code: V +=1 if a[2] == code[2]: P +=1 elif a[2] in code: V +=1 if a[3] == code[3]: P +=1 elif a[3] in code: V +=1 X= 4-P-V if P == 4 : print(WINNING_MSG) else : print(" ""P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) a = input("Turn #2 : ") P= 0 V= 0 if a[0] == code[0]: P +=1 elif a[0] in code: V +=1 if a[1] == code[1]: P +=1 elif a[1] in code: V +=1 if a[2] == code[2]: P +=1 elif a[2] in code: V +=1 if a[3] == code[3]: P +=1 elif a[3] in code: V +=1 X= 4-P-V if P == 4 : print(WINNING_MSG) else : print(" ""P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) a = input("Turn #3 : ") P= 0 V= 0 if a[0] == code[0]: P +=1 elif a[0] in code: V +=1 if a[1] == code[1]: P +=1 elif a[1] in code: V +=1 if a[2] == code[2]: P +=1 elif a[2] in code: V +=1 if a[3] == code[3]: P +=1 elif a[3] in code: V +=1 X= 4-P-V if P == 4 : print(WINNING_MSG) else : print(" ""P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) a = input("Turn #4 : ") P= 0 V= 0 if a[0] == code[0]: P +=1 elif a[0] in code: V +=1 if a[1] == code[1]: P +=1 elif a[1] in code: V +=1 if a[2] == code[2]: P +=1 elif a[2] in code: V +=1 if a[3] == code[3]: P +=1 elif a[3] in code: V +=1 X= 4-P-V if P == 4 : print(WINNING_MSG) else : print(" ""P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) print(LOSING_MSG) print("The answer is "+code) print("Please try again...") |
# 6330509621 (20.00) 339 (2021-02-15 15:47) #code = 'ABCD' ans = input('Turn #1 : ') #AECD v = 0 x = 0 p = 0 if ans[0] == code[0] : p += 1 else : p += 0 if ans[1] == code[1] : p += 1 else : p += 0 if ans[2] == code[2] : p += 1 else : p += 0 if ans[3] == code[3] : p += 1 else: p += 0 if p == 4: print(WINNING_MSG) exit() if ans[0] in code and ans[0] != code[0] : v += 1 else : v += 0 if ans[1] in code and ans[1] != code[1] : v += 1 else : v += 0 if ans[2] in code and ans[2] != code[2] : v += 1 else : v += 0 if ans[3] in code and ans[3] != code[3] : v += 1 else : v += 0 if not ans[0] in code : x += 1 else : x += 0 if not ans[1] in code : x += 1 else : x += 0 if not ans[2] in code : x += 1 else : x += 0 if not ans[3] in code : x += 1 else : x += 0 print(' '+"P="+str(p)+',V='+str(v)+',X='+str(x)) ans = input('Turn #2 : ') #AECD v = 0 x = 0 p = 0 if ans[0] == code[0] : p += 1 else : p += 0 if ans[1] == code[1] : p += 1 else : p += 0 if ans[2] == code[2] : p += 1 else : p += 0 if ans[3] == code[3] : p += 1 else: p += 0 if p == 4: print(WINNING_MSG) exit() if ans[0] in code and ans[0] != code[0] : v += 1 else : v += 0 if ans[1] in code and ans[1] != code[1] : v += 1 else : v += 0 if ans[2] in code and ans[2] != code[2] : v += 1 else : v += 0 if ans[3] in code and ans[3] != code[3] : v += 1 else : v += 0 if not ans[0] in code : x += 1 else : x += 0 if not ans[1] in code : x += 1 else : x += 0 if not ans[2] in code : x += 1 else : x += 0 if not ans[3] in code : x += 1 else : x += 0 print(' '+"P="+str(p)+',V='+str(v)+',X='+str(x)) ans = input('Turn #3 : ') #AECD v = 0 x = 0 p = 0 if ans[0] == code[0] : p += 1 else : p += 0 if ans[1] == code[1] : p += 1 else : p += 0 if ans[2] == code[2] : p += 1 else : p += 0 if ans[3] == code[3] : p += 1 else: p += 0 if p == 4: print(WINNING_MSG) exit() if ans[0] in code and ans[0] != code[0] : v += 1 else : v += 0 if ans[1] in code and ans[1] != code[1] : v += 1 else : v += 0 if ans[2] in code and ans[2] != code[2] : v += 1 else : v += 0 if ans[3] in code and ans[3] != code[3] : v += 1 else : v += 0 if not ans[0] in code : x += 1 else : x += 0 if not ans[1] in code : x += 1 else : x += 0 if not ans[2] in code : x += 1 else : x += 0 if not ans[3] in code : x += 1 else : x += 0 print(' '+"P="+str(p)+',V='+str(v)+',X='+str(x)) ans = input('Turn #4 : ') #AECD v = 0 x = 0 p = 0 if ans[0] == code[0] : p += 1 else : p += 0 if ans[1] == code[1] : p += 1 else : p += 0 if ans[2] == code[2] : p += 1 else : p += 0 if ans[3] == code[3] : p += 1 else: p += 0 if p == 4: print(WINNING_MSG) exit() if ans[0] in code and ans[0] != code[0] : v += 1 else : v += 0 if ans[1] in code and ans[1] != code[1] : v += 1 else : v += 0 if ans[2] in code and ans[2] != code[2] : v += 1 else : v += 0 if ans[3] in code and ans[3] != code[3] : v += 1 else : v += 0 if not ans[0] in code : x += 1 else : x += 0 if not ans[1] in code : x += 1 else : x += 0 if not ans[2] in code : x += 1 else : x += 0 if not ans[3] in code : x += 1 else : x += 0 print(' '+"P="+str(p)+',V='+str(v)+',X='+str(x)) print(LOSING_MSG) print('The answer is '+str(code)) print('Please try again...') |
# 6330510121 (20.00) 340 (2021-02-11 17:54) a=[code[0],code[1],code[2],code[3]] x=input('Turn #1 : ') b=(a.count(x[0])+a.count(x[1])+a.count(x[2])+a.count(x[3])) P=0 if a[0]==x[0]: P+=1 if a[1]==x[1]: P+=1 if a[2]==x[2]: P+=1 if a[3]==x[3]: P+=1 V=b-P X=4-b if P==4: print(WINNING_MSG) else : print(' P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) x=input('Turn #2 : ') b=(a.count(x[0])+a.count(x[1])+a.count(x[2])+a.count(x[3])) P=0 if a[0]==x[0]: P+=1 if a[1]==x[1]: P+=1 if a[2]==x[2]: P+=1 if a[3]==x[3]: P+=1 V=b-P X=4-b if P==4: print(WINNING_MSG) else : print(' P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) x=input('Turn #3 : ') b=(a.count(x[0])+a.count(x[1])+a.count(x[2])+a.count(x[3])) P=0 P=0 if a[0]==x[0]: P+=1 if a[1]==x[1]: P+=1 if a[2]==x[2]: P+=1 if a[3]==x[3]: P+=1 V=b-P X=4-b if P==4: print(WINNING_MSG) else : print(' P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) x=input('Turn #4 : ') b=(a.count(x[0])+a.count(x[1])+a.count(x[2])+a.count(x[3])) P=0 if a[0]==x[0]: P+=1 if a[1]==x[1]: P+=1 if a[2]==x[2]: P+=1 if a[3]==x[3]: P+=1 V=b-P X=4-b if P==4: print(WINNING_MSG) else: print(' P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) print(LOSING_MSG) print('The answer is'+' '+code) print('Please try again...') |
# 6330511821 (19.90) 341 (2021-02-13 01:44) #TURNONE x = input('Turn #1 :',) P = 0 V = 0 X = 0 if x[0] == code[0]: P = P + 1 if x[1] == code[1]: P = P + 1 if x[2] == code[2]: P = P + 1 if x[3] == code[3]: P = P + 1 if x[0] in code and x[0] != code[0]: V = V + 1 if x[1] in code and x[1] != code[1]: V = V + 1 if x[2] in code and x[2] != code[2]: V = V + 1 if x[3] in code and x[3] != code[3]: V = V + 1 if not x[0] in code : X = X + 1 if not x[1] in code : X = X + 1 if not x[2] in code : X = X + 1 if not x[3] in code : X = X + 1 if x == code: print(WINNING_MSG) else: print(' '*9+'P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) y = input('Turn #2 :',) #TURNTWO P = 0 V = 0 X = 0 if y[0] == code[0]: P = P + 1 if y[1] == code[1]: P = P + 1 if y[2] == code[2]: P = P + 1 if y[3] == code[3]: P = P + 1 if y[0] in code and y[0] != code[0]: V = V + 1 if y[1] in code and y[1] != code[1]: V = V + 1 if y[2] in code and y[2] != code[2]: V = V + 1 if y[3] in code and y[3] != code[3]: V = V + 1 if not y[0] in code : X = X + 1 if not y[1] in code : X = X + 1 if not y[2] in code : X = X + 1 if not y[3] in code : X = X + 1 if y == code: print(WINNING_MSG) else: print(' '*9+'P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) z = input('Turn #3 :',) #TURNTHREE P = 0 V = 0 X = 0 if z[0] == code[0]: P = P + 1 if z[1] == code[1]: P = P + 1 if z[2] == code[2]: P = P + 1 if z[3] == code[3]: P = P + 1 if z[0] in code and z[0] != code[0]: V = V + 1 if z[1] in code and z[1] != code[1]: V = V + 1 if z[2] in code and z[2] != code[2]: V = V + 1 if z[3] in code and z[3] != code[3]: V = V + 1 if not z[0] in code : X = X + 1 if not z[1] in code : X = X + 1 if not z[2] in code : X = X + 1 if not z[3] in code : X = X + 1 if z == code: print(WINNING_MSG) else: print(' '*9+'P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) k = input('Turn #4 :',) #TURNFOUR P = 0 V = 0 X = 0 if k[0] == code[0]: P = P + 1 if k[1] == code[1]: P = P + 1 if k[2] == code[2]: P = P + 1 if k[3] == code[3]: P = P + 1 if k[0] in code and k[0] != code[0]: V = V + 1 if k[1] in code and k[1] != code[1]: V = V + 1 if k[2] in code and k[2] != code[2]: V = V + 1 if k[3] in code and k[3] != code[3]: V = V + 1 if not k[0] in code : X = X + 1 if not k[1] in code : X = X + 1 if not k[2] in code : X = X + 1 if not k[3] in code : X = X + 1 if k == code: print(WINNING_MSG) else: print(' '*9+'P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) print(LOSING_MSG) print('The answer is '+code) print('Please try again...') |
# 6330512421 (17.37) 342 (2021-02-12 17:16) #####ROUND1 P = 0 V = 0 X = 0 f = 0 k = input("Turn #1 : ", ) if k[0] in code[0] : P += 1 elif k[0] in code and k[0] not in code[0] : V += 1 elif k[0] not in code and k[0] != code[0] : X += 1 if k[1] in code[1] : P += 1 elif k[1] in code and k[1] not in code[1] : V += 1 elif k[1] not in code and k[1] != code[1] : X += 1 if k[2] in code[2] : P += 1 elif k[2] in code and k[2] not in code[2] : V += 1 elif k[2] not in code and k[2] != code[2] : X += 1 if k[3] in code[3] : P += 1 elif k[3] in code and k[3] not in code[3] : V += 1 elif k[3] not in code and k[3] != code[3] : X += 1 if P == 4 : print(WINNING_MSG) f+=1 else : print(" ","P="+str(P)+",V="+str(V)+",X="+str(X)) #####ROUND2 P = 0 V = 0 X = 0 if f!= 1 : k = input("Turn #2 : ", ) if k[0] in code[0] : P += 1 elif k[0] in code and k[0] not in code[0] : V += 1 elif k[0] not in code and k[0] != code[0] : X += 1 if k[1] in code[1] : P += 1 elif k[1] in code and k[1] not in code[1] : V += 1 elif k[1] not in code and k[1] != code[1] : X += 1 if k[2] in code[2] : P += 1 elif k[2] in code and k[2] not in code[2] : V += 1 elif k[2] not in code and k[2] != code[2] : X += 1 if k[3] in code[3] : P += 1 elif k[3] in code and k[3] not in code[3] : V += 1 elif k[3] not in code and k[3] != code[3] : X += 1 if P == 4 : print(WINNING_MSG) f+=1 else : print(" ","P="+str(P)+",V="+str(V)+",X="+str(X)) else : pass #####ROUND 3 P = 0 V = 0 X = 0 if f!= 1 : k = input("Turn #3 : ", ) if k[0] in code[0] : P += 1 elif k[0] in code and k[0] not in code[0] : V += 1 elif k[0] not in code and k[0] != code[0] : X += 1 if k[1] in code[1] : P += 1 elif k[1] in code and k[1] not in code[1] : V += 1 elif k[1] not in code and k[1] != code[1] : X += 1 if k[2] in code[2] : P += 1 elif k[2] in code and k[2] not in code[2] : V += 1 elif k[2] not in code and k[2] != code[2] : X += 1 if k[3] in code[3] : P += 1 elif k[3] in code and k[3] not in code[3] : V += 1 elif k[3] not in code and k[3] != code[3] : X += 1 if P == 4 : print(WINNING_MSG) f+=1 else : print(" ","P="+str(P)+",V="+str(V)+",X="+str(X)) else : pass #####ROUND4 P = 0 V = 0 X = 0 if f!= 1 : k = input("Turn #4 : ", ) if k[0] in code[0] : P += 1 elif k[0] in code and k[0] not in code[0] : V += 1 elif k[0] not in code and k[0] != code[0] : X += 1 if k[1] in code[1] : P += 1 elif k[1] in code and k[1] not in code[1] : V += 1 elif k[1] not in code and k[1] != code[1] : X += 1 if k[2] in code[2] : P += 1 elif k[2] in code and k[2] not in code[2] : V += 1 elif k[2] not in code and k[2] != code[2] : X += 1 if k[3] in code[3] : P += 1 elif k[3] in code and k[3] not in code[3] : V += 1 elif k[3] not in code and k[3] != code[3] : X += 1 if P == 4 : print(WINNING_MSG) else : print(LOSING_MSG) print("The answer is ",code,) print("Please try again...") |
# 6330513021 (20.00) 343 (2021-02-11 17:57) check = False A=input('Turn #1 : ') p=0 v=0 x=0 if A[0] in code: v=v+1 if A[1] in code: v=v+1 if A[2] in code: v=v+1 if A[3] in code: v=v+1 if A[0] ==code[0]: p=p+1 if A[1] ==code[1]: p=p+1 if A[2] ==code[2]: p=p+1 if A[3] ==code[3]: p=p+1 if not A[0] in code: x=x+1 if not A[1] in code: x=x+1 if not A[2] in code: x=x+1 if not A[3] in code: x=x+1 if A == code : print(WINNING_MSG) check = True else : print(' '+'P='+str(p)+',V='+str(v-p)+',X='+str(x)) if not check : B=input('Turn #2 : ') p=0 v=0 x=0 if B[0] in code : v=v+1 if B[1] in code: v=v+1 if B[2] in code: v=v+1 if B[3] in code: v=v+1 if B[0] ==code[0]: p=p+1 if B[1] ==code[1]: p=p+1 if B[2]==code[2] : p=p+1 if B[3]==code[3] : p=p+1 if not B[0] in code: x=x+1 if not B[1] in code: x=x+1 if not B[2] in code: x=x+1 if not B[3] in code: x=x+1 if B == code : print(WINNING_MSG) check = True else : print(' '+'P='+str(p)+',V='+str(v-p)+',X='+str(x)) if not check : C=input('Turn #3 : ') p=0 v=0 x=0 if C[0] in code : v=v+1 if C[1] in code: v=v+1 if C[2] in code: v=v+1 if C[3] in code: v=v+1 if C[0] ==code[0]: p=p+1 if C[1] ==code[1]: p=p+1 if C[2]==code[2] : p=p+1 if C[3]==code[3] : p=p+1 if not C[0] in code: x=x+1 if not C[1] in code: x=x+1 if not C[2] in code: x=x+1 if not C[3] in code: x=x+1 if C == code : print(WINNING_MSG) check = True else : print(' '+'P='+str(p)+',V='+str(v-p)+',X='+str(x)) if not check : D=input('Turn #4 : ') p=0 v=0 x=0 if D[0] in code : v=v+1 if D[1] in code: v=v+1 if D[2] in code: v=v+1 if D[3] in code: v=v+1 if D[0] ==code[0]: p=p+1 if D[1] ==code[1]: p=p+1 if D[2]==code[2] : p=p+1 if D[3]==code[3] : p=p+1 if not D[0] in code: x=x+1 if not D[1] in code: x=x+1 if not D[2] in code: x=x+1 if not D[3] in code: x=x+1 if D == code : print(WINNING_MSG) else : print(' '+'P='+str(p)+',V='+str(v-p)+',X='+str(x)) print(LOSING_MSG) print('The answer is '+code) print('Please try again...') |
# 6330514721 (20.00) 344 (2021-02-14 18:04) P=0;V=0;X=0 a=input("Turn #1 : ") if a[0]==code[0]: P+=1 else: if a[0] in code: V+=1 else: X+=1 if a[1]==code[1]: P+=1 else: if a[1] in code: V+=1 else: X+=1 if a[2]==code[2]: P+=1 else: if a[2] in code: V+=1 else: X+=1 if a[3]==code[3]: P+=1 else: if a[3] in code: V+=1 else: X+=1 if P==4: print("Congratulations! You won the game.") else: print(("\t "+"P"+"="+str(P))+","+("V"+"="+str(V))+","+("X""="+str(X))) P=0;V=0;X=0 b=input("Turn #2 : ") if b[0]==code[0]: P+=1 else: if b[0] in code: V+=1 else: X+=1 if b[1]==code[1]: P+=1 else: if b[1] in code: V+=1 else: X+=1 if b[2]==code[2]: P+=1 else: if b[2] in code: V+=1 else: X+=1 if b[3]==code[3]: P+=1 else: if b[3] in code: V+=1 else: X+=1 if P==4: print("Congratulations! You won the game.") else: print(("\t "+"P"+"="+str(P))+","+("V"+"="+str(V))+","+("X"+"="+str(X))) P=0;V=0;X=0 c=input("Turn #3 : ") if c[0]==code[0]: P+=1 else: if c[0] in code: V+=1 else: X+=1 if c[1]==code[1]: P+=1 else: if c[1] in code: V+=1 else: X+=1 if c[2]==code[2]: P+=1 else: if c[2] in code: V+=1 else: X+=1 if c[3]==code[3]: P+=1 else: if c[3] in code: V+=1 else: X+=1 if P==4: print("Congratulations! You won the game.") else: print(("\t "+"P"+"="+str(P))+","+("V"+"="+str(V))+","+("X"+"="+str(X))) P=0;V=0;X=0 d=input("Turn #4 : ") if d[0]==code[0]: P+=1 else: if d[0] in code: V+=1 else: X+=1 if d[1]==code[1]: P+=1 else: if d[1] in code: V+=1 else: X+=1 if d[2]==code[2]: P+=1 else: if d[2] in code: V+=1 else: X+=1 if d[3]==code[3]: P+=1 else: if d[3] in code: V+=1 else: X+=1 if P==4: print("Congratulations! You won the game.") else: print(("\t "+"P"+"="+str(P))+","+("V"+"="+str(V))+","+("X"+"="+str(X))) print("Sorry! You just lost it.") print("The answer is"+" "+code) print("Please try again...") |
# 6330515321 (20.00) 345 (2021-02-15 21:57) A = input("Turn #1 : ") frist = A[0] second = A[1] third = A[2] fourth = A[3] if A == code : print(WINNING_MSG) else : if A[0] == code[0] : a = 1 else : a = 0 if A[1] == code[1] : b = 1 else : b = 0 if A[2] == code[2] : c = 1 else : c = 0 if A[3] == code[3] : d = 1 else : d = 0 P = a+b+c+d V = code.count(frist)+code.count(second)+code.count(third)+code.count(fourth)-P X = 4-V-P print(" "+"P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) A = input("Turn #2 : ") if A == code : print(WINNING_MSG) else : if A[0] == code[0] : a = 1 else : a = 0 if A[1] == code[1] : b = 1 else : b = 0 if A[2] == code[2] : c = 1 else : c = 0 if A[3] == code[3] : d = 1 else : d = 0 P = a+b+c+d V = code.count(frist)+code.count(second)+code.count(third)+code.count(fourth)-P X = 4-V-P print(" "+"P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) A = input("Turn #3 : ") if A == code : print(WINNING_MSG) else : if A[0] == code[0] : a = 1 else : a = 0 if A[1] == code[1] : b = 1 else : b = 0 if A[2] == code[2] : c = 1 else : c = 0 if A[3] == code[3] : d = 1 else : d = 0 P = a+b+c+d V = code.count(frist)+code.count(second)+code.count(third)+code.count(fourth)-P X = 4-V-P print(" "+"P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) A = input("Turn #4 : ") if A == code : print(WINNING_MSG) else : if A[0] == code[0] : a = 1 else : a = 0 if A[1] == code[1] : b = 1 else : b = 0 if A[2] == code[2] : c = 1 else : c = 0 if A[3] == code[3] : d = 1 else : d = 0 P = a+b+c+d V = code.count(frist)+code.count(second)+code.count(third)+code.count(fourth)-P X = 4-V-P print(" "+"P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) print("Sorry! You just lost it.") print("The answer is "+code) print("Please try again...") |
# 6330516021 (20.00) 346 (2021-02-12 21:06) T1 = input('Turn #1 : ') P1 = 0 V1 = 0 X1 = 0 if T1[0] == code[0] : P1 += 1 if T1[1] == code[1] : P1 += 1 if T1[2] == code[2] : P1 += 1 if T1[3] == code[3] : P1 += 1 if T1[0] in code : V1 += 1 if T1[1] in code : V1 += 1 if T1[2] in code : V1 += 1 if T1[3] in code : V1 += 1 V1 -= P1 X1 = 4 - V1 - P1 if P1 == 4 : print(WINNING_MSG) else : print(' P=' + str(P1) +',V=' + str(V1) +',X=' + str(X1)) T2 = input('Turn #2 : ') P2 = 0 V2 = 0 X2 = 0 if T2[0] == code[0] : P2 += 1 if T2[1] == code[1] : P2 += 1 if T2[2] == code[2] : P2 += 1 if T2[3] == code[3] : P2 += 1 if T2[0] in code : V2 += 1 if T2[1] in code : V2 += 1 if T2[2] in code : V2 += 1 if T2[3] in code : V2 += 1 V2 -= P2 X2 = 4 - V2 - P2 if P2 == 4 : print(WINNING_MSG) else : print(' P=' + str(P2) +',V=' + str(V2) +',X=' + str(X2)) T3 = input('Turn #3 : ') P3 = 0 V3 = 0 X3 = 0 if T3[0] == code[0] : P3 += 1 if T3[1] == code[1] : P3 += 1 if T3[2] == code[2] : P3 += 1 if T3[3] == code[3] : P3 += 1 if T3[0] in code : V3 += 1 if T3[1] in code : V3 += 1 if T3[2] in code : V3 += 1 if T3[3] in code : V3 += 1 V3 -= P3 X3 = 4 - V3 - P3 if P3 == 4 : print(WINNING_MSG) else : print(' P=' + str(P3) +',V=' + str(V3) +',X=' + str(X3)) T4 = input('Turn #4 : ') P4 = 0 V4 = 0 X4 = 0 if T4[0] == code[0] : P4 += 1 if T4[1] == code[1] : P4 += 1 if T4[2] == code[2] : P4 += 1 if T4[3] == code[3] : P4 += 1 if T4[0] in code : V4 += 1 if T4[1] in code : V4 += 1 if T4[2] in code : V4 += 1 if T4[3] in code : V4 += 1 V4 -= P4 X4 = 4 - V4 - P4 if P4 == 4 : print(WINNING_MSG) else : print(' P=' + str(P4) +',V=' + str(V4) +',X=' + str(X4)) print(LOSING_MSG) print('The answer is '+ code) print('Please try again...') |
# 6330517621 (20.00) 347 (2021-02-11 13:12) a = 0 b = 0 c = 0 t = input('Turn #'+'1'+' : ') uwig = list(t) ucode = list(code) if t != code : if uwig[0] == ucode[0] : a += 1 if uwig[1] == ucode[1] : a += 1 if uwig[2] == ucode[2] : a += 1 if uwig[3] == ucode[3] : a += 1 if uwig[0] == ucode[1] : b += 1 if uwig[0] == ucode[2] : b += 1 if uwig[0] == ucode[3] : b += 1 if uwig[1] == ucode[0] : b += 1 if uwig[1] == ucode[2] : b += 1 if uwig[1] == ucode[3] : b += 1 if uwig[2] == ucode[0] : b += 1 if uwig[2] == ucode[1] : b += 1 if uwig[2] == ucode[3] : b += 1 if uwig[3] == ucode[0] : b += 1 if uwig[3] == ucode[1] : b += 1 if uwig[3] == ucode[2] : b += 1 if uwig[0] not in ucode : c += 1 if uwig[1] not in ucode : c += 1 if uwig[2] not in ucode : c += 1 if uwig[3] not in ucode : c += 1 a = str(a) b = str(b) c = str(c) print(' '+'P'+' '+'='+' '+a+','+'V'+' '+'='+' '+b+','+'X'+' '+'='+' '+c) t = input('Turn #'+'2'+' : ') uwig = list(t) ucode = list(code) a = 0 b = 0 c = 0 if t != code : if uwig[0] == ucode[0] : a += 1 if uwig[1] == ucode[1] : a += 1 if uwig[2] == ucode[2] : a += 1 if uwig[3] == ucode[3] : a += 1 if uwig[0] == ucode[1] : b += 1 if uwig[0] == ucode[2] : b += 1 if uwig[0] == ucode[3] : b += 1 if uwig[1] == ucode[0] : b += 1 if uwig[1] == ucode[2] : b += 1 if uwig[1] == ucode[3] : b += 1 if uwig[2] == ucode[0] : b += 1 if uwig[2] == ucode[1] : b += 1 if uwig[2] == ucode[3] : b += 1 if uwig[3] == ucode[0] : b += 1 if uwig[3] == ucode[1] : b += 1 if uwig[3] == ucode[2] : b += 1 if uwig[0] not in ucode : c += 1 if uwig[1] not in ucode : c += 1 if uwig[2] not in ucode : c += 1 if uwig[3] not in ucode : c += 1 a = str(a) b = str(b) c = str(c) print(' '+'P'+' '+'='+' '+a+','+'V'+' '+'='+' '+b+','+'X'+' '+'='+' '+c) t = input('Turn #'+'3'+' : ') uwig = list(t) ucode = list(code) a = 0 b = 0 c = 0 if t != code : if uwig[0] == ucode[0] : a += 1 if uwig[1] == ucode[1] : a += 1 if uwig[2] == ucode[2] : a += 1 if uwig[3] == ucode[3] : a += 1 if uwig[0] == ucode[1] : b += 1 if uwig[0] == ucode[2] : b += 1 if uwig[0] == ucode[3] : b += 1 if uwig[1] == ucode[0] : b += 1 if uwig[1] == ucode[2] : b += 1 if uwig[1] == ucode[3] : b += 1 if uwig[2] == ucode[0] : b += 1 if uwig[2] == ucode[1] : b += 1 if uwig[2] == ucode[3] : b += 1 if uwig[3] == ucode[0] : b += 1 if uwig[3] == ucode[1] : b += 1 if uwig[3] == ucode[2] : b += 1 if uwig[0] not in ucode : c += 1 if uwig[1] not in ucode : c += 1 if uwig[2] not in ucode : c += 1 if uwig[3] not in ucode : c += 1 a = str(a) b = str(b) c = str(c) print(' '+'P'+' '+'='+' '+a+','+'V'+' '+'='+' '+b+','+'X'+' '+'='+' '+c) t = input('Turn #'+'4'+' : ') uwig = list(t) ucode = list(code) a = 0 b = 0 c = 0 if t != code : if uwig[0] == ucode[0] : a += 1 if uwig[1] == ucode[1] : a += 1 if uwig[2] == ucode[2] : a += 1 if uwig[3] == ucode[3] : a += 1 if uwig[0] == ucode[1] : b += 1 if uwig[0] == ucode[2] : b += 1 if uwig[0] == ucode[3] : b += 1 if uwig[1] == ucode[0] : b += 1 if uwig[1] == ucode[2] : b += 1 if uwig[1] == ucode[3] : b += 1 if uwig[2] == ucode[0] : b += 1 if uwig[2] == ucode[1] : b += 1 if uwig[2] == ucode[3] : b += 1 if uwig[3] == ucode[0] : b += 1 if uwig[3] == ucode[1] : b += 1 if uwig[3] == ucode[2] : b += 1 if uwig[0] not in ucode : c += 1 if uwig[1] not in ucode : c += 1 if uwig[2] not in ucode : c += 1 if uwig[3] not in ucode : c += 1 a = str(a) b = str(b) c = str(c) print(' '+'P'+' '+'='+' '+a+','+'V'+' '+'='+' '+b+','+'X'+' '+'='+' '+c) print(LOSING_MSG) print('The answer is'+' '+code) print('Please try again...') else : print(WINNING_MSG) else : print(WINNING_MSG) else : print(WINNING_MSG) else : print(WINNING_MSG) |
# 6330518221 (20.00) 348 (2021-02-12 18:11) n = 0 correct = False if not correct: n += 1 guess = input('Turn #' + str(n) + ' : ') if guess == code: correct = True elif guess != code: P = V = 0 testcase = list() testcase.append(code[0]) testcase.append(code[1]) testcase.append(code[2]) testcase.append(code[3]) asw = list() asw.append(guess[0]) asw.append(guess[1]) asw.append(guess[2]) asw.append(guess[3]) if asw[0] == testcase[0]: P += 1 if asw[1] == testcase[1]: P += 1 if asw[2] == testcase[2]: P += 1 if asw[3] == testcase[3]: P += 1 if asw[0] in testcase: testcase.remove(asw[0]) V += 1 if asw[1] in testcase: testcase.remove(asw[1]) V += 1 if asw[2] in testcase: testcase.remove(asw[2]) V += 1 if asw[3] in testcase: testcase.remove(asw[3]) V += 1 V -= P X = 4 - (V + P) print(' '*10 + 'P=' + str(P) + ',V=' + str(V) + ',X=' + str(X)) if not correct: n += 1 guess = input('Turn #' + str(n) + ' : ') if guess == code: correct = True elif guess != code: P = V = 0 testcase = list() testcase.append(code[0]) testcase.append(code[1]) testcase.append(code[2]) testcase.append(code[3]) asw = list() asw.append(guess[0]) asw.append(guess[1]) asw.append(guess[2]) asw.append(guess[3]) if asw[0] == testcase[0]: P += 1 if asw[1] == testcase[1]: P += 1 if asw[2] == testcase[2]: P += 1 if asw[3] == testcase[3]: P += 1 if asw[0] in testcase: testcase.remove(asw[0]) V += 1 if asw[1] in testcase: testcase.remove(asw[1]) V += 1 if asw[2] in testcase: testcase.remove(asw[2]) V += 1 if asw[3] in testcase: testcase.remove(asw[3]) V += 1 V -= P X = 4 - (V + P) print(' ' * 10 + 'P=' + str(P) + ',V=' + str(V) + ',X=' + str(X)) if not correct: n += 1 guess = input('Turn #' + str(n) + ' : ') if guess == code: correct = True elif guess != code: P = V = 0 testcase = list() testcase.append(code[0]) testcase.append(code[1]) testcase.append(code[2]) testcase.append(code[3]) asw = list() asw.append(guess[0]) asw.append(guess[1]) asw.append(guess[2]) asw.append(guess[3]) if asw[0] == testcase[0]: P += 1 if asw[1] == testcase[1]: P += 1 if asw[2] == testcase[2]: P += 1 if asw[3] == testcase[3]: P += 1 if asw[0] in testcase: testcase.remove(asw[0]) V += 1 if asw[1] in testcase: testcase.remove(asw[1]) V += 1 if asw[2] in testcase: testcase.remove(asw[2]) V += 1 if asw[3] in testcase: testcase.remove(asw[3]) V += 1 V -= P X = 4 - (V + P) print(' ' * 10 + 'P=' + str(P) + ',V=' + str(V) + ',X=' + str(X)) if not correct: n += 1 guess = input('Turn #' + str(n) + ' : ') if guess == code: correct = True elif guess != code: P = V = 0 testcase = list() testcase.append(code[0]) testcase.append(code[1]) testcase.append(code[2]) testcase.append(code[3]) asw = list() asw.append(guess[0]) asw.append(guess[1]) asw.append(guess[2]) asw.append(guess[3]) if asw[0] == testcase[0]: P += 1 if asw[1] == testcase[1]: P += 1 if asw[2] == testcase[2]: P += 1 if asw[3] == testcase[3]: P += 1 if asw[0] in testcase: testcase.remove(asw[0]) V += 1 if asw[1] in testcase: testcase.remove(asw[1]) V += 1 if asw[2] in testcase: testcase.remove(asw[2]) V += 1 if asw[3] in testcase: testcase.remove(asw[3]) V += 1 V -= P X = 4 - (V + P) print(' ' * 10 + 'P=' + str(P) + ',V=' + str(V) + ',X=' + str(X)) if correct: print(WINNING_MSG) else: print(LOSING_MSG) print('The answer is '+code) print('Please try again...') |
# 6330519921 (15.09) 349 (2021-02-15 16:43) R=input('Turn #1 :') if R[0:] == code[0:]: print('Congratulations! You won the game.') elif R[0] in code[0] and R[1] in code[1]and R[2] in code[2] and R[3] not in code[0:]: print('P=3,V=0,X=1') elif R[0] in code[0] and R[1] in code[1]and R[3] in code[3] and R[2] not in code[0:]: print('P=3,V=0,X=1') elif R[0] in code[0] and R[2] in code[2]and R[3] in code[3] and R[1] not in code[0:]: print('P=3,V=0,X=1') elif R[1] in code[1] and R[2] in code[2]and R[3] in code[3] and R[0] not in code[0:]: print('P=3,V=0,X=1') elif R[0] in code[0] and R[1] in code[1] and R[0] in code[0:]and R[1] in code[0:]and R[2] in code[0:]and R[3] in code[0:]: print('P=2,V=2,X=0') elif R[0] in code[0] and R[2] in code[2] and R[0] in code[0:]and R[1] in code[0:]and R[2] in code[0:]and R[3] in code[0:]: print('P=2,V=2,X=0') elif R[0] in code[0] and R[3] in code[3] and R[0] in code[0:]and R[1] in code[0:]and R[2] in code[0:]and R[3] in code[0:]: print('P=2,V=2,X=0') elif R[1] in code[1] and R[2] in code[2] and R[0] in code[0:]and R[1] in code[0:]and R[2] in code[0:]and R[3] in code[0:]: print('P=2,V=2,X=0') elif R[1] in code[1] and R[3] in code[3] and R[0] in code[0:]and R[1] in code[0:]and R[2] in code[0:]and R[3] in code[0:]: print('P=2,V=2,X=0') elif R[2] in code[2] and R[3] in code[3] and R[0] in code[0:]and R[1] in code[0:]and R[2] in code[0:]and R[3] in code[0:]: print('P=2,V=2,X=0') elif R[0] in code[0] and R[1] in code[1] and R[2] not in code[0:] and R[3] not in code[0:]: print('P=2,V=0,X=2') elif R[0] in code[0] and R[2] in code[2] and R[1] not in code[0:] and R[3] not in code[0:]: print('P=2,V=0,X=2') elif R[0] in code[0] and R[3] in code[3] and R[1] not in code[0:] and R[2] not in code[0:]: print('P=2,V=0,X=2') elif R[1] in code[1] and R[2] in code[2] and R[0] not in code[0:] and R[3] not in code[0:]: print('P=2,V=0,X=2') elif R[1] in code[1] and R[3] in code[3] and R[0] not in code[0:] and R[2] not in code[0:]: print('P=2,V=0,X=2') elif R[2] in code[2] and R[3] in code[3] and R[0] not in code[0:] and R[1] not in code[0:]: print('P=2,V=0,X=2') elif R[0] in code[0] and R[1] in code[0:] and R[2] not in code[0:] and R[3] not in code[0:]: print('P=1,V=1,X=2') elif R[0] in code[0] and R[2] in code[0:] and R[1] not in code[0:] and R[3] not in code[0:]: print('P=1,V=1,X=2') elif R[0] in code[0] and R[3] in code[0:] and R[1] not in code[0:] and R[2] not in code[0:]: print('P=1,V=1,X=2') elif R[1] in code[1] and R[0] in code[0:] and R[2] not in code[0:] and R[3] not in code[0:]: print('P=1,V=1,X=2') elif R[1] in code[1] and R[2] in code[0:] and R[0] not in code[0:] and R[3] not in code[0:]: print('P=1,V=1,X=2') elif R[1] in code[1] and R[3] in code[0:] and R[0] not in code[0:] and R[2] not in code[0:]: print('P=1,V=1,X=2') elif R[2] in code[2] and R[0] in code[0:] and R[1] not in code[0:] and R[3] not in code[0:]: print('P=1,V=1,X=2') elif R[2] in code[2] and R[1] in code[0:] and R[0] not in code[0:] and R[3] not in code[0:]: print('P=1,V=1,X=2') elif R[2] in code[2] and R[3] in code[0:] and R[0] not in code[0:] and R[1] not in code[0:]: print('P=1,V=1,X=2') elif R[3] in code[3] and R[0] in code[0:] and R[1] not in code[0:] and R[2] not in code[0:]: print('P=1,V=1,X=2') elif R[3] in code[3] and R[1] in code[0:] and R[0] not in code[0:] and R[2] not in code[0:]: print('P=1,V=1,X=2') elif R[3] in code[3] and R[2] in code[0:] and R[0] not in code[0:] and R[1] not in code[0:]: print('P=1,V=1,X=2') elif R[0] in code[0] and R[1] in code[0:] and R[2] in code[0:] and R[3] not in code[0:]: print('P=1,V=2,X=1') elif R[0] in code[0] and R[1] in code[0:] and R[3] in code[0:] and R[2] not in code[0:]: print('P=1,V=2,X=1') elif R[0] in code[0] and R[2] in code[0:] and R[3] in code[0:] and R[1] not in code[0:]: print('P=1,V=2,X=1') elif R[1] in code[1] and R[2] in code[0:] and R[3] in code[0:] and R[0] not in code[0:]: print('P=1,V=2,X=1') elif R[1] in code[1] and R[0] in code[0:] and R[2] in code[0:] and R[3] not in code[0:]: print('P=1,V=2,X=1') elif R[1] in code[1] and R[0] in code[0:] and R[3] in code[0:] and R[2] not in code[0:]: print('P=1,V=2,X=1') elif R[2] in code[2] and R[1] in code[0:] and R[3] in code[0:] and R[0] not in code[0:]: print('P=1,V=2,X=1') elif R[2] in code[2] and R[0] in code[0:] and R[3] in code[0:] and R[1] not in code[0:]: print('P=1,V=2,X=1') elif R[2] in code[2] and R[0] in code[0:] and R[1] in code[0:] and R[3] not in code[0:]: print('P=1,V=2,X=1') elif R[3] in code[3] and R[1] in code[0:] and R[2] in code[0:] and R[0] not in code[0:]: print('P=1,V=2,X=1') elif R[3] in code[3] and R[0] in code[0:] and R[2] in code[0:] and R[1] not in code[0:]: print('P=1,V=2,X=1') elif R[3] in code[3] and R[0] in code[0:] and R[1] in code[0:] and R[2] not in code[0:]: print('P=1,V=2,X=1') elif R[0] in code[0] and R[1] not in code[0:] and R[2] not in code[0:] and R[3] not in code[0:]: print('P=1,V=0,X=3') elif R[1] in code[1] and R[0] not in code[0:] and R[2] not in code[0:] and R[3] not in code[0:]: print('P=1,V=0,X=3') elif R[2] in code[2] and R[0] not in code[0:] and R[1] not in code[0:] and R[3] not in code[0:]: print('P=1,V=0,X=3') elif R[3] in code[3] and R[0] not in code[0:] and R[1] not in code[0:] and R[2] not in code[0:]: print('P=1,V=0,X=3') elif R[0] in code[0] and R[1] in code[0:] and R[2] in code[0:] and R[3] in code[0:]: print('P=1,V=3,X=0') elif R[1] in code[1] and R[0] in code[0:] and R[2] in code[0:] and R[3] in code[0:]: print('P=1,V=3,X=0') elif R[2] in code[2] and R[0] in code[0:] and R[1] in code[0:] and R[3] in code[0:]: print('P=1,V=3,X=0') elif R[3] in code[3] and R[0] in code[0:] and R[1] in code[0:] and R[2] in code[0:]: print('P=1,V=3,X=0') elif R[0] in code[0:] and R[1] not in code[0:] and R[2] not in code[0:] and R[3] not in code[0:]: print('P=0,V=1,X=3') elif R[1] in code[0:] and R[0] not in code[0:] and R[1] not in code[0:] and R[2] not in code[0:]: print('P=0,V=1,X=3') elif R[2] in code[0:] and R[0] not in code[0:] and R[1] not in code[0:] and R[3] not in code[0:]: print('P=0,V=1,X=3') elif R[3] in code[0:] and R[0] not in code[0:] and R[1] not in code[0:] and R[2] not in code[0:]: print('P=0,V=1,X=3') elif R[0] in code[0:] and R[1] in code[0:] and R[2] in code[0:] and R[3] not in code[0:]: print('P=0,V=3,X=1') elif R[0] in code[0:] and R[2] in code[0:] and R[3] in code[0:] and R[1] not in code[0:]: print('P=0,V=3,X=1') elif R[0] in code[0:] and R[1] in code[0:] and R[3] in code[0:] and R[2] not in code[0:]: print('P=0,V=3,X=1') elif R[1] in code[0:] and R[2] in code[0:] and R[3] in code[0:] and R[0] not in code[0:]: print('P=0,V=3,X=1') elif R[0] in code[0:] and R[1] in code[0:] and R[2] not in code[0:] and R[3] not in code[0:]: print('P=0,V=2,X=2') elif R[0] in code[0:] and R[2] in code[0:] and R[1] not in code[0:] and R[3] not in code[0:]: print('P=0,V=2,X=2') elif R[0] in code[0:] and R[3] in code[0:] and R[1] not in code[0:] and R[2] not in code[0:]: print('P=0,V=2,X=2') elif R[1] in code[0:] and R[2] in code[0:] and R[0] not in code[0:] and R[3] not in code[0:]: print('P=0,V=2,X=2') elif R[1] in code[0:] and R[3] in code[0:] and R[0] not in code[0:] and R[2] not in code[0:]: print('P=0,V=2,X=2') elif R[2] in code[0:] and R[3] in code[0:] and R[0] not in code[0:] and R[1] not in code[0:]: print('P=0,V=2,X=2') else: print('P=0,V=0,X=4') R=input('Turn #2 :') if R[0:] == code[0:]: print('Congratulations! You won the game.') elif R[0] in code[0] and R[1] in code[1]and R[2] in code[2] and R[3] not in code[0:]: print('P=3,V=0,X=1') elif R[0] in code[0] and R[1] in code[1]and R[3] in code[3] and R[2] not in code[0:]: print('P=3,V=0,X=1') elif R[0] in code[0] and R[2] in code[2]and R[3] in code[3] and R[1] not in code[0:]: print('P=3,V=0,X=1') elif R[1] in code[1] and R[2] in code[2]and R[3] in code[3] and R[0] not in code[0:]: print('P=3,V=0,X=1') elif R[0] in code[0] and R[1] in code[1] and R[0] in code[0:]and R[1] in code[0:]and R[2] in code[0:]and R[3] in code[0:]: print('P=2,V=2,X=0') elif R[0] in code[0] and R[2] in code[2] and R[0] in code[0:]and R[1] in code[0:]and R[2] in code[0:]and R[3] in code[0:]: print('P=2,V=2,X=0') elif R[0] in code[0] and R[3] in code[3] and R[0] in code[0:]and R[1] in code[0:]and R[2] in code[0:]and R[3] in code[0:]: print('P=2,V=2,X=0') elif R[1] in code[1] and R[2] in code[2] and R[0] in code[0:]and R[1] in code[0:]and R[2] in code[0:]and R[3] in code[0:]: print('P=2,V=2,X=0') elif R[1] in code[1] and R[3] in code[3] and R[0] in code[0:]and R[1] in code[0:]and R[2] in code[0:]and R[3] in code[0:]: print('P=2,V=2,X=0') elif R[2] in code[2] and R[3] in code[3] and R[0] in code[0:]and R[1] in code[0:]and R[2] in code[0:]and R[3] in code[0:]: print('P=2,V=2,X=0') elif R[0] in code[0] and R[1] in code[1] and R[2] not in code[0:] and R[3] not in code[0:]: print('P=2,V=0,X=2') elif R[0] in code[0] and R[2] in code[2] and R[1] not in code[0:] and R[3] not in code[0:]: print('P=2,V=0,X=2') elif R[0] in code[0] and R[3] in code[3] and R[1] not in code[0:] and R[2] not in code[0:]: print('P=2,V=0,X=2') elif R[1] in code[1] and R[2] in code[2] and R[0] not in code[0:] and R[3] not in code[0:]: print('P=2,V=0,X=2') elif R[1] in code[1] and R[3] in code[3] and R[0] not in code[0:] and R[2] not in code[0:]: print('P=2,V=0,X=2') elif R[2] in code[2] and R[3] in code[3] and R[0] not in code[0:] and R[1] not in code[0:]: print('P=2,V=0,X=2') elif R[0] in code[0] and R[1] in code[0:] and R[2] not in code[0:] and R[3] not in code[0:]: print('P=1,V=1,X=2') elif R[0] in code[0] and R[2] in code[0:] and R[1] not in code[0:] and R[3] not in code[0:]: print('P=1,V=1,X=2') elif R[0] in code[0] and R[3] in code[0:] and R[1] not in code[0:] and R[2] not in code[0:]: print('P=1,V=1,X=2') elif R[1] in code[1] and R[0] in code[0:] and R[2] not in code[0:] and R[3] not in code[0:]: print('P=1,V=1,X=2') elif R[1] in code[1] and R[2] in code[0:] and R[0] not in code[0:] and R[3] not in code[0:]: print('P=1,V=1,X=2') elif R[1] in code[1] and R[3] in code[0:] and R[0] not in code[0:] and R[2] not in code[0:]: print('P=1,V=1,X=2') elif R[2] in code[2] and R[0] in code[0:] and R[1] not in code[0:] and R[3] not in code[0:]: print('P=1,V=1,X=2') elif R[2] in code[2] and R[1] in code[0:] and R[0] not in code[0:] and R[3] not in code[0:]: print('P=1,V=1,X=2') elif R[2] in code[2] and R[3] in code[0:] and R[0] not in code[0:] and R[1] not in code[0:]: print('P=1,V=1,X=2') elif R[3] in code[3] and R[0] in code[0:] and R[1] not in code[0:] and R[2] not in code[0:]: print('P=1,V=1,X=2') elif R[3] in code[3] and R[1] in code[0:] and R[0] not in code[0:] and R[2] not in code[0:]: print('P=1,V=1,X=2') elif R[3] in code[3] and R[2] in code[0:] and R[0] not in code[0:] and R[1] not in code[0:]: print('P=1,V=1,X=2') elif R[0] in code[0] and R[1] in code[0:] and R[2] in code[0:] and R[3] not in code[0:]: print('P=1,V=2,X=1') elif R[0] in code[0] and R[1] in code[0:] and R[3] in code[0:] and R[2] not in code[0:]: print('P=1,V=2,X=1') elif R[0] in code[0] and R[2] in code[0:] and R[3] in code[0:] and R[1] not in code[0:]: print('P=1,V=2,X=1') elif R[1] in code[1] and R[2] in code[0:] and R[3] in code[0:] and R[0] not in code[0:]: print('P=1,V=2,X=1') elif R[1] in code[1] and R[0] in code[0:] and R[2] in code[0:] and R[3] not in code[0:]: print('P=1,V=2,X=1') elif R[1] in code[1] and R[0] in code[0:] and R[3] in code[0:] and R[2] not in code[0:]: print('P=1,V=2,X=1') elif R[2] in code[2] and R[1] in code[0:] and R[3] in code[0:] and R[0] not in code[0:]: print('P=1,V=2,X=1') elif R[2] in code[2] and R[0] in code[0:] and R[3] in code[0:] and R[1] not in code[0:]: print('P=1,V=2,X=1') elif R[2] in code[2] and R[0] in code[0:] and R[1] in code[0:] and R[3] not in code[0:]: print('P=1,V=2,X=1') elif R[3] in code[3] and R[1] in code[0:] and R[2] in code[0:] and R[0] not in code[0:]: print('P=1,V=2,X=1') elif R[3] in code[3] and R[0] in code[0:] and R[2] in code[0:] and R[1] not in code[0:]: print('P=1,V=2,X=1') elif R[3] in code[3] and R[0] in code[0:] and R[1] in code[0:] and R[2] not in code[0:]: print('P=1,V=2,X=1') elif R[0] in code[0] and R[1] not in code[0:] and R[2] not in code[0:] and R[3] not in code[0:]: print('P=1,V=0,X=3') elif R[1] in code[1] and R[0] not in code[0:] and R[2] not in code[0:] and R[3] not in code[0:]: print('P=1,V=0,X=3') elif R[2] in code[2] and R[0] not in code[0:] and R[1] not in code[0:] and R[3] not in code[0:]: print('P=1,V=0,X=3') elif R[3] in code[3] and R[0] not in code[0:] and R[1] not in code[0:] and R[2] not in code[0:]: print('P=1,V=0,X=3') elif R[0] in code[0] and R[1] in code[0:] and R[2] in code[0:] and R[3] in code[0:]: print('P=1,V=3,X=0') elif R[1] in code[1] and R[0] in code[0:] and R[2] in code[0:] and R[3] in code[0:]: print('P=1,V=3,X=0') elif R[2] in code[2] and R[0] in code[0:] and R[1] in code[0:] and R[3] in code[0:]: print('P=1,V=3,X=0') elif R[3] in code[3] and R[0] in code[0:] and R[1] in code[0:] and R[2] in code[0:]: print('P=1,V=3,X=0') elif R[0] in code[0:] and R[1] not in code[0:] and R[2] not in code[0:] and R[3] not in code[0:]: print('P=0,V=1,X=3') elif R[1] in code[0:] and R[0] not in code[0:] and R[1] not in code[0:] and R[2] not in code[0:]: print('P=0,V=1,X=3') elif R[2] in code[0:] and R[0] not in code[0:] and R[1] not in code[0:] and R[3] not in code[0:]: print('P=0,V=1,X=3') elif R[3] in code[0:] and R[0] not in code[0:] and R[1] not in code[0:] and R[2] not in code[0:]: print('P=0,V=1,X=3') elif R[0] in code[0:] and R[1] in code[0:] and R[2] in code[0:] and R[3] not in code[0:]: print('P=0,V=3,X=1') elif R[0] in code[0:] and R[2] in code[0:] and R[3] in code[0:] and R[1] not in code[0:]: print('P=0,V=3,X=1') elif R[0] in code[0:] and R[1] in code[0:] and R[3] in code[0:] and R[2] not in code[0:]: print('P=0,V=3,X=1') elif R[1] in code[0:] and R[2] in code[0:] and R[3] in code[0:] and R[0] not in code[0:]: print('P=0,V=3,X=1') elif R[0] in code[0:] and R[1] in code[0:] and R[2] not in code[0:] and R[3] not in code[0:]: print('P=0,V=2,X=2') elif R[0] in code[0:] and R[2] in code[0:] and R[1] not in code[0:] and R[3] not in code[0:]: print('P=0,V=2,X=2') elif R[0] in code[0:] and R[3] in code[0:] and R[1] not in code[0:] and R[2] not in code[0:]: print('P=0,V=2,X=2') elif R[1] in code[0:] and R[2] in code[0:] and R[0] not in code[0:] and R[3] not in code[0:]: print('P=0,V=2,X=2') elif R[1] in code[0:] and R[3] in code[0:] and R[0] not in code[0:] and R[2] not in code[0:]: print('P=0,V=2,X=2') elif R[2] in code[0:] and R[3] in code[0:] and R[0] not in code[0:] and R[1] not in code[0:]: print('P=0,V=2,X=2') else: print('P=0,V=0,X=4') R=input('Turn #3 :') if R[0:] == code[0:]: print('Congratulations! You won the game.') elif R[0] not in code[0:] and R[1] not in code[0:]and R[2] not in code[0:] and R[3] not in code[0:]: print('P=0,V=0,X=4') elif R[0] in code[0] and R[1] in code[1]and R[2] in code[2] and R[3] not in code[0:]: print('P=3,V=0,X=1') elif R[0] in code[0] and R[1] in code[1]and R[3] in code[3] and R[2] not in code[0:]: print('P=3,V=0,X=1') elif R[0] in code[0] and R[2] in code[2]and R[3] in code[3] and R[1] not in code[0:]: print('P=3,V=0,X=1') elif R[1] in code[1] and R[2] in code[2]and R[3] in code[3] and R[0] not in code[0:]: print('P=3,V=0,X=1') elif R[0] in code[0] and R[1] in code[1] and R[0] in code[0:]and R[1] in code[0:]and R[2] in code[0:]and R[3] in code[0:]: print('P=2,V=2,X=0') elif R[0] in code[0] and R[2] in code[2] and R[0] in code[0:]and R[1] in code[0:]and R[2] in code[0:]and R[3] in code[0:]: print('P=2,V=2,X=0') elif R[0] in code[0] and R[3] in code[3] and R[0] in code[0:]and R[1] in code[0:]and R[2] in code[0:]and R[3] in code[0:]: print('P=2,V=2,X=0') elif R[1] in code[1] and R[2] in code[2] and R[0] in code[0:]and R[1] in code[0:]and R[2] in code[0:]and R[3] in code[0:]: print('P=2,V=2,X=0') elif R[1] in code[1] and R[3] in code[3] and R[0] in code[0:]and R[1] in code[0:]and R[2] in code[0:]and R[3] in code[0:]: print('P=2,V=2,X=0') elif R[2] in code[2] and R[3] in code[3] and R[0] in code[0:]and R[1] in code[0:]and R[2] in code[0:]and R[3] in code[0:]: print('P=2,V=2,X=0') elif R[0] in code[0] and R[1] in code[1] and R[2] not in code[0:] and R[3] not in code[0:]: print('P=2,V=0,X=2') elif R[0] in code[0] and R[2] in code[2] and R[1] not in code[0:] and R[3] not in code[0:]: print('P=2,V=0,X=2') elif R[0] in code[0] and R[3] in code[3] and R[1] not in code[0:] and R[2] not in code[0:]: print('P=2,V=0,X=2') elif R[1] in code[1] and R[2] in code[2] and R[0] not in code[0:] and R[3] not in code[0:]: print('P=2,V=0,X=2') elif R[1] in code[1] and R[3] in code[3] and R[0] not in code[0:] and R[2] not in code[0:]: print('P=2,V=0,X=2') elif R[2] in code[2] and R[3] in code[3] and R[0] not in code[0:] and R[1] not in code[0:]: print('P=2,V=0,X=2') elif R[0] in code[0] and R[1] in code[0:] and R[2] not in code[0:] and R[3] not in code[0:]: print('P=1,V=1,X=2') elif R[0] in code[0] and R[2] in code[0:] and R[1] not in code[0:] and R[3] not in code[0:]: print('P=1,V=1,X=2') elif R[0] in code[0] and R[3] in code[0:] and R[1] not in code[0:] and R[2] not in code[0:]: print('P=1,V=1,X=2') elif R[1] in code[1] and R[0] in code[0:] and R[2] not in code[0:] and R[3] not in code[0:]: print('P=1,V=1,X=2') elif R[1] in code[1] and R[2] in code[0:] and R[0] not in code[0:] and R[3] not in code[0:]: print('P=1,V=1,X=2') elif R[1] in code[1] and R[3] in code[0:] and R[0] not in code[0:] and R[2] not in code[0:]: print('P=1,V=1,X=2') elif R[2] in code[2] and R[0] in code[0:] and R[1] not in code[0:] and R[3] not in code[0:]: print('P=1,V=1,X=2') elif R[2] in code[2] and R[1] in code[0:] and R[0] not in code[0:] and R[3] not in code[0:]: print('P=1,V=1,X=2') elif R[2] in code[2] and R[3] in code[0:] and R[0] not in code[0:] and R[1] not in code[0:]: print('P=1,V=1,X=2') elif R[3] in code[3] and R[0] in code[0:] and R[1] not in code[0:] and R[2] not in code[0:]: print('P=1,V=1,X=2') elif R[3] in code[3] and R[1] in code[0:] and R[0] not in code[0:] and R[2] not in code[0:]: print('P=1,V=1,X=2') elif R[3] in code[3] and R[2] in code[0:] and R[0] not in code[0:] and R[1] not in code[0:]: print('P=1,V=1,X=2') elif R[0] in code[0] and R[1] in code[0:] and R[2] in code[0:] and R[3] not in code[0:]: print('P=1,V=2,X=1') elif R[0] in code[0] and R[1] in code[0:] and R[3] in code[0:] and R[2] not in code[0:]: print('P=1,V=2,X=1') elif R[0] in code[0] and R[2] in code[0:] and R[3] in code[0:] and R[1] not in code[0:]: print('P=1,V=2,X=1') elif R[1] in code[1] and R[2] in code[0:] and R[3] in code[0:] and R[0] not in code[0:]: print('P=1,V=2,X=1') elif R[1] in code[1] and R[0] in code[0:] and R[2] in code[0:] and R[3] not in code[0:]: print('P=1,V=2,X=1') elif R[1] in code[1] and R[0] in code[0:] and R[3] in code[0:] and R[2] not in code[0:]: print('P=1,V=2,X=1') elif R[2] in code[2] and R[1] in code[0:] and R[3] in code[0:] and R[0] not in code[0:]: print('P=1,V=2,X=1') elif R[2] in code[2] and R[0] in code[0:] and R[3] in code[0:] and R[1] not in code[0:]: print('P=1,V=2,X=1') elif R[2] in code[2] and R[0] in code[0:] and R[1] in code[0:] and R[3] not in code[0:]: print('P=1,V=2,X=1') elif R[3] in code[3] and R[1] in code[0:] and R[2] in code[0:] and R[0] not in code[0:]: print('P=1,V=2,X=1') elif R[3] in code[3] and R[0] in code[0:] and R[2] in code[0:] and R[1] not in code[0:]: print('P=1,V=2,X=1') elif R[3] in code[3] and R[0] in code[0:] and R[1] in code[0:] and R[2] not in code[0:]: print('P=1,V=2,X=1') elif R[0] in code[0] and R[1] not in code[0:] and R[2] not in code[0:] and R[3] not in code[0:]: print('P=1,V=0,X=3') elif R[1] in code[1] and R[0] not in code[0:] and R[2] not in code[0:] and R[3] not in code[0:]: print('P=1,V=0,X=3') elif R[2] in code[2] and R[0] not in code[0:] and R[1] not in code[0:] and R[3] not in code[0:]: print('P=1,V=0,X=3') elif R[3] in code[3] and R[0] not in code[0:] and R[1] not in code[0:] and R[2] not in code[0:]: print('P=1,V=0,X=3') elif R[0] in code[0] and R[1] in code[0:] and R[2] in code[0:] and R[3] in code[0:]: print('P=1,V=3,X=0') elif R[1] in code[1] and R[0] in code[0:] and R[2] in code[0:] and R[3] in code[0:]: print('P=1,V=3,X=0') elif R[2] in code[2] and R[0] in code[0:] and R[1] in code[0:] and R[3] in code[0:]: print('P=1,V=3,X=0') elif R[3] in code[3] and R[0] in code[0:] and R[1] in code[0:] and R[2] in code[0:]: print('P=1,V=3,X=0') elif R[0] in code[0:] and R[1] not in code[0:] and R[2] not in code[0:] and R[3] not in code[0:]: print('P=0,V=1,X=3') elif R[1] in code[0:] and R[0] not in code[0:] and R[1] not in code[0:] and R[2] not in code[0:]: print('P=0,V=1,X=3') elif R[2] in code[0:] and R[0] not in code[0:] and R[1] not in code[0:] and R[3] not in code[0:]: print('P=0,V=1,X=3') elif R[3] in code[0:] and R[0] not in code[0:] and R[1] not in code[0:] and R[2] not in code[0:]: print('P=0,V=1,X=3') elif R[0] in code[0:] and R[1] in code[0:] and R[2] in code[0:] and R[3] not in code[0:]: print('P=0,V=3,X=1') elif R[0] in code[0:] and R[2] in code[0:] and R[3] in code[0:] and R[1] not in code[0:]: print('P=0,V=3,X=1') elif R[0] in code[0:] and R[1] in code[0:] and R[3] in code[0:] and R[2] not in code[0:]: print('P=0,V=3,X=1') elif R[1] in code[0:] and R[2] in code[0:] and R[3] in code[0:] and R[0] not in code[0:]: print('P=0,V=3,X=1') elif R[0] in code[0:] and R[1] in code[0:] and R[2] not in code[0:] and R[3] not in code[0:]: print('P=0,V=2,X=2') elif R[0] in code[0:] and R[2] in code[0:] and R[1] not in code[0:] and R[3] not in code[0:]: print('P=0,V=2,X=2') elif R[0] in code[0:] and R[3] in code[0:] and R[1] not in code[0:] and R[2] not in code[0:]: print('P=0,V=2,X=2') elif R[1] in code[0:] and R[2] in code[0:] and R[0] not in code[0:] and R[3] not in code[0:]: print('P=0,V=2,X=2') elif R[1] in code[0:] and R[3] in code[0:] and R[0] not in code[0:] and R[2] not in code[0:]: print('P=0,V=2,X=2') elif R[2] in code[0:] and R[3] in code[0:] and R[0] not in code[0:] and R[1] not in code[0:]: print('P=0,V=2,X=2') else: print('P=0,V=0,X=4') R=input('Turn #4 :') if R[0:] == code[0:]: print('Congratulations! You won the game.') elif R[0] not in code[0:] and R[1] not in code[0:]and R[2] not in code[0:] and R[3] not in code[0:]: print('P=0,V=0,X=4') print('Sorry! You just lost it.') print('The answer is', code) print('Please try again...') elif R[0] in code[0] and R[1] in code[1]and R[2] in code[2] and R[3] not in code[0:]: print('P=3,V=0,X=1') print('Sorry! You just lost it.') print('The answer is', code) print('Please try again...') elif R[0] in code[0] and R[1] in code[1]and R[3] in code[3] and R[2] not in code[0:]: print('P=3,V=0,X=1') print('Sorry! You just lost it.') print('The answer is', code) print('Please try again...') elif R[0] in code[0] and R[2] in code[2]and R[3] in code[3] and R[1] not in code[0:]: print('P=3,V=0,X=1') print('Sorry! You just lost it.') print('The answer is', code) print('Please try again...') elif R[1] in code[1] and R[2] in code[2]and R[3] in code[3] and R[0] not in code[0:]: print('P=3,V=0,X=1') print('Sorry! You just lost it.') print('The answer is', code) print('Please try again...') elif R[0] in code[0] and R[1] in code[1] and R[0] in code[0:]and R[1] in code[0:]and R[2] in code[0:]and R[3] in code[0:]: print('P=2,V=2,X=0') print('Sorry! You just lost it.') print('The answer is', code) print('Please try again...') elif R[0] in code[0] and R[2] in code[2] and R[0] in code[0:]and R[1] in code[0:]and R[2] in code[0:]and R[3] in code[0:]: print('P=2,V=2,X=0') print('Sorry! You just lost it.') print('The answer is', code) print('Please try again...') elif R[0] in code[0] and R[3] in code[3] and R[0] in code[0:]and R[1] in code[0:]and R[2] in code[0:]and R[3] in code[0:]: print('P=2,V=2,X=0') print('Sorry! You just lost it.') print('The answer is', code) print('Please try again...') elif R[1] in code[1] and R[2] in code[2] and R[0] in code[0:]and R[1] in code[0:]and R[2] in code[0:]and R[3] in code[0:]: print('P=2,V=2,X=0') print('Sorry! You just lost it.') print('The answer is', code) print('Please try again...') elif R[1] in code[1] and R[3] in code[3] and R[0] in code[0:]and R[1] in code[0:]and R[2] in code[0:]and R[3] in code[0:]: print('P=2,V=2,X=0') print('Sorry! You just lost it.') print('The answer is', code) print('Please try again...') elif R[2] in code[2] and R[3] in code[3] and R[0] in code[0:]and R[1] in code[0:]and R[2] in code[0:]and R[3] in code[0:]: print('P=2,V=2,X=0') print('Sorry! You just lost it.') print('The answer is', code) print('Please try again...') elif R[0] in code[0] and R[1] in code[1] and R[2] not in code[0:] and R[3] not in code[0:]: print('P=2,V=0,X=2') print('Sorry! You just lost it.') print('The answer is', code) print('Please try again...') elif R[0] in code[0] and R[2] in code[2] and R[1] not in code[0:] and R[3] not in code[0:]: print('P=2,V=0,X=2') print('Sorry! You just lost it.') print('The answer is', code) print('Please try again...') elif R[0] in code[0] and R[3] in code[3] and R[1] not in code[0:] and R[2] not in code[0:]: print('P=2,V=0,X=2') print('Sorry! You just lost it.') print('The answer is', code) print('Please try again...') elif R[1] in code[1] and R[2] in code[2] and R[0] not in code[0:] and R[3] not in code[0:]: print('P=2,V=0,X=2') print('Sorry! You just lost it.') print('The answer is', code) print('Please try again...') elif R[1] in code[1] and R[3] in code[3] and R[0] not in code[0:] and R[2] not in code[0:]: print('P=2,V=0,X=2') print('Sorry! You just lost it.') print('The answer is', code) print('Please try again...') elif R[2] in code[2] and R[3] in code[3] and R[0] not in code[0:] and R[1] not in code[0:]: print('P=2,V=0,X=2') print('Sorry! You just lost it.') print('The answer is', code) print('Please try again...') elif R[0] in code[0] and R[1] in code[0:] and R[2] not in code[0:] and R[3] not in code[0:]: print('P=1,V=1,X=2') print('Sorry! You just lost it.') print('The answer is', code) print('Please try again...') elif R[0] in code[0] and R[2] in code[0:] and R[1] not in code[0:] and R[3] not in code[0:]: print('P=1,V=1,X=2') print('Sorry! You just lost it.') print('The answer is', code) print('Please try again...') elif R[0] in code[0] and R[3] in code[0:] and R[1] not in code[0:] and R[2] not in code[0:]: print('P=1,V=1,X=2') print('Sorry! You just lost it.') print('The answer is', code) print('Please try again...') elif R[1] in code[1] and R[0] in code[0:] and R[2] not in code[0:] and R[3] not in code[0:]: print('P=1,V=1,X=2') print('Sorry! You just lost it.') print('The answer is', code) print('Please try again...') elif R[1] in code[1] and R[2] in code[0:] and R[0] not in code[0:] and R[3] not in code[0:]: print('P=1,V=1,X=2') print('Sorry! You just lost it.') print('The answer is', code) print('Please try again...') elif R[1] in code[1] and R[3] in code[0:] and R[0] not in code[0:] and R[2] not in code[0:]: print('P=1,V=1,X=2') print('Sorry! You just lost it.') print('The answer is', code) print('Please try again...') elif R[2] in code[2] and R[0] in code[0:] and R[1] not in code[0:] and R[3] not in code[0:]: print('P=1,V=1,X=2') print('Sorry! You just lost it.') print('The answer is', code) print('Please try again...') elif R[2] in code[2] and R[1] in code[0:] and R[0] not in code[0:] and R[3] not in code[0:]: print('P=1,V=1,X=2') print('Sorry! You just lost it.') print('The answer is', code) print('Please try again...') elif R[2] in code[2] and R[3] in code[0:] and R[0] not in code[0:] and R[1] not in code[0:]: print('P=1,V=1,X=2') print('Sorry! You just lost it.') print('The answer is', code) print('Please try again...') elif R[3] in code[3] and R[0] in code[0:] and R[1] not in code[0:] and R[2] not in code[0:]: print('P=1,V=1,X=2') print('Sorry! You just lost it.') print('The answer is', code) print('Please try again...') elif R[3] in code[3] and R[1] in code[0:] and R[0] not in code[0:] and R[2] not in code[0:]: print('P=1,V=1,X=2') print('Sorry! You just lost it.') print('The answer is', code) print('Please try again...') elif R[3] in code[3] and R[2] in code[0:] and R[0] not in code[0:] and R[1] not in code[0:]: print('P=1,V=1,X=2') print('Sorry! You just lost it.') print('The answer is', code) print('Please try again...') elif R[0] in code[0] and R[1] in code[0:] and R[2] in code[0:] and R[3] not in code[0:]: print('P=1,V=2,X=1') print('Sorry! You just lost it.') print('The answer is', code) print('Please try again...') elif R[0] in code[0] and R[1] in code[0:] and R[3] in code[0:] and R[2] not in code[0:]: print('P=1,V=2,X=1') print('Sorry! You just lost it.') print('The answer is', code) print('Please try again...') elif R[0] in code[0] and R[2] in code[0:] and R[3] in code[0:] and R[1] not in code[0:]: print('P=1,V=2,X=1') print('Sorry! You just lost it.') print('The answer is', code) print('Please try again...') elif R[1] in code[1] and R[2] in code[0:] and R[3] in code[0:] and R[0] not in code[0:]: print('P=1,V=2,X=1') print('Sorry! You just lost it.') print('The answer is', code) print('Please try again...') elif R[1] in code[1] and R[0] in code[0:] and R[2] in code[0:] and R[3] not in code[0:]: print('P=1,V=2,X=1') print('Sorry! You just lost it.') print('The answer is', code) print('Please try again...') elif R[1] in code[1] and R[0] in code[0:] and R[3] in code[0:] and R[2] not in code[0:]: print('P=1,V=2,X=1') print('Sorry! You just lost it.') print('The answer is', code) print('Please try again...') elif R[2] in code[2] and R[1] in code[0:] and R[3] in code[0:] and R[0] not in code[0:]: print('P=1,V=2,X=1') print('Sorry! You just lost it.') print('The answer is', code) print('Please try again...') elif R[2] in code[2] and R[0] in code[0:] and R[3] in code[0:] and R[1] not in code[0:]: print('P=1,V=2,X=1') print('Sorry! You just lost it.') print('The answer is', code) print('Please try again...') elif R[2] in code[2] and R[0] in code[0:] and R[1] in code[0:] and R[3] not in code[0:]: print('P=1,V=2,X=1') print('Sorry! You just lost it.') print('The answer is', code) print('Please try again...') elif R[3] in code[3] and R[1] in code[0:] and R[2] in code[0:] and R[0] not in code[0:]: print('P=1,V=2,X=1') print('Sorry! You just lost it.') print('The answer is', code) print('Please try again...') elif R[3] in code[3] and R[0] in code[0:] and R[2] in code[0:] and R[1] not in code[0:]: print('P=1,V=2,X=1') print('Sorry! You just lost it.') print('The answer is', code) print('Please try again...') elif R[3] in code[3] and R[0] in code[0:] and R[1] in code[0:] and R[2] not in code[0:]: print('P=1,V=2,X=1') print('Sorry! You just lost it.') print('The answer is', code) print('Please try again...') elif R[0] in code[0] and R[1] not in code[0:] and R[2] not in code[0:] and R[3] not in code[0:]: print('P=1,V=0,X=3') print('Sorry! You just lost it.') print('The answer is', code) print('Please try again...') elif R[1] in code[1] and R[0] not in code[0:] and R[2] not in code[0:] and R[3] not in code[0:]: print('P=1,V=0,X=3') print('Sorry! You just lost it.') print('The answer is', code) print('Please try again...') elif R[2] in code[2] and R[0] not in code[0:] and R[1] not in code[0:] and R[3] not in code[0:]: print('P=1,V=0,X=3') print('Sorry! You just lost it.') print('The answer is', code) print('Please try again...') elif R[3] in code[3] and R[0] not in code[0:] and R[1] not in code[0:] and R[2] not in code[0:]: print('P=1,V=0,X=3') print('Sorry! You just lost it.') print('The answer is', code) print('Please try again...') elif R[0] in code[0] and R[1] in code[0:] and R[2] in code[0:] and R[3] in code[0:]: print('P=1,V=3,X=0') print('Sorry! You just lost it.') print('The answer is', code) print('Please try again...') elif R[1] in code[1] and R[0] in code[0:] and R[2] in code[0:] and R[3] in code[0:]: print('P=1,V=3,X=0') print('Sorry! You just lost it.') print('The answer is', code) print('Please try again...') elif R[2] in code[2] and R[0] in code[0:] and R[1] in code[0:] and R[3] in code[0:]: print('P=1,V=3,X=0') print('Sorry! You just lost it.') print('The answer is', code) print('Please try again...') elif R[3] in code[3] and R[0] in code[0:] and R[1] in code[0:] and R[2] in code[0:]: print('P=1,V=3,X=0') print('Sorry! You just lost it.') print('The answer is', code) print('Please try again...') elif R[0] in code[0:] and R[1] not in code[0:] and R[2] not in code[0:] and R[3] not in code[0:]: print('P=0,V=1,X=3') print('Sorry! You just lost it.') print('The answer is', code) print('Please try again...') elif R[1] in code[0:] and R[0] not in code[0:] and R[1] not in code[0:] and R[2] not in code[0:]: print('P=0,V=1,X=3') print('Sorry! You just lost it.') print('The answer is', code) print('Please try again...') elif R[2] in code[0:] and R[0] not in code[0:] and R[1] not in code[0:] and R[3] not in code[0:]: print('P=0,V=1,X=3') print('Sorry! You just lost it.') print('The answer is', code) print('Please try again...') elif R[3] in code[0:] and R[0] not in code[0:] and R[1] not in code[0:] and R[2] not in code[0:]: print('P=0,V=1,X=3') print('Sorry! You just lost it.') print('The answer is', code) print('Please try again...') elif R[0] in code[0:] and R[1] in code[0:] and R[2] in code[0:] and R[3] not in code[0:]: print('P=0,V=3,X=1') print('Sorry! You just lost it.') print('The answer is', code) print('Please try again...') elif R[0] in code[0:] and R[2] in code[0:] and R[3] in code[0:] and R[1] not in code[0:]: print('P=0,V=3,X=1') print('Sorry! You just lost it.') print('The answer is', code) print('Please try again...') elif R[0] in code[0:] and R[1] in code[0:] and R[3] in code[0:] and R[2] not in code[0:]: print('P=0,V=3,X=1') print('Sorry! You just lost it.') print('The answer is', code) print('Please try again...') elif R[1] in code[0:] and R[2] in code[0:] and R[3] in code[0:] and R[0] not in code[0:]: print('P=0,V=3,X=1') print('Sorry! You just lost it.') print('The answer is', code) print('Please try again...') elif R[0] in code[0:] and R[1] in code[0:] and R[2] not in code[0:] and R[3] not in code[0:]: print('P=0,V=2,X=2') print('Sorry! You just lost it.') print('The answer is', code) print('Please try again...') elif R[0] in code[0:] and R[2] in code[0:] and R[1] not in code[0:] and R[3] not in code[0:]: print('P=0,V=2,X=2') print('Sorry! You just lost it.') print('The answer is', code) print('Please try again...') elif R[0] in code[0:] and R[3] in code[0:] and R[1] not in code[0:] and R[2] not in code[0:]: print('P=0,V=2,X=2') print('Sorry! You just lost it.') print('The answer is', code) print('Please try again...') elif R[1] in code[0:] and R[2] in code[0:] and R[0] not in code[0:] and R[3] not in code[0:]: print('P=0,V=2,X=2') print('Sorry! You just lost it.') print('The answer is', code) print('Please try again...') elif R[1] in code[0:] and R[3] in code[0:] and R[0] not in code[0:] and R[2] not in code[0:]: print('P=0,V=2,X=2') print('Sorry! You just lost it.') print('The answer is', code) print('Please try again...') elif R[2] in code[0:] and R[3] in code[0:] and R[0] not in code[0:] and R[1] not in code[0:]: print('P=0,V=2,X=2') print('Sorry! You just lost it.') print('The answer is', code) print('Please try again...') else: print('P=0,V=0,X=4') print('Sorry! You just lost it.') print('The answer is', code) print('Please try again...') |
# 6330520421 (19.90) 350 (2021-02-15 22:46) c=list(code) print(code) #turn1 a=input('Turn #1 :') b=list(a) p=0 if b[0]==c[0] : p+=1 if b[1]==c[1] : p+=1 if b[2]==c[2] : p+=1 if b[3]==c[3]: p+=1 d=set(b) & set(c) nd=len(d) v=nd - p x= 4 - nd ans=(' '*9+'P='+str(p)+','+'V='+str(v)+','+'X='+str(x)) if p==4: print("Congratulations! You won the game.") else: print(ans) #turn2 a=input('Turn #2 :') b=list(a) p=0 if b[0]==c[0] : p+=1 if b[1]==c[1] : p+=1 if b[2]==c[2] : p+=1 if b[3]==c[3]: p+=1 d=set(b) & set(c) nd=len(d) v=nd - p x= 4 - nd ans=(' '*9+'P='+str(p)+','+'V='+str(v)+','+'X='+str(x)) if p==4: print("Congratulations! You won the game.") else: #turn3 print(ans) a=input('Turn #3 :') b=list(a) p=0 if b[0]==c[0] : p+=1 if b[1]==c[1] : p+=1 if b[2]==c[2] : p+=1 if b[3]==c[3]: p+=1 d=set(b) & set(c) nd=len(d) v=nd - p x= 4 - nd ans=(' '*9+'P='+str(p)+','+'V='+str(v)+','+'X='+str(x)) if p==4: print("Congratulations! You won the game.") else: #turn4 print(ans) a=input('Turn #4 :') b=list(a) p=0 if b[0]==c[0] : p+=1 if b[1]==c[1] : p+=1 if b[2]==c[2] : p+=1 if b[3]==c[3]: p+=1 d=set(b) & set(c) nd=len(d) v=nd - p x= 4 - nd ans=(' '*9+'P='+str(p)+','+'V='+str(v)+','+'X='+str(x)) if p==4: print("Congratulations! You won the game.") else: print(ans) print("Sorry! You just lost it.") print('The answer is',code) print('Please try again....') |
# 6330521021 (20.00) 351 (2021-02-12 18:42) turn1 = input("Turn #1 : ") p=0 v=0 x=0 if turn1[0]==code[0]: p=p+1 if turn1[1]==code[1]: p=p+1 if turn1[2]==code[2]: p=p+1 if turn1[3]==code[3]: p=p+1 if turn1[0] in code and turn1[0]!=code[0]: v=v+1 if turn1[1] in code and turn1[1]!=code[1]: v=v+1 if turn1[2] in code and turn1[2]!=code[2]: v=v+1 if turn1[3] in code and turn1[3]!=code[3]: v=v+1 if turn1[0] not in code: x=x+1 if turn1[1] not in code: x=x+1 if turn1[2] not in code: x=x+1 if turn1[3] not in code: x=x+1 if turn1==code: print("Congratulations! You won the game.") else: print(" P="+str(p)+",V="+str(v)+",X="+str(x)) turn2 = input("Turn #2 : ") p=0 v=0 x=0 if turn2[0]==code[0]: p=p+1 if turn2[1]==code[1]: p=p+1 if turn2[2]==code[2]: p=p+1 if turn2[3]==code[3]: p=p+1 if turn2[0] in code and turn2[0]!=code[0]: v=v+1 if turn2[1] in code and turn2[1]!=code[1]: v=v+1 if turn2[2] in code and turn2[2]!=code[2]: v=v+1 if turn2[3] in code and turn2[3]!=code[3]: v=v+1 if turn2[0] not in code: x=x+1 if turn2[1] not in code: x=x+1 if turn2[2] not in code: x=x+1 if turn2[3] not in code: x=x+1 if turn2==code: print("Congratulations! You won the game.") else: print(" P="+str(p)+",V="+str(v)+",X="+str(x)) turn3 = input("Turn #3 : ") p=0 v=0 x=0 if turn3[0]==code[0]: p=p+1 if turn3[1]==code[1]: p=p+1 if turn3[2]==code[2]: p=p+1 if turn3[3]==code[3]: p=p+1 if turn3[0] in code and turn3[0]!=code[0]: v=v+1 if turn3[1] in code and turn3[1]!=code[1]: v=v+1 if turn3[2] in code and turn3[2]!=code[2]: v=v+1 if turn3[3] in code and turn3[3]!=code[3]: v=v+1 if turn3[0] not in code: x=x+1 if turn3[1] not in code: x=x+1 if turn3[2] not in code: x=x+1 if turn3[3] not in code: x=x+1 if turn3==code: print("Congratulations! You won the game.") else: print(" P="+str(p)+",V="+str(v)+",X="+str(x)) turn4 = input("Turn #4 : ") p=0 v=0 x=0 if turn4[0]==code[0]: p=p+1 if turn4[1]==code[1]: p=p+1 if turn4[2]==code[2]: p=p+1 if turn4[3]==code[3]: p=p+1 if turn4[0] in code and turn4[0]!=code[0]: v=v+1 if turn4[1] in code and turn4[1]!=code[1]: v=v+1 if turn4[2] in code and turn4[2]!=code[2]: v=v+1 if turn4[3] in code and turn4[3]!=code[3]: v=v+1 if turn4[0] not in code: x=x+1 if turn4[1] not in code: x=x+1 if turn4[2] not in code: x=x+1 if turn4[3] not in code: x=x+1 if turn4==code: print("Congratulations! You won the game.") else: print(" P="+str(p)+",V="+str(v)+",X="+str(x)) print("Sorry! You just lost it.") print("The answer is",code) print("Please try again...") |
# 6330522721 (19.81) 352 (2021-02-15 20:39) P = 0 V = 0 X = 0 lcode = list(code) guess1 = input('Turn #1 ') lguess1 = list(guess1) if lguess1[0] == lcode[0]: P += 1 if lguess1[1] == lcode[1]: P += 1 if lguess1[2] == lcode[2]: P += 1 if lguess1[3] == lcode[3]: P += 1 if lguess1[0] in lcode and lguess1[0] != lcode[0] : V += 1 if lguess1[1] in lcode and lguess1[1] != lcode[1] : V += 1 if lguess1[2] in lcode and lguess1[2] != lcode[2] : V += 1 if lguess1[3] in lcode and lguess1[3] != lcode[3] : V += 1 if lguess1[0] not in lcode: X += 1 if lguess1[1] not in lcode: X += 1 if lguess1[2] not in lcode: X += 1 if lguess1[3] not in lcode: X += 1 if P == 4: print(WINNING_MSG) else: print(' P='+str(P)+',V='+str(V)+',X='+str(X)) ####222222 if P != 4 : P = 0 V = 0 X = 0 guess2 = input('Turn #2 ') lguess2 = list(guess2) if lguess2[0] == lcode[0]: P += 1 if lguess2[1] == lcode[1]: P += 1 if lguess2[2] == lcode[2]: P += 1 if lguess2[3] == lcode[3]: P += 1 if lguess2[0] in lcode and lguess2[0] != lcode[0] : V += 1 if lguess2[1] in lcode and lguess2[1] != lcode[1] : V += 1 if lguess2[2] in lcode and lguess2[2] != lcode[2] : V += 1 if lguess2[3] in lcode and lguess2[3] != lcode[3] : V += 1 if lguess2[0] not in lcode: X += 1 if lguess2[1] not in lcode: X += 1 if lguess2[2] not in lcode: X += 1 if lguess2[3] not in lcode: X += 1 if P == 4: print(WINNING_MSG) else: print(' P='+str(P)+',V='+str(V)+',X='+str(X)) ####33333 if P != 4: P = 0 V = 0 X = 0 guess3 = input('Turn #3 ') lguess3 = list(guess3) if lguess3[0] == lcode[0]: P += 1 if lguess3[1] == lcode[1]: P += 1 if lguess3[2] == lcode[2]: P += 1 if lguess3[3] == lcode[3]: P += 1 if lguess3[0] in lcode and lguess3[0] != lcode[0] : V += 1 if lguess3[1] in lcode and lguess3[1] != lcode[1] : V += 1 if lguess3[2] in lcode and lguess3[2] != lcode[2] : V += 1 if lguess3[3] in lcode and lguess3[3] != lcode[3] : V += 1 if lguess3[0] not in lcode: X += 1 if lguess3[1] not in lcode: X += 1 if lguess3[2] not in lcode: X += 1 if lguess3[3] not in lcode: X += 1 if P == 4: print(WINNING_MSG) else: print(' P='+str(P)+',V='+str(V)+',X='+str(X)) ####444444 if P != 4: P = 0 V = 0 X = 0 guess4 = input('Turn #4 ') lguess4 = list(guess4) if lguess4[0] == lcode[0]: P += 1 if lguess4[1] == lcode[1]: P += 1 if lguess4[2] == lcode[2]: P += 1 if lguess4[3] == lcode[3]: P += 1 if lguess4[0] in lcode and lguess4[0] != lcode[0] : V += 1 if lguess4[1] in lcode and lguess4[1] != lcode[1] : V += 1 if lguess4[2] in lcode and lguess4[2] != lcode[2] : V += 1 if lguess4[3] in lcode and lguess4[3] != lcode[3] : V += 1 if lguess4[0] not in lcode: X += 1 if lguess4[1] not in lcode: X += 1 if lguess4[2] not in lcode: X += 1 if lguess4[3] not in lcode: X += 1 if P == 4: print(WINNING_MSG) else: print(' P='+str(P)+',V='+str(V)+',X='+str(X)) print(LOSING_MSG) print('The answer is '+code) print('Please try again...') |
# 6330523321 (20.00) 353 (2021-02-12 13:57) player = input("Turn #1 : ") p1 = 0 v1 = 0 x1 = 4 if(player != code) : if(player[0] in code) : v1+=1 x1-=1 if(player[1] in code) : v1+=1 x1-=1 if(player[2] in code) : v1+=1 x1-=1 if(player[3] in code) : v1+=1 x1-=1 if(player[0] == code[0]) : p1+=1 v1-=1 if(player[1] == code[1]) : p1+=1 v1-=1 if(player[2] == code[2]) : p1+=1 v1-=1 if(player[3] == code[3]) : p1+=1 v1-=1 print(" P="+str(p1)+","+"V="+str(v1)+","+"X="+str(x1)) player2 = input("Turn #2 : ") p2=0 v2=0 x2=4 if(player2 != code): if(player2[0] in code) : v2+=1 x2-=1 if(player2[1] in code) : v2+=1 x2-=1 if(player2[2] in code) : v2+=1 x2-=1 if(player2[3] in code) : v2+=1 x2-=1 if(player2[0] == code[0]) : p2+=1 v2-=1 if(player2[1] == code[1]) : p2+=1 v2-=1 if(player2[2] == code[2]) : p2+=1 v2-=1 if(player2[3] == code[3]) : p2+=1 v2-=1 print(" P="+str(p2)+","+"V="+str(v2)+","+"X="+str(x2)) player3 = input("Turn #3 : ") p3 = 0 v3 = 0 x3 = 4 if(player3 != code) : if(player3[0] in code) : v3+=1 x3-=1 if(player3[1] in code) : v3+=1 x3-=1 if(player3[2] in code) : v3+=1 x3-=1 if(player3[3] in code) : v3+=1 x3-=1 if(player3[0] == code[0]) : p3+=1 v3-=1 if(player3[1] == code[1]) : p3+=1 v3-=1 if(player3[2] == code[2]) : p3+=1 v3-=1 if(player3[3] == code[3]) : p3+=1 v3-=1 print(" P="+str(p3)+","+"V="+str(v3)+","+"X="+str(x3)) player4 = input("Turn #4 : ") p4 = 0 v4 = 0 x4 = 4 if(player4 != code) : if(player4[0] in code) : v4+=1 x4-=1 if(player4[1] in code) : v4+=1 x4-=1 if(player4[2] in code) : v4+=1 x4-=1 if(player4[3] in code) : v4+=1 x4-=1 if(player4[0] == code[0]) : p4+=1 v4-=1 if(player4[1] == code[1]) : p4+=1 v4-=1 if(player4[2] == code[2]) : p4+=1 v4-=1 if(player4[3] == code[3]) : p4+=1 v4-=1 print(" P="+str(p4)+","+"V="+str(v4)+","+"X="+str(x4)) print(LOSING_MSG) print("The answer is ",code) print("Please try again...") else : print(WINNING_MSG) else : print(WINNING_MSG) else : print(WINNING_MSG) else : print(WINNING_MSG) |
# 6330524021 (19.61) 354 (2021-02-13 16:12) x = 'Turn #1 : ' x = input(x) P = 0 V = 0 X = 0 if x != code: if x[0] in code: if x[0] == code[0]: P += 1 else: V += 1 else: X += 1 if x[1] in code: if x[1] == code[1]: P += 1 else: V += 1 else: X += 1 if x[2] in code: if x[2] == code[2]: P += 1 else: V += 1 else: X += 1 if x[3] in code: if x[3] == code[3]: P += 1 else: V += 1 else: X += 1 print(' '*10 +'P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) if x != code: x = 'Turn #2 : ' x = input(x) P = 0 V = 0 X = 0 if x[0] in code: if x[0] == code[0]: P += 1 else: V += 1 else: X += 1 if x[1] in code: if x[1] == code[1]: P += 1 else: V += 1 else: X += 1 if x[2] in code: if x[2] == code[2]: P += 1 else: V += 1 else: X += 1 if x[3] in code: if x[3] == code[3]: P += 1 else: V += 1 else: X += 1 print(' '*10 +'P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) if x != code: x = 'Turn #3 : ' x = input(x) P = 0 V = 0 X = 0 if x[0] in code: if x[0] == code[0]: P += 1 else: V += 1 else: X += 1 if x[1] in code: if x[1] == code[1]: P += 1 else: V += 1 else: X += 1 if x[2] in code: if x[2] == code[2]: P += 1 else: V += 1 else: X += 1 if x[3] in code: if x[3] == code[3]: P += 1 else: V += 1 else: X += 1 print(' '*10 +'P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) if x != code: x = 'Turn #4 : ' x = input(x) P = 0 V = 0 X = 0 if x[0] in code: if x[0] == code[0]: P += 1 else: V += 1 else: X += 1 if x[1] in code: if x[1] == code[1]: P += 1 else: V += 1 else: X += 1 if x[2] in code: if x[2] == code[2]: P += 1 else: V += 1 else: X += 1 if x[3] in code: if x[3] == code[3]: P += 1 else: V += 1 else: X += 1 if x == code: print(WINNING_MSG) else: print(' '*10 +'P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) print(LOSING_MSG) print('The answer is','', code) print('Please try again...') |
# 6330525621 (19.89) 355 (2021-02-14 18:20) ans=input("Turn #1 : ") P=0 V=0 if ans[0] in code: V+=1 if ans[1] in code: V+=1 if ans[2] in code: V+=1 if ans[3] in code: V+=1 if ans[0]==code[0]: P+=1 V-=1 if ans[1]==code[1]: P+=1 V-=1 if ans[2]==code[2]: P+=1 V-=1 if ans[3]==code[3]: P+=1 V-=1 if P==4: print(WINNING_MSG) else: print(" P="+str(P)+",V="+str(V)+",X="+str(4-P-V)) ans=input("Turn #2 : ") P=0 V=0 if ans[0] in code: V+=1 if ans[1] in code: V+=1 if ans[2] in code: V+=1 if ans[3] in code: V+=1 if ans[0]==code[0]: P+=1 V-=1 if ans[1]==code[1]: P+=1 V-=1 if ans[2]==code[2]: P+=1 V-=1 if ans[3]==code[3]: P+=1 V-=1 if P==4: print(WINNING_MSG) else: print(" P="+str(P)+",V="+str(V)+",X="+str(4-P-V)) ans=input("Turn #3 : ") P=0 V=0 if ans[0] in code: V+=1 if ans[1] in code: V+=1 if ans[2] in code: V+=1 if ans[3] in code: V+=1 if ans[0]==code[0]: P+=1 V-=1 if ans[1]==code[1]: P+=1 V-=1 if ans[2]==code[2]: P+=1 V-=1 if ans[3]==code[3]: P+=1 V-=1 if P==4: print(WINNING_MSG) else: print(" P="+str(P)+",V="+str(V)+",X="+str(4-P-V)) ans=input("Turn #4 : ") P=0 V=0 if ans[0] in code: V+=1 if ans[1] in code: V+=1 if ans[2] in code: V+=1 if ans[3] in code: V+=1 if ans[0]==code[0]: P+=1 V-=1 if ans[1]==code[1]: P+=1 V-=1 if ans[2]==code[2]: P+=1 V-=1 if ans[3]==code[3]: P+=1 V-=1 if P==4: print(WINNING_MSG) else: print(" P="+str(P)+",V="+str(V)+",X="+str(4-P-V)) print(LOSING_MSG) print("The answer is "+code) print("Please try again") |
# 6330526221 (19.14) 356 (2021-02-11 17:44) a = [code[0],code[1],code[2],code[3]] x = input('Turn #1 : ') P = 0 V = 0 X = 0 if x[0] == code[0] : P += 1 if x[1] == code[1] : P += 1 if x[2] == code[2] : P += 1 if x[3] == code[3] : P += 1 if not x[0] in a[:] : X += 1 if not x[1] in a[:] : X += 1 if not x[2] in a[:] : X += 1 if not x[3] in a[:] : X += 1 if x[0] in a[1:3] : V += 1 if x[1] in a[:1]+a[2:] : V += 1 if x[2] in a[0:2]+a[3:] : V += 1 if x[3] in a[:3] : V += 1 if P == 4 : print(WINNING_MSG) else : print((' '*10)+'P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) P = 0 V = 0 X = 0 x = input('Turn #2 : ') if x[0] == code[0] : P += 1 if x[1] == code[1] : P += 1 if x[2] == code[2] : P += 1 if x[3] == code[3] : P += 1 if not x[0] in a[:] : X += 1 if not x[1] in a[:] : X += 1 if not x[2] in a[:] : X += 1 if not x[3] in a[:] : X += 1 if x[0] in a[1:3] : V += 1 if x[1] in a[:1]+a[2:] : V += 1 if x[2] in a[0:2]+a[3:] : V += 1 if x[3] in a[:3] : V += 1 if P == 4 : print(WINNING_MSG) else : print((' '*10)+'P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) P = 0 V = 0 X = 0 x = input('Turn #3 : ') if x[0] == code[0] : P += 1 if x[1] == code[1] : P += 1 if x[2] == code[2] : P += 1 if x[3] == code[3] : P += 1 if not x[0] in a[:] : X += 1 if not x[1] in a[:] : X += 1 if not x[2] in a[:] : X += 1 if not x[3] in a[:] : X += 1 if x[0] in a[1:3] : V += 1 if x[1] in a[:1]+a[2:] : V += 1 if x[2] in a[0:2]+a[3:] : V += 1 if x[3] in a[:3] : V += 1 if P == 4 : print(WINNING_MSG) else : print((' '*10)+'P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) P = 0 V = 0 X = 0 x = input('Turn #4 : ') if x[0] == code[0] : P += 1 if x[1] == code[1] : P += 1 if x[2] == code[2] : P += 1 if x[3] == code[3] : P += 1 if not x[0] in a[:] : X += 1 if not x[1] in a[:] : X += 1 if not x[2] in a[:] : X += 1 if not x[3] in a[:] : X += 1 if x[0] in a[1:3] : V += 1 if x[1] in a[:1]+a[2:] : V += 1 if x[2] in a[0:2]+a[3:] : V += 1 if x[3] in a[:3] : V += 1 if P == 4 : print(WINNING_MSG) else : print((' '*10)+'P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) print(LOSING_MSG) print('The answer is'+ ' '*2 + code) print('Please try again...') |
# 6330527921 (16.61) 357 (2021-02-14 06:44) t1 = str(input('Turn #1 : ')) p=0 v=0 x=0 if t1[0] == code[0] : p+=1 elif t1[0] in code : v+=1 else : x+=1 if t1[1] == code[1] : p+=1 elif t1[1] in code : v+=1 else : x+=1 if t1[2] == code[2] : p+=1 elif t1[2] in code : v+=1 else : x+=1 if t1[3] == code[3] : p+=1 elif t1[3] in code : v+=1 else : x+=1 if p == 4 : print(WINNING_MSG) else : print (' p='+str(p)+',v='+str(v)+',x='+str(x)) t2 = str(input('Turn #2 : ')) p=0 v=0 x=0 if t2[0] == code[0] : p+=1 elif t2[0] in code : v+=1 else : x+=1 if t2[1] == code[1] : p+=1 elif t2[1] in code : v+=1 else : x+=1 if t2[2] == code[2] : p+=1 elif t2[2] in code : v+=1 else : x+=1 if t2[3] == code[3] : p+=1 elif t2[3] in code : v+=1 else : x+=1 if p == 4 : print(WINNING_MSG) else : print (' p='+str(p)+',v='+str(v)+',x='+str(x)) t3 = str(input('Turn #3 : ')) p=0 v=0 x=0 if t3[0] == code[0] : p+=1 elif t3[0] in code : v+=1 else : x+=1 if t3[1] == code[1] : p+=1 elif t3[1] in code : v+=1 else : x+=1 if t3[2] == code[2] : p+=1 elif t3[2] in code : v+=1 else : x+=1 if t3[3] == code[3] : p+=1 elif t3[3] in code : v+=1 else : x+=1 if p == 4 : print(WINNING_MSG) else : print (' p='+str(p)+',v='+str(v)+',x='+str(x)) t4 = str(input('Turn #4 : ')) p=0 v=0 x=0 if t4[0] == code[0] : p+=1 elif t4[0] in code : v+=1 else : x+=1 if t4[1] == code[1] : p+=1 elif t4[1] in code : v+=1 else : x+=1 if t4[2] == code[2] : p+=1 elif t4[2] in code : v+=1 else : x+=1 if t4[3] == code[3] : p+=1 elif t4[3] in code : v+=1 else : x+=1 if p == 3 : print(WINNING_MSG) else : print (' p='+str(p)+',v='+str(v)+',x='+str(x)) print (LOSING_MSG) print ('The answer is '+str(code)) print ('Please try again...') |
# 6330528521 (20.00) 358 (2021-02-15 00:40) n=1 p=0 v=0 if n==1 : a = input('Turn #1 : ') a = a.upper() if a == code : print(WINNING_MSG) else : if a[0] in code[0]: p = p+1 if a[1] in code[1]: p = p+1 if a[2] in code[2]: p = p+1 if a[3] in code[3]: p = p+1 if a[0] in code: v = v+1 if a[1] in code: v = v+1 if a[2] in code: v = v+1 if a[3] in code: v= v+1 n=n+1 v = v-p a = 4-v-p print(' P='+str(p)+',V='+str(v)+',X='+str(a)) p = 0 v = 0 if n==2 : a = input('Turn #2 : ') a = a.upper() if a == code : print(WINNING_MSG) else : if a[0] in code[0]: p = p+1 if a[1] in code[1]: p = p+1 if a[2] in code[2]: p = p+1 if a[3] in code[3]: p = p+1 if a[0] in code: v = v+1 if a[1] in code: v = v+1 if a[2] in code: v = v+1 if a[3] in code: v= v+1 n=n+1 v = v-p a = 4-v-p print(' P='+str(p)+',V='+str(v)+',X='+str(a)) p = 0 v = 0 if n==3 : a = input('Turn #3 : ') a = a.upper() if a == code : print(WINNING_MSG) else : if a[0] in code[0]: p = p+1 if a[1] in code[1]: p = p+1 if a[2] in code[2]: p = p+1 if a[3] in code[3]: p = p+1 if a[0] in code: v = v+1 if a[1] in code: v = v+1 if a[2] in code: v = v+1 if a[3] in code: v= v+1 n=n+1 v = v-p a = 4-v-p print(' P='+str(p)+',V='+str(v)+',X='+str(a)) p = 0 v = 0 if n==4 : a = input('Turn #4 : ') a = a.upper() if a == code : print('Congratulations! You won the game.') else : if a[0] in code[0]: p = p+1 if a[1] in code[1]: p = p+1 if a[2] in code[2]: p = p+1 if a[3] in code[3]: p = p+1 if a[0] in code: v = v+1 if a[1] in code: v = v+1 if a[2] in code: v = v+1 if a[3] in code: v= v+1 n=n+1 v = v-p a = 4-v-p print(' P='+str(p)+',V='+str(v)+',X='+str(a)) if n==5 : print(LOSING_MSG) print('The answer is '+ code) print('Please try again...') |
# 6330529121 (17.37) 359 (2021-02-15 14:33) answer = input('Turn #1 : ') P = 0 V = 0 X = 0 end = 0 if code[0] == answer[0]: P=P+1 if code[1] == answer[1]: P=P+1 if code[2] == answer[2]: P=P+1 if code[3] == answer[3]: P=P+1 if answer[0] in code : V=V+1 if answer[1] in code : V=V+1 if answer[2] in code : V=V+1 if answer[3] in code : V=V+1 V = V - P X = 4 - V - P if P == 4 : print(WINNING_MSG) end=end+1 else: print(' '*10 + 'P='+ str(P) + ',V='+str(V)+',X='+str(X)) if end == 0 : answer = input('Turn #2 : ') P = 0 V = 0 X = 0 if code[0] == answer[0]: P=P+1 if code[1] == answer[1]: P=P+1 if code[2] == answer[2]: P=P+1 if code[3] == answer[3]: P=P+1 if answer[0] in code : V=V+1 if answer[1] in code : V=V+1 if answer[2] in code : V=V+1 if answer[3] in code : V=V+1 V = V - P X = 4 - V - P if P == 4 : print(WINNING_MSG) end=end+1 else: print(' '*10 + 'P='+ str(P) + ',V='+str(V)+',X='+str(X)) if end == 0 : answer = input('Turn #3 : ') P = 0 V = 0 X = 0 if code[0] == answer[0]: P=P+1 if code[1] == answer[1]: P=P+1 if code[2] == answer[2]: P=P+1 if code[3] == answer[3]: P=P+1 if answer[0] in code : V=V+1 if answer[1] in code : V=V+1 if answer[2] in code : V=V+1 if answer[3] in code : V=V+1 V = V - P X = 4 - V - P if P == 4 : print(WINNING_MSG) end=end+1 else: print(' '*10 + 'P='+ str(P) + ',V='+str(V)+',X='+str(X)) if end == 0 : answer = input('Turn #4 : ') P = 0 V = 0 X = 0 if code[0] == answer[0]: P=P+1 if code[1] == answer[1]: P=P+1 if code[2] == answer[2]: P=P+1 if code[3] == answer[3]: P=P+1 if answer[0] in code : V=V+1 if answer[1] in code : V=V+1 if answer[2] in code : V=V+1 if answer[3] in code : V=V+1 V = V - P X = 4 - V - P if P == 4 : print(WINNING_MSG) else: print(LOSING_MSG) print('The answer is '+code) print('Please try again...') |
# 6330530721 (20.00) 360 (2021-02-15 00:05) guess_1 = input('Turn #1 : ') g_11 = guess_1[0] g_12 = guess_1[1] g_13 = guess_1[2] g_14 = guess_1[3] p = 0 v = 0 x = 0 if guess_1 == code : pass print(WINNING_MSG) else : if g_11 == code[0] : p += 1 elif g_11 in code : v += 1 else : x += 1 if g_12 == code[1] : p += 1 elif g_12 in code : v += 1 else : x += 1 if g_13 == code[2] : p += 1 elif g_13 in code : v += 1 else : x += 1 if g_14 == code[3] : p += 1 elif g_14 in code : v += 1 else : x += 1 print(" "+'P='+ str(p) + ',V=' + str(v) + ',X=' + str(x)) if guess_1 != code : guess_2 = input('Turn #2 : ') g_21 = guess_2[0] g_22 = guess_2[1] g_23 = guess_2[2] g_24 = guess_2[3] p2 = 0 v2 = 0 x2 = 0 if guess_2 == code : pass print(WINNING_MSG) else : if g_21 == code[0] : p2 += 1 elif g_21 in code : v2 += 1 else : x2 += 1 if g_22 == code[1] : p2 += 1 elif g_22 in code : v2 += 1 else : x2 += 1 if g_23 == code[2] : p2 += 1 elif g_23 in code : v2 += 1 else : x2 += 1 if g_24 == code[3] : p2 += 1 elif g_24 in code : v2 += 1 else : x2 += 1 print(" "+'P='+ str(p2) + ',V=' + str(v2) + ',X=' + str(x2)) if guess_2 != code : guess_3 = input('Turn #3 : ') g_31 = guess_3[0] g_32 = guess_3[1] g_33 = guess_3[2] g_34 = guess_3[3] p3 = 0 v3 = 0 x3 = 0 if guess_3 == code : pass print(WINNING_MSG) else : if g_31 == code[0] : p3 += 1 elif g_31 in code : v3 += 1 else : x3 += 1 if g_32 == code[1] : p3 += 1 elif g_32 in code : v3 += 1 else : x3 += 1 if g_33 == code[2] : p3 += 1 elif g_33 in code : v3 += 1 else : x3 += 1 if g_34 == code[3] : p3 += 1 elif g_34 in code : v3 += 1 else : x3 += 1 print(" "+'P='+ str(p3) + ',V=' + str(v3) + ',X=' + str(x3)) if guess_3 != code : guess_4 = input('Turn #4 : ') g_41 = guess_4[0] g_42 = guess_4[1] g_43 = guess_4[2] g_44 = guess_4[3] p4 = 0 v4 = 0 x4 = 0 if guess_4 == code : pass print(WINNING_MSG) else : if g_41 == code[0] : p4 += 1 elif g_41 in code : v4 += 1 else : x4 += 1 if g_42 == code[1] : p4 += 1 elif g_42 in code : v4 += 1 else : x4 += 1 if g_43 == code[2] : p4 += 1 elif g_43 in code : v4 += 1 else : x4 += 1 if g_44 == code[3] : p4 += 1 elif g_44 in code : v4 += 1 else : x4 += 1 print(" "+'P='+ str(p4) + ',V=' + str(v4) + ',X=' + str(x4)) print(LOSING_MSG) print("The answer is", str(code)) print('Please try again...') |
# 6330531321 (18.43) 361 (2021-02-12 01:23) gg = len("Turn #1 : ") first = input("Turn #1 : ") if first != code: p = 0 v = 0 x = 0 if first[0] in code: if first[0] == code[0]: p = p+1 else: v = v+1 else: x = x+1 if first[1] in code: if first[1] == code[1]: p = p+1 else: v = v+1 else: x = x+1 if first[2] in code: if first[2] == code[2]: p = p+1 else: v = v+1 else: x = x+1 if first[3] in code: if first[3] == code[3]: p = p+1 else: v = v+1 else: x = x+1 print((" "*gg)+"P="+str(p)+","+"V="+str(v)+","+"X="+str(x)) second = input("Turn #2 : ") if second != code: p = 0 v = 0 x = 0 if second[0] in code: if first[0] == code[0]: p = p+1 else: v = v+1 else: x = x+1 if second[1] in code: if second[1] == code[1]: p = p+1 else: v = v+1 else: x = x+1 if second[2] in code: if second[2] == code[2]: p = p+1 else: v = v+1 else: x = x+1 if second[3] in code: if second[3] == code[3]: p = p+1 else: v = v+1 else: x = x+1 print((" "*gg)+"P="+str(p)+","+"V="+str(v)+","+"X="+str(x)) third = input("Turn #3 : ") if third != code: p = 0 v = 0 x = 0 if second[0] in code: if first[0] == code[0]: p = p+1 else: v = v+1 else: x = x+1 if second[1] in code: if second[1] == code[1]: p = p+1 else: v = v+1 else: x = x+1 if second[2] in code: if second[2] == code[2]: p = p+1 else: v = v+1 else: x = x+1 if second[3] in code: if second[3] == code[3]: p = p+1 else: v = v+1 else: x = x+1 print((" "*gg)+"P="+str(p)+","+"V="+str(v)+","+"X="+str(x)) third = input("Turn #4 : ") if third != code: p = 0 v = 0 x = 0 if second[0] in code: if first[0] == code[0]: p = p+1 else: v = v+1 else: x = x+1 if second[1] in code: if second[1] == code[1]: p = p+1 else: v = v+1 else: x = x+1 if second[2] in code: if second[2] == code[2]: p = p+1 else: v = v+1 else: x = x+1 if second[3] in code: if second[3] == code[3]: p = p+1 else: v = v+1 else: x = x+1 print((" "*gg)+"P="+str(p)+","+"V="+str(v)+","+"X="+str(x)) print(LOSING_MSG) print("The answer is" ," "+ code) print("Please try again..." ) else: print(WINNING_MSG) else: print(WINNING_MSG) else: print(WINNING_MSG) else: print(WINNING_MSG) |
# 6330532021 (20.00) 362 (2021-02-12 21:13) x = input('Turn #1 : ') P = 0 V = 0 X = 0 if x[0] == code[0] : P = P+1 elif x[0] in code : V = V+1 else : X = X +1 if x[1] == code[1] : P = P+1 elif x[1] in code : V = V+1 else : X = X +1 if x[2] == code[2] : P = P+1 elif x[2] in code : V = V+1 else : X = X +1 if x[3] == code[3] : P = P+1 elif x[3] in code : V = V+1 else : X = X +1 if x == code : print("Congratulations! You won the game.") else : print(' P='+str(P)+',V='+str(V)+',X='+str(X)) P = 0 V = 0 X = 0 x = input('Turn #2 : ') if x[0] == code[0] : P = P+1 elif x[0] in code : V = V+1 else : X = X +1 if x[1] == code[1] : P = P+1 elif x[1] in code : V = V+1 else : X = X +1 if x[2] == code[2] : P = P+1 elif x[2] in code : V = V+1 else : X = X +1 if x[3] == code[3] : P = P+1 elif x[3] in code : V = V+1 else : X = X+1 if x == code : print("Congratulations! You won the game.") else : print(' P='+str(P)+',V='+str(V)+',X='+str(X)) x = input('Turn #3 : ') P = 0 V = 0 X = 0 if x[0] == code[0] : P = P+1 elif x[0] in code : V = V+1 else : X = X +1 if x[1] == code[1] : P = P+1 elif x[1] in code : V = V+1 else : X = X +1 if x[2] == code[2] : P = P+1 elif x[2] in code : V = V+1 else : X = X +1 if x[3] == code[3] : P = P+1 elif x[3] in code : V = V+1 else : X = X+1 if x == code : print("Congratulations! You won the game.") else : print(' P='+str(P)+',V='+str(V)+',X='+str(X)) x = input('Turn #4 : ') P = 0 V = 0 X = 0 if x[0] == code[0] : P = P+1 elif x[0] in code : V = V+1 else : X = X +1 if x[1] == code[1] : P = P+1 elif x[1] in code : V = V+1 else : X = X +1 if x[2] == code[2] : P = P+1 elif x[2] in code : V = V+1 else : X = X +1 if x[3] == code[3] : P = P+1 elif x[3] in code : V = V+1 else : X = X+1 if x == code : print("Congratulations! You won the game.") else : print(' P='+str(P)+',V='+str(V)+',X='+str(X)) print("Sorry! You just lost it.") print('The answer is '+code) print('Please try again...') |
# 6330533621 (20.00) 363 (2021-02-13 04:17) Q=list(code) a=input('Turn #1 : ') a=list(a) if a[0]==Q[0]: p=1 v=0 x=0 else: p=0 if a[0] in [Q[1],Q[2],Q[3]]: v=1 x=0 else: v=0 x=1 if a[1]==Q[1]: p=p+1 v=v x=x else: p=p if a[1] in [Q[0],Q[2],Q[3]]: v=v+1 x=x else: v=v x=x+1 if a[2]==Q[2]: p=p+1 v=v x=x else: p=p if a[2] in [Q[0],Q[1],Q[3]]: v=v+1 x=x else: v=v x=x+1 if a[3]==Q[3]: p=p+1 v=v x=x else: p=p if a[3] in [Q[0],Q[1],Q[2]]: v=v+1 x=x else: v=v x=x+1 if p==4: print(WINNING_MSG) else: print(' P={},V={},X={}'.format(p,v,x)) b=input('Turn #2 : ') if b[0]==Q[0]: p=1 v=0 x=0 else: p=0 if b[0] in [Q[1],Q[2],Q[3]]: v=1 x=0 else: v=0 x=1 if b[1]==Q[1]: p=p+1 v=v x=x else: p=p if b[1] in [Q[0],Q[2],Q[3]]: v=v+1 x=x else: v=v x=x+1 if b[2]==Q[2]: p=p+1 v=v x=x else: p=p if b[2] in [Q[0],Q[1],Q[3]]: v=v+1 x=x else: v=v x=x+1 if b[3]==Q[3]: p=p+1 v=v x=x else: p=p if b[3] in [Q[0],Q[1],Q[2]]: v=v+1 x=x else: v=v x=x+1 if p==4: print(WINNING_MSG) else: print(' P={},V={},X={}'.format(p,v,x)) c=input('Turn #3 : ') if c[0]==Q[0]: p=1 v=0 x=0 else: p=0 if c[0] in [Q[1],Q[2],Q[3]]: v=1 x=0 else: v=0 x=1 if c[1]==Q[1]: p=p+1 v=v x=x else: p=p if c[1] in [Q[0],Q[2],Q[3]]: v=v+1 x=x else: v=v x=x+1 if c[2]==Q[2]: p=p+1 v=v x=x else: p=p if c[2] in [Q[0],Q[1],Q[3]]: v=v+1 x=x else: v=v x=x+1 if c[3]==Q[3]: p=p+1 v=v x=x else: p=p if c[3] in [Q[0],Q[1],Q[2]]: v=v+1 x=x else: v=v x=x+1 if p==4: print(WINNING_MSG) else: print(' P={},V={},X={}'.format(p,v,x)) d=input('Turn #4 : ') if d[0]==Q[0]: p=1 v=0 x=0 else: p=0 if d[0] in [Q[1],Q[2],Q[3]]: v=1 x=0 else: v=0 x=1 if d[1]==Q[1]: p=p+1 v=v x=x else: p=p if d[1] in [Q[0],Q[2],Q[3]]: v=v+1 x=x else: v=v x=x+1 if d[2]==Q[2]: p=p+1 v=v x=x else: p=p if d[2] in [Q[0],Q[1],Q[3]]: v=v+1 x=x else: v=v x=x+1 if d[3]==Q[3]: p=p+1 v=v x=x else: p=p if d[3] in [Q[0],Q[1],Q[2]]: v=v+1 x=x else: v=v x=x+1 if p==4: print(WINNING_MSG) else: print(' P={},V={},X={}'.format(p,v,x)) print(LOSING_MSG) print('The answer is {}'.format(code)) print('Please try again...') |
# 6330534221 (20.00) 364 (2021-02-14 20:38) codelist=list(code) x,y,z,n=0,0,0,0 ans1=list(input("Turn #1 : ")) code1=codelist if code1[0]==ans1[0]: x+=1 if code1[1]==ans1[1]: x+=1 if code1[2]==ans1[2]: x+=1 if code1[3]==ans1[3]: x+=1 if ans1[0] in code1: y+=1 if ans1[1] in code1: y+=1 if ans1[2] in code1: y+=1 if ans1[3] in code1: y+=1 if x==4: n+=10 print(WINNING_MSG) z=4-y if n<4: print(" P="+str(x)+",V="+str(y-x)+",X="+str(z)) n+=1 if n<4: ans2=list(input("Turn #2 : ")) h,j,k,l=0,0,0,0 code2=codelist if code2[0]==ans2[0]: h+=1 if code2[1]==ans2[1]: h+=1 if code2[2]==ans2[2]: h+=1 if code2[3]==ans2[3]: h+=1 if ans2[0] in code2: j+=1 if ans2[1] in code2: j+=1 if ans2[2] in code2: j+=1 if ans2[3] in code2: j+=1 if h==4: n+=10 print(WINNING_MSG) k=4-j if n<4: print(" P="+str(h)+",V="+str(j-h)+",X="+str(k)) if n<4: ans3=list(input("Turn #3 : ")) u,i,o,p=0,0,0,0 code3=codelist if code3[0]==ans3[0]: u+=1 if code3[1]==ans3[1]: u+=1 if code3[2]==ans3[2]: u+=1 if code3[3]==ans3[3]: u+=1 if ans3[0] in code1: i+=1 if ans3[1] in code1: i+=1 if ans3[2] in code1: i+=1 if ans3[3] in code1: i+=1 if u==4: n+=10 print(WINNING_MSG) o=4-i if n<4: print(" P="+str(u)+",V="+str(i-u)+",X="+str(o)) if n<4: ans4=list(input("Turn #4 : ")) u,i,o,p=0,0,0,0 code2=codelist if code2[0]==ans4[0]: u+=1 if code2[1]==ans4[1]: u+=1 if code2[2]==ans4[2]: u+=1 if code2[3]==ans4[3]: u+=1 if ans4[0] in code1: i+=1 if ans4[1] in code1: i+=1 if ans4[2] in code1: i+=1 if ans4[3] in code1: i+=1 if u==4: n+=10 print(WINNING_MSG) o=4-i if n<4: print(" P="+str(u)+",V="+str(i-u)+",X="+str(o)) if n<=5: print("Sorry! You just lost it.") print("The answer is "+str(code)) print("Please try again...") |
# 6330535921 (20.00) 365 (2021-02-15 01:39) def splitz(ans): ans = [ans[0],ans[1],ans[2],ans[3]] return ans def solution(code,xx,p,v): x = splitz(xx) if x[0]==ans[0]: p = p+1 if x[1]==ans[1]: p = p+1 if x[2]==ans[2]: p = p+1 if x[3]==ans[3]: p = p+1 if x[0] in code: v = v+1 if x[1] in code: v = v+1 if x[2] in code: v = v+1 if x[3] in code: v= v+1 v = abs(p-v) a = 4-v-p print(' P='+str(p)+',V='+str(v)+',X='+str(a)) ans = splitz(code) n = 1 p = 0 v = 0 if n==1 : xx = input('Turn #1 : ') if xx == code : print('Congratulations! You won the game.') else : solution(code,xx,p,v) n =n+1 if n==2 : xx = input('Turn #2 : ') if xx == code : print('Congratulations! You won the game.') else : solution(code,xx,p,v) n =n+1 if n==3 : xx = input('Turn #3 : ') if xx == code : print('Congratulations! You won the game.') else : solution(code,xx,p,v) n =n+1 if n==4 : xx = input('Turn #4 : ') if xx == code : print('Congratulations! You won the game.') else : solution(code,xx,p,v) n =n+1 if n==5 : print('Sorry! You just lost it.') print('The answer is '+ code) print('Please try again...') |
# 6330536521 (20.00) 366 (2021-02-12 15:23) p=0 x=0 n=input("Turn #1 : ") if n[0]==code[0] : p+=1 if n[1]==code[1] : p+=1 if n[2]==code[2] : p+=1 if n[3]==code[3] : p+=1 if code[0] not in n: x+=1 if code[1] not in n: x+=1 if code[2] not in n: x+=1 if code[3] not in n: x+=1 v=4-(p+x) if p==4 : print(WINNING_MSG) else: print(" P="+str(p)+",V="+str(v)+",X="+str(x)) p=0 x=0 n=input("Turn #2 : ") if n[0]==code[0] : p+=1 if n[1]==code[1] : p+=1 if n[2]==code[2] : p+=1 if n[3]==code[3] : p+=1 if code[0] not in n: x+=1 if code[1] not in n: x+=1 if code[2] not in n: x+=1 if code[3] not in n: x+=1 v=4-(p+x) if p==4 : print(WINNING_MSG) else: print(" P="+str(p)+",V="+str(v)+",X="+str(x)) p=0 x=0 n=input("Turn #3 : ") if n[0]==code[0] : p+=1 if n[1]==code[1] : p+=1 if n[2]==code[2] : p+=1 if n[3]==code[3] : p+=1 if code[0] not in n: x+=1 if code[1] not in n: x+=1 if code[2] not in n: x+=1 if code[3] not in n: x+=1 v=4-(p+x) if p==4 : print(WINNING_MSG) else: print(" P="+str(p)+",V="+str(v)+",X="+str(x)) p=0 x=0 n=input("Turn #4 : ") if n[0]==code[0] : p+=1 if n[1]==code[1] : p+=1 if n[2]==code[2] : p+=1 if n[3]==code[3] : p+=1 if code[0] not in n: x+=1 if code[1] not in n: x+=1 if code[2] not in n: x+=1 if code[3] not in n: x+=1 v=4-(p+x) if p==4 : print(WINNING_MSG) else: print(" P="+str(p)+",V="+str(v)+",X="+str(x)) print(LOSING_MSG) print("The answer is "+str(code)) print("Please try again...") |
# 6330537121 (20.00) 367 (2021-02-14 21:28) win = 0 a = input('Turn #1 : ') P = 0 V = 0 X = 0 if (a == code): win = 1 print("Congratulations! You won the game.") elif (win != 1): if a[0] == code[0] : P = P+1 else : if a[0] in code[:4] : V = V+1 if a[0] not in code[:] : X = X+1 if a[1] == code[1] : P = P+1 else : if a[1] in code[0]+code[2]+code[3] : V = V+1 if a[1] not in code[:] : X = X+1 if a[2] == code[2] : P = P+1 else : if a[2] in code[0]+code[1]+code[3] : V = V+1 if a[2] not in code[:] : X = X+1 if a[3] == code[3] : P = P+1 else : if a[3] in code[0]+code[1]+code[2] : V = V+1 if a[3] not in code[:] : X = X+1 print((str(' ')*10)+'P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) if (win!=1): b = input('Turn #2 : ') P = 0 V = 0 X = 0 if (b == code): win = 1 print("Congratulations! You won the game.") elif (win != 1): if b[0] == code[0] : P = P+1 else : if b[0] in code[:4] : V = V+1 if b[0] not in code[:] : X = X+1 if b[1] == code[1] : P = P+1 else : if b[1] in code[0]+code[2]+code[3] : V = V+1 if b[1] not in code[:] : X = X+1 if b[2] == code[2] : P = P+1 else : if b[2] in code[0]+code[1]+code[3] : V = V+1 if b[2] not in code[:] : X = X+1 if b[3] == code[3] : P = P+1 else : if b[3] in code[0]+code[1]+code[2] : V = V+1 if b[3] not in code[:] : X = X+1 print((str(' ')*10)+'P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) if (win != 1): c = input('Turn #3 : ') P = 0 V = 0 X = 0 if (c == code): win = 1 print("Congratulations! You won the game.") elif (win != 1): if c[0] == code[0] : P = P+1 else : if c[0] in code[:4] : V = V+1 if c[0] not in code[:] : X = X+1 if c[1] == code[1] : P = P+1 else : if c[1] in code[0]+code[2]+code[3] : V = V+1 if c[1] not in code[:] : X = X+1 if c[2] == code[2] : P = P+1 else : if c[2] in code[0]+code[1]+code[3] : V = V+1 if c[2] not in code[:] : X = X+1 if c[3] == code[3] : P = P+1 else : if c[3] in code[0]+code[1]+code[2] : V = V+1 if c[3] not in code[:] : X = X+1 print((str(' ')*10)+'P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) if (win != 1): d = input('Turn #4 : ') P = 0 V = 0 X = 0 if (d == code): win = 1 print("Congratulations! You won the game.") elif (win != 1): if d[0] == code[0] : P = P+1 else : if d[0] in code[:4] : V = V+1 if d[0] not in code[:] : X = X+1 if d[1] == code[1] : P = P+1 else : if d[1] in code[0]+code[2]+code[3] : V = V+1 if d[1] not in code[:] : X = X+1 if d[2] == code[2] : P = P+1 else : if d[2] in code[0]+code[1]+code[3] : V = V+1 if d[2] not in code[:] : X = X+1 if d[3] == code[3] : P = P+1 else : if d[3] in code[0]+code[1]+code[2] : V = V+1 if d[3] not in code[:] : X = X+1 print((str(' ')*10)+'P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) if (win != 1): print("Sorry! You just lost it.") print("The answer is " + code) print("Please try again...") |
# 6330538821 (20.00) 368 (2021-02-11 16:13) a=input('Turn #1 : ',) P=0 V=0 X=0 if a[0]==code[0] : P=P+1 else: if a[1]==code[0] or a[2]==code[0] or a[3]==code[0] : V=V+1 else: X=X+1 if a[1]==code[1] : P=P+1 else: if a[0]==code[1] or a[2]==code[1] or a[3]==code[1] : V=V+1 else: X=X+1 if a[2]==code[2] : P=P+1 else: if a[0]==code[2] or a[1]==code[2] or a[3]==code[2]: V=V+1 else: X=X+1 if a[3]==code[3] : P=P+1 else: if a[0]==code[3] or a[1]==code[3] or a[2]==code[3]: V=V+1 else: X=X+1 if P==4 : print(WINNING_MSG) else: print(' '+'P='+str(P)+',V='+str(V)+',X='+str(X)) a=input('Turn #2 : ',) P=0 V=0 X=0 if a[0]==code[0] : P=P+1 else: if a[1]==code[0] or a[2]==code[0] or a[3]==code[0] : V=V+1 else: X=X+1 if a[1]==code[1] : P=P+1 else: if a[0]==code[1] or a[2]==code[1] or a[3]==code[1] : V=V+1 else: X=X+1 if a[2]==code[2] : P=P+1 else: if a[0]==code[2] or a[1]==code[2] or a[3]==code[2]: V=V+1 else: X=X+1 if a[3]==code[3] : P=P+1 else: if a[0]==code[3] or a[1]==code[3] or a[2]==code[3]: V=V+1 else: X=X+1 if P==4 : print(WINNING_MSG) else: print(' '+'P='+str(P)+',V='+str(V)+',X='+str(X)) a=input('Turn #3 : ',) P=0 V=0 X=0 if a[0]==code[0] : P=P+1 else: if a[1]==code[0] or a[2]==code[0] or a[3]==code[0] : V=V+1 else: X=X+1 if a[1]==code[1] : P=P+1 else: if a[0]==code[1] or a[2]==code[1] or a[3]==code[1] : V=V+1 else: X=X+1 if a[2]==code[2] : P=P+1 else: if a[0]==code[2] or a[1]==code[2] or a[3]==code[2]: V=V+1 else: X=X+1 if a[3]==code[3] : P=P+1 else: if a[0]==code[3] or a[1]==code[3] or a[2]==code[3]: V=V+1 else: X=X+1 if P==4 : print(WINNING_MSG) else: print(' '+'P='+str(P)+',V='+str(V)+',X='+str(X)) a=input('Turn #4 : ',) P=0 V=0 X=0 if a[0]==code[0] : P=P+1 else: if a[1]==code[0] or a[2]==code[0] or a[3]==code[0] : V=V+1 else: X=X+1 if a[1]==code[1] : P=P+1 else: if a[0]==code[1] or a[2]==code[1] or a[3]==code[1] : V=V+1 else: X=X+1 if a[2]==code[2] : P=P+1 else: if a[0]==code[2] or a[1]==code[2] or a[3]==code[2]: V=V+1 else: X=X+1 if a[3]==code[3] : P=P+1 else: if a[0]==code[3] or a[1]==code[3] or a[2]==code[3]: V=V+1 else: X=X+1 if P==4 : print(WINNING_MSG) else: print(' '+'P='+str(P)+',V='+str(V)+',X='+str(X)) print(LOSING_MSG) print('The answer is',code) print('Please try again...') |
# 6330539421 (20.00) 369 (2021-02-11 14:05) #print(code) a = input('Turn #1 : ') p=0 v=0 x=0 z=0 if a[0] == code[0]: p = p+1 if a[1] == code[1]: p = p+1 if a[2] == code[2]: p = p+1 if a[3] == code[3]: p = p+1 if a[0] in code: v = v+1 if a[1] in code: v = v+1 if a[2] in code: v = v+1 if a[3] in code: v = v+1 if p == 4: z = z+1 v = v - p x = 4 - v - p if z == 1: print(WINNING_MSG) else : print(' P='+str(p)+',V='+str(v)+',X='+str(x)) if z == 0: a = input('Turn #2 : ') p=0 v=0 x=0 if a[0] == code[0]: p = p+1 if a[1] == code[1]: p = p+1 if a[2] == code[2]: p = p+1 if a[3] == code[3]: p = p+1 if a[0] in code: v = v+1 if a[1] in code: v = v+1 if a[2] in code: v = v+1 if a[3] in code: v = v+1 if p == 4: z = z+1 v = v - p x = 4 - v - p if z == 1: print(WINNING_MSG) if z == 0 : print(' P='+str(p)+',V='+str(v)+',X='+str(x)) if z == 0: a = input('Turn #3 : ') p=0 v=0 x=0 if a[0] == code[0]: p = p+1 if a[1] == code[1]: p = p+1 if a[2] == code[2]: p = p+1 if a[3] == code[3]: p = p+1 if a[0] in code: v = v+1 if a[1] in code: v = v+1 if a[2] in code: v = v+1 if a[3] in code: v = v+1 if p == 4: z = z+1 v = v - p x = 4 - v - p if z == 1: print(WINNING_MSG) if z == 0 : print(' P='+str(p)+',V='+str(v)+',X='+str(x)) if z == 0: a = input('Turn #4 : ') p=0 v=0 x=0 if a[0] == code[0]: p = p+1 if a[1] == code[1]: p = p+1 if a[2] == code[2]: p = p+1 if a[3] == code[3]: p = p+1 if a[0] in code: v = v+1 if a[1] in code: v = v+1 if a[2] in code: v = v+1 if a[3] in code: v = v+1 if p == 4: z = z+1 v = v - p x = 4 - v - p if z == 1: print(WINNING_MSG) if z == 0 : print(' P='+str(p)+',V='+str(v)+',X='+str(x)) print(LOSING_MSG) print('The answer is '+code) print('Please try again...') |
# 6330540021 (17.37) 370 (2021-02-14 18:08) c = input("Turn #1 : ") P0 = 0 V0 = 0 if c[0] == code[0]: P0 += 1 if c[1] == code[1]: P0 += 1 if c[2] == code[2]: P0 += 1 if c[3] == code[3]: P0 += 1 if c[0] in code: V0 = V0 + 1 if c[1] in code: V0 = V0 + 1 if c[2] in code: V0 = V0 + 1 if c[3] in code: V0 = V0 + 1 if c==code: print(WINNING_MSG) else : print(" "*10+"P="+str(P0)+","+"V="+str(V0-P0)+","+"X="+str(4-V0)) c = input("Turn #2 : ") P1 = 0 V1 = 0 if c[0] == code[0]: P1 += 1 if c[1] == code[1]: P1 += 1 if c[2] == code[2]: P1 += 1 if c[3] == code[3]: P1 += 1 if c[0] in code: V1 = V1 + 1 if c[1] in code: V1 = V1 + 1 if c[2] in code: V1 = V1 + 1 if c[3] in code: V1 = V1 + 1 if c==code: print(WINNING_MSG) else : print(" "*10+"P="+str(P1)+","+"V="+str(V1-P1)+","+"X="+str(4-V1)) c = input("Turn #3 : ") P2 = 0 V2 = 0 if c[0] == code[0]: P2 += 1 if c[1] == code[1]: P2 += 1 if c[2] == code[2]: P2 += 1 if c[3] == code[3]: P2 += 1 if c[0] in code: V2 = V2 + 1 if c[1] in code: V2 = V2 + 1 if c[2] in code: V2 = V2 + 1 if c[3] in code: V2 = V2 + 1 if c==code: print(WINNING_MSG) else : print(" "*10+"P="+str(P2)+","+"V="+str(V2-P2)+","+"X="+str(4-V2)) c = input("Turn #4 : ") P3 = 0 V3 = 0 if c[0] == code[0]: P3 += 1 if c[1] == code[1]: P3 += 1 if c[2] == code[2]: P3 += 1 if c[3] == code[3]: P3 += 1 if c[0] in code: V3 = V3 + 1 if c[1] in code: V3 = V3 + 1 if c[2] in code: V3 = V3 + 1 if c[3] in code: V3 = V3 + 1 if c==code: print(WINNING_MSG) else : print(LOSING_MSG) print("The answer is",code) print("Please try again...") |
# 6330541621 (18.61) 371 (2021-02-15 16:28) P = 0 V = 0 X = 0 x = input('Turn #1 : ') if not x==code: if x[0] in code[0]: P+=1 elif x[0] in list(code): V+=1 else: X+=1 if x[1] in code[1]: P+=1 elif x[1] in list(code): V+=1 else: X+=1 if x[2] in code[2]: P+=1 elif x[2] in list(code): V+=1 else: X+=1 if x[3] in code[3]: P+=1 elif x[3] in list(code): V+=1 else: X+=1 print(' '+'P='+str(P),'V='+str(V),'X='+str(X)) if x==code: print(WINNING_MSG) else: P = 0 V = 0 X = 0 y = input('Turn #2 : ') if not y==code: if y[0] in code[0]: P+=1 elif y[0] in list(code): V+=1 else: X+=1 if y[1] in code[1]: P+=1 elif y[1] in list(code): V+=1 else: X+=1 if y[2] in code[2]: P+=1 elif y[2] in list(code): V+=1 else: X+=1 if y[3] in code[3]: P+=1 elif y[3] in list(code): V+=1 else: X+=1 print(' '+'P='+str(P),'V='+str(V),'X='+str(X)) if y==code: print(WINNING_MSG) else: P = 0 V = 0 X = 0 z = input('Turn #3 : ') if not z==code: if z[0] in code[0]: P+=1 elif z[0] in list(code): V+=1 else: X+=1 if z[1] in code[1]: P+=1 elif z[1] in list(code): V+=1 else: X+=1 if z[2] in code[2]: P+=1 elif z[2] in list(code): V+=1 else: X+=1 if z[3] in code[3]: P+=1 elif z[3] in list(code): V+=1 else: X+=1 print(' '+'P='+str(P),'V='+str(V),'X='+str(X)) if z==code: print(WINNING_MSG) else: P = 0 V = 0 X = 0 m = input('Turn #4 : ') if not m==code: if m[0] in code[0]: P+=1 elif m[0] in list(code): V+=1 else: X+=1 if m[1] in code[1]: P+=1 elif m[1] in list(code): V+=1 else: X+=1 if m[2] in code[2]: P+=1 elif m[2] in list(code): V+=1 else: X+=1 if m[3] in code[3]: P+=1 elif m[3] in list(code): V+=1 else: X+=1 print(' '+'P='+str(P),'V='+str(V),'X='+str(X)) print(LOSING_MSG) print('The answer is '+str(code)) print('Please try again...') if m==code: print(WINNING_MSG) |
# 6330542221 (19.11) 372 (2021-02-13 01:00) c=list(code) b=True if b==True : a=input() a1=list(a) P=0 if a1[0]==c[0]: P=P+1 if a1[1]==c[1]: P=P+1 if a1[2]==c[2]: P=P+1 if a1[3]==c[3]: P=P+1 V=0 if a1[0] in c: V=V+1 if a1[1] in c: V=V+1 if a1[2] in c: V=V+1 if a1[3] in c: V=V+1 V=V-P X=4-V-P print('Turn #1 :',a) if P!=4 : print(' '+'P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) else : b=False print(WINNING_MSG) if b==True : a=input() a1=list(a) P=0 if a1[0]==c[0]: P=P+1 if a1[1]==c[1]: P=P+1 if a1[2]==c[2]: P=P+1 if a1[3]==c[3]: P=P+1 V=0 if a1[0] in c: V=V+1 if a1[1] in c: V=V+1 if a1[2] in c: V=V+1 if a1[3] in c: V=V+1 V=V-P X=4-V-P print('Turn #2 :',a) if P!=4 : print(' '+'P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) else : b=False print(WINNING_MSG) if b==True : a=input() a1=list(a) P=0 if a1[0]==c[0]: P=P+1 if a1[1]==c[1]: P=P+1 if a1[2]==c[2]: P=P+1 if a1[3]==c[3]: P=P+1 V=0 if a1[0] in c: V=V+1 if a1[1] in c: V=V+1 if a1[2] in c: V=V+1 if a1[3] in c: V=V+1 V=V-P X=4-V-P print('Turn #3 :',a) if P!=4 : print(' '+'P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) else : b=False print(WINNING_MSG) if b==True : a=input() a1=list(a) P=0 if a1[0]==c[0]: P=P+1 if a1[1]==c[1]: P=P+1 if a1[2]==c[2]: P=P+1 if a1[3]==c[3]: P=P+1 V=0 if a1[0] in c: V=V+1 if a1[1] in c: V=V+1 if a1[2] in c: V=V+1 if a1[3] in c: V=V+1 V=V-P X=4-V-P print('Turn #4 :',a) if P!=4 : print(' '+'P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) print(LOSING_MSG) print('The answer is ',code) print('Please try again...') else : b=False print(WINNING_MSG) |
# 6330543921 (20.00) 373 (2021-02-12 00:21) co = input('Turn #1 : ').upper() P1 = 0 V1 = 0 if co[0] == code[0]: P1 += 1 if co[1] == code[1]: P1 += 1 if co[2] == code[2]: P1 += 1 if co[3] == code[3]: P1 += 1 if co[0] in code: V1 += 1 if co[1] in code: V1 += 1 if co[2] in code: V1 += 1 if co[3] in code: V1 += 1 if co == code: print(WINNING_MSG) else: text1 = ' '*10+'P='+str(P1)+','+'V='+str(V1-P1)+','+'X='+str(4-V1) print(text1) co = input('Turn #2 : ').upper() P2 = 0 V2 = 0 if co[0] == code[0]: P2 += 1 if co[1] == code[1]: P2 += 1 if co[2] == code[2]: P2 += 1 if co[3] == code[3]: P2 += 1 if co[0] in code: V2 += 1 if co[1] in code: V2 += 1 if co[2] in code: V2 += 1 if co[3] in code: V2 += 1 if co == code: print(WINNING_MSG) else: text2 = ' '*10+'P='+str(P2)+','+'V='+str(V2-P2)+','+'X='+str(4-V2) print(text2) co = input('Turn #3 : ').upper() P3 = 0 V3 = 0 if co[0] == code[0]: P3 += 1 if co[1] == code[1]: P3 += 1 if co[2] == code[2]: P3 += 1 if co[3] == code[3]: P3 += 1 if co[0] in code: V3 += 1 if co[1] in code: V3 += 1 if co[2] in code: V3 += 1 if co[3] in code: V3 += 1 if co == code: print(WINNING_MSG) else: text3 = ' '*10+'P='+str(P3)+','+'V='+str(V3-P3)+','+'X='+str(4-V3) print(text3) co = input('Turn #4 : ').upper() P4 = 0 V4 = 0 if co[0] == code[0]: P4 += 1 if co[1] == code[1]: P4 += 1 if co[2] == code[2]: P4 += 1 if co[3] == code[3]: P4 += 1 if co[0] in code: V4 += 1 if co[1] in code: V4 += 1 if co[2] in code: V4 += 1 if co[3] in code: V4 += 1 if co == code: print(WINNING_MSG) else: text4 = ' '*10+'P='+str(P4)+','+'V='+str(V4-P4)+','+'X='+str(4-V4) print(text4) print(LOSING_MSG) print('The answer is',code) print('Please try again...') |
# 6330544521 (17.27) 374 (2021-02-13 22:56) V = 0 P = 0 mycode = input('turn #1 : ') if mycode[0] in code: V = V + 1 if mycode[1] in code: V = V + 1 if mycode[2] in code: V = V + 1 if mycode[3] in code: V = V + 1 if mycode[0] == code[0]: P = P + 1 if mycode[1] == code[1]: P = P + 1 if mycode[2] == code[2]: P = P + 1 if mycode[3] == code[3]: P = P + 1 if P == 4: print(WINNING_MSG) else: print(" "*10 + "P=" + str(P) + "," + "V=" + str(V-P) + ",X=" + str(4-V)) V = 0 P = 0 mycode = input('turn #2 : ') if mycode[0] in code: V = V + 1 if mycode[1] in code: V = V + 1 if mycode[2] in code: V = V + 1 if mycode[3] in code: V = V + 1 if mycode[0] == code[0]: P = P + 1 if mycode[1] == code[1]: P = P + 1 if mycode[2] == code[2]: P = P + 1 if mycode[3] == code[3]: P = P + 1 if P == 4: print(WINNING_MSG) else: print(" "*10 + "P=" + str(P) + "," + "V=" + str(V-P) + ",X=" + str(4-V)) V = 0 P = 0 mycode = input('turn #3 : ') if mycode[0] in code: V = V + 1 if mycode[1] in code: V = V + 1 if mycode[2] in code: V = V + 1 if mycode[3] in code: V = V + 1 if mycode[0] == code[0]: P = P + 1 if mycode[1] == code[1]: P = P + 1 if mycode[2] == code[2]: P = P + 1 if mycode[3] == code[3]: P = P + 1 if P == 4: print(WINNING_MSG) else: print(" "*10 + "P=" + str(P) + "," + "V=" + str(V-P) + ",X=" + str(4-V)) V = 0 P = 0 mycode = input('turn #4 : ') if mycode[0] in code: V = V + 1 if mycode[1] in code: V = V + 1 if mycode[2] in code: V = V + 1 if mycode[3] in code: V = V + 1 if mycode[0] == code[0]: P = P + 1 if mycode[1] == code[1]: P = P + 1 if mycode[2] == code[2]: P = P + 1 if mycode[3] == code[3]: P = P + 1 if P == 4: print(WINNING_MSG) else: print(LOSING_MSG) print("The answer is" + " " + str(code)) print("Please try again...") |
# 6330545121 (20.00) 375 (2021-02-14 21:44) Correct = [code[0],code[1],code[2],code[3]] [P,V,X] = [0,0,0] print('Turn #1',':',end=' ') Input = str(input()) Num = [Input[0],Input[1],Input[2],Input[3]] if code[0] == Input[0]: P = P+1 elif code[0] in Num: V = V+1 if code[1] == Input[1]: P = P+1 elif code[1] in Num: V = V+1 if code[2] == Input[2]: P = P+1 elif code[2] in Num: V = V+1 if code[3] == Input[3]: P = P+1 elif code[3] in Num: V = V+1 if P == 4: print(WINNING_MSG) else: X = 4-P-V print(' '+'P='+str(P)+',V='+str(V)+',X='+str(X)) #------------------R2--------------------------------- [P,V,X] = [0,0,0] print('Turn #2',':',end=' ') Input = str(input()) Num = [Input[0],Input[1],Input[2],Input[3]] if code[0] == Input[0]: P = P+1 elif code[0] in Num: V = V+1 if code[1] == Input[1]: P = P+1 elif code[1] in Num: V = V+1 if code[2] == Input[2]: P = P+1 elif code[2] in Num: V = V+1 if code[3] == Input[3]: P = P+1 elif code[3] in Num: V = V+1 if P == 4 : print(WINNING_MSG) else: X = 4-P-V print(' '+'P='+str(P)+',V='+str(V)+',X='+str(X)) #------------------R3--------------------------------- [P,V,X] = [0,0,0] print('Turn #3',':',end=' ') Input = str(input()) Num = [Input[0],Input[1],Input[2],Input[3]] if code[0] == Input[0]: P = P+1 elif code[0] in Num: V = V+1 if code[1] == Input[1]: P = P+1 elif code[1] in Num: V = V+1 if code[2] == Input[2]: P = P+1 elif code[2] in Num: V = V+1 if code[3] == Input[3]: P = P+1 elif code[3] in Num: V = V+1 if P == 4 : print(WINNING_MSG) else: X = 4-P-V print(' '+'P='+str(P)+',V='+str(V)+',X='+str(X)) #------------------R4--------------------------------- [P,V,X] = [0,0,0] print('Turn #4',':',end=' ') Input = str(input()) Num = [Input[0],Input[1],Input[2],Input[3]] if code[0] == Input[0]: P = P+1 elif code[0] in Num: V = V+1 else: X = X+1 if code[1] == Input[1]: P = P+1 elif code[1] in Num: V = V+1 else: X = X+1 if code[2] == Input[2]: P = P+1 elif code[2] in Num: V = V+1 else: X = X+1 if code[3] == Input[3]: P = P+1 elif code[3] in Num: V = V+1 else: X = 4-P-V if P == 4 : print(WINNING_MSG) if P != 4 : print(' '+'P='+str(P)+',V='+str(V)+',X='+str(X)) print(LOSING_MSG) print('The answer is',code) print('Please try again...') |
# 6330546821 (15.23) 376 (2021-02-15 21:43) def checkp(a,b): p=0 if a[0]==b[0]:p+=1 if a[1]==b[1]:p+=1 if a[2]==b[2]:p+=1 if a[3]==b[3]:p+=1 return p def checkv(a,b,p): return len(set(a).intersection(set(b)))-p cor=False if not cor : print('Turn #1 :') guess=input().strip() p=checkp(code,guess) v=checkv(code,guess,p) print('p=',p,'v=',v,'x=',(4-p-v)) if p==4:cor=True if not cor : print('Turn #2 :') guess=input().strip() p=checkp(code,guess) v=checkv(code,guess,p) print('p=',p,'v=',v,'x=',(4-p-v)) if p==4:cor=True if not cor : print('Turn #3 :') guess=input().strip() p=checkp(code,guess) v=checkv(code,guess,p) print('p=',p,'v=',v,'x=',(4-p-v)) if p==4:cor=True if not cor : print('Turn #4 :') guess=input().strip() p=checkp(code,guess) v=checkv(code,guess,p) print('p=',p,'v=',v,'x=',(4-p-v)) if p==4:cor=True if cor: print(WINNING_MSG) else: print(LOSING_MSG) print('The answer is',code) print('Please try again...') |
# 6330547421 (20.00) 377 (2021-02-14 21:49) ans1 = str(input('Turn #1 :'+' ')) a,b,c,d = list(ans1) p=0 v=0 x=0 if list(ans1) == list(code) : print(WINNING_MSG) elif list(ans1) != list(code) : if a == code[0:1] : p += 1 elif a in list(code) : v += 1 else : x += 1 if b == code[1:2]: p += 1 elif b in list(code) : v += 1 else : x += 1 if c == code[2:3] : p += 1 elif c in list(code) : v += 1 else : x += 1 if d == code[3:4] : p += 1 elif d in list(code) : v += 1 else : x += 1 print(' '+'P='+str(p)+','+'V='+str(v)+','+'X='+str(x)) ans2 = str(input('Turn #2 :'+' ')) a,b,c,d = list(ans2) p=0 v=0 x=0 if list(ans2) == list(code) : print(WINNING_MSG) elif list(ans2) != list(code) : if a == code[0:1] : p += 1 elif a in list(code) : v += 1 else : x += 1 if b == code[1:2]: p += 1 elif b in list(code) : v += 1 else : x += 1 if c == code[2:3] : p += 1 elif c in list(code) : v += 1 else : x += 1 if d == code[3:4] : p += 1 elif d in list(code) : v += 1 else : x += 1 print(' '+'P='+str(p)+','+'V='+str(v)+','+'X='+str(x)) ans3 = str(input('Turn #3 :'+' ')) a,b,c,d = list(ans3) p=0 v=0 x=0 if list(ans3) == list(code) : print(WINNING_MSG) elif list(ans3) != list(code) : if a == code[0:1] : p += 1 elif a in list(code) : v += 1 else : x += 1 if b == code[1:2]: p += 1 elif b in list(code) : v += 1 else : x += 1 if c == code[2:3] : p += 1 elif c in list(code) : v += 1 else : x += 1 if d == code[3:4] : p += 1 elif d in list(code) : v += 1 else : x += 1 print(' '+'P='+str(p)+','+'V='+str(v)+','+'X='+str(x)) ans4 = str(input('Turn #4 :'+' ')) a,b,c,d = list(ans4) p=0 v=0 x=0 if list(ans4) == list(code) : print(WINNING_MSG) elif list(ans4) != list(code) : if a == code[0:1] : p += 1 elif a in list(code) : v += 1 else : x += 1 if b == code[1:2]: p += 1 elif b in list(code) : v += 1 else : x += 1 if c == code[2:3] : p += 1 elif c in list(code) : v += 1 else : x += 1 if d == code[3:4] : p += 1 elif d in list(code) : v += 1 else : x += 1 print(' '+'P='+str(p)+','+'V='+str(v)+','+'X='+str(x)) print(LOSING_MSG) print('The answer is ',code) print('Please try again...') |
# 6330548021 (18.81) 378 (2021-02-15 23:11) #print(code) x = 'P=,V=,X=01234' a = input('Turn #1 : ') if a == code : print('Congratulations! You won the game.') elif (a[0:3] == code[0:3]) or (a[0] + a[2::] == code[0] + code[2::]) or (a[1::] == code[1::]) : a1,a2,a3 = 11,8,9 # 301 elif ((a[0:2] == code[0:2]) and (a[2] in code) and (a[3] in code)) \ or ((a[0] + a[2] == code[0] + code[2]) and (a[1] in code) and (a[3] in code)) \ or ((a[0] + a[3] == code[0] + code[3]) and (a[1] in code) and (a[2] in code)) \ or ((a[1] + a[2] == code[1] + code[2]) and (a[0] in code) and (a[3] in code)) \ or ((a[1] + a[3] == code[1] + code[3]) and (a[0] in code) and (a[2] in code)) \ or ((a[2] + a[3] == code[2] + code[3]) and (a[0] in code) and (a[1] in code)) : a1,a2,a3 = 10,10,8 #220 elif ((a[0] + a[1] == code[0] + code[1]) and ((a[2] in code) or (a[3] in code))) \ or ((a[0] + a[2] == code[0] + code[2]) and ((a[1] in code) or (a[3] in code))) \ or ((a[0] + a[3] == code[0] + code[3]) and ((a[1] in code) or (a[2] in code))) \ or ((a[1] + a[2] == code[1] + code[2]) and ((a[0] in code) or (a[3] in code))) \ or ((a[1] + a[3] == code[1] + code[3]) and ((a[0] in code) or (a[2] in code))) \ or ((a[2] + a[3] == code[2] + code[3]) and ((a[0] in code) or (a[1] in code))) : a1,a2,a3 = 10,9,9 #211 elif (a[0:2] == code[0:2] and (a[2] not in code) and (a[3] not in code)) \ or (a[0] + a[2] == code[0] + code[2] and (a[1] not in code) and (a[3] not in code)) \ or (a[0] + a[3] == code[0] + code[3] and (a[1] not in code) and (a[2] not in code)) \ or (a[1] + a[2] == code[1] + code[2] and (a[0] not in code) and (a[2] not in code)) \ or (a[1] + a[3] == code[1] + code[3] and (a[0] not in code) and (a[1] not in code)) \ or (a[2] + a[3] == code[2] + code[3] and (a[0] not in code) and (a[1] not in code)) : a1,a2,a3 = 10,8,10 # 202 elif ((a[0] == code[0]) and (a[1] in code) and (a[2] in code) and (a[3] in code)) \ or ((a[1] == code[1]) and (a[0] in code) and (a[2] in code) and (a[3] in code)) \ or ((a[2] == code[2]) and (a[1] in code) and (a[0] in code) and (a[3] in code)) \ or ((a[3] == code[3]) and (a[1] in code) and (a[2] in code) and (a[0] in code)) : a1,a2,a3 = 9,11,8 #130 elif ((a[0] == code[0]) and (((a[1] in code) and (a[2] in code)) or ((a[1] in code) and (a[3] in code)) or ((a[2] in code) and (a[3] in code)))) \ or ((a[1] == code[1]) and (((a[0] in code) and (a[2] in code)) or ((a[0] in code) and (a[3] in code)) or ((a[2] in code) and (a[3] in code)))) \ or ((a[2] == code[2]) and (((a[1] in code) and (a[0] in code)) or ((a[1] in code) and (a[3] in code)) or ((a[0] in code) and (a[3] in code)))) \ or ((a[3] == code[3]) and (((a[1] in code) and (a[2] in code)) or ((a[1] in code) and (a[0] in code)) or ((a[2] in code) and (a[0] in code)))) : a1,a2,a3 = 9,10,9 #121 elif ((a[0] == code[0]) and ((a[1] in code) or (a[2] in code) or (a[3] in code))) \ or ((a[1] == code[1]) and ((a[0] in code) or (a[2] in code) or (a[3] in code))) \ or ((a[2] == code[2]) and ((a[1] in code) or (a[0] in code) or (a[3] in code))) \ or ((a[3] == code[3]) and ((a[1] in code) or (a[2] in code) or (a[0] in code))) : a1,a2,a3 = 9,9,10 #112 #elif ((a[0] == code[0]) and (a[1] and a[2] and a[3] not in code)) or ((a[1] == code[1]) and (a[0] and a[2] and a[3] not in code)) or ((a[2] == code[2]) and (a[1] and a[0] and a[3] not in code)) or ((a[3] == code[3]) and (a[1] and a[2] and a[0] not in code)) : #a1,a2,a3 = 9,8,11 #103 elif (a[0] in code) and (a[1] in code) and (a[2] in code) and (a[3] in code) : a1,a2,a3 = 8,12,8 #040 elif ((a[0] in code) and (a[1] in code) and (a[2] in code)) or ((a[0] in code) and (a[1] in code) and (a[3] in code)) \ or ((a[0] in code) and (a[2] in code) and (a[3] in code)) or ((a[1] in code) and (a[2] in code) and (a[3] in code)) : a1,a2,a3 = 8,11,9 #031 elif ((a[0] in code) or (a[1] in code)) or ((a[0] in code) or (a[2] in code)) \ or ((a[0] in code) or (a[3] in code)) or ((a[1] in code) or (a[2] in code)) \ or ((a[1] in code) or (a[3] in code)) or ((a[2] in code) or (a[3] in code)) : a1,a2,a3 = 8,10,10 #022 #elif (a[1] in code) or (a[2] in code) or (a[3] in code) or (a[0] in code) : #a1,a2,a3 = 8,9,11 #013 #elif a[0] and a[1] and a[2] and a[3] not in code : #a1,a2,a3 = 8,8,12 #004 if not a==code : print(" " + x[:2:]+x[a1]+x[2:5]+x[a2]+x[5:8]+x[a3]) a = input('Turn #2 : ') if a == code : print('Congratulations! You won the game.') elif (a[0:3] == code[0:3]) or (a[0] + a[2::] == code[0] + code[2::]) or (a[1::] == code[1::]) : a1,a2,a3 = 11,8,9 # 301 elif ((a[0:2] == code[0:2]) and (a[2] in code) and (a[3] in code)) \ or ((a[0] + a[2] == code[0] + code[2]) and (a[1] in code) and (a[3] in code)) \ or ((a[0] + a[3] == code[0] + code[3]) and (a[1] in code) and (a[2] in code)) \ or ((a[1] + a[2] == code[1] + code[2]) and (a[0] in code) and (a[3] in code)) \ or ((a[1] + a[3] == code[1] + code[3]) and (a[0] in code) and (a[2] in code)) \ or ((a[2] + a[3] == code[2] + code[3]) and (a[0] in code) and (a[1] in code)) : a1,a2,a3 = 10,10,8 #220 elif ((a[0] + a[1] == code[0] + code[1]) and ((a[2] in code) or (a[3] in code))) \ or ((a[0] + a[2] == code[0] + code[2]) and ((a[1] in code) or (a[3] in code))) \ or ((a[0] + a[3] == code[0] + code[3]) and ((a[1] in code) or (a[2] in code))) \ or ((a[1] + a[2] == code[1] + code[2]) and ((a[0] in code) or (a[3] in code))) \ or ((a[1] + a[3] == code[1] + code[3]) and ((a[0] in code) or (a[2] in code))) \ or ((a[2] + a[3] == code[2] + code[3]) and ((a[0] in code) or (a[1] in code))) : a1,a2,a3 = 10,9,9 #211 elif (a[0:2] == code[0:2] and (a[2] not in code) and (a[3] not in code)) \ or (a[0] + a[2] == code[0] + code[2] and (a[1] not in code) and (a[3] not in code)) \ or (a[0] + a[3] == code[0] + code[3] and (a[1] not in code) and (a[2] not in code)) \ or (a[1] + a[2] == code[1] + code[2] and (a[0] not in code) and (a[2] not in code)) \ or (a[1] + a[3] == code[1] + code[3] and (a[0] not in code) and (a[1] not in code)) \ or (a[2] + a[3] == code[2] + code[3] and (a[0] not in code) and (a[1] not in code)) : a1,a2,a3 = 10,8,10 # 202 elif ((a[0] == code[0]) and (a[1] in code) and (a[2] in code) and (a[3] in code)) \ or ((a[1] == code[1]) and (a[0] in code) and (a[2] in code) and (a[3] in code)) \ or ((a[2] == code[2]) and (a[1] in code) and (a[0] in code) and (a[3] in code)) \ or ((a[3] == code[3]) and (a[1] in code) and (a[2] in code) and (a[0] in code)) : a1,a2,a3 = 9,11,8 #130 elif ((a[0] == code[0]) and (((a[1] in code) and (a[2] in code)) or ((a[1] in code) and (a[3] in code)) or ((a[2] in code) and (a[3] in code)))) \ or ((a[1] == code[1]) and (((a[0] in code) and (a[2] in code)) or ((a[0] in code) and (a[3] in code)) or ((a[2] in code) and (a[3] in code)))) \ or ((a[2] == code[2]) and (((a[1] in code) and (a[0] in code)) or ((a[1] in code) and (a[3] in code)) or ((a[0] in code) and (a[3] in code)))) \ or ((a[3] == code[3]) and (((a[1] in code) and (a[2] in code)) or ((a[1] in code) and (a[0] in code)) or ((a[2] in code) and (a[0] in code)))) : a1,a2,a3 = 9,10,9 #121 elif ((a[0] == code[0]) and ((a[1] in code) or (a[2] in code) or (a[3] in code))) \ or ((a[1] == code[1]) and ((a[0] in code) or (a[2] in code) or (a[3] in code))) \ or ((a[2] == code[2]) and ((a[1] in code) or (a[0] in code) or (a[3] in code))) \ or ((a[3] == code[3]) and ((a[1] in code) or (a[2] in code) or (a[0] in code))) : a1,a2,a3 = 9,9,10 #112 elif (a[0] in code) and (a[1] in code) and (a[2] in code) and (a[3] in code) : a1,a2,a3 = 8,12,8 #040 elif ((a[0] in code) and (a[1] in code) and (a[2] in code)) or ((a[0] in code) and (a[1] in code) and (a[3] in code)) \ or ((a[0] in code) and (a[2] in code) and (a[3] in code)) or ((a[1] in code) and (a[2] in code) and (a[3] in code)) : a1,a2,a3 = 8,11,9 #031 elif ((a[0] in code) or (a[1] in code)) or ((a[0] in code) or (a[2] in code)) \ or ((a[0] in code) or (a[3] in code)) or ((a[1] in code) or (a[2] in code)) \ or ((a[1] in code) or (a[3] in code)) or ((a[2] in code) or (a[3] in code)) : a1,a2,a3 = 8,10,10 #022 if not a==code : print(" " + x[:2:]+x[a1]+x[2:5]+x[a2]+x[5:8]+x[a3]) a = input('Turn #3 : ') if a == code : print('Congratulations! You won the game.') elif (a[0:3] == code[0:3]) or (a[0] + a[2::] == code[0] + code[2::]) or (a[1::] == code[1::]) : a1,a2,a3 = 11,8,9 # 301 elif ((a[0:2] == code[0:2]) and (a[2] in code) and (a[3] in code)) \ or ((a[0] + a[2] == code[0] + code[2]) and (a[1] in code) and (a[3] in code)) \ or ((a[0] + a[3] == code[0] + code[3]) and (a[1] in code) and (a[2] in code)) \ or ((a[1] + a[2] == code[1] + code[2]) and (a[0] in code) and (a[3] in code)) \ or ((a[1] + a[3] == code[1] + code[3]) and (a[0] in code) and (a[2] in code)) \ or ((a[2] + a[3] == code[2] + code[3]) and (a[0] in code) and (a[1] in code)) : a1,a2,a3 = 10,10,8 #220 elif ((a[0] + a[1] == code[0] + code[1]) and ((a[2] in code) or (a[3] in code))) \ or ((a[0] + a[2] == code[0] + code[2]) and ((a[1] in code) or (a[3] in code))) \ or ((a[0] + a[3] == code[0] + code[3]) and ((a[1] in code) or (a[2] in code))) \ or ((a[1] + a[2] == code[1] + code[2]) and ((a[0] in code) or (a[3] in code))) \ or ((a[1] + a[3] == code[1] + code[3]) and ((a[0] in code) or (a[2] in code))) \ or ((a[2] + a[3] == code[2] + code[3]) and ((a[0] in code) or (a[1] in code))) : a1,a2,a3 = 10,9,9 #211 elif (a[0:2] == code[0:2] and (a[2] not in code) and (a[3] not in code)) \ or ((a[0] + a[2] == code[0] + code[2]) and (a[1] not in code) and (a[3] not in code)) \ or ((a[0] + a[3] == code[0] + code[3]) and (a[1] not in code) and (a[2] not in code)) \ or ((a[1] + a[2] == code[1] + code[2]) and (a[0] not in code) and (a[2] not in code)) \ or ((a[1] + a[3] == code[1] + code[3]) and (a[0] not in code) and (a[1] not in code)) \ or ((a[2] + a[3] == code[2] + code[3]) and (a[0] not in code) and (a[1] not in code)) : a1,a2,a3 = 10,8,10 # 202 elif ((a[0] == code[0]) and (a[1] in code) and (a[2] in code) and (a[3] in code) ) \ or ((a[1] == code[1]) and (a[0] in code) and (a[2] in code) and (a[3] in code)) \ or ((a[2] == code[2]) and (a[1] in code) and (a[0] in code) and (a[3] in code)) \ or ((a[3] == code[3]) and (a[1] in code) and (a[2] in code) and (a[0] in code)) : a1,a2,a3 = 9,11,8 #130 elif ((a[0] == code[0]) and (((a[1] in code) and (a[2] in code)) or ((a[1] in code) and (a[3] in code)) or ((a[2] in code) and (a[3] in code)))) \ or ((a[1] == code[1]) and (((a[0] in code) and (a[2] in code)) or ((a[0] in code) and (a[3] in code)) or ((a[2] in code) and (a[3] in code)))) \ or ((a[2] == code[2]) and (((a[1] in code) and (a[0] in code)) or ((a[1] in code) and (a[3] in code)) or ((a[0] in code) and (a[3] in code)))) \ or ((a[3] == code[3]) and (((a[1] in code) and (a[2] in code)) or ((a[1] in code) and (a[0] in code)) or ((a[2] in code) and (a[0] in code)))) : a1,a2,a3 = 9,10,9 #121 elif ((a[0] == code[0]) and ((a[1] in code) or (a[2] in code) or (a[3] in code))) \ or ((a[1] == code[1]) and ((a[0] in code) or (a[2] in code) or (a[3] in code))) \ or ((a[2] == code[2]) and ((a[1] in code) or (a[0] in code) or (a[3] in code))) \ or ((a[3] == code[3]) and ((a[1] in code) or (a[2] in code) or (a[0] in code))) : a1,a2,a3 = 9,9,10 #112 elif (a[0] in code) and (a[1] in code) and (a[2] in code) and (a[3] in code) : a1,a2,a3 = 8,12,8 #040 elif ((a[0] in code) and (a[1] in code) and (a[2] in code)) or ((a[0] in code) and (a[1] in code) and (a[3] in code)) \ or ((a[0] in code) and (a[2] in code) and (a[3] in code)) or ((a[1] in code) and (a[2] in code) and (a[3] in code)) : a1,a2,a3 = 8,11,9 #031 elif ((a[0] in code) or (a[1] in code)) or ((a[0] in code) or (a[2] in code)) \ or ((a[0] in code) or (a[3] in code)) or ((a[1] in code) or (a[2] in code)) \ or ((a[1] in code) or (a[3] in code)) or ((a[2] in code) or (a[3] in code)) : a1,a2,a3 = 8,10,10 #022 if not a==code : print(" " + x[:2:]+x[a1]+x[2:5]+x[a2]+x[5:8]+x[a3]) a = input('Turn #4 : ') if a == code : print('Congratulations! You won the game.') elif (a[0:3] == code[0:3]) or (a[0] + a[2::] == code[0] + code[2::]) or (a[1::] == code[1::]) : a1,a2,a3 = 11,8,9 # 301 elif ((a[0:2] == code[0:2]) and (a[2] in code) and (a[3] in code)) \ or ((a[0] + a[2] == code[0] + code[2]) and (a[1] in code) and (a[3] in code)) \ or ((a[0] + a[3] == code[0] + code[3]) and (a[1] in code) and (a[2] in code)) \ or ((a[1] + a[2] == code[1] + code[2]) and (a[0] in code) and (a[3] in code)) \ or ((a[1] + a[3] == code[1] + code[3]) and (a[0] in code) and (a[2] in code)) \ or ((a[2] + a[3] == code[2] + code[3]) and (a[0] in code) and (a[1] in code)) : a1,a2,a3 = 10,10,8 #220 elif ((a[0] + a[1] == code[0] + code[1]) and ((a[2] in code) or (a[3] in code))) \ or ((a[0] + a[2] == code[0] + code[2]) and ((a[1] in code) or (a[3] in code))) \ or ((a[0] + a[3] == code[0] + code[3]) and ((a[1] in code) or (a[2] in code))) \ or ((a[1] + a[2] == code[1] + code[2]) and ((a[0] in code) or (a[3] in code))) \ or ((a[1] + a[3] == code[1] + code[3]) and ((a[0] in code) or (a[2] in code))) \ or ((a[2] + a[3] == code[2] + code[3]) and ((a[0] in code) or (a[1] in code))) : a1,a2,a3 = 10,9,9 #211 elif (a[0:2] == code[0:2] and (a[2] not in code) and (a[3] not in code)) \ or (a[0] + a[2] == code[0] + code[2] and (a[1] not in code) and (a[3] not in code)) \ or (a[0] + a[3] == code[0] + code[3] and (a[1] not in code) and (a[2] not in code)) \ or (a[1] + a[2] == code[1] + code[2] and (a[0] not in code) and (a[2] not in code)) \ or (a[1] + a[3] == code[1] + code[3] and (a[0] not in code) and (a[1] not in code)) \ or (a[2] + a[3] == code[2] + code[3] and (a[0] not in code) and (a[1] not in code)) : a1,a2,a3 = 10,8,10 # 202 elif ((a[0] == code[0]) and (a[1] in code) and (a[2] in code) and (a[3] in code)) \ or ((a[1] == code[1]) and (a[0] in code) and (a[2] in code) and (a[3] in code)) \ or ((a[2] == code[2]) and (a[1] in code) and (a[0] in code) and (a[3] in code)) \ or ((a[3] == code[3]) and (a[1] in code) and (a[2] in code) and (a[0] in code)) : a1,a2,a3 = 9,11,8 #130 elif ((a[0] == code[0]) and (((a[1] in code) and (a[2] in code)) or ((a[1] in code) and (a[3] in code)) or ((a[2] in code) and (a[3] in code)))) \ or ((a[1] == code[1]) and (((a[0] in code) and (a[2] in code)) or ((a[0] in code) and (a[3] in code)) or ((a[2] in code) and (a[3] in code)))) \ or ((a[2] == code[2]) and (((a[1] in code) and (a[0] in code)) or ((a[1] in code) and (a[3] in code)) or ((a[0] in code) and (a[3] in code)))) \ or ((a[3] == code[3]) and (((a[1] in code) and (a[2] in code)) or ((a[1] in code) and (a[0] in code)) or ((a[2] in code) and (a[0] in code)))) : a1,a2,a3 = 9,10,9 #121 elif ((a[0] == code[0]) and ((a[1] in code) or (a[2] in code) or (a[3] in code))) \ or ((a[1] == code[1]) and ((a[0] in code) or (a[2] in code) or (a[3] in code))) \ or ((a[2] == code[2]) and ((a[1] in code) or (a[0] in code) or (a[3] in code))) \ or ((a[3] == code[3]) and ((a[1] in code) or (a[2] in code) or (a[0] in code))) : a1,a2,a3 = 9,9,10 #112 elif (a[0] in code) and (a[1] in code) and (a[2] in code) and (a[3] in code) : a1,a2,a3 = 8,12,8 #040 elif ((a[0] in code) and (a[1] in code) and (a[2] in code)) or ((a[0] in code) and (a[1] in code) and (a[3] in code)) \ or ((a[0] in code) and (a[2] in code) and (a[3] in code)) or ((a[1] in code) and (a[2] in code) and (a[3] in code)) : a1,a2,a3 = 8,11,9 #031 elif ((a[0] in code) or (a[1] in code)) or ((a[0] in code) or (a[2] in code)) \ or ((a[0] in code) or (a[3] in code)) or ((a[1] in code) or (a[2] in code)) \ or ((a[1] in code) or (a[3] in code)) or ((a[2] in code) or (a[3] in code)) : a1,a2,a3 = 8,10,10 #022 if not a==code : print(" " + x[:2:]+x[a1]+x[2:5]+x[a2]+x[5:8]+x[a3]) print('Sorry! You just lost it.') print('The answer is',code) print('Please try again...') |
# 6330549721 (19.11) 379 (2021-02-12 23:28) guess=input('Turn #1 : ') P=0 V=0 X=0 if guess[0]==code[0]: P+=1 elif guess[0] in code: V+=1 else: X+=1 if guess[1]==code[1]: P+=1 elif guess[1] in code: V+=1 else: X+=1 if guess[2]==code[2]: P+=1 elif guess[2] in code: V+=1 else: X+=1 if guess[3]==code[3]: P+=1 elif guess[3] in code: V+=1 else: X+=1 print(' P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) if P==4: print(WINNING_MSG) elif P<4: b=input('Turn #2 : ') P=0 V=0 X=0 if b[0]==code[0]: P+=1 elif b[0] in code: V+=1 else: X+=1 if b[1]==code[1]: P+=1 elif b[1] in code: V+=1 else: X+=1 if b[2]==code[2]: P+=1 elif b[2] in code: V+=1 else : X+=1 if b[3]==code[3]: P+=1 elif b[3] in code: V+=1 else: X+=1 print(' P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) if P==4: print(WINNING_MSG) elif P<4: c=input('Turn #3 : ') P=0 V=0 X=0 if c[0]==code[0]: P+=1 elif c[0] in code: V+=1 else: X+=1 if c[1]==code[1]: P+=1 elif c[1] in code: V+=1 else: X+=1 if c[2]==code[2]: P+=1 elif c[2] in code: V+=1 else : X+=1 if c[3]==code[3]: P+=1 elif c[3] in code: V+=1 else: X+=1 print(' P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) if P==4: print(WINNING_MSG) elif P<4: a=input('Turn #4 : ') P=0 V=0 X=0 if a[0]==code[0]: P+=1 elif a[0] in code: V+=1 else: X+=1 if a[1]==code[1]: P+=1 elif a[1] in code: V+=1 else: X+=1 if a[2]==code[2]: P+=1 elif a[2] in code: V+=1 else : X+=1 if a[3]==code[3]: P+=1 elif a[3] in code: V+=1 else: X+=1 print(' P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) if P<4: print(LOSING_MSG) print('The answer is ',code) print('Please try again...') else: print(WINNING_MSG) |
# 6330550221 (20.00) 380 (2021-02-14 23:07) u = input('Turn #1 : ') p = int(0) if u[0]==code[0]: p +=1 if u[1]==code[1]: p +=1 if u[2]==code[2]: p +=1 if u[3]==code[3]: p +=1 v = int(0) if u[0] in code: v +=1 if u[1] in code: v +=1 if u[2] in code: v +=1 if u[3] in code: v +=1 v = v-p x = int(0) if u[0] not in code: x +=1 if u[1] not in code: x +=1 if u[2] not in code: x +=1 if u[3] not in code: x +=1 w = 'P='+str(p)+','+'V='+str(v)+','+'X='+str(x) if p==4: print(WINNING_MSG) else: print(' '+w) u = input('Turn #2 : ') p = int(0) if u[0]==code[0]: p +=1 if u[1]==code[1]: p +=1 if u[2]==code[2]: p +=1 if u[3]==code[3]: p +=1 v = int(0) if u[0] in code: v +=1 if u[1] in code: v +=1 if u[2] in code: v +=1 if u[3] in code: v +=1 v = v-p x = int(0) if u[0] not in code: x +=1 if u[1] not in code: x +=1 if u[2] not in code: x +=1 if u[3] not in code: x +=1 w = 'P='+str(p)+','+'V='+str(v)+','+'X='+str(x) if p==4: print(WINNING_MSG) else: print(' '+w) u = input('Turn #3 : ') p = int(0) if u[0]==code[0]: p +=1 if u[1]==code[1]: p +=1 if u[2]==code[2]: p +=1 if u[3]==code[3]: p +=1 v = int(0) if u[0] in code: v +=1 if u[1] in code: v +=1 if u[2] in code: v +=1 if u[3] in code: v +=1 v = v-p x = int(0) if u[0] not in code: x +=1 if u[1] not in code: x +=1 if u[2] not in code: x +=1 if u[3] not in code: x +=1 w = 'P='+str(p)+','+'V='+str(v)+','+'X='+str(x) if p==4: print(WINNING_MSG) else: print(' '+w) u = input('Turn #4 : ') p = int(0) if u[0]==code[0]: p +=1 if u[1]==code[1]: p +=1 if u[2]==code[2]: p +=1 if u[3]==code[3]: p +=1 v = int(0) if u[0] in code: v +=1 if u[1] in code: v +=1 if u[2] in code: v +=1 if u[3] in code: v +=1 v = v-p x = int(0) if u[0] not in code: x +=1 if u[1] not in code: x +=1 if u[2] not in code: x +=1 if u[3] not in code: x +=1 w = 'P='+str(p)+','+'V='+str(v)+','+'X='+str(x) if p==4: print(WINNING_MSG) else: print(' '+w) print(LOSING_MSG) print('The answer is'+' '+code) print('Please try again...') |
# 6330551921 (20.00) 381 (2021-02-12 19:01) p,v,e,=0,0,0 guess =input("Turn #1 : ") guess = guess.upper() new = " ".join(code).split() if guess == code: print(WINNING_MSG) e=1 elif guess!=code: if guess[0]==new[0]: p+=1 new[0] = "0" if guess[1]==new[1]: p+=1 new[1] = "0" if guess[2]==new[2]: p+=1 new[2] = "0" if guess[3]==new[3]: p+=1 new[3] = "0" v = new.count(guess[0]) + new.count(guess[1]) + new.count(guess[2]) + new.count(guess[3]) print(" "*10+"P="+str(p)+","+"V="+str(v)+","+"X="+str(len(guess)-p-v)) p,v,e,guess,new=0,0,0,input("Turn #2 : ")," ".join(code).split() guess = guess.upper() if guess == code and e==0: print(WINNING_MSG) e=1 if guess!=code: if guess[0]==new[0]: p+=1 new[0] = "0" if guess[1]==new[1]: p+=1 new[1] = "0" if guess[2]==new[2]: p+=1 new[2] = "0" if guess[3]==new[3]: p+=1 new[3] = "0" v = new.count(guess[0]) + new.count(guess[1]) + new.count(guess[2]) + new.count(guess[3]) print(" "*10+"P="+str(p)+","+"V="+str(v)+","+"X="+str(len(guess)-p-v)) p,v,e,guess,new=0,0,0,input("Turn #3 : ")," ".join(code).split() guess = guess.upper() if guess == code and e==0: print(WINNING_MSG) e=1 if guess!=code: if guess[0]==new[0]: p+=1 new[0] = "0" if guess[1]==new[1]: p+=1 new[1] = "0" if guess[2]==new[2]: p+=1 new[2] = "0" if guess[3]==new[3]: p+=1 new[3] = "0" v = new.count(guess[0]) + new.count(guess[1]) + new.count(guess[2]) + new.count(guess[3]) print(" "*10+"P="+str(p)+","+"V="+str(v)+","+"X="+str(len(guess)-p-v)) p,v,e,guess,new=0,0,0,input("Turn #4 : ")," ".join(code).split() guess = guess.upper() if guess == code and e==0: print(WINNING_MSG) if guess != code : if guess[0]==new[0]: p+=1 new[0] = "0" if guess[1]==new[1]: p+=1 new[1] = "0" if guess[2]==new[2]: p+=1 new[2] = "0" if guess[3]==new[3]: p+=1 new[3] = "0" v = new.count(guess[0]) + new.count(guess[1]) + new.count(guess[2]) + new.count(guess[3]) print(" "*10+"P="+str(p)+","+"V="+str(v)+","+"X="+str(len(guess)-p-v)) print(LOSING_MSG) print("The answer is ",code) print("Please try again...") |
# 6330552521 (20.00) 382 (2021-02-14 18:15) turn = 1 if turn == 1: guess1 = input('Turn #1 : ') iTsc = list(set(guess1) & set(code)) if guess1 == code: print(WINNING_MSG) if guess1 != code and len(set(guess1) & set(code)) > 0: p = 0 if guess1[0] == code[0]: p += 1 if guess1[1] == code[1]: p += 1 if guess1[2] == code[2]: p += 1 if guess1[3] == code[3]: p += 1 v = len(iTsc) - p x = len(set(guess1).difference(set(code))) print(' ' + 'P=' + str(p) + ',V=' + str(v) + ',X=' + str(x)) turn += 1 if turn == 2: guess2 = input('Turn #2 : ') iTsc = list(set(guess2) & set(code)) if guess2 == code: print(WINNING_MSG) if guess2 != code and len(set(guess1) & set(code)) > 0: p = 0 if guess2[0] == code[0]: p += 1 if guess2[1] == code[1]: p += 1 if guess2[2] == code[2]: p += 1 if guess2[3] == code[3]: p += 1 v = len(iTsc) - p x = len(set(guess2).difference(set(code))) print(' ' + 'P=' + str(p) + ',V=' + str(v) + ',X=' + str(x)) turn += 1 if turn == 3: guess3 = input('Turn #3 : ') iTsc = list(set(guess3) & set(code)) if guess3 == code: print(WINNING_MSG) if guess3 != code and len(set(guess3) & set(code)) > 0: p = 0 if guess3[0] == code[0]: p += 1 if guess3[1] == code[1]: p += 1 if guess3[2] == code[2]: p += 1 if guess3[3] == code[3]: p += 1 v = len(iTsc) - p x = len(set(guess3).difference(set(code))) print(' ' + 'P=' + str(p) + ',V=' + str(v) + ',X=' + str(x)) turn += 1 if turn == 4: guess4 = input('Turn #4 : ') iTsc = list(set(guess4) & set(code)) if guess4 == code: print(WINNING_MSG) if guess4 != code and len(set(guess4) & set(code)) > 0: p = 0 if guess4[0] == code[0]: p += 1 if guess4[1] == code[1]: p += 1 if guess4[2] == code[2]: p += 1 if guess4[3] == code[3]: p += 1 v = len(iTsc) - p x = len(set(guess4).difference(set(code))) print(' ' + 'P=' + str(p) + ',V=' + str(v) + ',X=' + str(x)) print(LOSING_MSG) print('The answer is ' + code) print('Please try again...') |
# 6330553121 (20.00) 383 (2021-02-15 20:39) g = input('Turn #1 : ') p = 0; v = 0;x = 0; if g[0] == code[0] : p +=1 elif g[0] in code : v +=1 else : x +=1 #--------------------------------------------- if g[1] == code[1] : p +=1 elif g[1] in code : v +=1 else : x +=1 #--------------------------------------------- if g[2] == code[2]: p +=1 elif g[2] in code : v +=1 else : x +=1 #--------------------------------------------- if g[3] == code[3]: p +=1 elif g[3] in code : v +=1 else : x +=1 if p == 4 : print(WINNING_MSG) else : ############################################## print(' '+'P='+str(p)+','+'V='+str(v)+','+'X='+str(x)) g = input('Turn #2 : ') p = 0; v = 0;x = 0; if g[0] == code[0] : p +=1 elif g[0] in code : v +=1 else : x +=1 #--------------------------------------------- if g[1] == code[1] : p +=1 elif g[1] in code : v +=1 else : x +=1 #--------------------------------------------- if g[2] == code[2]: p +=1 elif g[2] in code : v +=1 else : x +=1 #--------------------------------------------- if g[3] == code[3]: p +=1 elif g[3] in code : v +=1 else : x +=1 if p == 4 : print(WINNING_MSG) else : ############################################## print(' '+'P='+str(p)+','+'V='+str(v)+','+'X='+str(x)) g = input('Turn #3 : ') p = 0; v = 0;x = 0; if g[0] == code[0] : p +=1 elif g[0] in code : v +=1 else : x +=1 #--------------------------------------------- if g[1] == code[1] : p +=1 elif g[1] in code : v +=1 else : x +=1 #--------------------------------------------- if g[2] == code[2]: p +=1 elif g[2] in code : v +=1 else : x +=1 #--------------------------------------------- if g[3] == code[3]: p +=1 elif g[3] in code : v +=1 else : x +=1 if p == 4 : print(WINNING_MSG) else : ############################################## print(' '+'P='+str(p)+','+'V='+str(v)+','+'X='+str(x)) g = input('Turn #4 : ') p = 0; v = 0;x = 0; if g[0] == code[0] : p +=1 elif g[0] in code : v +=1 else : x +=1 #--------------------------------------------- if g[1] == code[1] : p +=1 elif g[1] in code : v +=1 else : x +=1 #--------------------------------------------- if g[2] == code[2]: p +=1 elif g[2] in code : v +=1 else : x +=1 #--------------------------------------------- if g[3] == code[3]: p +=1 elif g[3] in code : v +=1 else : x +=1 if p == 4 : print(WINNING_MSG) else : ############################################## print(' '+'P='+str(p)+','+'V='+str(v)+','+'X='+str(x)) print(LOSING_MSG) print('The answer is '+code) print('Please try again...') |
# 6330554821 (20.00) 384 (2021-02-12 17:44) P,P1,P2,P3 = 0,0,0,0 V,V1,V2,V3 = 0,0,0,0 X,X1,X2,X3 = 0,0,0,0 code1 = list(code) m = input('Turn #1 : ').upper() if m[0]==code[0]: P += 1 if m[1]==code[1]: P += 1 if m[2]==code[2]: P += 1 if m[3]==code[3]: P += 1 if m[0] in code1: if not m[0]==code[0]: V += 1 if m[1] in code1: if not m[1]==code[1]: V += 1 if m[2] in code1: if not m[2]==code[2]: V += 1 if m[3] in code1: if not m[3]==code[3]: V += 1 if not m[0] in code1: X += 1 if not m[1] in code1: X += 1 if not m[2] in code1: X += 1 if not m[3] in code1: X += 1 if P==4 and V==0 and X==0: print(WINNING_MSG) else: print(' '*len('Turn #1 : ')+'P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) m = input('Turn #2 : ').upper() if m[0]==code[0]: P1 += 1 if m[1]==code[1]: P1 += 1 if m[2]==code[2]: P1 += 1 if m[3]==code[3]: P1 += 1 if m[0] in code1: if not m[0]==code[0]: V1 += 1 if m[1] in code1: if not m[1]==code[1]: V1 += 1 if m[2] in code1: if not m[2]==code[2]: V1 += 1 if m[3] in code1: if not m[3]==code[3]: V1 += 1 if not m[0] in code1: X1 += 1 if not m[1] in code1: X1 += 1 if not m[2] in code1: X1 += 1 if not m[3] in code1: X1 += 1 if P1==4 and V1==0 and X1==0: print(WINNING_MSG) else: print(' '*len('Turn #2 : ')+'P='+str(P1)+','+'V='+str(V1)+','+'X='+str(X1)) m = input('Turn #3 : ').upper() if m[0]==code[0]: P2 += 1 if m[1]==code[1]: P2 += 1 if m[2]==code[2]: P2 += 1 if m[3]==code[3]: P2 += 1 if m[0] in code1: if not m[0]==code[0]: V2 += 1 if m[1] in code1: if not m[1]==code[1]: V2 += 1 if m[2] in code1: if not m[2]==code[2]: V2 += 1 if m[3] in code1: if not m[3]==code[3]: V2 += 1 if not m[0] in code1: X2 += 1 if not m[1] in code1: X2 += 1 if not m[2] in code1: X2 += 1 if not m[3] in code1: X2 += 1 if P2==4 and V2==0 and X2==0: print(WINNING_MSG) else: print(' '*len('Turn #3 : ')+'P='+str(P2)+','+'V='+str(V2)+','+'X='+str(X2)) m = input('Turn #4 : ').upper() if m[0]==code[0]: P3 += 1 if m[1]==code[1]: P3 += 1 if m[2]==code[2]: P3 += 1 if m[3]==code[3]: P3 += 1 if m[0] in code1: if not m[0]==code[0]: V3 += 1 if m[1] in code1: if not m[1]==code[1]: V3 += 1 if m[2] in code1: if not m[2]==code[2]: V3 += 1 if m[3] in code1: if not m[3]==code[3]: V3 += 1 if not m[0] in code1: X3 += 1 if not m[1] in code1: X3 += 1 if not m[2] in code1: X3 += 1 if not m[3] in code1: X3 += 1 if P3==4 and V3==0 and X3==0: print(WINNING_MSG) else: print(' '*len('Turn #4 : ')+'P='+str(P3)+','+'V='+str(V3)+','+'X='+str(X3)) print(LOSING_MSG) print('The answer is'+' '+str(code)) print('Please try again...') |
# 6330555421 (20.00) 385 (2021-02-15 18:07) y=input('Turn #1 : ') p = 0 v = 0 x = 0 if True : if y[0]==code[0] : p += 1 elif y[0] in code and y[0] != code[0]: v += 1 else : x += 1 if True : if y[1]==code[1] : p += 1 elif y[1] in code and y[1] != code[1]: v += 1 else : x += 1 if True : if y[2]==code[2] : p += 1 elif y[2] in code and y[2] != code[2]: v += 1 else : x += 1 if True : if y[3]==code[3] : p += 1 elif y[3] in code and y[3] != code[3]: v += 1 else : x += 1 if p!=4 : print(' P='+str(p)+',V='+str(v)+',X='+str(x)) if p==4 : print(WINNING_MSG) #---------------------------------------------- if p!=4: p = 0 v = 0 x = 0 y=input('Turn #2 : ') if True: if y[0]==code[0] : p += 1 elif y[0] in code and y[0] != code[0]: v += 1 else : x += 1 if True: if y[1]==code[1] : p += 1 elif y[1] in code and y[1] != code[1]: v += 1 else : x += 1 if True: if y[2]==code[2] : p += 1 elif y[2] in code and y[2] != code[2]: v += 1 else : x += 1 if True : if y[3]==code[3] : p += 1 elif y[3] in code and y[3] != code[3]: v += 1 else : x += 1 if p!=4 : print(' P='+str(p)+',V='+str(v)+',X='+str(x)) if p==4 : print(WINNING_MSG) #--------------------------------------------------------------- if p!=4: p = 0 v = 0 x = 0 y=input('Turn #3 : ') if True: if y[0]==code[0] : p += 1 elif y[0] in code and y[0] != code[0]: v += 1 else : x += 1 if True: if y[1]==code[1] : p += 1 elif y[1] in code and y[1] != code[1]: v += 1 else : x += 1 if True: if y[2]==code[2] : p += 1 elif y[2] in code and y[2] != code[2]: v += 1 else : x += 1 if True: if y[3]==code[3] : p += 1 elif y[3] in code and y[3] != code[3]: v += 1 else : x += 1 if p!=4 : print(' P='+str(p)+',V='+str(v)+',X='+str(x)) if p==4 : print(WINNING_MSG) #---------------------------------------------------------------- if p!=4: p = 0 v = 0 x = 0 y=input('Turn #4 : ') if True : if y[0]==code[0] : p += 1 elif y[0] in code and y[0] != code[0]: v += 1 else : x += 1 if True : if y[1]==code[1] : p += 1 elif y[1] in code and y[1] != code[1]: v += 1 else : x += 1 if True: if y[2]==code[2] : p += 1 elif y[2] in code and y[2] != code[2]: v += 1 else : x += 1 if True : if y[3]==code[3] : p += 1 elif y[3] in code and y[3] != code[3]: v += 1 else : x += 1 if p!=4 : print(' P='+str(p)+',V='+str(v)+',X='+str(x)) if p==4 : print(WINNING_MSG) if p!=4: print(LOSING_MSG) print('The answer is '+str(code)) print('Please try again...') |
# 6330556021 (20.00) 386 (2021-02-13 00:10) guess = input("Turn #1 : ") P = 0 V = 0 X = 0 check = True if check == True: if guess == code: print("Congratulations! You won the game.") check = False else: if guess[0] in code: if guess[0] == code[0]: P += 1 else: V +=1 if guess[1] in code: if guess[1] == code[1]: P += 1 else: V +=1 if guess[2] in code: if guess[2] == code[2]: P += 1 else: V +=1 if guess[3] in code: if guess[3] == code[3]: P += 1 else: V +=1 X = 4-(P+V) print(" P="+str(P)+",V="+str(V)+",X="+str(X)) if check == True: guess = input("Turn #2 : ") P = 0 V = 0 X = 0 if guess == code: print("Congratulations! You won the game.") check = False else: if guess[0] in code: if guess[0] == code[0]: P += 1 else: V +=1 if guess[1] in code: if guess[1] == code[1]: P += 1 else: V +=1 if guess[2] in code: if guess[2] == code[2]: P += 1 else: V +=1 if guess[3] in code: if guess[3] == code[3]: P += 1 else: V +=1 X = 4-(P+V) print(" P="+str(P)+",V="+str(V)+",X="+str(X)) if check == True: guess = input("Turn #3 : ") P = 0 V = 0 X = 0 if guess == code: print("Congratulations! You won the game.") check = False else: if guess[0] in code: if guess[0] == code[0]: P += 1 else: V +=1 if guess[1] in code: if guess[1] == code[1]: P += 1 else: V +=1 if guess[2] in code: if guess[2] == code[2]: P += 1 else: V +=1 if guess[3] in code: if guess[3] == code[3]: P += 1 else: V +=1 X = 4-(P+V) print(" P="+str(P)+",V="+str(V)+",X="+str(X)) if check == True: guess = input("Turn #4 : ") P = 0 V = 0 X = 0 if guess == code: print("Congratulations! You won the game.") check = False else: if guess[0] in code: if guess[0] == code[0]: P += 1 else: V +=1 if guess[1] in code: if guess[1] == code[1]: P += 1 else: V +=1 if guess[2] in code: if guess[2] == code[2]: P += 1 else: V +=1 if guess[3] in code: if guess[3] == code[3]: P += 1 else: V +=1 X = 4-(P+V) print(" P="+str(P)+",V="+str(V)+",X="+str(X)) print("Sorry! You just lost it.") print("The answer is "+ code) print("Please try again...") |
# 6330557721 (20.00) 387 (2021-02-14 18:04) S = str(input("Turn #1 : ")) P = 0 V = 0 X = 0 if S == code: print("Congratulations! You won the game.") else : #one one if S[0] in code: if S[0] == code[0]: P +=1 else : V +=1 else: X +=1 #one two if S[1] in code: if S[1] == code[1]: P +=1 else : V +=1 else: X +=1 #one three if S[2] in code: if S[2] == code[2]: P +=1 else : V +=1 else: X +=1 #one four if S[3] in code: if S[3] == code[3]: P +=1 else : V +=1 else: X +=1 print(" P"+"="+str(P)+","+"V"+"="+str(V)+","+"X"+"="+str(X)) #2 S1 = str(input("Turn #2 : ")) P1 = 0 V1 = 0 X1 = 0 if S1 == code: print("Congratulations! You won the game.") else : #one one if S1[0] in code: if S1[0] == code[0]: P1 +=1 else : V1 +=1 else: X1 +=1 #one two if S1[1] in code: if S1[1] == code[1]: P1 +=1 else : V1 +=1 else: X1 +=1 #one three if S1[2] in code: if S1[2] == code[2]: P1 +=1 else : V1 +=1 else: X1 +=1 #one four if S1[3] in code: if S1[3] == code[3]: P1 +=1 else : V1 +=1 else: X1 +=1 print(" P"+"="+str(P1)+","+"V"+"="+str(V1)+","+"X"+"="+str(X1)) #3 S2 = str(input("Turn #3 : ")) P2 = 0 V2 = 0 X2 = 0 if S2 == code: print("Congratulations! You won the game.") else : #one one if S2[0] in code: if S2[0] == code[0]: P2 +=1 else : V2 +=1 else: X2 +=1 #one two if S2[1] in code: if S2[1] == code[1]: P2 +=1 else : V2 +=1 else: X2 +=1 #one three if S2[2] in code: if S2[2] == code[2]: P2 +=1 else : V2 +=1 else: X2 +=1 #one four if S2[3] in code: if S2[3] == code[3]: P2 +=1 else : V2 +=1 else: X2 +=1 print(" P"+"="+str(P2)+","+"V"+"="+str(V2)+","+"X"+"="+str(X2)) #4 S3 = str(input("Turn #4 : ")) P3 = 0 V3 = 0 X3 = 0 if S3 == code: print("Congratulations! You won the game.") else : #one one if S3[0] in code: if S3[0] == code[0]: P3 +=1 else : V3 +=1 else: X3 +=1 #one two if S3[1] in code: if S3[1] == code[1]: P3 +=1 else : V3 +=1 else: X3 +=1 #one three if S3[2] in code: if S3[2] == code[2]: P3 +=1 else : V3 +=1 else: X3 +=1 #one four if S3[3] in code: if S3[3] == code[3]: P3 +=1 else : V3 +=1 else: X3 +=1 print(" P"+"="+str(P3)+","+"V"+"="+str(V3)+","+"X"+"="+str(X3)) print("Sorry! You just lost it.") print("The answer is "+str(code)) print("Please try again...") |
# 6330558321 (20.00) 388 (2021-02-12 15:30) code_set = set(code) guess = input("Turn #1 : ") p = sum([code[0] == guess[0], code[1] == guess[1], code[2] == guess[2], code[3] == guess[3]]) if p == 4: print(WINNING_MSG) exit() v = len(set(guess) & code_set) - p x = 4 - p - v print(f" P={p},V={v},X={x}") guess = input("Turn #2 : ") p = sum([code[0] == guess[0], code[1] == guess[1], code[2] == guess[2], code[3] == guess[3]]) if p == 4: print(WINNING_MSG) exit() v = len(set(guess) & code_set) - p x = 4 - p - v print(f" P={p},V={v},X={x}") guess = input("Turn #3 : ") p = sum([code[0] == guess[0], code[1] == guess[1], code[2] == guess[2], code[3] == guess[3]]) if p == 4: print(WINNING_MSG) exit() v = len(set(guess) & code_set) - p x = 4 - p - v print(f" P={p},V={v},X={x}") guess = input("Turn #4 : ") p = sum([code[0] == guess[0], code[1] == guess[1], code[2] == guess[2], code[3] == guess[3]]) if p == 4: print(WINNING_MSG) exit() v = len(set(guess) & code_set) - p x = 4 - p - v print(f" P={p},V={v},X={x}") print(LOSING_MSG) print(f"The answer is {code}") print("Please try again...") |
# 6330559021 (17.40) 389 (2021-02-12 14:32) k = input("Turn #1 : ") p = 0 v = 0 x = 0 if k[0] == code[0] : p += 1 elif k[0] == code[1] or k[0] == code[2] or k[0] == code[3]: v += 1 else : x += 1 if k[1] == code[1] : p += 1 elif k[1] == code[0] or k[1] == code[2] or k[1] == code[3]: v += 1 else : x += 1 if k[2] == code[2] : p += 1 elif k[2] == code[0] or k[2] == code[1] or k[2] == code[3]: v += 1 else : x += 1 if k[3] == code[3] : p += 1 elif k[3] == code[0] or k[3] == code[1] or k[3] == code[2]: v += 1 else : x += 1 if k == code : print("Congratulations! You won the game.") else : print(" "*10+"P="+str(p)+","+"V="+str(v)+","+"X="+str(x) ) k = input("Turn #2 : ") p = 0 v = 0 x = 0 if k[0] == code[0] : p += 1 elif k[0] == code[1] or k[0] == code[2] or k[0] == code[3]: v += 1 else : x += 1 if k[1] == code[1] : p += 1 elif k[1] == code[0] or k[1] == code[2] or k[1] == code[3]: v += 1 else : x += 1 if k[2] == code[2] : p += 1 elif k[2] == code[0] or k[2] == code[1] or k[2] == code[3]: v += 1 else : x += 1 if k[3] == code[3] : p += 1 elif k[3] == code[0] or k[3] == code[1] or k[3] == code[2]: v += 1 else : x += 1 if k == code : print("Congratulations! You won the game.") else : print(" "*10+"P="+str(p)+","+"V="+str(v)+","+"X="+str(x) ) k = input("Turn #3 : ") p = 0 v = 0 x = 0 if k[0] == code[0] : p += 1 elif k[0] == code[1] or k[0] == code[2] or k[0] == code[3]: v += 1 else : x += 1 if k[1] == code[1] : p += 1 elif k[1] == code[0] or k[1] == code[2] or k[1] == code[3]: v += 1 else : x += 1 if k[2] == code[2] : p += 1 elif k[2] == code[0] or k[2] == code[1] or k[2] == code[3]: v += 1 else : x += 1 if k[3] == code[3] : p += 1 elif k[3] == code[0] or k[3] == code[1] or k[3] == code[2]: v += 1 else : x += 1 if k == code : print("Congratulations! You won the game.") else : print(" "*10+"P="+str(p)+","+"V="+str(v)+","+"X="+str(x) ) k = input("Turn #4 : ") p = 0 v = 0 x = 0 if k[0] == code[0] : p += 1 elif k[0] == code[1] or k[0] == code[2] or k[0] == code[3]: v += 1 else : x += 1 if k[1] == code[1] : p += 1 elif k[1] == code[0] or k[1] == code[2] or k[1] == code[3]: v += 1 else : x += 1 if k[2] == code[2] : p += 1 elif k[2] == code[0] or k[2] == code[1] or k[2] == code[3]: v += 1 else : x += 1 if k[3] == code[3] : p += 1 elif k[3] == code[0] or k[3] == code[1] or k[3] == code[2]: v += 1 else : x += 1 if k == code : print("Congratulations! You won the game.") else : print(" "*10+"P="+str(p)+","+"V="+str(v)+","+"X="+str(x) ) print("Sorry! You just lost it.") print("The answer is" , str(code)) print("Please try again...") |
# 6330560521 (20.00) 390 (2021-02-12 17:13) Turn1 = input("Turn #1 : ") n = len(code) P=0 X=0 if Turn1 == code : print(WINNING_MSG) else : if Turn1[0] == code[0] : P += 1 if Turn1[1] == code[1] : P += 1 if Turn1[2] == code[2] : P += 1 if Turn1[3] == code[3] : P += 1 if Turn1[0] not in code : X += 1 if Turn1[1] not in code : X += 1 if Turn1[2] not in code : X += 1 if Turn1[3] not in code : X += 1 V = n-P-X print(' '+'P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) #Turn2_____________________________________________________________________________________ Turn2 = input("Turn #2 : ") if Turn2 == code : print(WINNING_MSG) else : P=0 X=0 if Turn2[0] == code[0] : P += 1 if Turn2[1] == code[1] : P += 1 if Turn2[2] == code[2] : P += 1 if Turn2[3] == code[3] : P += 1 if Turn2[0] not in code : X += 1 if Turn2[1] not in code : X += 1 if Turn2[2] not in code : X += 1 if Turn2[3] not in code : X += 1 V = n-P-X print(' '+'P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) #Turn3_____________________________________________________________________________________ Turn3 = input("Turn #3 : ") if Turn3 == code : print(WINNING_MSG) else : P=0 X=0 if Turn3[0] == code[0] : P += 1 if Turn3[1] == code[1] : P += 1 if Turn3[2] == code[2] : P += 1 if Turn3[3] == code[3] : P += 1 if Turn3[0] not in code : X += 1 if Turn3[1] not in code : X += 1 if Turn3[2] not in code : X += 1 if Turn3[3] not in code : X += 1 V = n-P-X print(' '+'P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) #Turn4___________________________________________________________________________________ Turn4 = input("Turn #4 : ") if Turn4 == code : print(WINNING_MSG) else : P=0 X=0 if Turn4[0] == code[0] : P += 1 if Turn4[1] == code[1] : P += 1 if Turn4[2] == code[2] : P += 1 if Turn4[3] == code[3] : P += 1 if Turn4[0] not in code : X += 1 if Turn4[1] not in code : X += 1 if Turn4[2] not in code : X += 1 if Turn4[3] not in code : X += 1 V = n-P-X print(' '+'P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) print(LOSING_MSG) print("The answer is "+code) print("Please try again...") |
# 6330561121 (20.00) 391 (2021-02-12 21:01) P=0 ; V=0 ; X=4 x = input("Turn #1 : ") if x[0] == code[0] : P+=1 if x[1] == code[1] : P+=1 if x[2] == code[2] : P+=1 if x[3] == code[3] : P+=1 if x[0] in code and x[0] != code[0] : V+=1 if x[1] in code and x[1] != code[1] : V+=1 if x[2] in code and x[2] != code[2] : V+=1 if x[3] in code and x[3] != code[3] : V+=1 X = 4-V-P if x == code : print(WINNING_MSG) else : print(" P="+str(P)+",V="+str(V)+",X="+str(X)) P=0 ; V=0 ; X=4 x = input("Turn #2 : ") if x[0] == code[0] : P+=1 if x[1] == code[1] : P+=1 if x[2] == code[2] : P+=1 if x[3] == code[3] : P+=1 if x[0] in code and x[0] != code[0] : V+=1 if x[1] in code and x[1] != code[1] : V+=1 if x[2] in code and x[2] != code[2] : V+=1 if x[3] in code and x[3] != code[3] : V+=1 X = 4-V-P if x == code : print(WINNING_MSG) else : print(" P="+str(P)+",V="+str(V)+",X="+str(X)) P=0 ; V=0 ; X=4 x = input("Turn #3 : ") if x[0] == code[0] : P+=1 if x[1] == code[1] : P+=1 if x[2] == code[2] : P+=1 if x[3] == code[3] : P+=1 if x[0] in code and x[0] != code[0] : V+=1 if x[1] in code and x[1] != code[1] : V+=1 if x[2] in code and x[2] != code[2] : V+=1 if x[3] in code and x[3] != code[3] : V+=1 X = 4-V-P if x == code : print(WINNING_MSG) else : print(" P="+str(P)+",V="+str(V)+",X="+str(X)) P=0 ; V=0 ; X=4 x = input("Turn #4 : ") if x[0] == code[0] : P+=1 if x[1] == code[1] : P+=1 if x[2] == code[2] : P+=1 if x[3] == code[3] : P+=1 if x[0] in code and x[0] != code[0] : V+=1 if x[1] in code and x[1] != code[1] : V+=1 if x[2] in code and x[2] != code[2] : V+=1 if x[3] in code and x[3] != code[3] : V+=1 X = 4-V-P if x == code : print(WINNING_MSG) else : print(" P="+str(P)+",V="+str(V)+",X="+str(X)) print(LOSING_MSG) print("The answer is "+code) print("Please try again...") |
# 6330562821 (20.00) 392 (2021-02-12 23:32) #turn 1 win = False ch = input('Turn #1 : ') ch = ch.upper() if ch != code : P = 0; V = 0 if ch[0] in code : if ch[0] == code[0] : P += 1 else : V += 1 if ch[1] in code : if ch[1] == code[1] : P += 1 else : V += 1 if ch[2] in code : if ch[2] == code[2] : P += 1 else : V += 1 if ch[3] in code : if ch[3] == code[3] : P += 1 else : V += 1 print(' '*10+'P='+str(P)+',V='+str(V)+',X='+str(4-P-V)) else : print(WINNING_MSG) win = True #turn 2 if not win == True : ch = input('Turn #2 : ') ch = ch.upper() if ch != code : P = 0; V = 0 if ch[0] in code : if ch[0] == code[0] : P += 1 else : V += 1 if ch[1] in code : if ch[1] == code[1] : P += 1 else : V += 1 if ch[2] in code : if ch[2] == code[2] : P += 1 else : V += 1 if ch[3] in code : if ch[3] == code[3] : P += 1 else : V += 1 print(' '*10+'P='+str(P)+',V='+str(V)+',X='+str(4-P-V)) else : print(WINNING_MSG) win = True #turn 3 if not win == True : ch = input('Turn #3 : ') ch = ch.upper() if ch != code : P = 0; V = 0 if ch[0] in code : if ch[0] == code[0] : P += 1 else : V += 1 if ch[1] in code : if ch[1] == code[1] : P += 1 else : V += 1 if ch[2] in code : if ch[2] == code[2] : P += 1 else : V += 1 if ch[3] in code : if ch[3] == code[3] : P += 1 else : V += 1 print(' '*10+'P='+str(P)+',V='+str(V)+',X='+str(4-P-V)) else : print(WINNING_MSG) win = True #turn 4 if not win == True : ch = input('Turn #4 : ') ch = ch.upper() if ch != code : P = 0; V = 0 if ch[0] in code : if ch[0] == code[0] : P += 1 else : V += 1 if ch[1] in code : if ch[1] == code[1] : P += 1 else : V += 1 if ch[2] in code : if ch[2] == code[2] : P += 1 else : V += 1 if ch[3] in code : if ch[3] == code[3] : P += 1 else : V += 1 print(' '*10+'P='+str(P)+',V='+str(V)+',X='+str(4-P-V)) else : print(WINNING_MSG) win = True if win == False : print(LOSING_MSG) print('The answer is',code) print('Please try again...') |
# 6330563421 (20.00) 393 (2021-02-13 00:51) sol=list(code) sol1=sol[0]; sol2=sol[1]; sol3=sol[2]; sol4=sol[3] try1=input('Turn #1 : ') a=list(try1) check=code p=0; v=0 a1=a[0]; a2=a[1]; a3=a[2]; a4=a[3] if a1==sol1: p=1 ; check=check.replace(a1,'') if a2==sol2: p=p+1 ; check=check.replace(a2,'') if a3==sol3: p=p+1 ; check=check.replace(a3,'') if a4==sol4: p=p+1 ; check=check.replace(a4,'') if a1 in check: v=1 ; check=check.replace(a1,'') if a2 in check: v=v+1 ; check=check.replace(a2,'') if a3 in check: v=v+1 ; check=check.replace(a3,'') if a4 in check: v=v+1 ; check=check.replace(a4,'') x=4-p-v if try1 in code: print(WINNING_MSG) quit() else: print(' P='+str(p)+',V='+str(v)+',X='+str(x)) try2=input('Turn #2 : ') a=list(try2) check=code p=0; v=0 a1=a[0]; a2=a[1]; a3=a[2]; a4=a[3] if a1==sol1: p=1 ; check=check.replace(a1,'') if a2==sol2: p=p+1 ; check=check.replace(a2,'') if a3==sol3: p=p+1 ; check=check.replace(a3,'') if a4==sol4: p=p+1 ; check=check.replace(a4,'') if a1 in check: v=1 ; check=check.replace(a1,'') if a2 in check: v=v+1 ; check=check.replace(a2,'') if a3 in check: v=v+1 ; check=check.replace(a3,'') if a4 in check: v=v+1 ; check=check.replace(a4,'') x=4-p-v if try2 in code: print(WINNING_MSG) quit() else: print(' P='+str(p)+',V='+str(v)+',X='+str(x)) try3=input('Turn #3 : ') a=list(try3) check=code p=0; v=0 a1=a[0]; a2=a[1]; a3=a[2]; a4=a[3] if a1==sol1: p=1 ; check=check.replace(a1,'') if a2==sol2: p=p+1 ; check=check.replace(a2,'') if a3==sol3: p=p+1 ; check=check.replace(a3,'') if a4==sol4: p=p+1 ; check=check.replace(a4,'') if a1 in check: v=1 ; check=check.replace(a1,'') if a2 in check: v=v+1 ; check=check.replace(a2,'') if a3 in check: v=v+1 ; check=check.replace(a3,'') if a4 in check: v=v+1 ; check=check.replace(a4,'') x=4-p-v if try3 in code: print(WINNING_MSG) quit() else: print(' P='+str(p)+',V='+str(v)+',X='+str(x)) try4=input('Turn #4 : ') a=list(try4) check=code p=0; v=0 a1=a[0]; a2=a[1]; a3=a[2]; a4=a[3] if a1==sol1: p=1 ; check=check.replace(a1,'') if a2==sol2: p=p+1 ; check=check.replace(a2,'') if a3==sol3: p=p+1 ; check=check.replace(a3,'') if a4==sol4: p=p+1 ; check=check.replace(a4,'') if a1 in check: v=1 ; check=check.replace(a1,'') if a2 in check: v=v+1 ; check=check.replace(a2,'') if a3 in check: v=v+1 ; check=check.replace(a3,'') if a4 in check: v=v+1 ; check=check.replace(a4,'') x=4-p-v if try4 in code: print(WINNING_MSG) quit() else: print(' P='+str(p)+',V='+str(v)+',X='+str(x)) print(LOSING_MSG) print('The answer is '+code) print('Please try again...') |
# 6330564021 (20.00) 394 (2021-02-12 20:48) print(code) codemaker = input("Turn #1 : ") P = 0 V = 0 x = 0 if codemaker != code: if codemaker[0] == code[0]: P += 1 if codemaker[0] in code and codemaker[0] != code[0]: V += 1 if not(codemaker[0] in code): x += 1 if codemaker[1] == code[1]: P += 1 if codemaker[1] in code and codemaker[1] != code[1]: V += 1 if not(codemaker[1] in code): x += 1 if codemaker[2] == code[2]: P += 1 if codemaker[2] in code and codemaker[2] != code[2]: V += 1 if not(codemaker[2] in code): x += 1 if codemaker[3] == code[3]: P += 1 if codemaker[3] in code and codemaker[3] != code[3]: V += 1 if not(codemaker[3] in code): x += 1 print(" "+"P="+str(P)+","+"V="+str(V)+","+"X="+str(x)) codemaker = input("Turn #2 : ") P = 0 V = 0 x = 0 if codemaker != code: if codemaker[0] == code[0]: P += 1 if codemaker[0] in code and codemaker[0] != code[0]: V += 1 if not(codemaker[0] in code): x += 1 if codemaker[1] == code[1]: P += 1 if codemaker[1] in code and codemaker[1] != code[1]: V += 1 if not(codemaker[1] in code): x += 1 if codemaker[2] == code[2]: P += 1 if codemaker[2] in code and codemaker[2] != code[2]: V += 1 if not(codemaker[2] in code): x += 1 if codemaker[3] == code[3]: P += 1 if codemaker[3] in code and codemaker[3] != code[3]: V += 1 if not(codemaker[3] in code): x += 1 print(" "+"P="+str(P)+","+"V="+str(V)+","+"X="+str(x)) codemaker = input("Turn #3 : ") P = 0 V = 0 x = 0 if codemaker != code: if codemaker[0] == code[0]: P += 1 if codemaker[0] in code and codemaker[0] != code[0]: V += 1 if not(codemaker[0] in code): x += 1 if codemaker[1] == code[1]: P += 1 if codemaker[1] in code and codemaker[1] != code[1]: V += 1 if not(codemaker[1] in code): x += 1 if codemaker[2] == code[2]: P += 1 if codemaker[2] in code and codemaker[2] != code[2]: V += 1 if not(codemaker[2] in code): x += 1 if codemaker[3] == code[3]: P += 1 if codemaker[3] in code and codemaker[3] != code[3]: V += 1 if not(codemaker[3] in code): x += 1 print(" "+"P="+str(P)+","+"V="+str(V)+","+"X="+str(x)) codemaker = input("Turn #4 : ") P = 0 V = 0 x = 0 if codemaker != code: if codemaker[0] == code[0]: P += 1 if codemaker[0] in code and codemaker[0] != code[0]: V += 1 if not(codemaker[0] in code): x += 1 if codemaker[1] == code[1]: P += 1 if codemaker[1] in code and codemaker[1] != code[1]: V += 1 if not(codemaker[1] in code): x += 1 if codemaker[2] == code[2]: P += 1 if codemaker[2] in code and codemaker[2] != code[2]: V += 1 if not(codemaker[2] in code): x += 1 if codemaker[3] == code[3]: P += 1 if codemaker[3] in code and codemaker[3] != code[3]: V += 1 if not(codemaker[3] in code): x += 1 print(" "+"P="+str(P)+","+"V="+str(V)+","+"X="+str(x)) print(LOSING_MSG) print("The answer is",code) print("Please try again...") else: print(WINNING_MSG) else: print(WINNING_MSG) else: print(WINNING_MSG) else: print(WINNING_MSG) |
# 6330565721 (20.00) 395 (2021-02-14 23:29) a = str(input("Turn #1 : ")) a1 = a[0] a2 = a[1] a3 = a[2] a4 = a[3] P = 0 ; V = 0 ; X = 0 if a1 == code[0] :P +=1 if a2 == code[1] :P +=1 if a3 == code[2] :P +=1 if a4 == code[3] :P +=1 if a1 in code : V+=1 if a2 in code : V+=1 if a3 in code : V+=1 if a4 in code : V+=1 if a1 not in code : X+=1 if a2 not in code : X+=1 if a3 not in code : X+=1 if a4 not in code : X+=1 if P == 4 : print(WINNING_MSG) else : Z = V-P print(len('TURN #1 : ')*' '+"P="+str(P)+","+"V="+str(Z)+","+"X="+str(X)) b = str(input("Turn #2 : ")) b1 = b[0] b2 = b[1] b3 = b[2] b4 = b[3] P2 = 0 ; V2 = 0 ; X2 = 0 if b1 == code[0] : P2+=1 if b2 == code[1] : P2+=1 if b3 == code[2] : P2+=1 if b4 == code[3] : P2+=1 if b1 in code : V2+=1 if b2 in code : V2+=1 if b3 in code : V2+=1 if b4 in code : V2+=1 if b1 not in code : X2+=1 if b2 not in code : X2+=1 if b3 not in code : X2+=1 if b4 not in code : X2+=1 if P2 == 4 : print(WINNING_MSG) else : Z2 = V2-P2 print(len('TURN #2 : ')*' '+"P="+str(P2)+","+"V="+str(Z2)+","+"X="+str(X2)) c = str(input("Turn #3 : ")) c1 = c[0] c2 = c[1] c3 = c[2] c4 = c[3] P3 = 0 ; V3 = 0 ; X3 = 0 if c1 == code[0] : P3+=1 if c2 == code[1] : P3+=1 if c3 == code[2] : P3+=1 if c4 == code[3] : P3+=1 if c1 in code : V3+=1 if c2 in code : V3+=1 if c3 in code : V3+=1 if c4 in code : V3+=1 if c1 not in code : X3+=1 if c2 not in code : X3+=1 if c3 not in code : X3+=1 if c4 not in code : X3+=1 if P3 == 4 : print(WINNING_MSG) else : Z3 = V3-P3 print(len('TURN #3 : ')*' '+"P="+str(P3)+","+"V="+str(Z3)+","+"X="+str(X3)) d = str(input("Turn #4 : ")) d1 = d[0] d2 = d[1] d3 = d[2] d4 = d[3] P4 = 0 ; V4 = 0 ; X4 = 0 if d1 == code[0] : P4+=1 if d2 == code[1] : P4+=1 if d3 == code[2] : P4+=1 if d4 == code[3] : P4+=1 if d1 in code : V4+=1 if d2 in code : V4+=1 if d3 in code : V4+=1 if d4 in code : V4+=1 if d1 not in code : X4+=1 if d2 not in code : X4+=1 if d3 not in code : X4+=1 if d4 not in code : X4+=1 if P4 == 4 : print(WINNING_MSG) else : Z4 = V4-P4 print(len('TURN #4 : ')*' '+"P="+str(P4)+","+"V="+str(Z4)+","+"X="+str(X4)) print(LOSING_MSG) print("The answer is "+str(code)) print("Please try again...") |
# 6330566321 (20.00) 396 (2021-02-13 22:23) p=0 v=0 x=0 guess = input('Turn #1 : ') if code[0]==guess[0] : p=p+1 if code[1]==guess[1] : p=p+1 if code[2]==guess[2] : p=p+1 if code[3]==guess[3] : p=p+1 if code[0] in guess and code[0]!=guess[0]: v=v+1 if code[1] in guess and code[1]!=guess[1]: v = v + 1 if code[2] in guess and code[2]!=guess[2]: v = v + 1 if code[3] in guess and code[3]!=guess[3]: v = v + 1 if not (code[0] in guess) : x = x + 1 if not (code[1] in guess) : x = x + 1 if not (code[2] in guess) : x = x + 1 if not (code[3] in guess) : x = x + 1 if p<4 : print(' '*10+'P='+str(p)+','+'V='+str(v)+','+'X='+str(x)) else : print(WINNING_MSG) if p<4 : p=0 v=0 x=0 guess = input('Turn #2 : ') if code[0]==guess[0] : p=p+1 if code[1]==guess[1] : p=p+1 if code[2]==guess[2] : p=p+1 if code[3]==guess[3] : p=p+1 if code[0] in guess and code[0]!=guess[0]: v=v+1 if code[1] in guess and code[1]!=guess[1]: v = v + 1 if code[2] in guess and code[2]!=guess[2]: v = v + 1 if code[3] in guess and code[3]!=guess[3]: v = v + 1 if not (code[0] in guess) : x = x + 1 if not (code[1] in guess) : x = x + 1 if not (code[2] in guess) : x = x + 1 if not (code[3] in guess) : x = x + 1 if p<4 : print(' '*10+'P='+str(p)+','+'V='+str(v)+','+'X='+str(x)) else : print(WINNING_MSG) if p<4 : p=0 v=0 x=0 guess = input('Turn #3 : ') if code[0]==guess[0] : p=p+1 if code[1]==guess[1] : p=p+1 if code[2]==guess[2] : p=p+1 if code[3]==guess[3] : p=p+1 if code[0] in guess and code[0]!=guess[0]: v=v+1 if code[1] in guess and code[1]!=guess[1]: v = v + 1 if code[2] in guess and code[2]!=guess[2]: v = v + 1 if code[3] in guess and code[3]!=guess[3]: v = v + 1 if not (code[0] in guess) : x = x + 1 if not (code[1] in guess) : x = x + 1 if not (code[2] in guess) : x = x + 1 if not (code[3] in guess) : x = x + 1 if p<4 : print(' '*10+'P='+str(p)+','+'V='+str(v)+','+'X='+str(x)) else : print(WINNING_MSG) if p<4 : p=0 v=0 x=0 guess = input('Turn #4 : ') if code[0]==guess[0] : p=p+1 if code[1]==guess[1] : p=p+1 if code[2]==guess[2] : p=p+1 if code[3]==guess[3] : p=p+1 if code[0] in guess and code[0]!=guess[0]: v=v+1 if code[1] in guess and code[1]!=guess[1]: v = v + 1 if code[2] in guess and code[2]!=guess[2]: v = v + 1 if code[3] in guess and code[3]!=guess[3]: v = v + 1 if not (code[0] in guess) : x = x + 1 if not (code[1] in guess) : x = x + 1 if not (code[2] in guess) : x = x + 1 if not (code[3] in guess) : x = x + 1 if p<4 : print(' ' * 10 + 'P=' + str(p) + ',' + 'V=' + str(v) + ',' + 'X=' + str(x)) print(LOSING_MSG) print("The answer is "+str(code)) print("Please try again...") else : print(WINNING_MSG) |
# 6330567021 (16.91) 397 (2021-02-12 14:48) cd = code gu = input('Turn #1 : ') if gu[0] in cd: #c if gu[1] in cd: #c if gu[2] in cd:#c if gu[3] in cd:#c v = 4 else: v = 3 else: if gu[3] in cd: #c v = 3 else: v = 2 else: if gu[2] in cd:#c if gu[3] in cd:#c v = 3 else: v = 2 else: if gu[3] in cd: #c v = 2 else: v = 1 else: if gu[1] in cd: #c if gu[2] in cd:#c if gu[3] in cd:#c v = 3 else: v = 2 else: if gu[3] in cd: #c v = 2 else: v = 1 else: if gu[2] in cd:#c if gu[3] in cd:#c v = 2 else: v = 1 else: if gu[3] in cd: #c v = 1 else: v = 0 wrong_color = abs(4 - v) ######################################### if gu[0] in cd[0] and gu[0] in cd: #c if gu[1] == cd[1] and gu[1] in cd: #c if gu[2] == cd[2] and gu[2] in cd:#c if gu[3] == cd[3] and gu[3] in cd:#c r = 4 else: r = 3 else: if gu[3] == cd[3] and gu[3] in cd: #c r = 3 else: r = 2 else: if gu[2] == cd[2] and gu[2] in cd:#c if gu[3] == cd[3] and gu[3] in cd:#c r = 3 else: r = 2 else: if gu[3] == cd[3] and gu[3] in cd: #c r = 2 else: r = 1 else: if gu[1] == cd[1] and gu[1] in cd: #c if gu[2] == cd[2] and gu[2] in cd:#c if gu[3] == cd[3] and gu[3] in cd:#c r = 3 else: r = 2 else: if gu[3] == cd[3] and gu[3] in cd: #c r = 2 else: r = 1 else: if gu[2] == cd[2] and gu[2] in cd:#c if gu[3] == cd[3] and gu[3] in cd:#c r = 2 else: r = 1 else: if gu[3] == cd[3] and gu[3] in cd: #c r = 1 else: r = 0 right_place_and_color = abs(r) right_color_wrong_place = abs(4 - r - wrong_color) ############################################ if right_place_and_color == 4 : print('Congratulations! You won the game.') j = 1 else: print(' P='+str(right_place_and_color)+',V='+str(right_color_wrong_place)+',X='+str(wrong_color)) j = 0 guess1 = input('Turn #2 : ') gu1 = guess1 if j == 1: pass elif gu1[0] in cd: #c if gu1[1] in cd: #c if gu1[2] in cd:#c if gu1[3] in cd:#c v1 = 4 else: v1 = 3 else: if gu1[3] in cd: #c v1 = 3 else: v1 = 2 else: if gu1[2] in cd:#c if gu1[3] in cd:#c v1 = 3 else: v1 = 2 else: if gu1[3] in cd: #c v1 = 2 else: v1 = 1 else: if gu1[1] in cd: #c if gu1[2] in cd:#c if gu1[3] in cd:#c v1 = 3 else: v1 = 2 else: if gu1[3] in cd: #c v1 = 2 else: v1 = 1 else: if gu1[2] in cd:#c if gu1[3] in cd:#c v1 = 2 else: v1 = 1 else: if gu1[3] in cd: #c v1 = 1 else: v1 = 0 wrong_color1 = abs(4 - v1) ######################################### if gu1[0] in cd[0] and gu1[0] in cd: #c if gu1[1] == cd[1] and gu1[1] in cd: #c if gu1[2] == cd[2] and gu1[2] in cd:#c if gu1[3] == cd[3] and gu1[3] in cd:#c r1 = 4 else: r1 = 3 else: if gu1[3] == cd[3] and gu1[3] in cd: #c r1 = 3 else: r1 = 2 else: if gu1[2] == cd[2] and gu1[2] in cd:#c if gu1[3] == cd[3] and gu1[3] in cd:#c r1 = 3 else: r1 = 2 else: if gu1[3] == cd[3] and gu1[3] in cd: #c r1 = 2 else: r1 = 1 else: if gu1[1] == cd[1] and gu1[1] in cd: #c if gu1[2] == cd[2] and gu1[2] in cd:#c if gu1[3] == cd[3] and gu1[3] in cd:#c r1 = 3 else: r1 = 2 else: if gu1[3] == cd[3] and gu1[3] in cd: #c r1 = 2 else: r1 = 1 else: if gu1[2] == cd[2] and gu1[2] in cd:#c if gu1[3] == cd[3] and gu1[3] in cd:#c r1 = 2 else: r1 = 1 else: if gu1[3] == cd[3] and gu1[3] in cd: #c r1 = 1 else: r1 = 0 right_place_and_color1 = abs(r1) right_color_wrong_place1 = abs(4 - r1 - wrong_color1) ########################################################## ##########################3 if right_place_and_color1 == 4 : print('Congratulations! You won the game.') p = 1 else: print(' P='+str(right_place_and_color1)+',V='+str(right_color_wrong_place1)+',X='+str(wrong_color1)) p = 0 guess2 = input('Turn #3 : ') gu2 = guess2 if p == 1: pass elif gu2[0] in cd: #c if gu2[1] in cd: #c if gu2[2] in cd:#c if gu2[3] in cd:#c v2 = 4 else: v2 = 3 else: if gu2[3] in cd: #c v2 = 3 else: v2 = 2 else: if gu2[2] in cd:#c if gu2[3] in cd:#c v2 = 3 else: v2 = 2 else: if gu2[3] in cd: #c v2 = 2 else: v2 = 1 else: if gu2[1] in cd: #c if gu2[2] in cd:#c if gu2[3] in cd:#c v2 = 3 else: v2 = 2 else: if gu2[3] in cd: #c v2 = 2 else: v2 = 1 else: if gu2[2] in cd:#c if gu2[3] in cd:#c v2 = 2 else: v2 = 1 else: if gu2[3] in cd: #c v = 1 else: v2 = 0 wrong_color2 = abs(4 - v2) ######################################### if gu2[0] in cd[0] and gu2[0] in cd: #c if gu2[1] == cd[1] and gu2[1] in cd: #c if gu2[2] == cd[2] and gu2[2] in cd:#c if gu2[3] == cd[3] and gu2[3] in cd:#c r2 = 4 else: r2 = 3 else: if gu2[3] == cd[3] and gu2[3] in cd: #c r2 = 3 else: r2 = 2 else: if gu2[2] == cd[2] and gu2[2] in cd:#c if gu2[3] == cd[3] and gu2[3] in cd:#c r2 = 3 else: r2 = 2 else: if gu2[3] == cd[3] and gu2[3] in cd: #c r2 = 2 else: r2 = 1 else: if gu2[1] == cd[1] and gu2[1] in cd: #c if gu2[2] == cd[2] and gu2[2] in cd:#c if gu2[3] == cd[3] and gu2[3] in cd:#c r2 = 3 else: r2 = 2 else: if gu2[3] == cd[3] and gu2[3] in cd: #c r2 = 2 else: r2 = 1 else: if gu2[2] == cd[2] and gu2[2] in cd:#c if gu2[3] == cd[3] and gu2[3] in cd:#c r2 = 2 else: r2 = 1 else: if gu2[3] == cd[3] and gu2[3] in cd: #c r2 = 1 else: r2 = 0 right_place_and_color2 = abs(r2) right_color_wrong_place2 = abs(4 - r2 - wrong_color2) if right_place_and_color2 == 4 : print('Congratulations! You won the game.') ll = 1 else: print(' P='+str(right_place_and_color2)+',V='+str(right_color_wrong_place2)+',X='+str(wrong_color2)) ll = 0 ##### guess3 = input('Turn #4 : ') gu3 = guess3 if ll == 1: pass elif gu3[0] in cd: #c if gu3[1] in cd: #c if gu3[2] in cd:#c if gu3[3] in cd:#c v3 = 4 else: v3 = 3 else: if gu3[3] in cd: #c v3 = 3 else: v3 = 2 else: if gu3[2] in cd:#c if gu3[3] in cd:#c v3 = 3 else: v3 = 2 else: if gu3[3] in cd: #c v3 = 2 else: v3 = 1 else: if gu3[1] in cd: #c if gu3[2] in cd:#c if gu3[3] in cd:#c v3 = 3 else: v3 = 2 else: if gu3[3] in cd: #c v3 = 2 else: v3 = 1 else: if gu3[2] in cd:#c if gu3[3] in cd:#c v3 = 2 else: v3 = 1 else: if gu3[3] in cd: #c v3 = 1 else: v3 = 0 wrong_color3 = abs(4 - v3) ######################################### if gu3[0] in cd[0] and gu3[0] in cd: #c if gu3[1] == cd[1] and gu3[1] in cd: #c if gu3[2] == cd[2] and gu3[2] in cd:#c if gu3[3] == cd[3] and gu3[3] in cd:#c r3 = 4 else: r3 = 3 else: if gu3[3] == cd[3] and gu3[3] in cd: #c r3 = 3 else: r3 = 2 else: if gu3[2] == cd[2] and gu3[2] in cd:#c if gu3[3] == cd[3] and gu3[3] in cd:#c r3 = 3 else: r3 = 2 else: if gu3[3] == cd[3] and gu3[3] in cd: #c r3 = 2 else: r3 = 1 else: if gu3[1] == cd[1] and gu3[1] in cd: #c if gu3[2] == cd[2] and gu3[2] in cd:#c if gu3[3] == cd[3] and gu3[3] in cd:#c r3 = 3 else: r3 = 2 else: if gu3[3] == cd[3] and gu3[3] in cd: #c r3 = 2 else: r3 = 1 else: if gu3[2] == cd[2] and gu3[2] in cd:#c if gu3[3] == cd[3] and gu3[3] in cd:#c r3 = 2 else: r3 = 1 else: if gu3[3] == cd[3] and gu3[3] in cd: #c r3 = 1 else: r3 = 0 right_place_and_color3 = abs(r3) right_color_wrong_place3 = abs(4 - r3 - wrong_color3) if right_place_and_color3 == 4: print('Congratulations! You won the game.') ll = 1 else: print(' P='+str(right_place_and_color3)+',V='+str(right_color_wrong_place3)+',X='+str(wrong_color3)) print('''Sorry! You just lost it.''') print("The answer is " + cd) print("Please try again...") |
# 6330568621 (20.00) 398 (2021-02-12 23:32) p = 0 v = 0 x = 0 m = input("Turn #1 : ").upper() if m != code: if m[0] in code: if m[0] == code[0]: p+= 1 else: v+=1 else: x+=1 if m[1] in code: if m[1] == code[1]: p+= 1 else: v+=1 else: x+=1 if m[2] in code: if m[2] == code[2]: p+= 1 else: v+=1 else: x+=1 if m[3] in code: if m[3] == code[3]: p+= 1 else: v+=1 else: x+=1 print(' P='+str(p) + ',' + 'V='+str(v) + ',' + 'X='+str(x)) p = 0 v = 0 x = 0 e = input("Turn #2 : ").upper() if e != code: if e[0] in code: if e[0] == code[0]: p += 1 else: v += 1 else: x += 1 if e[1] in code: if e[1] == code[1]: p += 1 else: v += 1 else: x += 1 if e[2] in code: if e[2] == code[2]: p += 1 else: v += 1 else: x += 1 if e[3] in code: if e[3] == code[3]: p += 1 else: v += 1 else: x += 1 print(' P='+str(p) + ',' + 'V='+str(v) + ',' + 'X='+str(x)) p = 0 v = 0 x = 0 f = input("Turn #3 : ").upper() if f != code: if f[0] in code: if f[0] == code[0]: p += 1 else: v += 1 else: x += 1 if f[1] in code: if f[1] == code[1]: p += 1 else: v += 1 else: x += 1 if f[2] in code: if f[2] == code[2]: p += 1 else: v += 1 else: x += 1 if f[3] in code: if f[3] == code[3]: p += 1 else: v += 1 else: x += 1 print(' P='+str(p) + ',' + 'V='+str(v) + ',' + 'X='+str(x)) p = 0 v = 0 x = 0 t = input("Turn #4 : ").upper() if t != code: if t[0] in code: if t[0] == code[0]: p += 1 else: v += 1 else: x += 1 if t[1] in code: if t[1] == code[1]: p += 1 else: v += 1 else: x += 1 if t[2] in code: if t[2] == code[2]: p += 1 else: v += 1 else: x += 1 if t[3] in code: if t[3] == code[3]: p += 1 else: v += 1 else: x += 1 print(' P='+str(p) + ',' + 'V='+str(v) + ',' + 'X='+str(x)) print(LOSING_MSG) print('The answer is', code) print('Please try again...') else: print(WINNING_MSG) else: print(WINNING_MSG) else: print(WINNING_MSG) else: print(WINNING_MSG) |
# 6330569221 (20.00) 399 (2021-02-15 22:38) a = [code[0],code[1],code[2],code[3]] n = input('Turn #1 : ') n = [n[0],n[1],n[2],n[3]] P = [0,0,0,0] V = [0,0,0,0] X = [0,0,0,0] if n == a: print(WINNING_MSG) else: if n[0] in a: if n[0] == a[0]: P[0] = 1 else: V[0] = 1 else: X[0] = 1 if n[1] in a: if n[1] == a[1]: P[1] = 1 else: V[1] = 1 else: X[1] = 1 if n[2] in a: if n[2] == a[2]: P[2] = 1 else: V[2] = 1 else: X[2] = 1 if n[3] in a: if n[3] == a[3]: P[3] = 1 else: V[3] = 1 else: X[3] = 1 print(" " + "P=" + str(P[0]+P[1]+P[2]+P[3]) + ",V=" + str(V[0]+V[1]+V[2]+V[3]) + ",X=" + str(X[0]+X[1]+X[2]+X[3])) n = input('Turn #2 : ') n = [n[0],n[1],n[2],n[3]] P = [0,0,0,0] V = [0,0,0,0] X = [0,0,0,0] if n == a: print(WINNING_MSG) else: if n[0] in a: if n[0] == a[0]: P[0] = 1 else: V[0] = 1 else: X[0] = 1 if n[1] in a: if n[1] == a[1]: P[1] = 1 else: V[1] = 1 else: X[1] = 1 if n[2] in a: if n[2] == a[2]: P[2] = 1 else: V[2] = 1 else: X[2] = 1 if n[3] in a: if n[3] == a[3]: P[3] = 1 else: V[3] = 1 else: X[3] = 1 print(" " + "P=" + str(P[0]+P[1]+P[2]+P[3]) + ",V=" + str(V[0]+V[1]+V[2]+V[3]) + ",X=" + str(X[0]+X[1]+X[2]+X[3])) n = input('Turn #3 : ') n = [n[0],n[1],n[2],n[3]] P = [0,0,0,0] V = [0,0,0,0] X = [0,0,0,0] if n == a: print(WINNING_MSG) else: if n[0] in a: if n[0] == a[0]: P[0] = 1 else: V[0] = 1 else: X[0] = 1 if n[1] in a: if n[1] == a[1]: P[1] = 1 else: V[1] = 1 else: X[1] = 1 if n[2] in a: if n[2] == a[2]: P[2] = 1 else: V[2] = 1 else: X[2] = 1 if n[3] in a: if n[3] == a[3]: P[3] = 1 else: V[3] = 1 else: X[3] = 1 print(" " + "P=" + str(P[0]+P[1]+P[2]+P[3]) + ",V=" + str(V[0]+V[1]+V[2]+V[3]) + ",X=" + str(X[0]+X[1]+X[2]+X[3])) n = input('Turn #4 : ') n = [n[0],n[1],n[2],n[3]] P = [0,0,0,0] V = [0,0,0,0] X = [0,0,0,0] if n == a: print(WINNING_MSG) else: if n[0] in a: if n[0] == a[0]: P[0] = 1 else: V[0] = 1 else: X[0] = 1 if n[1] in a: if n[1] == a[1]: P[1] = 1 else: V[1] = 1 else: X[1] = 1 if n[2] in a: if n[2] == a[2]: P[2] = 1 else: V[2] = 1 else: X[2] = 1 if n[3] in a: if n[3] == a[3]: P[3] = 1 else: V[3] = 1 else: X[3] = 1 print(" " + "P=" + str(P[0]+P[1]+P[2]+P[3]) + ",V=" + str(V[0]+V[1]+V[2]+V[3]) + ",X=" + str(X[0]+X[1]+X[2]+X[3])) print('Sorry! You just lost it.') print('The answer is',code) print("Please"+"try again...") |
# 6330570821 (20.00) 400 (2021-02-12 15:12) i = input('Turn #1 : ').upper() p,v,x = 0,0,0 if code[0]==i[0]: p += 1 if code[1]==i[1]: p += 1 if code[2]==i[2]: p += 1 if code[3]==i[3]: p += 1 if code[0] not in i: x += 1 if code[1] not in i: x += 1 if code[2] not in i: x += 1 if code[3] not in i: x += 1 v = 4 - p -x if p == 4: print(WINNING_MSG) exit() else: p = str(p) v = str(v) x = str(x) print(' '+'P='+p+','+'V='+v+','+'X='+x) ###################################################################### i = input('Turn #2 : ').upper() p,v,x = 0,0,0 if code[0]==i[0]: p += 1 if code[1]==i[1]: p += 1 if code[2]==i[2]: p += 1 if code[3]==i[3]: p += 1 if code[0] not in i: x += 1 if code[1] not in i: x += 1 if code[2] not in i: x += 1 if code[3] not in i: x += 1 v = 4 - p -x if p == 4: print(WINNING_MSG) exit() else: p = str(p) v = str(v) x = str(x) print(' '+'P='+p+','+'V='+v+','+'X='+x) ###################################################################### i = input('Turn #3 : ').upper() p,v,x = 0,0,0 if code[0]==i[0]: p += 1 if code[1]==i[1]: p += 1 if code[2]==i[2]: p += 1 if code[3]==i[3]: p += 1 if code[0] not in i: x += 1 if code[1] not in i: x += 1 if code[2] not in i: x += 1 if code[3] not in i: x += 1 v = 4 - p -x if p == 4: print(WINNING_MSG) exit() else: p = str(p) v = str(v) x = str(x) print(' '+'P='+p+','+'V='+v+','+'X='+x) ###################################################################### i = input('Turn #4 : ').upper() p,v,x = 0,0,0 if code[0]==i[0]: p += 1 if code[1]==i[1]: p += 1 if code[2]==i[2]: p += 1 if code[3]==i[3]: p += 1 if code[0] not in i: x += 1 if code[1] not in i: x += 1 if code[2] not in i: x += 1 if code[3] not in i: x += 1 v = 4 - p -x if p == 4: print(WINNING_MSG) exit() else: p = str(p) v = str(v) x = str(x) print(' '+'P='+p+','+'V='+v+','+'X='+x) ###################################################################### print(LOSING_MSG) print('The answer is '+code) print("""Please try again...""") |
# 6330571421 (13.93) 401 (2021-02-14 19:11) space = len('Turn ##: ') try1 = input('Turn #1: ') P = 0 V = 0 X = 0 if try1 == code: print (WINNING_MSG) else: if try1[0] == code[0]: P += 1 elif try1[0] in code: V += 1 else: X +=1 if try1[1] == code[1]: P += 1 elif try1[1] in code: V += 1 else: X +=1 if try1[2] == code[2]: P += 1 elif try1[2] in code: V += 1 else: X +=1 if try1[3] == code[3]: P += 1 elif try1[3] in code: V += 1 else: X +=1 print(' '*space+'P='+str(P)+',V='+str(V)+',X='+str(X)) if try1 == code: pass else: try2 = input('Turn #2: ') P = 0 V = 0 X = 0 if try2 == code: print (WINNING_MSG) else: if try2[0] == code[0]: P += 1 elif try2[0] in code: V += 1 else: X +=1 if try2[1] == code[1]: P += 1 elif try2[1] in code: V += 1 else: X +=1 if try2[2] == code[2]: P += 1 elif try2[2] in code: V += 1 else: X +=1 if try2[3] == code[3]: P += 1 elif try2[3] in code: V += 1 else: X +=1 if try2==code: pass else: print(' '*space+'P='+str(P)+',V='+str(V)+',X='+str(X)) try3 = input('Turn #3: ') P = 0 V = 0 X = 0 if try3 == code: print (WINNING_MSG) else: if try3[0] == code[0]: P += 1 elif try3[0] in code: V += 1 else: X +=1 if try3[1] == code[1]: P += 1 elif try3[1] in code: V += 1 else: X +=1 if try3[2] == code[2]: P += 1 elif try3[2] in code: V += 1 else: X +=1 if try3[3] == code[3]: P += 1 elif try3[3] in code: V += 1 else: X +=1 if try3==code: pass else: print(' '*space+'P='+str(P)+',V='+str(V)+',F='+str(X)) try4 = input('Turn #4: ') P = 0 V = 0 X = 0 if try3 == code: print (WINNING_MSG) else: if try4[0] == code[0]: P += 1 elif try4[0] in code: V += 1 else: X +=1 if try4[1] == code[1]: P += 1 elif try4[1] in code: V += 1 else: X +=1 if try4[2] == code[2]: P += 1 elif try4[2] in code: V += 1 else: X +=1 if try4[3] == code[3]: P += 1 elif try4[3] in code: V += 1 else: X +=1 print(' '*space+'P='+str(P)+',V='+str(V)+',F='+str(X)) print(LOSING_MSG) print('The answer is ' +code) print('Please try again...') |
# 6330572021 (20.00) 402 (2021-02-14 15:42) r1=input('Turn #1 : ') if r1==code: print('Congratulations! You won the game.') else: p=0 if r1[0]==code[0]: p+=1 if r1[1]==code[1]: p+=1 if r1[2]==code[2]: p+=1 if r1[3]==code[3]: p+=1 P=p v=0 x=0 if r1[0] in code: v+=1 else: x+=1 if r1[1] in code: v+=1 else: x+=1 if r1[2] in code: v+=1 else: x+=1 if r1[3] in code: v+=1 else: x+=1 V=v-p X=x print(' P='+str(P)+',V='+str(V)+',X='+str(X)) r2=input('Turn #2 : ') if r2==code: print('Congratulations! You won the game.') else: p=0 if r2[0]==code[0]: p+=1 if r2[1]==code[1]: p+=1 if r2[2]==code[2]: p+=1 if r2[3]==code[3]: p+=1 P=p v=0 x=0 if r2[0] in code: v+=1 else: x+=1 if r2[1] in code: v+=1 else: x+=1 if r2[2] in code: v+=1 else: x+=1 if r2[3] in code: v+=1 else: x+=1 V=v-p X=x print(' P='+str(P)+',V='+str(V)+',X='+str(X)) r3=input('Turn #3 : ') if r3==code: print('Congratulations! You won the game.') else: p=0 if r3[0]==code[0]: p+=1 if r3[1]==code[1]: p+=1 if r3[2]==code[2]: p+=1 if r3[3]==code[3]: p+=1 P=p v=0 x=0 if r3[0] in code: v+=1 else: x+=1 if r3[1] in code: v+=1 else: x+=1 if r3[2] in code: v+=1 else: x+=1 if r3[3] in code: v+=1 else: x+=1 V=v-p X=x print(' P='+str(P)+',V='+str(V)+',X='+str(X)) r4=input('Turn #4 : ') if r4==code: print('Congratulations! You won the game.') else: p=0 if r4[0]==code[0]: p+=1 if r4[1]==code[1]: p+=1 if r4[2]==code[2]: p+=1 if r4[3]==code[3]: p+=1 P=p v=0 x=0 if r4[0] in code: v+=1 else: x+=1 if r4[1] in code: v+=1 else: x+=1 if r4[2] in code: v+=1 else: x+=1 if r4[3] in code: v+=1 else: x+=1 V=v-p X=x print(' P='+str(P)+',V='+str(V)+',X='+str(X)) print('Sorry! You just lost it.') print('The answer is '+str(code)) print('Please try again...') |
# 6330573721 (0.00) 403 (2021-02-14 17:27) #print(code) # P = both correct # V = position incorrect but color correct # X = both incorrect time = 0 def mastermind(code, guess): import sys global time p = 0 v = 0 x = 0 time+=1 #-------------------------- P case --------- if guess[0] in code and guess[0] == code[0]: p+=1 elif guess[0] in code and guess[0] != code[0]: v+=1 #----------------- if guess[1] in code and guess[1] == code[1]: p+=1 elif guess[1] in code and guess[1] != code[1]: v+=1 #----------------- if guess[2] in code and guess[2] == code[2]: p+=1 elif guess[2] in code and guess[2] != code[2]: v+=1 #----------------- if guess[3] in code and guess[3] == code[3]: p+=1 elif guess[3] in code and guess[3] != code[3]: v+=1 #-------------------------- X case --------- if guess[0] not in code: x+=1 if guess[1] not in code: x+=1 if guess[2] not in code: x+=1 if guess[3] not in code: x+=1 if p == 4: print(WINNING_MSG) sys.exit() else: print("\t P={},V={},X={}".format(p,v,x)) if time == 4 and p!= 4: print(LOSING_MSG) print("The answer is", code) print("Please try again...") turn1 = str(input("Turn #1 : ")) mastermind(code, turn1) turn2 = str(input("Turn #2 : ")) mastermind(code, turn2) turn3 = str(input("Turn #3 : ")) mastermind(code, turn3) turn4 = str(input("Turn #4 : ")) mastermind(code, turn4) |
# 6330574321 (17.37) 404 (2021-02-15 21:14) c1 = code[0] c2 = code[1] c3 = code[2] c4 = code[3] x = input("Turn #1 : ") x1 = x[0] x2 = x[1] x3 = x[2] x4 = x[3] if x1==c1: a1=1 else: a1=0 if x2==c2: b1=1 else: b1=0 if x3==c3: c1=1 else: c1=0 if x4==c4: d1=1 else: d1=0 p = a1+b1+c1+d1 if x1 in code: a2=1 else: a2=0 if x2 in code: b2=1 else: b2=0 if x3 in code: c2=1 else: c2=0 if x4 in code: d2=1 else: d2=0 v=a2+b2+c2+d2 v= v-p x= 4-p-v if p==4: print("Congratulations! You won the game.") else: p=str(p) v=str(v) x=str(x) print(" "+"P"+"="+p+","+"V"+"="+v+","+"X"+"="+x) c1 = code[0] c2 = code[1] c3 = code[2] c4 = code[3] x = input("Turn #2 : ") x1 = x[0] x2 = x[1] x3 = x[2] x4 = x[3] if x1==c1: a1=1 else: a1=0 if x2==c2: b1=1 else: b1=0 if x3==c3: c1=1 else: c1=0 if x4==c4: d1=1 else: d1=0 p = a1+b1+c1+d1 if x1 in code: a2=1 else: a2=0 if x2 in code: b2=1 else: b2=0 if x3 in code: c2=1 else: c2=0 if x4 in code: d2=1 else: d2=0 v=a2+b2+c2+d2 v= v-p x= 4-p-v if p==4: print("Congratulations! You won the game.") else: p=str(p) v=str(v) x=str(x) print(" "+"P"+"="+p+","+"V"+"="+v+","+"X"+"="+x) c1 = code[0] c2 = code[1] c3 = code[2] c4 = code[3] x = input("Turn #3 : ") x1 = x[0] x2 = x[1] x3 = x[2] x4 = x[3] if x1==c1: a1=1 else: a1=0 if x2==c2: b1=1 else: b1=0 if x3==c3: c1=1 else: c1=0 if x4==c4: d1=1 else: d1=0 p = a1+b1+c1+d1 if x1 in code: a2=1 else: a2=0 if x2 in code: b2=1 else: b2=0 if x3 in code: c2=1 else: c2=0 if x4 in code: d2=1 else: d2=0 v=a2+b2+c2+d2 v= v-p x= 4-p-v if p==4: print("Congratulations! You won the game.") else: p=str(p) v=str(v) x=str(x) print(" "+"P"+"="+p+","+"V"+"="+v+","+"X"+"="+x) c1 = code[0] c2 = code[1] c3 = code[2] c4 = code[3] x = input("Turn #4 : ") x1 = x[0] x2 = x[1] x3 = x[2] x4 = x[3] if x1==c1: a1=1 else: a1=0 if x2==c2: b1=1 else: b1=0 if x3==c3: c1=1 else: c1=0 if x4==c4: d1=1 else: d1=0 p = a1+b1+c1+d1 if x1 in code: a2=1 else: a2=0 if x2 in code: b2=1 else: b2=0 if x3 in code: c2=1 else: c2=0 if x4 in code: d2=1 else: d2=0 v=a2+b2+c2+d2 v= v-p x= 4-p-v code=str(code) if p!=4: print("Sorry! You just lost it.") print("The answer is"+" "+code) print("Please try again...") else: print("Congratulations! You won the game.") |
# 6330575021 (20.00) 405 (2021-02-12 23:22) P = 0 V = 0 X = 0 #1st a = input("Turn #1 : ").upper() if a != code : if a[0] in code : if a[0] == code[0]: P+=1 else : V+=1 else : X+=1 if a[1] in code : if a[1] == code[1]: P+=1 else : V+=1 else : X+=1 if a[2] in code : if a[2] == code[2]: P+=1 else : V+=1 else : X+=1 if a[3] in code : if a[3] == code[3]: P+=1 else : V+=1 else : X+=1 print(" ","P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) #2nd P = 0 V = 0 X = 0 a = input("Turn #2 : ").upper() if a != code : if a[0] in code : if a[0] == code[0]: P+=1 else : V+=1 else : X+=1 if a[1] in code : if a[1] == code[1]: P+=1 else : V+=1 else : X+=1 if a[2] in code : if a[2] == code[2]: P+=1 else : V+=1 else : X+=1 if a[3] in code : if a[3] == code[3]: P+=1 else : V+=1 else : X+=1 print(" ","P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) #3rd P = 0 V = 0 X = 0 a = input("Turn #3 : ").upper() if a != code : if a[0] in code : if a[0] == code[0]: P+=1 else : V+=1 else : X+=1 if a[1] in code : if a[1] == code[1]: P+=1 else : V+=1 else : X+=1 if a[2] in code : if a[2] == code[2]: P+=1 else : V+=1 else : X+=1 if a[3] in code : if a[3] == code[3]: P+=1 else : V+=1 else : X+=1 print(" ","P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) #4th P = 0 V = 0 X = 0 a = input("Turn #4 : ").upper() if a != code : if a[0] in code : if a[0] == code[0]: P+=1 else : V+=1 else : X+=1 if a[1] in code : if a[1] == code[1]: P+=1 else : V+=1 else : X+=1 if a[2] in code : if a[2] == code[2]: P+=1 else : V+=1 else : X+=1 if a[3] in code : if a[3] == code[3]: P+=1 else : V+=1 else : X+=1 print(" ","P="+str(P)+","+"V="+str(V)+","+"X="+str(X)) print("Sorry! You just lost it.") print("The answer is",code) print("Please try again"+"."*3) else : print(WINNING_MSG) else : print(WINNING_MSG) else : print(WINNING_MSG) else : print(WINNING_MSG) |
# 6330576621 (20.00) 406 (2021-02-13 21:51) x=input("Turn #1 : ") ;P=0;V=0;X=0 if x == code: print(WINNING_MSG) else: if x[0] == code[0]: P+=1 elif x[0] in code and x[0] != code[0]: V+=1 elif x[0] not in code: X+=1 else: P if x[1] == code[1]: P+=1 elif x[1] in code and x[1] != code[1]: V+=1 elif x[1] not in code: X+=1 else: P if x[2] == code[2]: P+=1 elif x[2] in code and x[2] != code[2]: V+=1 elif x[2] not in code: X+=1 else: P if x[3] == code[3]: P+=1 elif x[3] in code and x[3] != code[3]: V+=1 elif x[3] not in code: X+=1 else: P print(" "+"P"+"="+str(P)+","+"V"+"="+str(V)+","+"X"+"="+str(X)) x=input("Turn #2 : ") ;P=0;V=0;X=0 if x == code: print(WINNING_MSG) else: if x[0] == code[0]: P+=1 elif x[0] in code and x[0] != code[0]: V+=1 elif x[0] not in code: X+=1 else: P if x[1] == code[1]: P+=1 elif x[1] in code and x[1] != code[1]: V+=1 elif x[1] not in code: X+=1 else: P if x[2] == code[2]: P+=1 elif x[2] in code and x[2] != code[2]: V+=1 elif x[2] not in code: X+=1 else: P if x[3] == code[3]: P+=1 elif x[3] in code and x[3] != code[3]: V+=1 elif x[3] not in code: X+=1 else: P print(" "+"P"+"="+str(P)+","+"V"+"="+str(V)+","+"X"+"="+str(X)) x=input("Turn #3 : ") ;P=0;V=0;X=0 if x == code: print(WINNING_MSG) else: if x[0] == code[0]: P+=1 elif x[0] in code and x[0] != code[0]: V+=1 elif x[0] not in code: X+=1 else: P if x[1] == code[1]: P+=1 elif x[1] in code and x[1] != code[1]: V+=1 elif x[1] not in code: X+=1 else: P if x[2] == code[2]: P+=1 elif x[2] in code and x[2] != code[2]: V+=1 elif x[2] not in code: X+=1 else: P if x[3] == code[3]: P+=1 elif x[3] in code and x[3] != code[3]: V+=1 elif x[3] not in code: X+=1 else: P print(" "+"P"+"="+str(P)+","+"V"+"="+str(V)+","+"X"+"="+str(X)) x=input("Turn #4 : ") ;P=0;V=0;X=0 if x == code: print(WINNING_MSG) else: if x[0] == code[0]: P+=1 elif x[0] in code and x[0] != code[0]: V+=1 elif x[0] not in code: X+=1 else: P if x[1] == code[1]: P+=1 elif x[1] in code and x[1] != code[1]: V+=1 elif x[1] not in code: X+=1 else: P if x[2] == code[2]: P+=1 elif x[2] in code and x[2] != code[2]: V+=1 elif x[2] not in code: X+=1 else: P if x[3] == code[3]: P+=1 elif x[3] in code and x[3] != code[3]: V+=1 elif x[3] not in code: X+=1 else: P print(" "+"P"+"="+str(P)+","+"V"+"="+str(V)+","+"X"+"="+str(X)) print(LOSING_MSG) print("The answer is "+code) print("Please try again...") |
# 6330577221 (20.00) 407 (2021-02-15 00:03) P=0 V=0 X=0 ans1=' ' ans2=' ' ans3=' ' ans4=' ' ans1=input('Turn #1 : ') if ans1 == code: print(WINNING_MSG) if ans1[0]==code[0]: P+=1 if ans1[1]==code[1]: P+=1 if ans1[2]==code[2]: P+=1 if ans1[3]==code[3]: P+=1 if ans1[0] in code and ans1[0]!=code[0]: V+=1 if ans1[1] in code and ans1[1]!=code[1]: V+=1 if ans1[2] in code and ans1[2]!=code[2]: V+=1 if ans1[3] in code and ans1[3]!=code[3]: V+=1 if ans1[0] not in code: X+=1 if ans1[1] not in code: X+=1 if ans1[2] not in code: X+=1 if ans1[3] not in code: X+=1 if ans1 != code: print(' P='+str(P)+',V='+str(V)+',X='+str(X)) P=0 V=0 X=0 ans2=input('Turn #2 : ') if ans2 == code: print(WINNING_MSG) if ans2[0]==code[0]: P+=1 if ans2[1]==code[1]: P+=1 if ans2[2]==code[2]: P+=1 if ans2[3]==code[3]: P+=1 if ans2[0] in code and ans2[0]!=code[0]: V+=1 if ans2[1] in code and ans2[1]!=code[1]: V+=1 if ans2[2] in code and ans2[2]!=code[2]: V+=1 if ans2[3] in code and ans2[3]!=code[3]: V+=1 if ans2[0] not in code: X+=1 if ans2[1] not in code: X+=1 if ans2[2] not in code: X+=1 if ans2[3] not in code: X+=1 if ans1!=code and ans2!=code: print(' P='+str(P)+',V='+str(V)+',X='+str(X)) P=0 V=0 X=0 ans3=input('Turn #3 : ') if ans3 == code: print(WINNING_MSG) if ans3[0]==code[0]: P+=1 if ans3[1]==code[1]: P+=1 if ans3[2]==code[2]: P+=1 if ans3[3]==code[3]: P+=1 if ans3[0] in code and ans3[0]!=code[0]: V+=1 if ans3[1] in code and ans3[1]!=code[1]: V+=1 if ans3[2] in code and ans3[2]!=code[2]: V+=1 if ans3[3] in code and ans3[3]!=code[3]: V+=1 if ans3[0] not in code: X+=1 if ans3[1] not in code: X+=1 if ans3[2] not in code: X+=1 if ans3[3] not in code: X+=1 if ans1!=code and ans2!=code and ans3!=code: print(' P='+str(P)+',V='+str(V)+',X='+str(X)) P=0 V=0 X=0 ans4=input('Turn #4 : ') if ans4 == code: print(WINNING_MSG) if ans4[0]==code[0]: P+=1 if ans4[1]==code[1]: P+=1 if ans4[2]==code[2]: P+=1 if ans4[3]==code[3]: P+=1 if ans4[0] in code and ans4[0]!=code[0]: V+=1 if ans4[1] in code and ans4[1]!=code[1]: V+=1 if ans4[2] in code and ans4[2]!=code[2]: V+=1 if ans4[3] in code and ans4[3]!=code[3]: V+=1 if ans4[0] not in code: X+=1 if ans4[1] not in code: X+=1 if ans4[2] not in code: X+=1 if ans4[3] not in code: X+=1 if ans1!=code and ans2!=code and ans3!=code and ans4!=code: print(' P='+str(P)+',V='+str(V)+',X='+str(X)) print(LOSING_MSG) print('The answer is '+code) print('Please try again...') |
# 6330578921 (17.37) 408 (2021-02-11 22:29) #print(code) i = 1 v,p,m =0,0,"0" while i <= 4 : while len(m) !=4 : m = input("Turn #"+str(i)+" : ") if m == code : print(WINNING_MSG) break elif i != 4: v = code.count(m[0]) + code.count(m[1]) + code.count(m[2]) + code.count(m[3]) if code[0] == m[0]: p+=1 if code[1] == m[1]: p+=1 if code[2] == m[2]: p+=1 if code[3] == m[3]: p+=1 i+=1 print(" "*10+"P="+str(p)+","+"V="+str(v-p)+","+"X="+str(4-v)) v,p,m =0,0,"0" elif i == 4: print(LOSING_MSG) print("The answer is",code) print("Please try again...") break |
# 6330579521 (19.11) 409 (2021-02-13 18:29) #calculate pvx def guess_letter(guess,code): p,v,x=0,0,0 if guess[0] in code: if guess[0]==code[0]: p+=1 else: v+=1 else: x+=1 if guess[1] in code: if guess[1]== code[1]: p+=1 else: v+=1 else: x+=1 if guess[2] in code: if guess[2]== code[2]: p+=1 else: v+=1 else: x+=1 if guess[3] in code: if guess[3]== code[3]: p+=1 else: v+=1 else: x+=1 return str(p),str(v),str(x) def congrat(): print('Congratulations! You won the game.') guess=input('Turn #1 : ') P,V,X= guess_letter(guess,code) print(' '*10+'P='+P+','+'V='+V+','+'X='+X) if P!='4': guess=input('Turn #2 : ') P,V,X= guess_letter(guess,code) print(' '*10+'P='+P+','+'V='+V+','+'X='+X) if P!='4': guess= input('Turn #3 : ') P,V,X= guess_letter(guess,code) print(' '*10+'P='+P+','+'V='+V+','+'X='+X) if P!='4': guess= input('Turn #4 : ') P,V,X= guess_letter(guess,code) print(' '*10+'P='+P+','+'V='+V+','+'X='+X) if P!='4': print('Sorry! You just lost it.') print('The answer is',code) print('Please try again...') else: congrat() else : congrat() else : congrat() else : congrat() |
# 6330580021 (17.11) 410 (2021-02-12 00:07) a=str(input()) #p if a[0]==list(code)[0]: p1=len(a[0]) else: p1=0 if a[1]==list(code)[1]: p2=len(a[1]) else: p2=0 if a[2]==list(code)[2]: p3=len(a[2]) else: p3=0 if a[3]==list(code)[3]: p4=len(a[3]) else: p4=0 p=p1+p2+p3+p4 #v if a[0] in code: v1=len(a[0]) else: v1=0 if a[1] in code: v2=len(a[1]) else: v2=0 if a[2] in code: v3=len(a[2]) else: v3=0 if a[3] in code: v4=len(a[3]) else: v4=0 v=v1+v2+v3+v4 #x if a[0] in code: x1=0 else: x1=len(a[0]) if a[1] in code: x2=0 else: x2=len(a[1]) if a[2] in code: x3=0 else: x3=len(a[2]) if a[3] in code: x4=0 else: x4=len(a[3]) x=x1+x2+x3+x4 # if a==code: print("Turn #1 :"+" "+a) print('Congratulation! You won the game.') else: print("Turn #1 :"+" "+a) print(" "+"P="+str(p)+","+"V="+str(v-p)+","+"X="+str(x)) ##------------------------------------------------------------------------ a=str(input()) #p if a[0]==list(code)[0]: p1=len(a[0]) else: p1=0 if a[1]==list(code)[1]: p2=len(a[1]) else: p2=0 if a[2]==list(code)[2]: p3=len(a[2]) else: p3=0 if a[3]==list(code)[3]: p4=len(a[3]) else: p4=0 p=p1+p2+p3+p4 #v if a[0] in code: v1=len(a[0]) else: v1=0 if a[1] in code: v2=len(a[1]) else: v2=0 if a[2] in code: v3=len(a[2]) else: v3=0 if a[3] in code: v4=len(a[3]) else: v4=0 v=v1+v2+v3+v4 #x if a[0] in code: x1=0 else: x1=len(a[0]) if a[1] in code: x2=0 else: x2=len(a[1]) if a[2] in code: x3=0 else: x3=len(a[2]) if a[3] in code: x4=0 else: x4=len(a[3]) x=x1+x2+x3+x4 # if a==code: print("Turn #2 :"+" "+a) print('Congratulation! You won the game.') else: print("Turn #2 :"+" "+a) print(" "+"P="+str(p)+","+"V="+str(v-p)+","+"X="+str(x)) ##------------------------------------------------------------------------ a=str(input()) #p if a[0]==list(code)[0]: p1=len(a[0]) else: p1=0 if a[1]==list(code)[1]: p2=len(a[1]) else: p2=0 if a[2]==list(code)[2]: p3=len(a[2]) else: p3=0 if a[3]==list(code)[3]: p4=len(a[3]) else: p4=0 p=p1+p2+p3+p4 #v if a[0] in code: v1=len(a[0]) else: v1=0 if a[1] in code: v2=len(a[1]) else: v2=0 if a[2] in code: v3=len(a[2]) else: v3=0 if a[3] in code: v4=len(a[3]) else: v4=0 v=v1+v2+v3+v4 #x if a[0] in code: x1=0 else: x1=len(a[0]) if a[1] in code: x2=0 else: x2=len(a[1]) if a[2] in code: x3=0 else: x3=len(a[2]) if a[3] in code: x4=0 else: x4=len(a[3]) x=x1+x2+x3+x4 # if a==code: print("Turn #3 :"+" "+a) print('Congratulation! You won the game.') else: print("Turn #3 :"+" "+a) print(" "+"P="+str(p)+","+"V="+str(v-p)+","+"X="+str(x)) ##------------------------------------------------------------------------ a=str(input()) #p if a[0]==list(code)[0]: p1=len(a[0]) else: p1=0 if a[1]==list(code)[1]: p2=len(a[1]) else: p2=0 if a[2]==list(code)[2]: p3=len(a[2]) else: p3=0 if a[3]==list(code)[3]: p4=len(a[3]) else: p4=0 p=p1+p2+p3+p4 #v if a[0] in code: v1=len(a[0]) else: v1=0 if a[1] in code: v2=len(a[1]) else: v2=0 if a[2] in code: v3=len(a[2]) else: v3=0 if a[3] in code: v4=len(a[3]) else: v4=0 v=v1+v2+v3+v4 # if a[0] in code: x1=0 else: x1=len(a[0]) if a[1] in code: x2=0 else: x2=len(a[1]) if a[2] in code: x3=0 else: x3=len(a[2]) if a[3] in code: x4=0 else: x4=len(a[3]) x=x1+x2+x3+x4 # if a==code: print("Turn #4 :"+" "+a) print('Congratulation! You won the game.') else: print("Turn #4 :"+" "+a) print(" "+"P="+str(p),",","V=",str(v-p),",","X=",str(x)) print("Sorry! You just lost it.") print("The answer is ",str(code)) print("Plaese try again...") |
# 6330583021 (20.00) 411 (2021-02-12 16:16) j = input('Turn #1 :'+" ") if j[0]==code[0] or j[1]==code[1] or j[2]==code[2] or j[3]==code[3]: P=1 if (j[0]==code[0] and j[1]==code[1]) or (j[0]==code[0] and j[2]==code[2]) or (j[0]==code[0] and j[3]==code[3]) or (j[1]==code[1] and j[2]==code[2])\ or (j[1]==code[1] and j[3]==code[3]) or (j[2]==code[2] and j[3]==code[3]): P=2 if (j[0]==code[0] and j[1]==code[1] and j[2]==code[2]) or (j[0]==code[0] and j[1]==code[1] and j[3]==code[3])\ or(j[0]==code[0] and j[2]==code[2] and j[3]==code[3]) or (j[1]==code[1] and j[2]==code[2] and j[3]==code[3]): P=3 if j[0]==code[0] and j[1]==code[1] and j[2]==code[2] and j[3]==code[3]: P=4 if j[0]!=code[0] and j[1]!=code[1] and j[2]!=code[2] and j[3]!=code[3]: P=0 if (j[0] in code) or (j[1] in code) or (j[2] in code) or (j[3] in code): V=1 if (j[0] in code and j[1] in code) or (j[0] in code and j[2] in code) or (j[0] in code and j[3] in code) or (j[1] in code and j[2] in code)\ or (j[1] in code and j[3] in code) or (j[2] in code and j[3] in code): V=2 if (j[0] in code and j[1] in code and j[2] in code) or (j[0] in code and j[1] in code and j[3] in code)\ or(j[0] in code and j[2] in code and j[3] in code) or (j[1] in code and j[2] in code and j[3] in code): V=3 if (j[0] in code) and (j[1] in code) and (j[2] in code) and (j[3] in code): V=4 if P!=4: print(" "+'P='+str(P)+","+'V='+str(V-P)+","+'X='+str(4-V)) if P==4: print("Congratulations! You won the game.") else : j = input('Turn #2 :'+" ") if j[0]==code[0] or j[1]==code[1] or j[2]==code[2] or j[3]==code[3]: P=1 if (j[0]==code[0] and j[1]==code[1]) or (j[0]==code[0] and j[2]==code[2]) or (j[0]==code[0] and j[3]==code[3]) or (j[1]==code[1] and j[2]==code[2])\ or (j[1]==code[1] and j[3]==code[3]) or (j[2]==code[2] and j[3]==code[3]): P=2 if (j[0]==code[0] and j[1]==code[1] and j[2]==code[2]) or (j[0]==code[0] and j[1]==code[1] and j[3]==code[3])\ or(j[0]==code[0] and j[2]==code[2] and j[3]==code[3]) or (j[1]==code[1] and j[2]==code[2] and j[3]==code[3]): P=3 if j[0]==code[0] and j[1]==code[1] and j[2]==code[2] and j[3]==code[3]: P=4 if j[0]!=code[0] and j[1]!=code[1] and j[2]!=code[2] and j[3]!=code[3]: P=0 if (j[0] in code) or (j[1] in code) or (j[2] in code) or (j[3] in code): V=1 if (j[0] in code and j[1] in code) or (j[0] in code and j[2] in code) or (j[0] in code and j[3] in code) or (j[1] in code and j[2] in code)\ or (j[1] in code and j[3] in code) or (j[2] in code and j[3] in code): V=2 if (j[0] in code and j[1] in code and j[2] in code) or (j[0] in code and j[1] in code and j[3] in code)\ or(j[0] in code and j[2] in code and j[3] in code) or (j[1] in code and j[2] in code and j[3] in code): V=3 if (j[0] in code) and (j[1] in code) and (j[2] in code) and (j[3] in code): V=4 if P!=4: print(" "+'P='+str(P)+","+'V='+str(V-P)+","+'X='+str(4-V)) if P==4: print("Congratulations! You won the game.") else : j = input('Turn #3 :'+" ") if j[0]==code[0] or j[1]==code[1] or j[2]==code[2] or j[3]==code[3]: P=1 if (j[0]==code[0] and j[1]==code[1]) or (j[0]==code[0] and j[2]==code[2]) or (j[0]==code[0] and j[3]==code[3]) or (j[1]==code[1] and j[2]==code[2])\ or (j[1]==code[1] and j[3]==code[3]) or (j[2]==code[2] and j[3]==code[3]): P=2 if (j[0]==code[0] and j[1]==code[1] and j[2]==code[2]) or (j[0]==code[0] and j[1]==code[1] and j[3]==code[3])\ or(j[0]==code[0] and j[2]==code[2] and j[3]==code[3]) or (j[1]==code[1] and j[2]==code[2] and j[3]==code[3]): P=3 if j[0]==code[0] and j[1]==code[1] and j[2]==code[2] and j[3]==code[3]: P=4 if j[0]!=code[0] and j[1]!=code[1] and j[2]!=code[2] and j[3]!=code[3]: P=0 if (j[0] in code) or (j[1] in code) or (j[2] in code) or (j[3] in code): V=1 if (j[0] in code and j[1] in code) or (j[0] in code and j[2] in code) or (j[0] in code and j[3] in code) or (j[1] in code and j[2] in code)\ or (j[1] in code and j[3] in code) or (j[2] in code and j[3] in code): V=2 if (j[0] in code and j[1] in code and j[2] in code) or (j[0] in code and j[1] in code and j[3] in code)\ or(j[0] in code and j[2] in code and j[3] in code) or (j[1] in code and j[2] in code and j[3] in code): V=3 if (j[0] in code) and (j[1] in code) and (j[2] in code) and (j[3] in code): V=4 if P!=4: print(" "+'P='+str(P)+","+'V='+str(V-P)+","+'X='+str(4-V)) if P==4: print("Congratulations! You won the game.") else : j = input('Turn #4 :'+" ") if j[0]==code[0] or j[1]==code[1] or j[2]==code[2] or j[3]==code[3]: P=1 if (j[0]==code[0] and j[1]==code[1]) or (j[0]==code[0] and j[2]==code[2]) or (j[0]==code[0] and j[3]==code[3]) or (j[1]==code[1] and j[2]==code[2])\ or (j[1]==code[1] and j[3]==code[3]) or (j[2]==code[2] and j[3]==code[3]): P=2 if (j[0]==code[0] and j[1]==code[1] and j[2]==code[2]) or (j[0]==code[0] and j[1]==code[1] and j[3]==code[3])\ or(j[0]==code[0] and j[2]==code[2] and j[3]==code[3]) or (j[1]==code[1] and j[2]==code[2] and j[3]==code[3]): P=3 if j[0]==code[0] and j[1]==code[1] and j[2]==code[2] and j[3]==code[3]: P=4 if j[0]!=code[0] and j[1]!=code[1] and j[2]!=code[2] and j[3]!=code[3]: P=0 if (j[0] in code) or (j[1] in code) or (j[2] in code) or (j[3] in code): V=1 if (j[0] in code and j[1] in code) or (j[0] in code and j[2] in code) or (j[0] in code and j[3] in code) or (j[1] in code and j[2] in code)\ or (j[1] in code and j[3] in code) or (j[2] in code and j[3] in code): V=2 if (j[0] in code and j[1] in code and j[2] in code) or (j[0] in code and j[1] in code and j[3] in code)\ or(j[0] in code and j[2] in code and j[3] in code) or (j[1] in code and j[2] in code and j[3] in code): V=3 if (j[0] in code) and (j[1] in code) and (j[2] in code) and (j[3] in code): V=4 if P!=4: print(" "+'P='+str(P)+","+'V='+str(V-P)+","+'X='+str(4-V)) print("Sorry! You just lost it.") print('The answer is '+code) print('Please try again...') if P==4: print("Congratulations! You won the game.") |
# 6330585221 (20.00) 412 (2021-02-11 21:19) ############################### 1 ######################################### player = input('Turn #1 : ') #----------P--------------------------# P = 0 if player[0] == code[0]: P+=1 if player[1] == code[1]: P+=1 if player[2] == code[2]: P+=1 if player[3] == code[3]: P+=1 #----------V----------------------------# V = 0 if P == 1: V = -1 if P == 2: V = -2 if P == 3: V = -3 if P == 4: V = -4 if player[0] in code: V+=1 if player[1] in code: V+=1 if player[2] in code: V+=1 if player[3] in code: V+=1 #-----------------X---------------------# X = 0 if player[0] not in code: X+=1 if player[1] not in code: X+=1 if player[2] not in code: X+=1 if player[3] not in code: X+=1 if P == 4: print(WINNING_MSG) else: print(' '+'P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) ###################### 2 ###################### if P != 4: player = input('Turn #2 : ') #-------------------P--------------------------# P = 0 if player[0] == code[0]: P+=1 if player[1] == code[1]: P+=1 if player[2] == code[2]: P+=1 if player[3] == code[3]: P+=1 #------------------V----------------------------# V = 0 if P == 1: V = -1 if P == 2: V = -2 if P == 3: V = -3 if P == 4: V = -4 if player[0] in code: V+=1 if player[1] in code: V+=1 if player[2] in code: V+=1 if player[3] in code: V+=1 #---------------------X-------------------------# X = 0 if player[0] not in code: X+=1 if player[1] not in code: X+=1 if player[2] not in code: X+=1 if player[3] not in code: X+=1 if P == 4: print(WINNING_MSG) else: print(' '+'P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) ######################### 3 ################################ if P != 4: player = input('Turn #3 : ') #----------P--------------------------# P = 0 if player[0] == code[0]: P+=1 if player[1] == code[1]: P+=1 if player[2] == code[2]: P+=1 if player[3] == code[3]: P+=1 #---------------------V----------------------------# V = 0 if P == 1: V = -1 if P == 2: V = -2 if P == 3: V = -3 if P == 4: V = -4 if player[0] in code: V+=1 if player[1] in code: V+=1 if player[2] in code: V+=1 if player[3] in code: V+=1 #-----------------------X-------------------------# X = 0 if player[0] not in code: X+=1 if player[1] not in code: X+=1 if player[2] not in code: X+=1 if player[3] not in code: X+=1 if P == 4: print(WINNING_MSG) else: print(' '+'P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) ################################# 4 ###################### if P != 4: player = input('Turn #4 : ') #----------P--------------------------# P = 0 if player[0] == code[0]: P+=1 if player[1] == code[1]: P+=1 if player[2] == code[2]: P+=1 if player[3] == code[3]: P+=1 #------------------V----------------------------# V = 0 if P == 1: V = -1 if P == 2: V = -2 if P == 3: V = -3 if P == 4: V = -4 if player[0] in code: V+=1 if player[1] in code: V+=1 if player[2] in code: V+=1 if player[3] in code: V+=1 #-----------------X------------------# X = 0 if player[0] not in code: X+=1 if player[1] not in code: X+=1 if player[2] not in code: X+=1 if player[3] not in code: X+=1 if P == 4: print(WINNING_MSG) else: print(' '+'P='+str(P)+','+'V='+str(V)+','+'X='+str(X)) #----------------------------------------------------------------------------------------------- if P != 4: print(LOSING_MSG) print('The answer is '+code) print('Please try again...') |
# 6330586921 (3.01) 413 (2021-02-14 19:39) think = input("Turn #1 : ") count_A = 0 count_O = 0 count_X = 0 if think[0] in code[0]: count_A = count_A + 1 elif think[0] in code: count_O = count_O + 1 else: count_A = count_A + 1 if think[1] in code[1]: count_A = count_A + 1 elif think[1] in code: count_O = count_O + 1 else: count_X = count_X + 1 if think[2] in code[2]: count_A = count_A + 1 elif think[2] in code: count_O = count_O + 1 else: count_X = count_X + 1 if think[3] in code[3]: count_A = count_A + 1 elif think[3] in code: count_O = count_O + 1 else: count_X = count_X + 1 if count_A != 4: print(" "*10 + "P=" + str(count_A) + "," + "V=" + str(count_O) + "," + "X=" + str(count_X)) think = input("Turn #2 : ") count_A = 0 count_O = 0 count_X = 0 if think[0] in code[0]: count_A = count_A + 1 elif think[0] in code: count_O = count_O + 1 else: count_X = count_X + 1 if think[1] in code[1]: count_A = count_A + 1 elif think[1] in code: count_O = count_O + 1 else: count_X = count_X + 1 if think[2] in code[2]: count_A = count_A + 1 elif think[2] in code: count_O = count_O + 1 else: count_X = count_X + 1 if think[3] in code[3]: count_A = count_A + 1 elif think[3] in code: count_O = count_O + 1 else: count_X = count_X + 1 if count_P != 4: print(" "*10 + "P=" + str(count_A) + "," + "V=" + str(count_O) + "," + "X=" + str(count_X)) think = input("Turn #3 : ") count_A = 0 count_O = 0 count_X = 0 if think[0] in code[0]: count_A = count_A + 1 elif think[0] in code: count_O = count_O + 1 else: count_X = count_X + 1 if think[1] in code[1]: count_A = count_A + 1 elif think[1] in code: count_O = count_O + 1 else: count_X = count_X + 1 if think[2] in code[2]: count_A = count_A + 1 elif think[2] in code: count_O = count_O + 1 else: count_X = count_X + 1 if think[3] in code[3]: count_A = count_A + 1 elif think[3] in code: count_O = count_O + 1 else: count_X = count_X + 1 if count_P != 4: print(" "*10 + "P=" + str(count_A) + "," + "V=" + str(count_O) + "," + "X=" + str(count_X)) think = input("Turn #4 : ") count_A = 0 count_O = 0 count_X = 0 if think[0] in code[0]: count_A = count_A + 1 elif think[0] in code: count_O = count_O + 1 else: count_X = count_X + 1 if think[1] in code[1]: count_A = count_A + 1 elif think[1] in code: count_O = count_O + 1 else: count_X = count_X + 1 if think[2] in code[2]: count_A = count_A + 1 elif think[2] in code: count_O = count_O + 1 else: count_X = count_X + 1 if think[3] in code[3]: count_A = count_A + 1 elif think[3] in code: count_O = count_O + 1 else: count_X = count_X + 1 if count_A == 4: print(WINNING_MSG) else: print(" "*10 + "P=" + str(count_A) + "," + "V=" + str(count_O) + "," + "X=" + str(count_X)) print(LOSING_MSG) print("The answer is" ,code) print("Please try again...") |
# 6330587521 (20.00) 414 (2021-02-15 23:35) g=input('Turn #1 : ').upper() p=0;v=0 if g==code: print(WINNING_MSG) else: if g[0]==code[0]: p+=1 elif g[0] in code: v+=1 if g[1]==code[1]: p+=1 elif g[1] in code: v+=1 if g[2]==code[2]: p+=1 elif g[2] in code: v+=1 if g[3]==code[3]: p+=1 elif g[3] in code: v+=1 print(' '*9,'P='+str(p)+',V='+str(v)+',X='+str(4-p-v)) g=input('Turn #2 : ').upper() p=0;v=0 if g==code: print(WINNING_MSG) else: if g[0]==code[0]: p+=1 elif g[0] in code: v+=1 if g[1]==code[1]: p+=1 elif g[1] in code: v+=1 if g[2]==code[2]: p+=1 elif g[2] in code: v+=1 if g[3]==code[3]: p+=1 elif g[3] in code: v+=1 print(' '*9,'P='+str(p)+',V='+str(v)+',X='+str(4-p-v)) g=input('Turn #3 : ').upper() p=0;v=0 if g==code: print(WINNING_MSG) else: if g[0]==code[0]: p+=1 elif g[0] in code: v+=1 if g[1]==code[1]: p+=1 elif g[1] in code: v+=1 if g[2]==code[2]: p+=1 elif g[2] in code: v+=1 if g[3]==code[3]: p+=1 elif g[3] in code: v+=1 print(' '*9,'P='+str(p)+',V='+str(v)+',X='+str(4-p-v)) g=input('Turn #4 : ').upper() p=0;v=0 if g==code: print(WINNING_MSG) else: if g[0]==code[0]: p+=1 elif g[0] in code: v+=1 if g[1]==code[1]: p+=1 elif g[1] in code: v+=1 if g[2]==code[2]: p+=1 elif g[2] in code: v+=1 if g[3]==code[3]: p+=1 elif g[3] in code: v+=1 print(' '*9,'P='+str(p)+',V='+str(v)+',X='+str(4-p-v)) print(LOSING_MSG) print('The answer is',code) print('Please try again...') |
# 6330588121 (20.00) 415 (2021-02-13 00:35) cl=list(code) in1=input('Turn #1 : ') li=list(in1) p=0;v=0;x=0 if li[0]==cl[0]: p=p+1 if li[1]==cl[1]: p=p+1 if li[2]==cl[2]: p=p+1 if li[3]==cl[3]: p=p+1 if li[0] in cl and li[0]!=cl[0]: v=v+1 if li[1] in cl and li[1]!=cl[1]: v=v+1 if li[2] in cl and li[2]!=cl[2]: v=v+1 if li[3] in cl and li[3]!=cl[3]: v=v+1 if li[0] not in cl: x=x+1 if li[1] not in cl: x=x+1 if li[2] not in cl: x=x+1 if li[3] not in cl: x=x+1 if p==4: print("Congratulations! You won the game.") else: print(' '*10 + 'P='+str(p)+',' + 'V='+str(v)+',' + 'X='+str(x)) in2=input('Turn #2 : ') p=0;v=0;x=0 li=list(in2) if li[0]==cl[0]: p=p+1 if li[1]==cl[1]: p=p+1 if li[2]==cl[2]: p=p+1 if li[3]==cl[3]: p=p+1 if li[0] in cl and li[0]!=cl[0]: v=v+1 if li[1] in cl and li[1]!=cl[1]: v=v+1 if li[2] in cl and li[2]!=cl[2]: v=v+1 if li[3] in cl and li[3]!=cl[3]: v=v+1 if li[0] not in cl: x=x+1 if li[1] not in cl: x=x+1 if li[2] not in cl: x=x+1 if li[3] not in cl: x=x+1 if p==4: print("Congratulations! You won the game.") else: print(' '*10 + 'P='+str(p)+',' + 'V='+str(v)+',' + 'X='+str(x)) in3=input('Turn #3 : ') p=0;v=0;x=0 li=list(in3) if li[0]==cl[0]: p=p+1 if li[1]==cl[1]: p=p+1 if li[2]==cl[2]: p=p+1 if li[3]==cl[3]: p=p+1 if li[0] in cl and li[0]!=cl[0]: v=v+1 if li[1] in cl and li[1]!=cl[1]: v=v+1 if li[2] in cl and li[2]!=cl[2]: v=v+1 if li[3] in cl and li[3]!=cl[3]: v=v+1 if li[0] not in cl: x=x+1 if li[1] not in cl: x=x+1 if li[2] not in cl: x=x+1 if li[3] not in cl: x=x+1 if p==4: print("Congratulations! You won the game.") else: print(' '*10 + 'P='+str(p)+',' + 'V='+str(v)+',' + 'X='+str(x)) in4=input('Turn #4 : ') p=0;v=0;x=0 li=list(in4) if li[0]==cl[0]: p=p+1 if li[1]==cl[1]: p=p+1 if li[2]==cl[2]: p=p+1 if li[3]==cl[3]: p=p+1 if li[0] in cl and li[0]!=cl[0]: v=v+1 if li[1] in cl and li[1]!=cl[1]: v=v+1 if li[2] in cl and li[2]!=cl[2]: v=v+1 if li[3] in cl and li[3]!=cl[3]: v=v+1 if li[0] not in cl: x=x+1 if li[1] not in cl: x=x+1 if li[2] not in cl: x=x+1 if li[3] not in cl: x=x+1 if p==4: print("Congratulations! You won the game.") else: print(' '*10 + 'P='+str(p)+',' + 'V='+str(v)+',' + 'X='+str(x)) print("Sorry! You just lost it.") print('The answer is '+code) print('Please try again...') |
# 6330589821 (19.93) 416 (2021-02-14 14:10) code=[code[0],code[1],code[2],code[3]] x1 = input('Turn #1 : ').upper() if x1[0] in code: n1 = 1 if x1[1] in code: n1=2 if x1[2] in code: n1=3 if x1[3] in code: n1=4 elif x1[3] in code: n1=3 elif x1[2] in code: n1=2 if x1[3] in code: n1=3 elif x1[3] in code: n1=2 elif x1[1] in code: n1=1 if x1[2] in code: n1=2 if x1[3] in code: n1=3 elif x1[3] in code: n1=2 elif x1[2] in code: n1=1 if x1[3] in code: n1=2 elif x1[3] in code: n1=1 else: n1=0 if x1[0] == code[0]: p1=1 if x1[1] == code[1]: p1=2 if x1[2] == code[2]: p1=3 if x1[3] == code[3]: p1=4 elif x1[3] == code[3]: p1=3 elif x1[2] == code[2]: p1=2 if x1[3] == code[3]: p1=3 elif x1[3] == code[3]: p1=2 elif x1[1] == code[1]: p1=1 if x1[2] == code[2]: p1=2 if x1[3] == code[3]: p1=3 elif x1[3] == code[3]: p1=2 elif x1[2] == code[2]: p1=1 if x1[3] == code[3]: p1=2 elif x1[3] == code[3]: p1=1 else: p1=0 if p1 == 4: print('Congratulation! You won the game.') else: print(' '+'P='+str(p1)+',V='+str(int(n1)-int(p1))+',X='+str(4-int(n1))) x2=input('Turn #2 : ').upper() if x2[0] in code: n2 = 1 if x2[1] in code: n2=2 if x2[2] in code: n2=3 if x2[3] in code: n2=4 elif x2[3] in code: n2=3 elif x2[2] in code: n2=2 if x2[3] in code: n2=3 elif x2[3] in code: n2=2 elif x2[1] in code: n2=1 if x2[2] in code: n2=2 if x2[3] in code: n2=3 elif x2[3] in code: n2=2 elif x2[2] in code: n2=1 if x2[3] in code: n2=2 elif x2[3] in code: n2=1 else: n2=0 if x2[0] == code[0]: p2=1 if x2[1] == code[1]: p2=2 if x2[2] == code[2]: p2=3 if x2[3] == code[3]: p2=4 elif x2[3] == code[3]: p2=3 elif x2[2] == code[2]: p2=2 if x2[3] == code[3]: p2=3 elif x2[3] == code[3]: p2=2 elif x2[1] == code[1]: p2=1 if x2[2] == code[2]: p2=2 if x2[3] == code[3]: p2=3 elif x2[3] == code[3]: p2=2 elif x2[2] == code[2]: p2=1 if x2[3] == code[3]: p2=2 elif x2[3] == code[3]: p2=1 else: p2=0 if p2 == 4: print('Congratulation! You won the game.') else: print(' '+'P='+str(p2)+',V='+str(int(n2)-int(p2))+',X='+str(4-int(n2))) x3=input('Turn #3 : ').upper() if x3[0] in code: n3 = 1 if x3[1] in code: n3=2 if x3[2] in code: n3=3 if x3[3] in code: n3=4 elif x3[3] in code: n3=3 elif x3[2] in code: n3=2 if x3[3] in code: n3=3 elif x3[3] in code: n3=2 elif x3[1] in code: n3=1 if x3[2] in code: n3=2 if x3[3] in code: n3=3 elif x3[3] in code: n3=2 elif x3[2] in code: n3=1 if x3[3] in code: n3=2 elif x3[3] in code: n3=1 else: n3=0 if x3[0] == code[0]: p3=1 if x3[1] == code[1]: p3=2 if x3[2] == code[2]: p3=3 if x3[3] == code[3]: p3=4 elif x3[3] == code[3]: p3=3 elif x3[2] == code[2]: p3=2 if x3[3] == code[3]: p3=3 elif x3[3] == code[3]: p3=2 elif x3[1] == code[1]: p3=1 if x3[2] == code[2]: p3=2 if x3[3] == code[3]: p3=3 elif x3[3] == code[3]: p3=2 elif x3[2] == code[2]: p3=1 if x3[3] == code[3]: p3=2 elif x3[3] == code[3]: p3=1 else: p3=0 if p3 == 4: print('Congratulation! You won the game.') else: print(' '+'P='+str(p3)+',V='+str(int(n3)-int(p3))+',X='+str(4-int(n3))) x4=input('Turn #4 : ').upper() if x4[0] in code: n4 = 1 if x4[1] in code: n4=2 if x4[2] in code: n4=3 if x4[3] in code: n4=4 elif x4[3] in code: n4=3 elif x4[2] in code: n4=2 if x4[3] in code: n4=3 elif x4[3] in code: n4=2 elif x4[1] in code: n4=1 if x4[2] in code: n4=2 if x4[3] in code: n4=3 elif x4[3] in code: n4=2 elif x4[2] in code: n4=1 if x4[3] in code: n4=2 elif x4[3] in code: n4=1 else: n4=0 if x4[0] == code[0]: p4=1 if x4[1] == code[1]: p4=2 if x4[2] == code[2]: p4=3 if x4[3] == code[3]: p4=4 elif x4[3] == code[3]: p4=3 elif x4[2] == code[2]: p4=2 if x4[3] == code[3]: p4=3 elif x4[3] == code[3]: p4=2 elif x4[1] == code[1]: p4=1 if x4[2] == code[2]: p4=2 if x4[3] == code[3]: p4=3 elif x4[3] == code[3]: p4=2 elif x4[2] == code[2]: p4=1 if x4[3] == code[3]: p4=2 elif x4[3] == code[3]: p4=1 else: p4=0 if p4 == 4: print('Congratulations! You won the game.') else: print(' '+'P='+str(p4)+',V='+str(int(n4)-int(p4))+',X='+str(4-int(n4))) print('Sorry! You just lost it.') print('The answer is'+' '+code[0]+code[1]+code[2]+code[3]) print('Please try again...') |
# 6330591021 (19.07) 417 (2021-02-12 14:29) a = input("Turn #1 : ") if a==code : print (WINNING_MSG) else : p=0 if (a[0]==code[0]) : p=p+1 if (a[1]==code[1]) : p=p+1 if (a[2]==code[2]) : p=p+1 if (a[3]==code[3]) : p=p+1 v=0-p if (a[0] in code) : v=v+1 if (a[1]!=a[0] and a[1] in code) : v=v+1 if (a[2]!=a[1] and a[2]!=a[0] and a[2] in code) : v=v+1 if (a[3]!=a[2] and a[3]!=a[1] and a[3]!=a[0] and a[3] in code) : v=v+1 x=4-(v+p) print (" P="+ str(p) +",V="+ str(v) +",x="+ str(x)) #--------------------------------------------------- a = input("Turn #2 : ") if a==code : print (WINNING_MSG) else : p=0 if (a[0]==code[0]) : p=p+1 if (a[1]==code[1]) : p=p+1 if (a[2]==code[2]) : p=p+1 if (a[3]==code[3]) : p=p+1 v=0-p if (a[0] in code) : v=v+1 if (a[1]!=a[0] and a[1] in code) : v=v+1 if (a[2]!=a[1] and a[2]!=a[0] and a[2] in code) : v=v+1 if (a[3]!=a[2] and a[3]!=a[1] and a[3]!=a[0] and a[3] in code) : v=v+1 x=4-(v+p) print (" P="+ str(p) +",V="+ str(v) +",x="+ str(x)) #--------------------------------------------------- a = input("Turn #3 : ") if a==code : print (WINNING_MSG) else : p=0 if (a[0]==code[0]) : p=p+1 if (a[1]==code[1]) : p=p+1 if (a[2]==code[2]) : p=p+1 if (a[3]==code[3]) : p=p+1 v=0-p if (a[0] in code) : v=v+1 if (a[1]!=a[0] and a[1] in code) : v=v+1 if (a[2]!=a[1] and a[2]!=a[0] and a[2] in code) : v=v+1 if (a[3]!=a[2] and a[3]!=a[1] and a[3]!=a[0] and a[3] in code) : v=v+1 x=4-(v+p) print (" P="+ str(p) +",V="+ str(v) +",x="+ str(x)) #--------------------------------------------------- a = input("Turn #4 : ") if a==code : print (WINNING_MSG) else : p=0 if (a[0]==code[0]) : p=p+1 if (a[1]==code[1]) : p=p+1 if (a[2]==code[2]) : p=p+1 if (a[3]==code[3]) : p=p+1 v=0-p if (a[0] in code) : v=v+1 if (a[1]!=a[0] and a[1] in code) : v=v+1 if (a[2]!=a[1] and a[2]!=a[0] and a[2] in code) : v=v+1 if (a[3]!=a[2] and a[3]!=a[1] and a[3]!=a[0] and a[3] in code) : v=v+1 x=4-(v+p) print (" P="+ str(p) +",V="+ str(v) +",x="+ str(x)) print (LOSING_MSG) print ("The answer is "+ code) print ("Please try again...") #--------------------------------------------------- #print ("code = "+ code) |
# 6330592621 (17.37) 418 (2021-02-13 14:36) x = input("Turn #1 : ") V = 0 P = 0 if x[0] in code : V += 1 if x[1] in code : V += 1 if x[2] in code : V += 1 if x[3] in code : V += 1 if x[:1] == code[:1] : P += 1 V -= 1 if x[1:2] == code[1:2] : P += 1 V -= 1 if x[2:3] == code[2:3] : P += 1 V -= 1 if x[3:] == code[3:] : P += 1 V -= 1 X = 4 - P - V if P == 4 : print("Congratulations! You won the game.") exit() print(" "+"P="+str(P)+",V="+str(V)+",X="+str(X)) x = input("Turn #2 : ") V = 0 P = 0 if x[0] in code : V += 1 if x[1] in code : V += 1 if x[2] in code : V += 1 if x[3] in code : V += 1 if x[:1] == code[:1] : P += 1 V -= 1 if x[1:2] == code[1:2] : P += 1 V -= 1 if x[2:3] == code[2:3] : P += 1 V -= 1 if x[3:] == code[3:] : P += 1 V -= 1 X = 4 - P - V if P == 4 : print("Congratulations! You won the game.") exit() print(" "+"P="+str(P)+",V="+str(V)+",X="+str(X)) x = input("Turn #3 : ") V = 0 P = 0 if x[0] in code : V += 1 if x[1] in code : V += 1 if x[2] in code : V += 1 if x[3] in code : V += 1 if x[:1] == code[:1] : P += 1 V -= 1 if x[1:2] == code[1:2] : P += 1 V -= 1 if x[2:3] == code[2:3] : P += 1 V -= 1 if x[3:] == code[3:] : P += 1 V -= 1 X = 4 - P - V if P == 4 : print("Congratulations! You won the game.") exit() print(" "+"P="+str(P)+",V="+str(V)+",X="+str(X)) x = input("Turn #4 : ") V = 0 P = 0 if x[0] in code : V += 1 if x[1] in code : V += 1 if x[2] in code : V += 1 if x[3] in code : V += 1 if x[:1] == code[:1] : P += 1 V -= 1 if x[1:2] == code[1:2] : P += 1 V -= 1 if x[2:3] == code[2:3] : P += 1 V -= 1 if x[3:] == code[3:] : P += 1 V -= 1 X = 4 - P - V if P == 4 : print("Congratulations! You won the game.") else : print("Sorry! You just lost it.") print("The answer is ",str(code)) print("""Please try again...""") |
# 6330593221 (20.00) 419 (2021-02-14 00:36) try_code_one = input("Turn #1 : ") p = 0 v = 0 if code[0] in try_code_one[0]: p += 1 v -= 1 if code[0] in try_code_one: v += 1 if code[1] in try_code_one[1]: p += 1 v -= 1 if code[1] in try_code_one: v += 1 if code[2] in try_code_one[2]: p += 1 v -= 1 if code[2] in try_code_one: v += 1 if code[3] in try_code_one[3]: p += 1 v -= 1 if code[3] in try_code_one: v += 1 x = 4 - p - v p = str(p) v = str(v) x = str(x) if p == "4": print(WINNING_MSG) else: print("\t\t P=" + p + ",V=" + v + ",X=" + x) try_code_one = input("Turn #2 : ") p = 0 v = 0 if code[0] in try_code_one[0]: p += 1 v -= 1 if code[0] in try_code_one: v += 1 if code[1] in try_code_one[1]: p += 1 v -= 1 if code[1] in try_code_one: v += 1 if code[2] in try_code_one[2]: p += 1 v -= 1 if code[2] in try_code_one: v += 1 if code[3] in try_code_one[3]: p += 1 v -= 1 if code[3] in try_code_one: v += 1 x = 4 - p - v p = str(p) v = str(v) x = str(x) if p == "4": print(WINNING_MSG) else: print("\t\t P=" + p + ",V=" + v + ",X=" + x) try_code_one = input("Turn #3 : ") p = 0 v = 0 if code[0] in try_code_one[0]: p += 1 v -= 1 if code[0] in try_code_one: v += 1 if code[1] in try_code_one[1]: p += 1 v -= 1 if code[1] in try_code_one: v += 1 if code[2] in try_code_one[2]: p += 1 v -= 1 if code[2] in try_code_one: v += 1 if code[3] in try_code_one[3]: p += 1 v -= 1 if code[3] in try_code_one: v += 1 x = 4 - p - v p = str(p) v = str(v) x = str(x) if p == "4": print(WINNING_MSG) else: print("\t\t P=" + p + ",V=" + v + ",X=" + x) try_code_one = input("Turn #4 : ") p = 0 v = 0 if code[0] in try_code_one[0]: p += 1 v -= 1 if code[0] in try_code_one: v += 1 if code[1] in try_code_one[1]: p += 1 v -= 1 if code[1] in try_code_one: v += 1 if code[2] in try_code_one[2]: p += 1 v -= 1 if code[2] in try_code_one: v += 1 if code[3] in try_code_one[3]: p += 1 v -= 1 if code[3] in try_code_one: v += 1 x = 4 - p - v p = str(p) v = str(v) x = str(x) if p == "4": print(WINNING_MSG) else: print("\t\t P=" + p + ",V=" + v + ",X=" + x) print(LOSING_MSG) print("The answer is "+code) print("Please try again...") |
# 6330594921 (20.00) 420 (2021-02-13 21:40) # --------------------------------------------------- c = code #print(c) p1 = 0 v1 = 0 x1 = 0 t1 = input("Turn #1 : ") if t1 == c: print(WINNING_MSG) else: if t1[0] == c[0] : p1 += 1 elif t1[0] == c[1]: v1 += 1 elif t1[0] == c[2]: v1 += 1 elif t1[0] == c[3]: v1 += 1 else: x1 +=1 if t1[1] == c[1] : p1+=1 elif t1[1] == c[0]: v1+=1 elif t1[1] == c[2]: v1 += 1 elif t1[1] == c[3]: v1 += 1 else: x1 += 1 if t1[2] == c[2] : p1+=1 elif t1[2] == c[0]: v1+=1 elif t1[2] == c[1]: v1 += 1 elif t1[2] == c[3]: v1 += 1 else: x1 += 1 if t1[3] == c[3] : p1+=1 elif t1[3] == c[0]: v1+=1 elif t1[3] == c[1]: v1 += 1 elif t1[3] == c[2]: v1 += 1 else: x1 += 1 print(" P=" + str(p1) + ",V=" + str(v1) + ",X=" + str(x1)) p2 = 0 v2 = 0 x2 = 0 t2 = input("Turn #2 : ") if t2 == c: print(WINNING_MSG) else: if t2[0] == c[0]: p2 += 1 elif t2[0] == c[1]: v2 += 1 elif t2[0] == c[2]: v2 += 1 elif t2[0] == c[3]: v2 += 1 else: x2 += 1 if t2[1] == c[1]: p2 += 1 elif t2[1] == c[0]: v2 += 1 elif t2[1] == c[2]: v2 += 1 elif t2[1] == c[3]: v2 += 1 else: x2 += 1 if t2[2] == c[2]: p2 += 1 elif t2[2] == c[0]: v2 += 1 elif t2[2] == c[1]: v2 += 1 elif t2[2] == c[3]: v2 += 1 else: x2 += 1 if t2[3] == c[3]: p2 += 1 elif t2[3] == c[0]: v2 += 1 elif t2[3] == c[1]: v2 += 1 elif t2[3] == c[2]: v2 += 1 else: x2 += 1 print(" P=" + str(p2) + ",V=" + str(v2) + ",X=" + str(x2)) p3 = 0 v3 = 0 x3 = 0 t3 = input("Turn #3 : ") if t3 == c: print(WINNING_MSG) else: if t3[0] == c[0]: p3 += 1 elif t3[0] == c[1]: v3 += 1 elif t3[0] == c[2]: v3 += 1 elif t3[0] == c[3]: v3 += 1 else: x3 += 1 if t3[1] == c[1]: p3 += 1 elif t3[1] == c[0]: v3 += 1 elif t3[1] == c[2]: v3 += 1 elif t3[1] == c[3]: v3 += 1 else: x3 += 1 if t3[2] == c[2]: p3 += 1 elif t3[2] == c[0]: v3 += 1 elif t3[2] == c[1]: v3 += 1 elif t3[2] == c[3]: v3 += 1 else: x3 += 1 if t3[3] == c[3]: p3 += 1 elif t3[3] == c[0]: v3 += 1 elif t3[3] == c[1]: v3 += 1 elif t3[3] == c[2]: v3 += 1 else: x3 += 1 print(" P=" + str(p3) + ",V=" + str(v3) + ",X=" + str(x3)) p4 = 0 v4 = 0 x4 = 0 t4 = input("Turn #4 : ") if t4 == c: print(WINNING_MSG) else: if t4[0] == c[0]: p4 += 1 elif t4[0] == c[1]: v4 += 1 elif t4[0] == c[2]: v4 += 1 elif t4[0] == c[3]: v4 += 1 else: x4 += 1 if t4[1] == c[1]: p4 += 1 elif t4[1] == c[0]: v4 += 1 elif t4[1] == c[2]: v4 += 1 elif t4[1] == c[3]: v4 += 1 else: x4 += 1 if t4[2] == c[2]: p4 += 1 elif t4[2] == c[0]: v4 += 1 elif t4[2] == c[1]: v4 += 1 elif t4[2] == c[3]: v4 += 1 else: x4 += 1 if t4[3] == c[3]: p4 += 1 elif t4[3] == c[0]: v4 += 1 elif t4[3] == c[1]: v4 += 1 elif t4[3] == c[2]: v4 += 1 else: x4 += 1 print(" P=" + str(p4) + ",V=" + str(v4) + ",X=" + str(x4)) print(LOSING_MSG) print("The answer is ", c) print("Please try again...") |
# 6331138621 (17.76) 421 (2021-02-15 22:15) v,p,x,y=0,0,4,0 r=1 mc = input('Turn #1 : ') if mc[0] in code and mc[0]==code[0] : p += 1 if mc[0] in code and mc[0]!=code[0] : v += 1 if mc[1] in code and mc[1]==code[1] : p += 1 if mc[1] in code and mc[1]!=code[1] : v += 1 if mc[2] in code and mc[2]==code[2] : p += 1 if mc[2] in code and mc[2]!=code[2] : v += 1 if mc[3] in code and mc[3]==code[3] : p += 1 if mc[3] in code and mc[3]!=code[3] : v += 1 if not((p==2 and v==2) or (p==4 and v==0)) : print('P='+str(p)+',V='+str(v)+',X='+str(x-p-v)) if ((p==2 and v==2) or (p==4 and v==0)) : y+=1 if y==1 : print('Congratulation! You won the game') elif x!= 0 : r+=1 v,p,x=0,0,4 mc = input('Turn #2 : ') if mc[0] in code and mc[0]==code[0] : p += 1 if mc[0] in code and mc[0]!=code[0] : v += 1 if mc[1] in code and mc[1]==code[1] : p += 1 if mc[1] in code and mc[1]!=code[1] : v += 1 if mc[2] in code and mc[2]==code[2] : p += 1 if mc[2] in code and mc[2]!=code[2] : v += 1 if mc[3] in code and mc[3]==code[3] : p += 1 if mc[3] in code and mc[3]!=code[3] : v += 1 if not((p==2 and v==2) or (p==4 and v==0)) : print('P='+str(p)+',V='+str(v)+',X='+str(x-p-v)) if ((p==2 and v==2) or (p==4 and v==0)) : y+=1 if y==1 : print('Congratulation! You won the game') elif x!= 0 : r+=1 v,p,x=0,0,4 mc = input('Turn #3 : ') if mc[0] in code and mc[0]==code[0] : p += 1 if mc[0] in code and mc[0]!=code[0] : v += 1 if mc[1] in code and mc[1]==code[1] : p += 1 if mc[1] in code and mc[1]!=code[1] : v += 1 if mc[2] in code and mc[2]==code[2] : p += 1 if mc[2] in code and mc[2]!=code[2] : v += 1 if mc[3] in code and mc[3]==code[3] : p += 1 if mc[3] in code and mc[3]!=code[3] : v += 1 if not((p==2 and v==2) or (p==4 and v==0)) : print('P='+str(p)+',V='+str(v)+',X='+str(x-p-v)) if ((p==2 and v==2) or (p==4 and v==0)) : y+=1 if y==1 : print('Congratulation! You won the game') elif (p!=2 and v!=2) or (p!=4 and v!=0) : r+=1 v,p,x=0,0,4 mc = input('Turn #4 : ') if mc[0] in code and mc[0]==code[0] : p += 1 if mc[0] in code and mc[0]!=code[0] : v += 1 if mc[1] in code and mc[1]==code[1] : p += 1 if mc[1] in code and mc[1]!=code[1] : v += 1 if mc[2] in code and mc[2]==code[2] : p += 1 if mc[2] in code and mc[2]!=code[2] : v += 1 if mc[3] in code and mc[3]==code[3] : p += 1 if mc[3] in code and mc[3]!=code[3] : v += 1 if not((p==2 and v==2) or (p==4 and v==0)) : print('P='+str(p)+',V='+str(v)+',X='+str(x-p-v)) if ((p==2 and v==2) or (p==4 and v==0)) : r-=1 y+=1 if y==1 : print('Congratulation! You won the game') r+=1 if (r==5) : print('Sorry! you just lost it.') print('The answer is ',code) print('Please try again...') |