Skip to content

Instantly share code, notes, and snippets.

@devth
Created February 2, 2012 16:03
Show Gist options
  • Save devth/1724233 to your computer and use it in GitHub Desktop.
Save devth/1724233 to your computer and use it in GitHub Desktop.
# 5 Stars
paths = for i in [0..5]
# Draw a star
path = [
'M', 90,98, # Starting position
'L', 119,0, # Draw lines
148,98,
238,98,
166,152,
192,238,
119,187,
46,238,
72,152,
0,98,
90,98
]
# Scale all numbers & translate the Xs only
t = false # toggling boolean
path = for p in path
if isNaN(p) then p
else
(p * @scale + (if t = !t then (i * 90 * @scale) else 0))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment