def draw_turtle():
    global space
    turtle.pencolor("red")
    turtle.penup()
    turtle.goto(100, 200)
    turtle.pendown()
    turtle.goto(-100, 200)
    turtle.goto(-100, -200)
    turtle.goto(100, -200)
    turtle.goto(100, 200)
    turtle.pencolor("black")
    turtle.fillcolor("red")
    turtle.tracer(0)
    for obs in obstacles:
        turtle.penup()
        turtle.goto(obs)
        turtle.pendown()
        turtle.begin_fill()
        for _ in range(4):
            turtle.fd(4)
            turtle.lt(90)
        turtle.end_fill()
    turtle.tracer(1)
    turtle.penup()
    turtle.goto(0,0)
    turtle.left(90)
    turtle.turtlesize(0.1, 0.1)
    turtle.shape("square")
    space = [(x,y) for x in range(-100, 101, step) for y in range(-200, 201, step) if not battle_maze.is_position_blocked(x,y)]
예제 #2
0
def draw_turtle():
    turtle.pencolor("red")
    turtle.penup()
    turtle.goto(100, 200)
    turtle.pendown()
    turtle.goto(-100, 200)
    turtle.goto(-100, -200)
    turtle.goto(100, -200)
    turtle.goto(100, 200)
    turtle.pencolor("black")
    turtle.fillcolor("red")
    turtle.tracer(0)
    for obs in obstacles:
        turtle.penup()
        turtle.goto(obs)
        turtle.pendown()
        turtle.begin_fill()
        for _ in range(4):
            turtle.fd(4)
            turtle.lt(90)
        turtle.end_fill()
    turtle.tracer(1)
    turtle.penup()
    turtle.goto(0,0)
    turtle.left(90)
    turtle.turtlesize(0.1, 0.1)
    turtle.shape("square")
예제 #3
0
def score(x, y):
    global i
    myarray2[i].write(myarray[i])
    global points
    if value == 'BOMB':
        t.speed("fastest")
        t.home()
        t.turtlesize(7, 7, 7)
        t.shape("square")
        t.goto(-310, 355)
        t.setheading(270)
        amount = 9
        for i in range(5):
            for i in range(2):
                sides(amount)
                t.left(90)
            amount -= 2
        t.clone()
        t.goto(-175, 0)
        t.pencolor("white")
        t.pendown()
        t.write("Game Over", align="left", font=("Fantasy", 50))
        t.pencolor("black")
        t.penup()
        t.goto(2424, 24242)
        sleep(3)
        t.bye()

    points += i
    t.reset()
    t.penup()
    t.goto(0, 250)
    t.write(str(points))
예제 #4
0
def startingBoard():
    # Create board size (llx, lly, urx, ury)
    turtle.screensize(100, 100)
    turtle.setworldcoordinates(0, 100, 100, 0)
    turtle.pu()
    ###### Make Turtle draw fast ######
    turtle.speed(0)
    turtle.delay(0)
    ###### Number the rows and columns ######
    ## create ycor labels
    yct = 0
    y = 16
    while yct <= 7:
        turtle.goto(5, y)
        turtle.write(yct, font=("Arial", 12, "bold"))
        yct += 1
        y += 10
    ## create xcor labels
    xct = 0
    x = 15
    while xct <= 7:
        turtle.goto(x, 95)
        turtle.write(xct, font=("Arial", 12, "bold"))
        xct += 1
        x += 10
    ###### Stamp squares onto the board ######
    turtle.shape("square")
    turtle.turtlesize(3, 3, 3)
    turtle.color("gray", "Green")
    xcor = 85
    ycor = 85
    xcount = 0
    ycount = 0
    while ycount <= 7:
        if ycor == 85:
            while ycor > 15:
                turtle.goto(xcor, ycor)
                turtle.stamp()
                ycor -= 10
        if ycor == 15:
            while ycor < 85:
                turtle.goto(xcor, ycor)
                turtle.stamp()
                ycor += 10
            ycount += 1
        xcor -= 10
    ## starting tokens:
    #topleft:
    turtle.goto(45, 45)
    tokens("w")
    #top right:
    turtle.goto(55, 45)
    tokens("b")
    #bottom right:
    turtle.goto(55, 55)
    tokens("w")
    #bottom left:
    turtle.goto(45, 55)
    tokens("b")
