Skip to content

Instantly share code, notes, and snippets.

@spaghettiSyntax
Created December 5, 2017 15:04
Show Gist options
  • Save spaghettiSyntax/fc08e6900419a6d409184cbda8e5785c to your computer and use it in GitHub Desktop.
Save spaghettiSyntax/fc08e6900419a6d409184cbda8e5785c to your computer and use it in GitHub Desktop.
Tony Gaddis Python
#this program demonstrates some python graphic abilities
# the following URL gives a short tutorial on using the turtle
# http://www.eg.bucknell.edu/~hyde/Python3/TurtleDirections.html
# turtle is used to draw on screen
from turtle import * # star is a wildcard
# set colors: red line, blue fill
color('green', 'blue')
begin_fill() # fill in the shape we draw
while True:
speed(0)
forward(275) # go forward 200 pixels
left(245) #go forward 170 degrees
back(100)
right(30)
# repeat until we return to starting position
if abs(pos()) < 1:
break
end_fill() # fill in shape
done() # tell python that turtle is done drawing
# the following is a loop
# repeat until we return to starting position
# while abs(pos()) >= 1:
# forward(350)
# left(145
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment