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 may not be a "kata issue" but it would definitely be a good idea to update it as var is not the correct convention now that we have let and const. Or at the least explain that let and const exist but that this kata is using var by choice. Even better just test for the variable instead of how it is declared.
I do agree that it isn't an issue, but it would be a great boon for the kata and future learners to make the small adjustment.
Thank you for pointing that out! I was able to solve it eventually, but not nearly as nicely as some of the other solutions I saw. I have learned a lot from those solutions. Although I do feel that the Description should have declared that explicitly to clear up some confusion on how the class and method were going to be used.
If you look at the sample tests, you can see how your function is being used.
Only
Solution.main()
will be called and no object of the classSolution
will be created.In your solution,
main
is a function of objects with the classSolution
, but it isn't a function of the class itself.This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Thank you for posting this. I was pretty sure that was the case, but seeing someone else posting it made this kata simple
I completely forgot that your could use not there! Great job
This comment is hidden because it contains spoiler information about the solution
This is so pretty, but wow that took me a bit to wrap my head around how to explain it to the gerbils in my brain... Thank you for the eye candy! I will be remembering this one
Cool thanks for taking the time to answer!
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Oh... thanks :D
Well seeing this made my hard work feel stupid! ROFL Thanks for reminding me how math works again...
('..C..D..m..',5)
— 'Escaped!'('..m...D...C..',6)
— 'Escaped!'You have a relatively fair point of view though. Firstly I though similarly — if
'D'
separates'm'
and'C'
it should always be 'Protected'. But the kata implemented in such a way that if distance between'C'
and'm'
is too big result should be 'Escaped!' regardless of'D'
.Last example to clarify:
('m...D.........C', 5)
=>'Escaped!'
. I hope it make sense. PS. The kata was completed almost 100 times in JS -> It's very rarely that tests are broken in such cases.Loading more items...