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.
It is a generator btw.
i used my solution for the first kata and adjusted it to fit the non adjacency rule . now it's passing all of the tests exepct like 5 of them that are like this example :
input:
[1, 1, 1, 0, 0, 0, 0, 0, 0, 0],
[1, 1, 0, 0, 0, 0, 0, 0, 1, 0],
[1, 1, 0, 0, 1, 1, 1, 0, 1, 0],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[1, 0, 0, 0, 0, 0, 0, 0, 1, 0],
[0, 0, 0, 0, 1, 1, 1, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 1, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 1, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
after running the code :
[4, 3, 1, 0, 0, 0, 0, 0, 0, 0],
[4, 3, 0, 0, 0, 0, 0, 0, 2, 0],
[4, 3, 0, 0, 3, 3, 3, 0, 2, 0],
[4, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[1, 0, 0, 0, 0, 0, 0, 0, 1, 0],
[0, 0, 0, 0, 2, 2, 1, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 1, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 1, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
as you can see its prioritizing bigger ships first wich doesnt work in a minority of the cases.
any suggestions on how i should assign ships when they are next to each other
This comment is hidden because it contains spoiler information about the solution
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 confused as to why it knows c represents characters in the strings
This comment is hidden because it contains spoiler information about the solution
cool answer
This comment is hidden because it contains spoiler information about the solution
Wow!
This comment is hidden because it contains spoiler information about the solution
I do not like that I cannot see the test because the messages I was getting for my failures were never correct, so it was extremely hard to debug, and I eventually gave up on this kata.
It was telling me things like "must return False if there are diagonals" (my code could not even count diagonals) and "must return True with ships touching," but it did, and it never failed on account of ships touching, so I had no idea what was wrong with my code, and it was just frustrating.
Is there any way for you to make the tests viewable?
This comment is hidden because it contains spoiler information about the solution
in python
[
[1, 0, 0, 0, 0, 1, 1, 0, 0, 0],
[1, 0, 0, 0, 0, 0, 0, 0, 1, 0],
[1, 1, 0, 0, 1, 1, 1, 0, 1, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 1, 0],
[0, 0, 0, 0, 1, 1, 1, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 1, 0],
[0, 1, 0, 1, 0, 0, 0, 0, 0, 0],
[0, 1, 0, 0, 0, 0, 0, 1, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
]
Must return true if ships are in contact
Why this should be true? Where is the battleship?
omg! it's so simple!
Loading more items...