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 had no idea when I typed it. I just like it better when there are few stuff to concatenate, and I really dislike the syntax of /format/.
I suspect concatenation is slower. I just did some /timeit/ to check if that is true:
But I only tested this case : 2 numbers that must be stringified. I imagine that with 2 strings, concatenation might be faster. And if there are more objects to print, I imagine that /format/ would be faster.
But I still hate /format/ syntax :-) (and I even still like /%/ syntax better)
This test description is wrong :
Test.it('should return the decoded message
HNTP*!
', function() {Test.assertEquals(results, "HNTP*", 'returns HNTP*!');
});
No '!' is expected.
There are no pound signs (£) in Ruby test cases. Shouldn't it be removed from the description too, for the sake of consistency?
I see that it was already told by jcorbin 2 years, but I will rephrase it with my own vocabulary: I have not the slightest fucking idea of what I am expected to do in this kata. The description of the problem says nothing at all about what the hell should match what.
Tests seem OK now... except the description of the latest one does not match what it really tests :-)
In the string,
3 times 'u' should be 8 times,
3 times 'r' should be 1 time.
PS: That is for Javascript, I did not look at the C# version.
By "already guessed", do you mean both right and wrong, or only right?
In the first case (which means the guess is also ignored if the letter was already proposed and wrong), the following test should pass:
Test.describe(
Testing the word 'wars' with input 'wuuuuuuuuusarg'
, _ => {let hangman = new Hangman('wars');
Test.assertEquals(hangman.guess('w'),'w _ _ _');
Test.assertEquals(hangman.guess('u'),'w _ _ _ # u');
Test.assertEquals(hangman.guess('u'),'w _ _ _ # u');
Test.assertEquals(hangman.guess('u'),'w _ _ _ # u');
Test.assertEquals(hangman.guess('u'),'w _ _ _ # u');
Test.assertEquals(hangman.guess('u'),'w _ _ _ # u');
Test.assertEquals(hangman.guess('u'),'w _ _ _ # u');
Test.assertEquals(hangman.guess('u'),'w _ _ _ # u');
Test.assertEquals(hangman.guess('s'),'w _ _ s # u');
Test.assertEquals(hangman.guess('a'),'w a _ s # u');
Test.assertEquals(hangman.guess('r'),'You found the word! (wars)');
Test.assertEquals(hangman.guess('g'),'The game has ended.');
});
Problem: my program passes your test suite but does not pass this test.
Shouldn't the description tell what is the expected behaviour when the player proposes a letter that he already tried (and either guessed or missed)? Or state that the player never tries twice the same letter.