0
これは画面上の行に触れるとカメプログラムを閉じる方法ですか?今私はちょうど閉鎖を行う必要がありタートルが線に当たった場合にプログラムを閉じるには
from tkinter import *
from turtle import *
import turtle
import webbrowser
import time
tess = turtle.Turtle()
alex = turtle.Turtle()
tess.width(1)
tess.color("red")
alex.color("blue")
alex.width(1)
turtle.setup(500,600)
wn = turtle.Screen()
wn.title("Draw whith lines!!")
wn.bgcolor("black")
def h1():
yes = ("yes")
while yes in ("yes"):
tess.forward(10)
alex.forward(10)
time.sleep(0.5)
def h2():
tess.left(90)
def h3():
tess.right(90)
def ha():
alex.left(90)
def hd():
alex.right(90)
wn.onkey(h1, "Up")
wn.onkey(h2, "Left")
wn.onkey(h3, "Right")
wn.onkey(ha, "a")
wn.onkey(hd, "d")
wn.listen()
wn.mainloop()
:イムゲームトロンのようなビットをしようが、私は誰もがラインをヒットした場合、私は主要な部分を行っている、これまでに閉鎖するプログラムを取得する必要があります誰が勝ったかを示していますが、私はそれを理解できません!