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.
Wrong.
Rallies are:
ping-pong-ping-pong-ping-pong-ping-ding-plik-funk-
where ping serves, but eventually misses ==> no point ==> score ping=0:pong=0
pong-ping-pong-ping-pong-ting-pang-bonk-
where pong serves, but eventually misses ==> no point ==> score ping=0:pong=0
pong-ping-pong-ping-pong-ping-pong-ping-boof-bong-ting-
where pong serves, but eventually ping misses ==> 1 point to Mr Pong ==> score ping=0:pong=1
pong-ping-pong-whak-wang
where pong serves, but eventually misses ==> no point ==> score ping=0:pong=1
RESULT -
score: ping=0:pong=1 ==> Mr Pong is winner.
~
AFAICT you seem to be going wrong for this Kata rule:
Hmmm. I am confused. For
Javascript
there was no such "edge_cases_and_bugs" test having the noises like you gave, so I don't know why you mentioned that test name in your original mail. But, I have now just added that extra test case to "edge_cases and bugs" but it gave the expected answer as "pong".I suspect you have just fooled yourself (and then fooled me). I tried using your solution but importantly I added an extra
console.log(sounds)
to display what input it was processing. Doing this you can now see your solution has failed on one of the EXISTING "edge_cases_and_bugs" test.Here the expected answer was "ping" because:
ping-pong-aaaa
- Ping serves and wins. Score ping=1:pong=0ping-pong-ping-aaaa
- Ping serves and hits last bad shot. Score is unchanged.IMO your code is flawed somewhere.
Hmmm... at the end I think the scores are even (1:1)
ping-pong-ping-voom-wizz
-> ping serves, ping misses; no point; score: ping=0,pong=0ping-wizz
-> ping serves and misses; no point; score=ping=0,pong=0ping-pong-ping-pong-ping-pong-foom-bang-plop
-> ping serves, pong misses; ping scores a point; score: ping=1,pong=0pong-ping-pong-ping-pong-ping-pong-ping-pong-ping-klak-bing
-> pong serves. ping misses; pong scores a point; score: ping=1,pong=1;So the rule is:
Since "ping" hit that last bad shot so "pong" should be winner.
Maybe it is a bug. Please tell me what language this is.