Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Plan for modifications:
although more random tests wouldn't help in this instance I believe as the edge cases will still be the same ones. Where should
make_disk
go then? (I'm new to authoring kata so I'm still figuring this stuff out)well spotted - will have a think to see whether I can stop the brute force approach to find edge cases
Indeed, thanks for pointing that out – the new solution fixes the case when no solution is found (and indeed there were cases before when the wrong solution was found ). I believe the latest reference solution fixes both issues as I'm taking care of the precision of radius within the code now
Brute force: guilty as charged. I'll look for a cleaner and neater solution (and hopefully I'll see some better solutions by others posted soon)
Reference solution now rounds to 1 decimal place.
Thanks for your comment. Do you have an example in which you think the reference solution is incorrect? The requirement states that "if the centre of the pixel is within the disk, then it is represented as a 1, and if the centre of the pixel is outside the disk then its value is 0." This is not an ambiguous condition since the centre of a pixel, say (2, 2) is either within the radius of the circle or outside. This gives a clear one-to-one mapping from radius to array but possibly a many-to-one inverse mapping from array to radius. This requirement means that the solution is dependant of a "specific" precision requirement but that the solution needs to solve the above requirement.
Possibly the old version could be a separarte easier kata but this version poses a more interesting challenge, I believe. Happy to discuss further of course, hoping to clarify to you and hence in the kata description the actual requirement being made
I have updated this beta to include more random test cases and to include the option of indeterminate cases in which the input array does not have sufficient resolution to return a unique radius.
Comments welcome…
Great kata to help understanding of OOP.
Ah, figured it out… I was being silly
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
I'm only working in Python. It seems you're on JS…
Enjoyed this Kata although it felt a bit easier than 5 kyu to me. Or maybe I'm still 'calibrating' the difficulty levels
This comment is hidden because it contains spoiler information about the solution
I enjoyed this too. Not sure my solution is as elegant as some of the others, but it fits my current style and I'm relatively pleased I got it done in an hour or so.
So how about that LinkedIn endoresement?!