from turtle import *
from random import randint
def create_turtle():
color('red')
shape('turtle')
up()
goto(-130, 170)
down()
speed(9)
right(90)
def draw_maze():
t = Turtle()
t.speed(0)
t.width = 15
t.up()
x = -230
y = 170
t.goto(x, y)
t.down()
maze_rows = [
'## ########',
' # ####### ',
' ####### ',
' ## ## ',
' ## ',
' # ',
' ## ### ',
' ##### ',
' ####### ',
' ######### ',
'######## ##'
]
maze_columns = [
'##########',
' ### #### ',
'### ## # ',
'# ## ',
' # ',
' ## ',
' ',
' ## ',
' #### ',
' ###### ',
' ######## ',
'##########'
]
y -= 34
for string in maze_rows:
for i in range(len(string)):
if string[i:].find('#') == -1:
break
elem = string[i]
if elem == '#':
t.down()
else:
t.up()
t.fd(40)
t.up()
t.goto(x, y)
t.down()
y -= 34
t.up()
t.goto(-230, 170)
t.down()
t.right(90)
x = -190
for string in maze_columns:
for i in range(len(string)):
if string[i:].find('#') == -1:
break
elem = string[i]
if elem == '#':
t.down()
else:
t.up()
t.fd(34)
t.up()
t.goto(x, 170)
t.down()
x += 40
t.hideturtle()