예제 #5
0
def pythTreePlug():
    t.Screen().bgcolor("cyan")
    t.up()
    t.shape("square")
    t.delay(0)
    t.setpos(0, -300)
    t.turtlesize(8)
    pythTree(t.clone(), 8, radians(40), 8)
    t.mainloop()
예제 #6
0
def appearColor(color):
    turtle.turtlesize(1.7, 1.7, 1)
    if color == "w":
        turtle.color("black", "ivory")
        turtle.shape("circle")
        turtle.turtlesize(1.7, 1.7, 1)
    else:
        turtle.color("ivory", "black")
        turtle.shape("circle")
예제 #7
0
def show():
    x = random.randint(-300, 300)  # 랜덤 x좌표
    y = random.randint(-300, 300)  # 랜덤 y좌표
    color = random.choice(colors)  # 랜덤 색 선택
    t.showturtle()  # 거북이 보이기
    t.up()  # 펜을 올림
    t.color(color)
    t.turtlesize(random.randint(1, 3))  # 랜덤 거북이 크기
    t.setpos(x, y)  # 거북이 랜덤 위치
    t.stamp()  # 도장찍기
예제 #8
0
def tokens(color):
    if color == "w":
        turtle.color("black", "ivory")
        turtle.shape("circle")
        turtle.turtlesize(1.7, 1.7, 1)
        turtle.stamp()
    else:
        turtle.color("ivory", "black")
        turtle.shape("circle")
        turtle.turtlesize(1.7, 1.7, 1)
        turtle.stamp()
예제 #9
0
def chessBoard():
    t.shape("square")
    A = []
    t.delay(0)
    t.up()
    t.turtlesize(2)
    for i in range(8):
        for j in range(8):
            A.append(t.clone())
            A[i * 8 + j].color("blue" if (i + j) % 2 == 0 else "red")
            A[i * 8 + j].goto(i * 40, j * 40)
    t.mainloop()
예제 #10
0
def chess():
    import turtle as t
    t.shape("square")
    t.up()
    t.delay(0)
    t.turtlesize(2, 2, 2)
    A = []
    for i in range(64):
        A.append(t.clone())
        if i % 2 - int(i / 8) % 2 == 0:
            A[i].color("white")
    for i in range(64):
        A[i].goto(40 * (i % 8), 40 * (int(i / 8)))
예제 #11
0
def oct_draw(num, curX, curY):
    '''
    8진수를 size에 따라 거북이 그리기
    '''
    octnum = oct(num)
    for j in range(len(octnum) - 1, 1, -1):
        print(j)
        turtle.goto(curX, curY)
        turtle.color('red')
        turtle.turtlesize(int(octnum[j]))
        curX -= 100
        turtle.stamp()
    turtle.done()
예제 #12
0
def binary_draw(num, curX, curY):
    binary = bin(num)
    for i in range(len(binary) - 2):
        turtle.goto(curX, curY)
        if num & 1:
            turtle.color('red')
            turtle.turtlesize(2)
        else:
            turtle.color('blue')
            turtle.turtlesize(1)
        curX -= 50
        num >>= 1
        turtle.stamp()
예제 #13
0
def binToTurtle(binary, num):
    curX = swidth / 2  # 거북이 초기 위치를 윈도창 오른쪽 끝으로 설정
    for i in range(len(binary) - 2):  # 5를 입력시 0b101이므로 앞 0b를 제외한 101 글자 수에 해당하는 3번을 반족
        turtle.goto(curX, curY)  # 거북이랑 계산된 좌표로 이동
        if num & 1:  # 2진수로 변환했을 때 맨 하위 비트가 1인지 체크
            turtle.color('red')
            turtle.turtlesize(2)
        else:
            turtle.color('blue')
            turtle.turtlesize(1)
        turtle.stamp()  # 위에서 설정된 크기와 색상으로 거북이 도장을 현재 위치에 찍는다.
        curX -= 50  # X좌표를 왼쪽으로 50만큼 이동시킨다.
        num >>= 1  # 숫자를 오른쪽을 1 시프트시킨다. 오른쪽 비트는 이미 앞에서 표현했으므로 제거
