Play Home Contribute Github Join Us! Discourse Staff Members Github Contribution Guides Team

[Solved] Polygonception only works with squares

I’ve written code that appears to do the right thing. But when I submit, only the squares are marked with a tick - triangles, pentagons and hexagons are marked as incomplete.

image

(Edited to remove code)


What am I missing?

Comparing your code to mine, the biggest differences occur in the polygon function. I’ve PM’d you what I came up with…I’m hoping this will give you some insight on what’s wrong. I’m not fluent enough with fractals to see anything that sticks out.

2 Likes

The funny part, like you said, is that your pics look perfect, at least to the naked eye. Just for grins, I’m going to convert my function and try it in your code…we’ll see

1 Like

Thank dedreous, I’ve passed the level :smiley:.

I translated your code (which was actually more similar than I was expecting, just you are braver at stacking variables inside each other). I tried it and it failed, so I tried changing my if statement to be like yours. This made the whole thing stop working (I think I got my brackets wrong). So I undid and resubmitted (to check I’d undone the right amount)…and bizarrely it worked.

This time was the first time my seed had no squares at all…

Thanks for your help with working it through!

2 Likes