Jun-21-2018, 10:21 PM
# Here is the problem (and the solution is supposedly hidden in the Python code!)
# Your friend has recommended that you go eat at this restaurant, insisting that they have amazing pasta. When you arrive, you realize that it's not # just amazing...it's arguably the best in the world.
# The problem? Well...it's so commonly requested that they've had to implement a security measure to prevent everyone from ordering it. Looks like
# this is going to be more complicated than you hoped. To actually eat the pasta, you're going to have to figure out what the secret password is.
# After several minutes, your server comes up to you. Your stomach growls. Better figure that password out quickly!
# Your friend has recommended that you go eat at this restaurant, insisting that they have amazing pasta. When you arrive, you realize that it's not # just amazing...it's arguably the best in the world.
# The problem? Well...it's so commonly requested that they've had to implement a security measure to prevent everyone from ordering it. Looks like
# this is going to be more complicated than you hoped. To actually eat the pasta, you're going to have to figure out what the secret password is.
# After several minutes, your server comes up to you. Your stomach growls. Better figure that password out quickly!
# Ravioli ravioli, what is the formuoli # Finalized 6/13/18 """ you may or may not need this http://www.ssec.wisc.edu/~tomw/java/unicode.html """ spaghetti = 0 warming = int(bin(4)[2:]) def roast(nut): try: herring = str(nut)[1] cracker = int(str(nut)[:2]) barrel = int(str(nut)[0]) for beef in range(barrel, cracker): nut -= cracker return nut == cracker except: herring = "red" return False def boil(fish): salmon = [0]*2 + [1] * (fish - 1) gill = 2 while gill ** 2 <= fish: if salmon[gill] == 1: for fin in range(2, fish//gill + 1): salmon[gill*fin] = 0 gill += 1 filet = 0 for cod in range(fish): if salmon[cod] == 1: filet += cod return roast(filet) def salt(crystal): #Spagetii 0 global warming, spaghetti spaghetti = 1 if (crystal/warming != crystal // warming) else crystal // warming def served(): global spaghetti,warming spaghetti = 0 print("The waiter asks, 'What's the secret code?'") while True: try: pasta = ord(input("You reply: ")) salt(pasta) print(salt) if boil(spaghetti): break else: print(salt) print("\nThe waiter is confused.") print("'I'm afraid that is not the correct code.'") print("You're incredibly hungry, but you don't want to miss out on the opportunity for some incredible pasta.") print("Fortunately, the waiter seems to be inviting you to try again, so...") except: print(salt) print("\nThe waiter frowns and shakes their head.") print("'Sorry, that's not a valid code. Try again.'") print("Whoops! After apologizing...") continue print("\nThe waiter smiles and nods.") print("'We'll have your pasta out right away!'") print("Nice! You can finally eat. While you're waiting though, you should probably input your solution into the field below.") if __name__ == '__main__': served()