Skip to content
← Back to Community
Draw Some Shapes!
Profile icon
slickassassin03

Huh?

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!

The Challenge
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:


Goals

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:

Voters
Profile icon
EvanFlores1
Profile icon
21lettingtone
Profile icon
IsabellaRobert3
Profile icon
AidenClerge
Profile icon
LiamBoyd3
Profile icon
Mohammed-ZayanZ
Profile icon
ShasmeenThompso
Profile icon
ShakeelUllah
Profile icon
KS-10ZZ-718537
Profile icon
Umaguy
Comments
hotnewtop
Profile icon
[deleted]

The triangle is warping...

Profile icon
slickassassin03

@CodeABC123 Tried out a large number I see...

Profile icon
cf20600

Ah yes, I crashed my potato.

Profile icon
MadMath123

If you type 'int', it breaks

Profile icon
slickassassin03

@MadMath123 Not for me it doesn't

Profile icon
YeetMstr

repl process died unexpectedly: signal: killed

??

Profile icon
Nettakrim

@epicman702 that happens if it takes too long to compute something

Profile icon
YeetMstr

@Nettakrim I did enter the number 9999999999...

Profile icon
slickassassin03

@epicman702 Thatll do it...

Profile icon
AtriDey

@epicman702 Large number, I see

Profile icon
LILLIANANUCCIO

This is great

Profile icon
LILLIANANUCCIO

This is cool but when it says Filled with what I thought it was going to fill with a color

Profile icon
estherrrrrr

,

Profile icon
McodeMaker

i put in 99 and it did ----------------????-----------etc

Profile icon
OOF1234567

https://repl.it/@OOF1234567/learn-code mine is very simple but gets the job done

Profile icon
slickassassin03

@OOF1234567 I'm not completely sure how turtle works, but I guess it does what was intended lol. Was more hinting towards a custom module to do it yourself though.

No worries either way, still a cool program! Thanks for participating!

Profile icon
OOF1234567

@slickassassin03 turtle works with python to draw lines, so in other words it makes drawing easy if you dont wanna code a lot to make a shape, its pretty cool and easy to learn

Profile icon
aidanpatterson0

went from 'hey, that's cool, i wanna try' to 2d shape filling algorithms really quick. works, though. here to fill shapes.

Profile icon
slickassassin03

@aidanpatterson0 Not gonna lie, this is pretty impressive. Great script man, not something I probably could have done personally.

Profile icon
aidanpatterson0

@slickassassin03 i’m a shader girl, so my first instinct was, of course, to implement shader algorithms in python.

Profile icon
buffhorse

nice

Profile icon
[deleted]

Very cool, I accept your challenge!

Profile icon
slickassassin03

@IreoluwaRaufu Can't wait to see what you come up :)

Profile icon
merrillUwU

cool

Profile icon
LittleNomster

coolio

Profile icon
ChezCoder

10000...

Profile icon
ArushWadhawan

awesome amazing never better

Profile icon
staticvoidliam7

lol i put 600 (ow)

Profile icon
slickassassin03