Created
March 24, 2018 11:25
-
-
Save slendidev/575892bd7f020ae94598dc09f2f3b5dc to your computer and use it in GitHub Desktop.
A simple turtle application.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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