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 the ATTEMPT. I merely commented out the console describing the type of random test; so that can be reverted if better.
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.
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
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....
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...