# Is there an elegant way to generate the permutations of all the members of a set?

**URL:** <https://discourse.processing.org/t/is-there-an-elegant-way-to-generate-the-permutations-of-all-the-members-of-a-set/31810>\
**Category:** Coding Questions\
**Created:** [August 20, 2021, 5:04pm UTC](https://discourse.processing.org/t/is-there-an-elegant-way-to-generate-the-permutations-of-all-the-members-of-a-set/31810 "2021-08-20T17:04:55Z")\
**Posts on this page:** 1\
**Showing post:** 24

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [August 26, 2021, 5:06pm UTC](https://discourse.processing.org/t/is-there-an-elegant-way-to-generate-the-permutations-of-all-the-members-of-a-set/31810/24 "2021-08-26T17:06:24Z")

</div>

> [@paulstgeorge](#):
>
> I like the Fractal tree very much. I would like it even more if I could watch the tree grow (be drawn).

I made Recursor just for that purpose! It allows you to customize the order of generating and drawing from a recursive stack, creating different animation behaviors

[![](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/9/981ec1082b59780f2d9f714cce77f78e85730937.gif) ](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/9/981ec1082b59780f2d9f714cce77f78e85730937.gif)

> [@Update screen during draw() without thread?](https://discourse.processing.org/t/update-screen-during-draw-without-thread/18599/5):
>
> If you want to be able to render progressively from an unbounded recursive process in a single thread – and don’t want to use thread() – then there are ways. I mentioned a linked data structure that acts as a recursion queue. I actually have a draft library I wrote that does that – “Recursor”. Supposing you start out with a basic recursive function that cannot be animated. It looks like this: void tree(float[] seg) { line(seg[0], seg[1], seg[0]+seg[2], seg[1]+seg[3]); PVector s = new PV…

---

_[View the full topic](https://discourse.processing.org/t/is-there-an-elegant-way-to-generate-the-permutations-of-all-the-members-of-a-set/31810)._
