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.
You can use uppercase X to use Capitalized hex.
This comment is hidden because it contains spoiler information about the solution
This is pretty awesome, not very readable though.
This comment is hidden because it contains spoiler information about the solution
I think this is now a duplicate of https://www.codewars.com/kata/touching-rectangles.
thanks :) your kata is pretty good too
Ahh yes very well spotted, seems I got my shapes crossed. The code I wrote was focused on basic collision detection for squares, I didn't anticipate that case you have shown above.
Thank you for pointing that out, I have now made the code one test squares against each other. This should resolve the issue.
My solution works for rectangles and at any position negative or positive, I have tested it in 2D programming.. I will work in some negative tests.
Just added negative cases and my code works fine, thanks for your suggestion.
Long gone is the time when implementing algorithms of this level was interesting to me.
I understand. Just make sure you test all the cases, you own solution is incorrect and fails the test above.
Thanks;-)!
Use of java.awt.Rectangle is only cheating yourself!
Really interesting solution, good one.
Well done!
The point of this Kata was for people to write their own method to detect intersection, not just used java.awt.Rectangle.
Loading more items...