I know, I know. Easy right? Suddenly today I decided I wanted to mess with drawing shapes because it's fun to be completely honest. It turned into more than just a normal shape function. Going crazy with it showed me that one could really learn a lot from messing with this stuff!
Why do I care?
Well you don't have to, but personally learning projects like this are always interesting to me!
If you're up for it, I challenge people to create a function that does shape drawing as dynamically as possible. You would input amount of lines to cover and it would do the rest!
This is exponentially harder respective to the amount of sides of the shape you choose, but don't worry! All that you learn from it will be of great benefit to any future projects!
If you're interested, read on:
I see you're interested :)
Pleas make your script in a repl.it repository and comment with the link to it. When you're done, if you think it was too easy, maybe try a larger shape :)
Your script should
- make a shape when called (Duh)
- use almost entirely dynamic variables
- handle all errors
- be fast
That's it! Have fun obviously, but try to challenge yourself, making a function for a triangle is going to be the easiest, pick more complex shapes if you want a challenge!
I'm definitely interested in seeing what you guys do, and as a side note, this does not need to be written in Python. Use any language you'd like!
Below is my example of a triangle function: