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.
Thanks, will you or I make a SQL translation ;)
approved :)
Yeah, I went ahead and refactored the missing logic to complete this kata, thanks!
The tests aren't wrong, your code is incorrect. You aren't using the values of the races at all in your code, that's why it's not working. This isn't a simple "sum up the numbers in each string and see which one is bigger" type problem. Each number in each input represents the number of a certain race or class for that side.
For example, if your
good
input is1 2 3 4 5 6
, then the good side has 1 hobbit, 2 men, 3 elves, 4 dwarfs, 5 eagles, and 6 wizards. Each one of those things has a different "worth". You can see their worths in the description. 1 wizard has the same amount of "worth" as 10 hobbits, for example.Did you read the description and just think "Wow, they're really going on about hobbits and orcs and stuff and this has nothing to do with the task"?
I certainly need help with this Kata. There are several tests that are not working properly, such as one where it should be a tie but instead the test is expecting Evil to win. My code works with the examples on the kata description but when it comes to the attempts, the thing simply fail: Is there a way to fix the tests, please?
1 1 1 1 1 1
1 1 1 1 1 1
Test Failed
Expected string length 48 but was 45. Strings differ at index 15.
Expected: "Battle Result: Evil eradicates all trace of Good"
But was: "Battle Result: No victor on this battle field"
--------------------------^
Log
0 0 0 0 0 10
1 1 1 1 1 1
0 1 0 0 0 0
Test Failed
Expected string length 38 but was 45. Strings differ at index 15.
Expected: "Battle Result: Good triumphs over Evil"
But was: "Battle Result: No victor on this battle field"
--------------------------^
Completed in 1.6080ms
ShouldBeATie
Log
1 0 0 0 0 0
0 0 0 0 0 0
1 1 1 1 1 1
1 0 0 0 0 0
0 1 0 0 0 0
0 1 0 0 0 0
0 1 0 0 0 0
0 0 1 0 0 0
0 0 0 1 0 0
1 0 0 0 1 0
Test Failed
Expected string length 45 but was 38. Strings differ at index 15.
Expected: "Battle Result: No victor on this battle field"
But was: "Battle Result: Good triumphs over Evil"
It appears there may be some problems with the C# test cases for this Kata. My original solution passed the test prior to submission, then failed submission tests. When converting the algorithm to javascript (and presumably a different set of test cases) it appears that the same code passed through to submission.
No, it's not weird. You're not using the race's worth, that's why your code is wrong, read the description again.
Same sentiments here
Check this out: https://docs.codewars.com/training/troubleshooting#print-input
About your code, you're not using the race's worth at all. Read the description again.
Hello, I don't understand this task. Can I share my code here? I used three examples and the tests were successful.
Another test was nonsuccess, but I cannot see examples of test... input.
Can you help me, please? Thank you
Unspecified AssertionError
The assert libary has problem?
please change to chai
Yes, correct
Which language ? Python ?
Updated JS version with randomized tests
updated in this fork
Loading more items...