예제 #14
0
 def render_backdrop(self, obstacles, bot):
     if self.count % self.n == 0:
         turtle.hideturtle()
         turtle.colormode(255)
         turtle.pencolor((np.random.randint(255),np.random.randint(255),np.random.randint(255)))
         turtle.pensize(3+np.random.randint(5))
         for o in obstacles:
             self.render_obstacle(o)
         turtle.penup()
         turtle.goto(bot.x, bot.y)
         turtle.setheading(bot.heading)
         turtle.turtlesize(3)
         turtle.showturtle()
예제 #15
0
 def draw_grid(self):
     g.hideturtle()
     g.turtlesize(2, 2, 1)
     g.penup()
     g.setposition(-400, 400)
     g.pendown()
     g.forward(self.grid.width * int(self.scale_x))
     g.right(90)
     g.forward(self.grid.height * int(self.scale_y))
     g.right(90)
     g.forward(self.grid.width * int(self.scale_x))
     g.right(90)
     g.forward(self.grid.height * int(self.scale_y))
     g.right(90)
예제 #16
0
def setup(col, x, y, w, s, shape): 
    turtle.up()
    turtle.goto(x,y)
    turtle.width(w)
    turtle.turtlesize(s)
    turtle.color(col)
    turtle.shape(shape)
    turtle.down()
    wn.onkey(up, "Up")
    wn.onkey(left, "Left")
    wn.onkey(right, "Right")
    wn.onkey(back, "Down")
    wn.onkey(quitTurtles, "Escape")
    wn.listen()
    wn.mainloop()
예제 #17
0
def catch():
    global points

    x = turtle.xcor()
    y = turtle.ycor()
    x = sign(x) * 300 if abs(x) > 300 else x
    y = sign(y) * 300 if abs(y) > 300 else y
    turtle.goto(x, y)
    nearby = (abs(food.xcor() - turtle.xcor()) <
              12) and (abs(food.ycor() - turtle.ycor()) < 12)
    if nearby:
        x = random.randint(-300, 300)
        y = random.randint(-300, 300)

        print('going to', x, y)
        food.goto(x, y)
        points = points + 1
        turtle.turtlesize(points)
def setup(col, x, y, w, s, shape):
    turtle.up()
    turtle.goto(x, y)
    turtle.width(w)
    turtle.turtlesize(s)
    turtle.color(col)
    turtle.shape(shape)
    turtle.down()

    wn.onkey(up, "Up")
    wn.onkey(left, "Left")
    wn.onkey(right, "Right")
    wn.onkey(back, "Down")
    wn.onkey(quitTurtles, "Q")
    wn.onkey(quitTurtles, "q")
    wn.onkey(quitTurtles, "Escape")
    wn.listen()
    wn.mainloop()
예제 #19
0
파일: keyboard.py 프로젝트: malsf21/dmcs
def setup(x,y):
	wn.screensize(400,400)	
	#turtle.up()
	turtle.penup()
	turtle.goto(x,y)
	turtle.pendown()
	turtle.width(2)
	turtle.turtlesize(2)
	turtle.color("green")
	turtle.shape("yoda.gif")
	#turtle.down()
	#time.sleep(1)
	wn.listen()
	wn.onkey(home,"t")
	wn.onkey(up, "Up")
	wn.onkey(down, "Down")
	wn.onkey(right, "Right")
	wn.onkey(left, "Left")
	wn.onkey(escaper, "Escape")
예제 #20
0
파일: keyboard.py 프로젝트: mattxwang/dmcs
def setup(x, y):
    wn.screensize(400, 400)
    #turtle.up()
    turtle.penup()
    turtle.goto(x, y)
    turtle.pendown()
    turtle.width(2)
    turtle.turtlesize(2)
    turtle.color("green")
    turtle.shape("yoda.gif")
    #turtle.down()
    #time.sleep(1)
    wn.listen()
    wn.onkey(home, "t")
    wn.onkey(up, "Up")
    wn.onkey(down, "Down")
    wn.onkey(right, "Right")
    wn.onkey(left, "Left")
    wn.onkey(escaper, "Escape")
