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.
Unpublished!
And/or a testcase which always fails...
The first step you should take is to unpublish it in the kata editor. At least that way, even if you aren't able to successfully delete it, it won't show up in search results.
The
puzzle
is very nice. Yes, it's apuzzle
.Don't read the description, since it's not the truth..
If you write your code according to the description, You just need submit your solution again and again. If you're lucky, you will pass all the tests ;-) Otherwise, you will meet:
This is a duplicate of https://www.codewars.com/kata/two-fighters-one-winner
Good kata, just a few bugs to fix:
Player[i] wins!
. The sample unit tests check for this format:Playeri wins!
. The actual unit tests check for this format:Player i wins!
.attack : 0
causes an infinite loop. If you want this edge case to be part of the puzzle, the instructions should indicate how to deal with it.player.health == 0
, rather thanplayer.health <= 0
. Player health can be negative too.Kata Description and Sample Test Cases are inconsistent with actual Test Cases - description / sample tests expect string of format
"Player[i] wins!"
to be returned unless there is a tie but actual tests expect string of format"Player [i] wins!"
to be returned instead.battleAlgorithim({ health: 27, attack: 0 },{ health: 27, attack: 0 })
either player has 0 or less health at the end of the turn
But you test withplayer1.health == 0 && player2.health == 0