#Below is the map to be plotted out, in ASCII.

#A A A A A

#A 2 3 4 A

#A 1 A 5 A A A

#A 0 A 6 A D A

#A A A 7 A L A

# A 8 9 X A

# A A A A A

print("This Python program was coded by u/comradelenin456.")

print(" ")

print("To move the \"O\" inside of a square, press one of the following buttons on your keyboard:")

print("W - up")

print("A - left")

print("S - down")

print("D - right")

print("and then hit ENTER. If you press some other button, or if you try to move off the field, the program will give you an error message and prompt you to try again.")

def pos0():

print(" ")

print("A A A A A")

print("A A")

print("A A A A A")

print("A O A A A")

print("A A A A A")

print(" A A")

print(" A A A A A")

direc = input()

if direc == "w":

pos1()

else:

print("Error - Please try again.")

pos0()

def pos1():

print(" ")

print("A A A A A")

print("A A")

print("A O A A A A")

print("A A A A")

print("A A A A A")

print(" A A")

print(" A A A A A")

direc = input()

if direc == "w":

pos2()

if direc == "s":

pos0()

else:

print("Error - Please try again.")

pos1()

def pos2():

print(" ")

print("A A A A A")

print("A O A")

print("A A A A A")

print("A A A A")

print("A A A A A")

print(" A A")

print(" A A A A A")

direc = input()

if direc == "s":

pos1()

if direc == "d":

pos3()

else:

print("Error - Please try again.")

pos2()

def pos3():

print(" ")

print("A A A A A")

print("A O A")

print("A A A A A")

print("A A A A")

print("A A A A A")

print(" A A")

print(" A A A A A")

direc = input()

if direc == "a":

pos2()

if direc == "d":

pos4()

else:

print("Error - Please try again.")

pos3()

def pos4():

print(" ")

print("A A A A A")

print("A O A")

print("A A A A A")

print("A A A A")

print("A A A A A")

print(" A A")

print(" A A A A A")

direc = input()

if direc == "a":

pos3()

if direc == "s":

pos5()

else:

print("Error - Please try again.")

pos4()

def pos5():

print(" ")

print("A A A A A")

print("A A")

print("A A O A A A")

print("A A A A")

print("A A A A A")

print(" A A")

print(" A A A A A")

direc = input()

if direc == "w":

pos4()

if direc == "s":

pos6()

else:

print("Error - Please try again.")

pos5()

def pos6():

print(" ")

print("A A A A A")

print("A A")

print("A A A A A")

print("A A O A A")

print("A A A A A")

print(" A A")

print(" A A A A A")

direc = input()

if direc == "w":

pos5()

if direc == "s":

pos7()

else:

print("Error - Please try again.")

pos6()

def pos7():

print(" ")

print("A A A A A")

print("A A")

print("A A A A A")

print("A A A A")

print("A A A O A A")

print(" A A")

print(" A A A A A")

direc = input()

if direc == "w":

pos6()

if direc == "s":

pos8()

else:

print("Error - Please try again.")

pos7()

def pos8():

print(" ")

print("A A A A A")

print("A A")

print("A A A A A")

print("A A A A")

print("A A A A A")

print(" A O A")

print(" A A A A A")

direc = input()

if direc == "w":

pos7()

if direc == "d":

pos9()

else:

print("Error - Please try again.")

pos8()

def pos9():

print(" ")

print("A A A A A")

print("A A")

print("A A A A A")

print("A A A A")

print("A A A A A")

print(" A O A")

print(" A A A A A")

direc = input()

if direc == "a":

pos8()

if direc == "d":

posX()

else:

print("Error - Please try again.")

pos9()

def posX():

print(" ")

print("A A A A A")

print("A A")

print("A A A A A")

print("A A A A")

print("A A A A A")

print(" A O A")

print(" A A A A A")

direc = input()

if direc == "a":

pos9()

if direc == "w":

posL()

else:

print("Error - Please try again.")

posX()

def posL():

print(" ")

print("A A A A A")

print("A A")

print("A A A A A")

print("A A A A")

print("A A A A O A")

print(" A A")

print(" A A A A A")

direc = input()

if direc == "w":

posD()

if direc == "s":

posX()

else:

print("Error - Please try again.")

posL()

def posD():

print(" ")

print("A A A A A")

print("A A")

print("A A A A A")

print("A A A O A")

print("A A A A A")

print(" A A")

print(" A A A A A")

direc = input()

if direc == "s":

posL()

else:

print("Error - Please try again.")

posD()