def slc(x, y) :    #slc함수를 선언
    global r, g, b    #r, g, b를 전체 선언
    r = random.random()    #r을 랜덤으로 선언
    g = random.random()    #g를 랜덤으로 선언
    b = random.random()    #b를 랜덤으로 선언

    turtle.title("Code02-연습문제08")    #거북이 프로그램의 이름 설정
    turtle.shape("turtle")    #거북이의 모양 설정

    turtle.color((r, g, b))    #거북이의 색깔을 설정(r, g, b 혼합)
    turtle.penup()    #거북이의 흔적을 안남기게 설정

    tSize = random.randrange(1, 10)    #tSize를 1~9까지의 숫자를 랜덤으로 돌린 후, 선언
    turtle.turtlesize(tSize)    #거북이의 크기를 tSize로 설정

    tSpin = random.randrange(0, 360)    #tSpin을 0~359까지의 숫자를 랜덤으로 돌린 후, 선언
    turtle.right(tSpin)    #거북이를 오른쪽으로 tSpin만큼 회전
    
    turtle.stamp()    #거북이의 위치에서 도장을 찍음
    turtle.goto(x, y)    #거북이가 x, y좌표로 이동
예제 #22
0
def main():
    turtle.title('2진수')
    turtle.shape('turtle')
    turtle.setup(width=swidth + 50, height=sheight + 50)
    turtle.screensize(swidth, sheight)
    turtle.penup()
    turtle.left(90)

    num = int(input("숫자"))
    binary = bin(num)
    curX = swidth / 2
    curY = 0
    for i in range(len(binary) - 2):
        turtle.goto(curX, curY)
        if num & 1 == True:
            turtle.color('red')
            turtle.turtlesize(2)
        else:
            turtle.color('blue')
            turtle.turtlesize(1)
        turtle.stamp()
        curX -= 50
        num >>= 1
    turtle.done()
예제 #23
0
	turtle.shapesize(lengthSize+1,widthSize+1)
	lengthSize += 1
	widthSize += 1
turtle.onkeypress(enlarge,"equal")
def reduceSize():
	global lengthSize
	global widthSize
	turtle.resizemode("user")
	if lengthSize > 1 and widthSize >1:
		turtle.shapesize(lengthSize-1,widthSize-1)
		lengthSize -= 1
		widthSize -= 1
	else:
		turtle.shapesize(1,1)
		lengthSize = 1
		widthSize = 1
turtle.onkeypress(reduceSize,"minus")
#Stamp function and definition
def stamp(x,y):
	turtle.pu()
	turtle.goto(x,y)
	turtle.stamp()

turtle.ondrag(stamp, btn = 1, add = True)
######
turtle.onscreenclick(turtle.goto, btn = 1, add = True)
turtle.onkeypress(turtle.clear, "space")
print(turtle.shapesize(), turtle.turtlesize())
turtle.getscreen().listen()
turtle.mainloop()
예제 #24
0
 def render_reset_turtle(self, bot):
         turtle.penup()
         turtle.goto(bot.x, bot.y)
         turtle.setheading(bot.heading)
         turtle.turtlesize(3)
         turtle.showturtle()
import turtle

STAR_SIZE = 100

EXPANSION = 1.2
TRANSLATION = STAR_SIZE * EXPANSION / 4

turtle.hideturtle()
turtle.color("black")
turtle.shape("triangle")
turtle.turtlesize(STAR_SIZE * EXPANSION / 20)

for _ in range(5):
    turtle.right(72)
    turtle.forward(TRANSLATION)
    turtle.stamp()
    turtle.backward(TRANSLATION)
예제 #26
0
## 전역 변수부
num = 0
swidth, sheight = 1000, 300
curX, curY = 0, 0

# 메인 코드부
if __name__ == "__main__":
    turtle.title('거북이로 2진수 표현하기')
    turtle.shape('turtle')
    turtle.setup(width=swidth + 50, height=sheight + 50)
    turtle.screensize(swidth, sheight)
    turtle.penup()
    turtle.left(90)

    num = int(input("숫자를 입력하세요 : "))
    binary = bin(num)  # 입력한 숫자를 2진수로 변환한다.
    curX = swidth / 2  # 거북이 위치의 X 좌표
    curY = 0  # 거북이 위치의 Y 좌표
    for i in range(len(binary) - 2):  # 변환된 2진수의 길이 만큼 반복한다. -2는 앞에 0b를 제외한 것.
        turtle.goto(curX, curY)  # 알맞은 값의 좌표로 이동한다.
        if num & 1:
            turtle.color('red')
            turtle.turtlesize(2)
        else:
            turtle.color('blue')
            turtle.turtlesize(1)
        turtle.stamp()  # 거북이 도장을 현재 위치에 찍는다.
        curX -= 50  # 거북이를 왼쪽으로 50만큼 이동시킨다.
        num >>= 1  # 맨 오른쪽 비트에 대한 도장을 찍었으니 다른 비트를 찍으러가보자.

