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.
Great programming kata to exercise with, congratulations.
I thought for every hit to the ship 0.5 points. But I did not pass the test - I racked my head, read the comments and only saw there that 0.5 times the number of damaged ships was needed to calculate...
Either I'm stupid, or the translator let me down, but in the end, thanks to the commentators)
Nice kata!
python new test framework is required. updated in this fork
Hello. The following information is received in the test: "There should be 1 ship sunk: expected +0 to equal 1"
And even if I assign "result.sync = 1;" before return (as a test), the test result will be "There should be 1 ship sunk: expected +0 to equal 1".
The rest, except for the value "1", the test perceives as it should (if I assign "result.sync = 100;" before return (as a test), the test result will be "There should be 1 ship sunk: expected 100 to equal 1")
What could be the reason? (why does the test perceive "1" as "+0"?)
(JS solution)
or just
assert.deepEqual
:)Loved it. Thanks alot for this.
God that was brutal. Thumbs up
Didnt know the boats actually had hp according to their lengths.
super fun and great kata but kata details were a bit iffy....
This comment is hidden because it contains spoiler information about the solution
"-> nope, that list of attacks leads actually to the numbers 2,2,1,1, boats 1 & 2 sunken, the "3" untouched."
I do indeed get the numbers 2,2,1,1 and thus 1 boat is sunken, 1 damaged, and 1 untouched. Just like the second sample test case is expecting. I am solving in ruby.
So this is in contrast to the result that Blind4Basics gave that 2 boats are sunken. I got confused by that comment and somehow overlooked that boat 1 had a length of 3 in the example given.
Anyway nice kata, I did get confused but that is not necessarily bad practice in my opinion.
Language-specific output example in description is missing for Java.
Nice kata!
Digits 1-3 represent boats which vary in length 1-4 spaces long.
maybe
diff digits means diff boats, same digtis means one boat
is more clear.at first look, e.g [2,2,2,2], I thought there are two boats, each occupied 2 space, and the hard part is to split diff boats~
sunk = all boats that are sunk
: the number of sunk boats (all one-boat-occupied-space been hit).Any way, a nice game kata~ thanks~
It's a fun kata. Once you find out how to arrange the board its quite easy. Rearranging an array is not so uncommon I would say - taking into account my limited knowledge of coding though.
Loading more items...