Skip to content

Instantly share code, notes, and snippets.

@gazzar
Last active February 1, 2018 10:52
Show Gist options
  • Save gazzar/2fe1f4f08d08dfe0be53e6a5b52e3c2d to your computer and use it in GitHub Desktop.
Save gazzar/2fe1f4f08d08dfe0be53e6a5b52e3c2d to your computer and use it in GitHub Desktop.
Kerri's avatar by turtle
import turtle as t
t.setworldcoordinates(0,300,300,0)
t.pensize(6)
nodelists = {
0: [(30,53),(47,79),(66,60),(108,21),(151,61),(175,73),(193,52)],
1: [(99,50)],
2: [(116,50)],
3: [(92,68),(107,82),(123,68)],
4: [(41,124),(106,107),(164,138),(196,138),(227,138),(237,116),
(205,116),(175,116),(187,94),(216,94),(246,94),(227,138)],
5: [(155,195),(122,194),(97,194),(60,195)],
6: [(74,234),(97,234)],
7: [(122,234),(147,234)],
8: [(66,60),(106,107),(151,61)],
9: [(155,195),(106,107),(60,195)],
10: [(97,234),(97,194)],
11: [(122,234),(122,194)],
12: [(216,94),(205,116),(196,138)],
13: [(164,138),(175,116)]
}
text = {
(193,112): 1,
(224,112): 2,
(183,135): 2,
(214,135): 1,
(170,155): 'Farewell and may',
(166,167): 'you thrive in your',
(162,179): 'new position!',
(158,191): 'best wishes, Gary',
}
def move(list):
t.penup()
t.goto(nodelists[list][0])
t.pendown()
for key, nodelist in nodelists.items():
move(key)
for node in nodelist:
t.goto(node)
t.dot(24)
t.penup()
font = ("Arial", 24, "normal")
for key, val in text.items():
t.goto(key)
t.write(val, font=font)
t.done()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment