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.
i really should have put a bit more thinking into this - i forgot to check if the player has won
thank you for pointing that out
yup, forgot to copy paste into sample tests - thanks
I just copy-pasted my java tests - my bad. I hope this "new" version is better.
If it is too similar, I could make this a bit more complex by including both starting possibilities, resulting in 3 kata's about this puzzle:
(just an idea)
good hint, when searching for similar kata's i only found "NIM - the game" (https://www.codewars.com/kata/54120de842dff35232000195, i think there is enough difference hence its call Simplified Nim)
im not sure if it is too similar,
i think the main difference is throwing exceptions (and obviously the AI goes second in this kata)
you're absolutely right
the random tests now do random stuff until they can "end" the game, and then they will win it
(now they are at least not completely useless, even tho the kata is too easy for useful random tests)
the print was, the bigger brain lag fix should be up now
(sometimes code wars is a bit bugged when a new test is released)
woops, forgot to take that out
it should be fixed now
yikes, i thought i fixed that
not containing a single word is indeed an issue.
This comment is hidden because it contains spoiler information about the solution
that is intended
first of all, thank you for the feedback.
could you explain what you mean?
it is (and should be, its a 7kyu) possible that the wrong word never appears in the string
It is defined in the 2-dimensional array
words
that is given as an input (its a 7kyu after all).Example:
"badword" is the wrong word and "correctword" is the correction to it
then the array would be
[["badword","correctword"]]
Fixed it.
Youre right about the empty array, changed that too.
The random test already generates empty lists
Loading more items...