turtle.done()
import turtle as player
import turtle as sc

#===================create turtle===================

sc = sc.Turtle()
player = player.Turtle()
player._delay(0)

#===================setup===================

ps = 1  #pensize
player.pencolor("black")
player.pensize(ps)
player.speed(0)
player.turtlesize(1)
eraser = 0
pup = 0  #penup/down
sc.ht()

#===================title===================


def title():
    sc.penup()
    sc.goto(-100, 350)
    font = ("roboto", 25, "bold")
    sc.write("Etch-A-Sketch", font=font)


def title2():
예제 #28
0
파일: neural2.py 프로젝트: glutzic/bob
import pprint
import turtle
import time
import math
import random

turtle.shape("circle")
turtle.turtlesize(0.5, 0.5)
turtle.ht()
turtle.penup()
turtle.speed(0)
turtle.setup(1200, 600)
turtle.tracer(50, 0)

class Network:
	"""docstring for Network"""
	def __init__(self):
		self.layers = [Layer("input"), Layer("hidden"), Layer("output")]

	def getLayer(self, layerName):
		for layer in self.layers:
			if layer.name == layerName:
				return layer

		return

	def addNeuron(self, layerName, neuron):
		if not neuron in self.getLayer(layerName).neurons:
			self.getLayer(layerName).addNeuron(neuron)

	def getNeuronsFromLayer(self, layerName):
# TURTLES
# ------------------------------------------------------------------------------
# To use turtles we must first import the package.
import turtle

# EXERCISE 0: (Optional) Customize your turtles appearance.
# ------------------------------------------------------------------------------
# You can change the appearance of the turtle using the following commands
turtle.color("blue")
turtle.shape("turtle")
turtle.turtlesize(2)
turtle.width(5)

# EXERCISE 1: Make your turtle walk in a square.
# ------------------------------------------------------------------------------
turtle.forward(100)
turtle.right(90)
turtle.forward(100)
turtle.right(90)
turtle.forward(100)
turtle.right(90)
turtle.forward(100)
turtle.right(90)

# EXERCISE 2: Using a loop make your turtle walk in a square.
# ------------------------------------------------------------------------------
for side in range(4):
    turtle.forward(100)
    turtle.right(90)

# EXERCISE 3: Make your turtle walk in an n-sided shape.
예제 #30
0
import turtle
import random
import subprocess
audio_file = "15 second song teaser I composed and wrote.mp3"
color = ["blue","purple","yellow", "magenta", "darkorange"]
return_code = subprocess.Popen(["afplay", audio_file])
for i in range(1500000):
    turtle.speed(900)
    turtle.pensize(10)
    turtle.turtlesize(-1)
    turtle.pencolor(color[random.randrange(0,len(color))])
    turtle.forward(90)
    turtle.right(90)
    turtle.forward(90)
    turtle.right(90)  





