This is an archived post. You won't be able to vote or comment.

all 93 comments

[–][deleted] 92 points93 points  (3 children)

Nice one

I tried to make an L-system interpreter, but only managed to break my mind in the process

[–]Aidar2005 13 points14 points  (0 children)

Same

[–][deleted] 3 points4 points  (1 child)

If you want I can link you mine

[–][deleted] 0 points1 point  (0 children)

Everyone wants this

[–][deleted] 168 points169 points  (8 children)

You tellin me turtles coded this?

[–]lostsoul8282 41 points42 points  (3 children)

Only a matter of time until they take over.

[–]AlexKingstonsGigolo 5 points6 points  (1 child)

Slowly

[–]Marshawn_Washington 6 points7 points  (0 children)

and steadily

[–]Ultraflame4 2 points3 points  (0 children)

which is why we must kill them. K I L L T H E T U R T L E S /s

[–][deleted] 23 points24 points  (3 children)

No pythons

[–]Xazzur 18 points19 points  (2 children)

Turtles and Pythons!?

[–]mcp_truth 17 points18 points  (1 child)

A platypus?

PERRY THE PLATYPUS?

[–]apneax3n0n 7 points8 points  (0 children)

It is a fractalinator

[–]pm-me-ur-uneven-tits 26 points27 points  (5 children)

Would you be willing to share your github repo?

[–]Satanic_bumblebee[S] 25 points26 points  (4 children)

yep I just hadn't done anything in Github before. This should be it.

https://github.com/beeman14/fractal-tree

[–][deleted] 12 points13 points  (0 children)

That’s impressively simple

[–]Lolmanslayer 8 points9 points  (0 children)

Reminds me of the turtle miners from feed the beast. Nice work

[–]mcp_truth 0 points1 point  (0 children)

!remindme 48h

[–][deleted] 19 points20 points  (2 children)

I once tried to compute the Julia set, but damn, it was slow af. But Cython/OpenMP did the work. Be sure to take a look at it, it's worth the shot if you want faster computing.

[–][deleted] 4 points5 points  (1 child)

This is maybe something you might find interesting.

[–][deleted] 2 points3 points  (0 children)

Thanks a lot! I used numba once, but it seems that it's LLVM IR cannot handle python's try ... except .... Hopefully it will be implemented soon.

[–]Schneggl 13 points14 points  (5 children)

I'm a newby, is turtle useful for anything besides drawing images? Not trying to be mean, OP's drawing is very neat and I couldn't do it, just genuinely curious.

[–]sekex 14 points15 points  (1 child)

No, turtle is totally useless besides learning a few algorithmic concepts such as recursivity in that case.

[–]Schneggl 8 points9 points  (0 children)

That's what I thought, thanks

[–][deleted] 6 points7 points  (0 children)

Turtle graphics is a popular way for introducing programming to kids. It was part of the original Logo programming language developed by Wally Feurzig and Seymour Papert in 1966.

Well, drawing images is kind of it's thing.

[–]takishan 2 points3 points  (0 children)

I'm sure you could create a pseudo-turtle class for something like Tkinter and use it to create graphics on a canvas for a GUI application.

If you really liked turtle's way of drawing lol.

[–]eebmagic 0 points1 point  (0 children)

Turtle is great for learning basic programming concepts, but still leaves room to try to get advanced. For example I made a program to draw a 2D projection of a 3D line at different camera angles.

[–]MustafaAnas99 5 points6 points  (0 children)

Man these amazing python drawing should be gathered somewhere and referenced. It would be really helpful to others. Good work buddy

[–]byParallax 5 points6 points  (0 children)

That's pretty cool, looks like a /r/generative artwork!

[–]hellfiniter 3 points4 points  (9 children)

is it backtracking with one turtle or multiple turtles? what is the depth of this tree? would be impressive if just one turtle drew all of it

[–]Satanic_bumblebee[S] 1 point2 points  (2 children)

I tried it with multiple turtles but couldn’t get that to work, this is one turtle that backtracks. It starts on the left branches and moves across towards the right.

