Need help with automating a for(;;) loop via /r/learnprogramming


Need help with automating a for(;;) loop

Hello, I've been struggling to wrap my head around this one. What I want to do is reduce this code:

ellipse(c - r, cc, rrr, rrr); ellipse(c + r, cc, rrr, rrr); ellipse(c - rr, cc + rr, rrr, rrr); ellipse(c, cc + r, rrr, rrr); ellipse(c + rr, cc + rr, rrr, rrr); ellipse(c - rr, cc - rr, rrr, rrr); ellipse(c, cc - r, rrr, rrr); ellipse(c + rr, cc - rr, rrr, rrr); ellipse(c + rrr, cc + rrr, rrr, rrr); ellipse(c + rrr, cc - rrr, rrr, rrr); ellipse(c - rrr, cc - rrr, rrr, rrr); ellipse(c - rrr, cc + rrr, rrr, rrr); 

using for(;;) loops. I imagine that I'll need a nested loop, but I can't seem to figure it out. Can somebody help me out?

Submitted July 17, 2017 at 09:14PM by MrVaughan
via reddit http://ift.tt/2tzRxGM

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s