Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
события
import turtle import math countx = 10 county = 10 countv = 10 counta = 45 pi = 3.1415926 win = turtle.Screen() win.bgcolor('blue') pen = turtle.Pen() pen.hideturtle() pen.pensize(3) pen.color('white') ground = turtle.Pen() ground.hideturtle() ground.penup() ground.setpos(-300, 0) ground.pendown() ground.forward(600) vec = turtle.Pen() vec.left(counta) vec.forward(countv) def mypos(x, y): pen.dot(20, 'green') def myfun(x, y): pen.penup() pen.setpos(x, y) mypos(x, y) pen.down() myway(x, y) def speedright(): global countx countx += 1 return countx def speedleft(): global countx countx -= 1 return countx def speedup(): global county county += 1 return county def speeddown(): global county county -= 1 return county def speedvup(): global countv countv += 1 vec.forward(1) return countv def speedvdown(): global countv countv -= 1 vec.forward(-1) return countv def myangleup(): global counta counta += 1 vec.left(1) return counta def myangledown(): global counta counta -= 1 vec.right(1) return counta def myway(x, y): g = -0.5 # ускорение свободного падения time = .1 # шаг по времени x = pen.xcor() # координата x точки, куда указали мышкой y = pen.ycor() # координата y точки, куда указали мышкой #vx = countx #vy = county v = countv a = counta vx = v * math.cos(pi* a / 180) vy = v * math.sin(pi *a / 180) while y > 0: x = x + vx y = y + vy + g * time * time pen.setpos(x, y) vy = vy + g win.onclick(myfun) #win.onkeypress(speedright, 'Right') #win.onkeypress(speedleft, 'Left') #win.onkeypress(speedup, 'Up') #win.onkeypress(speeddown, 'Down') win.onkeypress(myangledown, 'Right') win.onkeypress(myangleup, 'Left') win.onkeypress(speedvup, 'Up') win.onkeypress(speedvdown, 'Down') win.listen() win.mainloop()
run
|
edit
|
history
|
help
0
PyStack
PyEnum
Faiha #4
Type
Linear search
PyDeque
Short python input
Python, finditer(), filter emails and place put in tuple
JSON page
substring