Skip to content

Instantly share code, notes, and snippets.

@joshy
Last active August 29, 2015 14:00
Show Gist options
  • Save joshy/11371627 to your computer and use it in GitHub Desktop.
Save joshy/11371627 to your computer and use it in GitHub Desktop.
Rotate a square a couple of times with elm
square : Path
square = path [ (50,50), (50,-50), (-50,-50), (-50,50), (50,50) ]
blueSquare : Form
blueSquare = traced (dashed blue) square
rotateSquareBy : Float -> Form
rotateSquareBy deg = rotate deg blueSquare
degrees : [number]
degrees = [0, 90, 180, 270, 360]
main : Element
main = collage 500 420 [ group <| map rotateSquareBy degrees ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment