Skip to content

Instantly share code, notes, and snippets.

@xslendix
Created March 24, 2018 11:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xslendix/575892bd7f020ae94598dc09f2f3b5dc to your computer and use it in GitHub Desktop.
Save xslendix/575892bd7f020ae94598dc09f2f3b5dc to your computer and use it in GitHub Desktop.
A simple turtle application.
import math
import turtle
x = -700
a = 0.0
wn = turtle.Screen()
wn.bgcolor('lightblue')
fred = turtle.Turtle()
wn.clear()
fred.penup();
while True:
fred.pendown()
x = x + 5
if x > 700:
wn.clear()
x = -700
for angle in range(-20, 20):
y = math.sin(math.radians(angle))
a = y
fred.goto(x, y*100)
print(y*1000)
x = x + 5
if x > turtle.window_width()/2:
wn.clear()
x = -700
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment