Skip to content

Commit

Permalink
Add David Candy Cane (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
david-001 authored Oct 19, 2024
1 parent 8c493f1 commit e81398d
Show file tree
Hide file tree
Showing 2 changed files with 100 additions and 1 deletion.
98 changes: 98 additions & 0 deletions drawfunctions/david_akim_candycane.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
from turtle import Turtle


def draw_candycane():
turtle = Turtle()
# turtle.speed(3)
turtle.hideturtle()

# candy cane
turtle.up()
turtle.goto(100, 90)
turtle.down()
turtle.rt(-90)
turtle.circle(15, 180)
turtle.fd(50)
turtle.circle(5, 180)
turtle.fd(50)
turtle.circle(-5, 180)
turtle.circle(5, 180)
turtle.up()

# red stripe
turtle.goto(70, 70)
turtle.down()
turtle.begin_fill()
turtle.color('red')
turtle.fd(5)
turtle.rt(45)
turtle.fd(14)
turtle.rt(135)
turtle.fd(5)
turtle.rt(45)
turtle.fd(14)
turtle.end_fill()

# green stripe
turtle.up()
turtle.goto(70, 55)
turtle.down()
turtle.rt(135)
turtle.begin_fill()
turtle.color('green')
turtle.fd(5)
turtle.rt(45)
turtle.fd(14)
turtle.rt(135)
turtle.fd(5)
turtle.rt(45)
turtle.fd(14)
turtle.end_fill()

# red stripe
turtle.up()
turtle.goto(70, 40)
turtle.down()
turtle.rt(135)
turtle.begin_fill()
turtle.color('red')
turtle.fd(5)
turtle.rt(45)
turtle.fd(14)
turtle.rt(135)
turtle.fd(5)
turtle.rt(45)
turtle.fd(14)
turtle.end_fill()

# red stripe
turtle.up()
turtle.goto(90, 90)
turtle.down()
turtle.rt(135)
turtle.begin_fill()
turtle.color('red')
turtle.fd(5)
turtle.rt(45)
turtle.fd(9)
turtle.rt(135)
turtle.fd(5)
turtle.rt(45)
turtle.fd(9)
turtle.end_fill()

# green stripe
turtle.up()
turtle.goto(70, 83)
turtle.down()
turtle.rt(135)
turtle.begin_fill()
turtle.color('green')
turtle.fd(5)
turtle.rt(45)
turtle.fd(22)
turtle.rt(50)
turtle.fd(5)
# turtle.rt(130)
# turtle.fd(22)
turtle.end_fill()
3 changes: 2 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from turtle import exitonclick
from drawfunctions import dominic_duffin, david_akim, satoshi_s, teri_eyenike, david_akim_present_2024, david_akim_christmas_sock, chris_j, christina_loiacono
from drawfunctions import dominic_duffin, david_akim, satoshi_s, teri_eyenike, david_akim_present_2024, david_akim_christmas_sock, chris_j, christina_loiacono, david_akim_candycane

dominic_duffin.christmas_tree()
david_akim.star()
Expand All @@ -9,5 +9,6 @@
david_akim_christmas_sock.draw_christmas_sock()
chris_j.draw_snowman()
christina_loiacono.tree_present()
david_akim_candycane.draw_candycane()

exitonclick()

0 comments on commit e81398d

Please sign in to comment.