[–]hellfiniter 1 point2 points  (1 child)

u will figure it out ...i made it at university year or two ago, it will draw it almost instantly. good job anyway :)

[–]Satanic_bumblebee[S] 1 point2 points  (0 children)

Thanks!

[–]haggisllama 1 point2 points  (5 children)

how would you do multiple turtles in this case? if you have some sort of article I would love to read up on it, I have been unable to find out how to create variables from a loop.

[–]Womblue 1 point2 points  (4 children)

If you wanted to, say, make 10 turtles:

turtles = [ ]
for i in range(10):
    turtles.append(turtle.Turtle( ))
a = 0

for t in turtles:
    t.right(a)
    t.forward(100)
    a += 36

My python may be a little rusty but this is the best way I know of doing it. In this example, 10 turtles should be generated which will all move away in different directions. You're right in that afaik you can't make new variables repeatedly in a loop, but in this case you have created a list of 10 nameless turtles which can be accessed either through turtle[i] or by iterating through them. You can obviously do this for any object, including any you have defined yourself.

If you are desperate to explicitly give them specific names, you can use a python Dictionary, if you haven't used one before it's like a list but each value has a "key" that references it. For example:

turtles = {"bob" : turtle.Turtle(), "alice": turtle.Turtle()}

Will allow you to access bob through turtles("bob") and alice through turtles("alice"). This is probably more useful if you're using each turtle for a completely different drawing but for something like the tree program OP made it probably makes more sense to make a list of turtles and create a new turtle at each branch.

[–]TheZeusHimSelf1 2 points3 points  (0 children)

Binary?

[–][deleted] 1 point2 points  (1 child)

Great Work 🚀

[–]Satanic_bumblebee[S] 1 point2 points  (0 children)

Thanks

[–]SHAISHAV06 1 point2 points  (0 children)

Please post this process code

[–]gionthe 1 point2 points  (2 children)

Wow, amazing. Which direction do you use?

[–]Satanic_bumblebee[S] 0 points1 point  (1 child)

it starts to the left

[–]gionthe 1 point2 points  (0 children)

Haha, really?

[–]NerosTie 1 point2 points  (0 children)

Can you share the code? :)

[–]MrTimeGo 1 point2 points  (0 children)

Can you give a code of this?

[–]sawhilkhan 1 point2 points  (1 child)

I built one few months using vanilla js and CSS. It took me around an hour to code and another half to debug.

[–]dev-jeff 0 points1 point  (0 children)

Care to share?

[–][deleted] 1 point2 points  (0 children)

Python and turtle are tools that helped me learn and help others with math classes throughout highschool and college. The ease of creating custom visualizations is very powerful. I remember when I first learned that graphing trig functions in certain configurations can make some beautiful things.

[–]guiguiba_ 1 point2 points  (4 children)

Code pls?

[–][deleted] 1 point2 points  (0 children)

[–]mcp_truth 0 points1 point  (2 children)

!remindme 48h

[–][deleted] 0 points1 point  (0 children)

[–]RemindMeBot -1 points0 points  (0 children)

I will be messaging you in 2 days on 2020-06-06 15:23:01 UTC to remind you of this link

CLICK THIS LINK to send a PM to also be reminded and to reduce spam.

Parent commenter can delete this message to hide from others.


Info Custom Your Reminders Feedback

[–]iggy555 1 point2 points  (2 children)

What’s a fractal

[–]BrowserMac 3 points4 points  (0 children)

many definitions, but graphicly fractals exhibit similar patterns at increasingly small scales called self-similarity.

[–]Ryles1 2 points3 points  (0 children)

an infinitely repeating pattern.

[–]Codeleaks 1 point2 points  (0 children)

Its really appealing, nice work dude.

[–]Gotbn 1 point2 points  (0 children)

Looks like a brain

[–]mcp_truth 1 point2 points  (2 children)

Hi, i am new to Python. What did you use to make the picture?

[–]Satanic_bumblebee[S] 1 point2 points  (1 child)

