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 am having the same issue
EDIT: never mind, solved it, turns out I was reading for length before checking if the array is null or not. thanks to @Chrono79
What the description means is that if a player has reached the final tile, all subsequent calls should return "Game over!".
Passes all tests except for the case "Should pass edge cases" I don't understand what the test is going on there. The array is passed empty, if I don't confuse anything, and its length is zero. I make checks for these conditions, but the error still does not allow me to pass this last test. Tell me what I'm doing wrong ?
Here is a fork that fixes the issue. Also, it adds
Fixed Tests
on theATTEMPT
. I merely commented out theconsole
describing the type of random test; so that can be reverted if better.This comment is hidden because it contains spoiler information about the solution
nice kata
Oh, that was really the problem. Thank you very much :D
your code mutates the input
My program for this test \ [ ':(', ':D', 'T_T', ':)' ] false \. Outputs the following \ [ 'T_T', ':(', ':)', ':D' ] \. But it gives me an error \ expected [ 'T_T', ':(', ':)', ':D' ] to deeply equal [] \ Please tell me what the problem is.
Can someone please explain to me how I can make sure the game ends. If one of the players scores 100 points, I return Player # won. The description says "Return Game over! if a player has won and another player tries to play." How can I understand if the second player is trying to roll the dice or not if the function arguments (dice rolls) are called in turn. Can I see the final number of dice rolls that are passed into the function at once? For example, there are only 30 rolls of the dice for two players, and player 1 scores 100 points on the 27th roll. And then it is clear that player 2 is still trying to play.
Thank you, thanks to you I finally understand this dilemma with the size and length of the line)
Oh, thank you very much. Indeed, an empty string created such an error. I added a condition for an empty string and everything is fine!
SolutionTest
randomTests
Log
JgAF
UHDWb
l
Jm
y
w
ecUPZc
expected:<ecUPZ[y IBOscgUZKji]c> but was:<ecUPZ[]c>
Stack Trace
Completed in 23ms
fixedTests
Log
exampleexample
exampleexample
example example
a e
a
hello example something
Test Passed
WTF?(((
You should add
console.log(s)
at the beginning of your function to see the whole input.And that's not your only problem but the
*
quantifier is greedy...Closing the issue since it's a problem with your code, not a problem with the kata itself.
i wonder where to find a parentheses in here: 'hello example here something' should equal
and i don't understand why the output is like this: 'hello example something'
it looks for me that the function is only deleting -here - in the string, that does not make any sence to me, since the description is talking about remove parentheses and the content inside them....
Loading more items...