It's definitely not a problem when somebody makes a mistake. But it's a problem when the vast majority of people vote for solutions they obviously either don't understand or didn't read at all. ;-)
I ran this solution against my test suite and some tests failed.
I pointed out some of those cases in the "Discussion" section.
For example, for "1000" I think it outputs "ten hundred" instead of "one thousand". For "20", I think it displays "twenty zero". etc.
Let me know if I'm mistaken :)
Hi guys, I was intrigued by the top solution and then I decided to run it against my tests and some tests failed.
I think this kata should contain more tests (sorry, I never suggested something to a kata, I don't know how to do this)
But here are some that failed (I can probably send my whole suite if you are interested)
Test.assert_equals(int_to_english(1000), 'one thousand')
Test.assert_equals(int_to_english(100), 'one hundred')
Test.assert_equals(int_to_english(30), 'thirty')
Test.assert_equals(int_to_english(20), 'twenty')
Test.assert_equals(int_to_english(14), 'fourteen')
That's absolutely correct. Spent too much time in JS on this site.
This comment is hidden because it contains spoiler information about the solution
Loading collection data...
It's definitely not a problem when somebody makes a mistake. But it's a problem when the vast majority of people vote for solutions they obviously either don't understand or didn't read at all. ;-)
I ran this solution against my test suite and some tests failed.
I pointed out some of those cases in the "Discussion" section.
For example, for "1000" I think it outputs "ten hundred" instead of "one thousand". For "20", I think it displays "twenty zero". etc.
Let me know if I'm mistaken :)
Hi guys, I was intrigued by the top solution and then I decided to run it against my tests and some tests failed.
I think this kata should contain more tests (sorry, I never suggested something to a kata, I don't know how to do this)
But here are some that failed (I can probably send my whole suite if you are interested)
Test.assert_equals(int_to_english(1000), 'one thousand')
Test.assert_equals(int_to_english(100), 'one hundred')
Test.assert_equals(int_to_english(30), 'thirty')
Test.assert_equals(int_to_english(20), 'twenty')
Test.assert_equals(int_to_english(14), 'fourteen')
That's absolutely correct. Spent too much time in JS on this site.
This comment is hidden because it contains spoiler information about the solution