# Draw every possible unique combination of a 3x3 circle grid with two colors

**URL:** <https://discourse.processing.org/t/draw-every-possible-unique-combination-of-a-3x3-circle-grid-with-two-colors/22338>\
**Category:** Coding Questions\
**Created:** [July 2, 2020, 9:52pm UTC](https://discourse.processing.org/t/draw-every-possible-unique-combination-of-a-3x3-circle-grid-with-two-colors/22338 "2020-07-02T21:52:51Z")\
**Posts on this page:** 4\
**Page:** 2

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [July 7, 2020, 5:32pm UTC](https://discourse.processing.org/t/draw-every-possible-unique-combination-of-a-3x3-circle-grid-with-two-colors/22338/23 "2020-07-07T17:32:09Z")

</div>

Are you solved it while I was typing!

Congratulations!

Chrisir

---

<div class="post-metadata">

**Author:** ![whistlinpete](https://avatars.discourse-cdn.com/v4/letter/w/0ea827/32.png) [@whistlinpete](https://discourse.processing.org/u/whistlinpete)\
**Post date:** [July 7, 2020, 5:32pm UTC](https://discourse.processing.org/t/draw-every-possible-unique-combination-of-a-3x3-circle-grid-with-two-colors/22338/24 "2020-07-07T17:32:35Z")

</div>

Thanks so much for your help!!!

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [July 7, 2020, 5:34pm UTC](https://discourse.processing.org/t/draw-every-possible-unique-combination-of-a-3x3-circle-grid-with-two-colors/22338/25 "2020-07-07T17:34:44Z")

</div>

OK, now house cleaning.

Write a function showOneConfig() that pretty much holds everything after this line:

```auto
    String binaryk = (binary(k, 9));

```

It gets the parameters showOneConfig ( binaryk , x, y );

Show this code here.

Then make a for-loop inside showOneConfig for each char so it’s more DRY.

(Or make 2 nested for-loops.)

😉

---

<div class="post-metadata">

**Author:** ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)\
**Post date:** [July 7, 2020, 5:47pm UTC](https://discourse.processing.org/t/draw-every-possible-unique-combination-of-a-3x3-circle-grid-with-two-colors/22338/26 "2020-07-07T17:47:13Z")

</div>

Great work!

I am pleased to see that you worked through all of this.

I learned along the way as well! All that [bit fiddling](https://en.wikipedia.org/wiki/Bit_manipulation) I did in the past is still part of me.

Every time you look at your code you will see something new to tweak.

Enjoy the journey!

`:)`

[Previous page](https://discourse.processing.org/t/draw-every-possible-unique-combination-of-a-3x3-circle-grid-with-two-colors/22338.md?page=1)
