So I've defined the initial opening of my game as mainmenu and within that is prints a few things with a few options to choose from such as the dificulty of the levels or they can see help for the game. When they go to help I want them to have the option to go back to the main menu, hence why I made def mainmenu(). However in my helpmenu if statement even though I have stated that if they type menu or Menu that it should call back on mainmenu it doesn't do anything. We have a module that we must use and this is why I have to use things such as p.next() which actually means it's listening for a user input so just ignore that :)
here's the code
def mainmen():
p.write("Welcome to 'The Great Escape'!\n")
p.write("\nPlease type what dificulty you would like to play the game,\nthe options are Easy, Medium or Hard\n")
p.write("\nHowever, if you need help please type Help for instructions\n")
p.write(">>>")
dificulty = p.next()
if dificulty == "easy" or dificulty == "Easy":
p.clear()
p.write("The Great Escape")
easy()
elif dificulty == "medium" or dificulty == "Medium":
p.clear()
p.write("The Great Escape")
medium()
elif dificulty == "hard" or dificulty == "Hard":
p.clear()
p.write("The Great Escape")
hard()
elif dificulty == "help" or dificulty == "Help":
p.clear()
p.write("Welcome to 'The Great Escape' instructions\n")
p.write("\nTo complete the level you must move your Turtle around the\nline without touching the line itself\n")
p.write("\nControls\n")
p.write("Forward - 'W'\n")
p.write("Left - 'A'\n")
p.write("Backwards - 'S'\n")
p.write("Right - 'D'\n")
p.write("\nPlease type 'Menu' to go back to the main menu,\nor 'Exit' to quit the game\n")
p.write(">>>")
**`here is my help menu if statements, I want it so that if they type Menu or menu they get taken back to the main menu.`**
helpmenu = p.next()
if helpmenu == "Menu" or helpmenu == "menu":
p.clear()
mainmenu() **<<This should call on the mainmenu but it doesn't??**
elif helpmenu == "Exit" or helpmenu == "exit":
p.clear()
p.write("Hope you play soon!")