#!/usr/bin/python Menuscreen = True while mainscreen: #Menu print ("Welcome to Enigma Encoder V1.0") print ("Made By Justin Chapman") print (" ") print ("Menu") print (" ") print ("1. Message") print (" ") print ("2. Options") print (" ") print ("3. Reset") print (" ") print ("4. Quit") print (" ") Menu = raw_input("Please chose an option 1,2, or 3") if Menu==3: #Reset Parameters Wheel1=0 Wheel2=0 Wheel3=0 print ("Options have been reset") elif Menu==4: print ("Good Bye!") mainscreen = False elif Menu==2: #Option Menu Optionsmenu = True while: Optionsmenu print "1. Wheel 1" print "2. Wheel 2" print "3. Wheel 3" print "4. Reflector" print "5. Plugboard" print "6. Back to Menu" OptionMenu = raw_input("please select a option") OptionMenu.lower() if OptionMenu == 1 or "one" or "wheel1" or "wheel 1" #Wheel select Wheel1select = True while: Wheel1select Wheel1 = raw_input("Please select the first wheel, from 1 to 8, or type back") if (Wheel1 > 0 and Wheel1 < 9) or "one" if Wheel1 == Wheel2 or Wheel1 == Wheel3 print "You cannot use the same wheel twice!" else print "Wheel 1 has been set to " + str(Wheel1) Wheel1select = False elif (Wheel1 == back) Wheel1select = False else print "This is not valid" #End of Wheelselect elif OptionMenu == 2 or "two" or "wheel2" or "wheel 2" #Wheel select Wheel2select = True while: Wheel2select Wheel2 = raw_input("Please select the Second wheel, from 1 to 8, or type back") if (Wheel2 > 0 and Wheel2 < 9) or "two" if Wheel2 == Wheel1 or Wheel2 == Wheel3 print "You cannot use the same wheel twice!" else print "Wheel 1 has been set to " + str(Wheel2) Wheel2select = False elif (Wheel2 == back) Wheel2select = False else print "This is not valid" #End of Wheelselect elif OptionMenu == 3 or "three" or "wheel3" or "wheel3" #Wheel select Wheel3select = True while: Wheel3select Wheel3 = raw_input("Please select the Third wheel, from 1 to 8, or type back") if (Wheel3 > 0 and Wheel3 < 9) or "three" if Wheel3 == Wheel2 or Wheel3 == Wheel1 print "You cannot use the same wheel twice!" else print "Wheel 1 has been set to " + str(Wheel3) Wheel2select = False elif (Wheel3 == back) Wheel3select = False else print "This is not valid" #End of Wheelselect elif OptionMenu == 5 or "five" or "plugboard" while plugboardscreen: print "Please type which each letter will go to on the plugboard." print "Please make sure that if 'A' goes to 'B' then 'B' will go to 'A'." print "A=1 B=2 etc..." Plugboardletter = 1 plugboardsetup = True while plugboardsetup: Plugboard + str(Plugboardletter) = raw_input(Plugboardletter":") print Plugboardletter":" Plugboard + str(Plugboardletter) Plugboardletter = Plugboardletter + 1 if Plugboardletter == 27 plugboardsetup = False elif OptionMenu == 4 or "five" or "plugboard" reflectorscreen = True while reflectorscreen Reflector = raw_input("Please select the reflector, A or B, and press enter") if Reflector == A or B reflectorscreen = False else print "Invalid input" elif Menu = 1 #Message option if Wheel1 != 1 or 2 or 3 or 4 or 5 or 6 or 7 or 8 #Wheel select Wheel1select = True while: Wheel1select Wheel1 = raw_input("Please select the first wheel, from 1 to 8, or type back") if Wheel1 > 0 and Wheel1 < 9 if Wheel1 == Wheel2 or Wheel1 == Wheel3 print "You cannot use the same wheel twice!" else print "Wheel 1 has been set to " + str(Wheel1) Wheel1select = False elif (Wheel1 == back) Wheel1select = False else print "This is not valid" #End of Wheelselect print "Wheel 1 is undefined" Wheel1 = raw_input("Please select the first wheel, from 1 to 8, and press enter") Wheel1.lower() if Wheel1 > 0 and Wheel1 < 9 or "one" print "Wheel 1 has been set to %s" % (Wheel1) else print "This is not valid" #return to 5 lines up elif Wheel2 = 0 print "Wheel 2 is undefined please go to options and set a wheel" elif Wheel3 print "Wheel 3 is undefined please go to options and set a wheel" else print "Invalid input"
Run
Reset
Share
Import
Link
Embed
Language▼
English
中文
Python Fiddle
Python Cloud IDE
Follow @python_fiddle
Browser Version Not Supported
Due to Python Fiddle's reliance on advanced JavaScript techniques, older browsers might have problems running it correctly. Please download the latest version of your favourite browser.
Chrome 10+
Firefox 4+
Safari 5+
IE 10+
Let me try anyway!
url:
Go
Python Snippet
Stackoverflow Question