Quick actions

cmd+k|ctrl+k

Navigation

Languages

The Regular Polygon Generator! :D

Snippet info

Language

Nim

Visibility

public

Author

bluecinderbox91-the-g.o.a.t.

Created

2019-08-31T12:54:48Z

Updated

2019-08-31T12:54:48Z

to regPolygon :sides :length
;repeat by the # of sides
repeat :sides[
;ie 360 / 4 is 90, so rt 90. 360 / 3 is 120, so rt 120.
  rt 360 / :sides
;a move function that makes the size of each shape roughly the same.
  fw :length / :sides * 4
]
end
;the first variable is the number of sides; the second is the length of each.
regPolygon 10 100
INFO