turtle.exitonclick()
예제 #31
0
def othello():
    game = "inprogress"
    board = [['0', '0', '0', '0', '0', '0', '0', '0'],
             ['0', '0', '0', '0', '0', '0', '0', '0'],
             ['0', '0', '0', '0', '0', '0', '0', '0'],
             ['0', '0', '0', "w", "b", '0', '0', '0'],
             ['0', '0', '0', "b", "w", '0', '0', '0'],
             ['0', '0', '0', '0', '0', '0', '0', '0'],
             ['0', '0', '0', '0', '0', '0', '0', '0'],
             ['0', '0', '0', '0', '0', '0', '0', '0']]
    row, col = boardConversion()
    turtle.hideturtle()
    turtle.setworldcoordinates(-235, -235, 235, 235)
    turtle.speed(0)
    turtle.color("green")
    turtle.shape("square")
    turtle.turtlesize(3, 3)
    turtle.penup()
    turtle.setx(-150)
    turtle.sety(-190)
    for x in range(0, 4):
        for x in range(0, 7):
            turtle.stamp()
            turtle.forward(45)
        turtle.stamp()
        turtle.left(90)
        turtle.forward(55)
        turtle.left(90)
        for x in range(0, 7):
            turtle.stamp()
            turtle.forward(45)
        turtle.stamp()
        turtle.right(90)
        turtle.forward(55)
        turtle.right(90)
    turtle.hideturtle()
    turtle.right(90)
    turtle.forward(25)
    turtle.left(90)
    turtle.color("black")
    for x in range(0, 8):
        turtle.write(x)
        turtle.forward(45)
    turtle.right(90)
    turtle.forward(35)
    turtle.right(90)
    turtle.forward(395)
    turtle.left(90)
    for x in range(0, 8):
        turtle.write(x)
        turtle.forward(55)
    whitepiece = turtle.Turtle()
    blackpiece = turtle.Turtle()
    whitepiece.speed(2)
    whitepiece.penup()
    whitepiece.goto(-15, 30)
    whitepiece.shape("circle")
    whitepiece.color("white")
    whitepiece.turtlesize(2, 2)
    whitepiece.stamp()
    whitepiece.goto(30, -25)
    whitepiece.stamp()
    blackpiece.speed(2)
    blackpiece.penup()
    blackpiece.shape("circle")
    blackpiece.color("black")
    blackpiece.penup()
    blackpiece.turtlesize(2, 2)
    blackpiece.goto(30, 30)
    blackpiece.stamp()
    blackpiece.goto(-15, -25)
    blackpiece.stamp()
    while game == "inprogress":
        if getValidMoves(board, "black") != []:
            board, blackpiece, row, col, game = userturn(
                board, blackpiece, row, col, game)
        if getValidMoves(board, "white") != [] and game == "inprogress":
            board, whitepiece, row, col = selectNextPlay(
                board, whitepiece, row, col)
        if getValidMoves(board, "black") == [] and getValidMoves(
                board, "white") == []:
            game = "over"
            gameOver(game, board)
import turtle as t
t.turtlesize(1)
t.shape("turtle")
t.color("gold", "black")
for i in range(5, 1000, 10):
    t.fd(i)
    t.left(90)
    t.fd(i)
    t.left(90)
    t.fd(i + 5)
    t.left(90)
    t.fd(i + 5)
    t.left(90)
t.exitonclick()
import turtle

turtle.showturtle()
turtle.turtlesize(1)

colors = ['red', 'orange', 'yellow', 'green', 'blue', 'purple']

while True:

    for color in colors:
        turtle.color(color)
        turtle.stamp()
        turtle.forward(10)
        turtle.left(1)

# add some colors
# add something that isn't a color?
# change forward
# change left
# does right work?
# Remove while True:
import turtle as tr
import numpy as np
tr.speed(0)
tr.width(3)
tr.shape('turtle')
tr.turtlesize(1)
tr.color('plum')
for i in range(1, 1800):
    tr.circle(10 + i / (2 * np.pi), 1)
tr.exitonclick()
예제 #35
0
 def __config_turtle_stamp(self, width: int, height: int) -> bool:
     if width <= 1 or height <= 1:
         return False
     t.turtlesize(width / _TURTLE_DEFAULT_WIDTH,
                  height / _TURTLE_DEFAULT_HEIGHT, 0)
     return True
예제 #36
0
파일: Game#1.py 프로젝트: r2kdev3/Games
def down():
    shape.shape(image_down)
    shape.setheading(270)
    shape.forward(distance)


def left():
    shape.shape(image_left)
    shape.setheading(180)
    shape.forward(distance)


def right():
    shape.shape(image_right)
    shape.setheading(0)
    shape.forward(distance)


t.setup(1000, 1000)
t.Screen().bgcolor("sky blue")
t.color("red")
t.turtlesize(3, 3, 2)
t.listen()

t.onkey(up, "Up")
t.onkey(down, "Down")
t.onkey(left, "Left")
t.onkey(right, "Right")
t.mainloop()
예제 #37
-1
def setup(col, x, y, w, s, shape): 
    turtle.up()
    turtle.goto(x,y)
    turtle.width(w)
    turtle.turtlesize(s)
    turtle.color(col)
    turtle.shape(shape)
    turtle.bgpic("assets/dancing-banana.gif")
    turtle.down()
    wn.listen()
    turtle.getscreen()._root.bind_all('<Key>', key_pressed)
    turtle.getscreen()._root.mainloop()