# How would you do this?

**URL:** <https://discourse.processing.org/t/how-would-you-do-this/35456>\
**Category:** Beginners\
**Created:** [February 26, 2022, 2:37am UTC](https://discourse.processing.org/t/how-would-you-do-this/35456 "2022-02-26T02:37:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous-54](https://avatars.discourse-cdn.com/v4/letter/a/65b543/32.png) [@anonymous-54](https://discourse.processing.org/u/anonymous-54)\
**Post date:** [February 26, 2022, 2:37am UTC](https://discourse.processing.org/t/how-would-you-do-this/35456/1 "2022-02-26T02:37:31Z")

</div>

New to processing as I’ve just started it in uni and there’s a question I don’t really know how to do after doing the 8x8 grid in blue. Here is the question ([Imgur: The magic of the Internet](https://imgur.com/a/o5BTB9i/)) thank you for any 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:** [February 26, 2022, 7:25am UTC](https://discourse.processing.org/t/how-would-you-do-this/35456/3 "2022-02-26T07:25:11Z")

</div>

It’s about nested for loops

So one for loop inside another

This means, the inner draws a row (its cells) and the outer repeats this for each row (the rows)

Show your attempt please

Ah, you mean after the blue grid, ok

---

<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:** [February 26, 2022, 12:23pm UTC](https://discourse.processing.org/t/how-would-you-do-this/35456/4 "2022-02-26T12:23:16Z")

</div>

After the blue grid we got a chess board

**Distinguish between two types of squares:**

Sum of row number plus column number is divisible by 2

```auto
if((x+y ) % 2 == 0 ) { // adjust names x and y to your liking 
...
}
else {
...
}

```

Then proceed with the two different types of cells

each has a for loop (not nested)

**Remark for the 4 rects**

Look at `rectMode(CENTER);` might help for the rects

Show your attempt