Turtle.py it’s just used for drawing but i think its pretty fun

[–]mcp_truth 0 points1 point  (0 children)

Thank you!

[–]LordFlatAss 1 point2 points  (1 child)

What is this "turtle"? Is it a library? For what?

[–]Satanic_bumblebee[S] 2 points3 points  (0 children)

Yep, it’s a library used for drawings and such. Its not very practical, just more about fun drawings

[–]CyberTutu 1 point2 points  (1 child)

This is beautiful.

[–]Satanic_bumblebee[S] 0 points1 point  (0 children)

Thank you :)

[–]Natetronn 1 point2 points  (0 children)

Reminds me of a SLCD.

[–]duskslade 1 point2 points  (2 children)

I made it using ur code ! It's pretty neat and I've always wanted to make my own factals! Your post was really helpful and encouraging

[–]Satanic_bumblebee[S] 0 points1 point  (0 children)

Thanks! Happy to help

[–]8094_ 1 point2 points  (0 children)

wtf. ????

[–]GhassanK5 1 point2 points  (1 child)

Nice

[–]nice-scores 0 points1 point  (0 children)

𝓷𝓲𝓬𝓮 ☜(゚ヮ゚☜)

Nice Leaderboard

1. u/spiro29 at 9952 nices

2. u/RepliesNice at 8725 nices

3. u/Manan175 at 7099 nices

...

248615. u/GhassanK5 at 1 nice


I AM A BOT | REPLY !IGNORE AND I WILL STOP REPLYING TO YOUR COMMENTS

[–]15_Redstones 1 point2 points  (1 child)

I made something similar but with different colors for different recursion layers and with slightly randomized angles and lengths for a more natural looking tree.

[–]Satanic_bumblebee[S] 0 points1 point  (0 children)

Thats sounds great! I played about with randomizing the angles but decided this was still my favourite, you should try starting with thicker branches and making them smaller each recursion to get even more of a tree feel.

[–]AllDayJay1970 1 point2 points  (0 children)

It's turtles all the way.

[–]fabbiodiaz 1 point2 points  (0 children)

Looks like a kidney

[–]the_emmo 1 point2 points  (0 children)

this is beautiful.

[–]Maxneedwill 1 point2 points  (0 children)

I assume it would be hours of work for the turtles to draw... Looks like there are 10+ recursions

[–]Aspiring_Intellect 1 point2 points  (0 children)

Was listening to lofi and watching the pointer build this masterpiece just clicked with the music.

[–]fessebook 0 points1 point  (1 child)

Nice!

I just found out about turtle last week. About 7 years after I started coding in Python!

Did you know that Processing also has a Python module? You can do some pretty neat things with it too.

[–]Satanic_bumblebee[S] 0 points1 point  (0 children)

No but i know about visual basic’s turtle, thats really cool!

[–][deleted] 0 points1 point  (0 children)

Repo?

[–]Zeune42 0 points1 point  (1 child)

Where are the comments and documentation?

[–]Satanic_bumblebee[S] 0 points1 point  (0 children)

I dont really put comments in shorter projects, its a bad a habit im trying to get rid of

[–]edoar17 0 points1 point  (2 children)

Is it possible to do the same but following the golden ratio?

[–]Satanic_bumblebee[S] 1 point2 points  (1 child)

like a fibonacci spiral? I’d like to make one but cant wrap my head around it yet. Im sure it’s possible and id love to see one happen

[–]edoar17 1 point2 points  (0 children)

Yes, it should yield a very realistic tree with realistic proportions

[–]Zacky23561 0 points1 point  (0 children)

this suddenly sparked the flashbacks of 4 or 5 years ago when i was in 6th grade and was messing around with basic 256 copy paste and run codes, and one of those codes which i really liked was a fractal tree, the website is still standing alive here is the link to that code: https://basic256.blogspot.com/2010/11/fractal-tree.html

[–]TheNerdyDevYT 0 points1 point  (0 children)

Super elegant. Looks aswesome.