I think something is incoherent.
For example in the HalfMoon test, the ‘j’ column should always show crop since it is right in the middle on the 2 circles.
The two centers are at same distance from this column.
So either the ‘jm’ point (for exemple) is touched by both circles, either it is touched by none.
In all case, the crop should appear.
However, the expected result is no crop for ‘jk’,‘jl’,‘jm’,‘jn’,‘jo’.
Since the instructions are sequential (I guess) this is inconsistant ; behavior is not the same for circle 1 and 2.
I liked the puzzle, but it took me a while to figure out which was the way to actually make a circle. I think the definition of circle should be more explicit in the problem text because it is not intuitive, even if it’s, I reckon, geometrically understandable.
For example, using Pitagora’s theorem to define the circle as every point with (distance <= diameter/2) from the center, in the case of a circle with diameter 3 and center ff you get as output this(a square):
The radius appears to be incorrect. You might have used integer division instead of floating-point division when calculating the radius from the diameter.
Hello, I’d like a little extra help here (thanks again for the first answer). I’m stuck on test 4 Bull’s eye (and also on test 5). Here’s what I get with my program:
action = MOW, col = 9, line = 12, diameter = 31
action = PLANTMOW, col = 9, line = 12, diameter = 27
action = PLANTMOW, col = 9, line = 12, diameter = 23
action = PLANTMOW, col = 9, line = 12, diameter = 19
action = PLANTMOW, col = 9, line = 12, diameter = 15
action = PLANTMOW, col = 9, line = 12, diameter = 11
action = PLANTMOW, col = 9, line = 12, diameter = 7
action = PLANTMOW, col = 9, line = 12, diameter = 1
When trying to edit a spot that is out of range (e.g. when center_line-i, center_col-j is -1, 1), your code edits some other spot on the field boundary (in this case 0, 1) instead of skipping this spot.
This puzzle is very interesting.
But something a little bit strange happens to me.
The Bulls eye and Bonus test failed. But when I submitted my code it pass every test.
There might be some minimal bug.
I spent more time on the task than it actually takes because when I was studying, elementary school was called grades 1 through 4 and there was only basic mathematics (and geometry was covered in senior grades 5+), so I thought it was a trick(Do not use them; stick with what you learned in elementary school.) and started looking for algorithms that are used to draw raster circles and all of them turned out to be unsuitable for this task, and only the next day I realized that the solution is very simple and yet this was a hint, not a trick.