5 kyu
Graphics 02: Drawing Circles
69smile67
Loading description...
Graphics
Algorithms
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
Further documentation of the API: x and y specify the center of the circle.
Approved!
Thanks again;-)! Really hard-working:-)...
Your
Graphics
series look quite unique and intersting. I guess it's worth to approve them ;P I will check also the rest when I will find some free time.About 2 years old, almost my first tries for publishing katas, so not really "perfect code" (today i would do some things different);-)... So good luck and thanks for your approvals!
You could refactor your code if you are ashamed :P But from the other hand a wise man says
if it's not broke, don't fix it
.It's not really necessary i think - good old time... first steps... memories... :-)
This comment has been hidden.
Hi, long time ago, hope you are well;-)... the problem is not the rounding, but the condition 'The circle has to be "complete", no single points with gaps between.' (see end of description). Your solution has too much gaps between single points (some are ok, because of my "rounding" max. two). So your steps between points should be smaller, especially for the third testcase with a big radius. Hope it helps, should be easy to do some little changes;-)!
PS: If you need a concrete hint what to change in your code, tell me (you are close to solve it, your solution generally works);-)...
Thanks, I got the point and submited the final solution.
This comment has been hidden.
This comment has been hidden.
This comment has been hidden.
This comment has been hidden.
I can't see what are you said ,because : "This comment has been hidden."
Hmmmmm...I'll try it later,I'm hungry now...
Ok... sorry, forgot that you haven't solved it, so you can't read it... Try it again and it should work... you will find my explanations after completing the kata, but here you can see the difference:
Difference (your circle is on right side)
Part of my answer was: I can see an incomplete part of your circle, a linepart where y is 50 at the bottom of the circle, perhaps the clipping is wrong for 1 pixel (it's a circle at 50,25 and radius 25 which means complete canvas height). The output of the testcase 2 shows this difference (some "DDDDDDD's" at the bottom, little bit to the right). All the other tastcases were ok... The testcases compare both images yours and my image, so my solution "deletes" every pixel and around +/-1 inside your image, but your pixels do not delete every pixel inside my image - because the complete linepart is missing which causes this deleting.
So enjoy your meal;-)!
Again one hint, tested your solution with my random tests (Submit- Button)... and there's often an extra point missing, so your solution isn't accepted... perhaps you change your rounding (and it's necessary to combine all the points on the circle, single points with gaps between are not enough!)? I enlarged the "delta" from +/- 1 pixel to +/-2 pixel around my solution points (only for circles and ellipses, lines at +/- 1 point)... but your solution doesn't work on every random test (normally one point missing or too much?!)