[Community Puzzle] Crop-Circles

Coding Games and Programming Challenges to Code Better

Send your feedback or ask for help here!

Created by @Lisa-Has-Ideas,validated by @Rafarafa,@Westicles and @Zorg1.
If you have any issues, feel free to ping them.

When a spot is “on the circle”, should it be cropped or not?
This definiton is missing.

intput jm4, depends on how you define it, output can be
either

{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}
{}{}{}{}{}{}{}{}{}  {}{}{}{}{}{}{}{}{}
{}{}{}{}{}{}{}{}      {}{}{}{}{}{}{}{}
{}{}{}{}{}{}{}          {}{}{}{}{}{}{}
{}{}{}{}{}{}{}{}      {}{}{}{}{}{}{}{}
{}{}{}{}{}{}{}{}{}  {}{}{}{}{}{}{}{}{}
{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}

or

{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}
{}{}{}{}{}{}{}{}      {}{}{}{}{}{}{}{}
{}{}{}{}{}{}{}{}      {}{}{}{}{}{}{}{}
{}{}{}{}{}{}{}{}      {}{}{}{}{}{}{}{}
{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}
1 Like

I tried < and ⩽, it seems that it’s <.

Yes, a circle includes its circumference

I added “(To be clear, a circle includes its circumference.)”

If you gave me a low rating, please consider adjusting it upward.

I added the sentence “(To be clear, a circle includes its circumference.)”

If you gave me a low rating, please consider adjusting it upward.

No, I didn’t.

1 Like

I didn’t either

1 Like

I used Bresenham(sp?) circle algorithm … and I think my circles look better in Bullseye and Bonus (as they fail your validator) here’s Bonus:

                  {}                  
                  {}                  
                  {}                  
                {}{}{}                
                {}{}{}                
              {}{}{}{}{}              
            {}{}{}{}{}{}{}            
          {}{}{}{}{}{}{}{}{}          
      {}{}{}{}          {}{}{}{}      
{}{}{}{}{}{}    {}{}{}    {}{}{}{}{}{}
{}{}{}{}{}    {}{}{}{}{}    {}{}{}{}{}
{}{}{}{}{}  {}{}{}{}{}{}{}  {}{}{}{}{}
{}{}{}{}{}  {}{}{}{}{}{}{}  {}{}{}{}{}
{}{}{}{}{}  {}{}{}{}{}{}{}  {}{}{}{}{}
{}{}{}{}{}    {}{}{}{}{}    {}{}{}{}{}
{}{}{}{}{}{}    {}{}{}    {}{}{}{}{}{}
      {}{}{}{}          {}{}{}{}      
          {}{}{}{}{}{}{}{}{}          
            {}{}{}{}{}{}{}            
              {}{}{}{}{}              
                {}{}{}                
                {}{}{}                
                  {}                  
                  {}                  
                  {}                  
2 Likes

Well isn’t that interesting !!

I didn’t even know there were “Circle Algorithm” – i was just relying on you know 4th grade geometry :slight_smile:

I will have to check that out.

1 Like

Yes, the difference is slight, but your version is certainly better !!
Codingame is soooo educational, even when you don’t expect it to be.

3 Likes

Nice concept but it seems hard to get exactly the same approximately circular. I simply calculate the distance to the center, if it’s not bigger than radius, I considered it as in.

{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}
{}{}{}{}{}{}{}{}{}{}{}{}{}{}  {}{}{}{}
{}{}{}{}{}  {}{}{}{}{}{}          {}{}
{}{}{}          {}{}{}{}          {}{}
{}{}              {}{}              {}
{}{}              {}{}{}          {}{}
{}                  {}{}          {}{}
{}{}              {}{}{}{}{}  {}{}{}{}
{}{}              {}{}{}{}{}{}{}{}{}{}
{}{}{}          {}{}{}{}{}{}{}{}{}{}{}
{}{}{}{}{}  {}{}{}{}{}{}{}{}{}{}{}{}{}
{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}
{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}
{}{}{}{}{}{}{}{}{}{}{}  {}{}{}{}{}{}{}
{}{}{}{}{}{}{}{}              {}{}{}{}
{}{}{}{}{}{}{}                  {}{}{}
{}{}{}{}{}{}{}                  {}{}{}
{}{}{}{}{}{}{}                  {}{}{}
{}{}{}{}{}{}                      {}{}
{}{}{}{}{}{}{}                  {}{}{}
{}{}{}{}{}{}{}                  {}{}{}
{}{}{}{}{}{}{}                  {}{}{}
{}{}{}{}{}{}{}{}              {}{}{}{}
{}{}{}{}{}{}{}{}{}{}{}  {}{}{}{}{}{}{}
{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}
4 Likes

Thanks for the feedback, and welcome to the wonderful world of posting :slight_smile:

Off hand, I am seeing maybe these possibilities:
(1) Could it be a rounding error ??? (Are you sure you are accurately calculating distance to center)
(2) Are you including the circumference? For example, if the “distance to center” is 5.5, and the diameter is 11, then you should INCLUDE it.
(3) Is the radius you are testing against accurate? Make sure that you are not making it an “int”. For example, if the diameter is 9, then the radius should be 4.5 (not 4).

If these do not help, perhaps you will send me your code??

thanks. yes it was the rounding issue and Int issue. I cleared them up and got all the beautiful crop-circles now! :smiley:

1 Like

Hey,
Is the puzzle working in C#?
I’m outputing (through Console.WriteLine()) a string that has the exact same shape as requested by the puzzle, yet the tests fail and the console displays:

Failure
Found: "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}End of line (\n)"
Expected: Nothing

Aren’t we supposed to pass the output through a string?

You could have output double End-of-line at the very end.

1 Like

Thanks, that’s it! I didn’t get that the “Nothing” related to the end-of-line only!

Super project, I had a lot of fun.

1 Like

Loved the puzzle! But gave 4 points for not defining the circle for discretely pixelated crop field. My first attempt was a Bresenham circle algorithm and that failed. It took several trials and errors to find the algorithm that made the puzzle validator happy.

2 Likes

Thanks for the feedback, and that is definitely a fair observation.

When I was writing the puzzle, I never even knew there was a different way to make a circle than what I learned in 4th-grade. I learned that later.

My lame/silly justification: Since Jack Elton Bresenham was an earthling, the aliens who created the technology (back on their home planet) would not be familiar with his work.