# Loop inside another loop

**URL:** <https://discourse.processing.org/t/loop-inside-another-loop/33957>\
**Category:** Coding Questions\
**Tags:** homework\
**Created:** [December 6, 2021, 12:24pm UTC](https://discourse.processing.org/t/loop-inside-another-loop/33957 "2021-12-06T12:24:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![aya](https://avatars.discourse-cdn.com/v4/letter/a/a6a055/32.png) [@aya](https://discourse.processing.org/u/aya)\
**Post date:** [December 6, 2021, 12:24pm UTC](https://discourse.processing.org/t/loop-inside-another-loop/33957/1 "2021-12-06T12:24:47Z")

</div>

> please format code with \</\> button \* [homework policy](https://discourse.processing.org/faq/#homework) \* [asking questions](https://discourse.processing.org/t/2147)

![04](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/9/947efd215f25fe0d1d78e813c8c017340c02c261.jpeg)

I was able to create the tree in the image but the code consists of two loops one for the trunk and one and branches, and I could not combine them together. I would like to get tips.  
thank you

---

<div class="post-metadata">

**Author:** ![SNICKRS](https://avatars.discourse-cdn.com/v4/letter/s/43a26b/32.png) [@SNICKRS](https://discourse.processing.org/u/SNICKRS)\
**Post date:** [December 7, 2021, 12:12am UTC](https://discourse.processing.org/t/loop-inside-another-loop/33957/2 "2021-12-07T00:12:44Z")

</div>

Please post your code so that we have an idea of what you need help with

---

<div class="post-metadata">

**Author:** ![aya](https://avatars.discourse-cdn.com/v4/letter/a/a6a055/32.png) [@aya](https://discourse.processing.org/u/aya)\
**Post date:** [December 7, 2021, 9:49pm UTC](https://discourse.processing.org/t/loop-inside-another-loop/33957/3 "2021-12-07T21:49:41Z")

</div>

I don’t have this option to add afile here, I don’t know why!

---

<div class="post-metadata">

**Author:** ![SNICKRS](https://avatars.discourse-cdn.com/v4/letter/s/43a26b/32.png) [@SNICKRS](https://discourse.processing.org/u/SNICKRS)\
**Post date:** [December 14, 2021, 1:14am UTC](https://discourse.processing.org/t/loop-inside-another-loop/33957/4 "2021-12-14T01:14:12Z")

</div>

Instead of posting the code as a file, you would click the format button (next to the quotation mark button) and then copy/paste your code into the designated space.
