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.
Added into description that an empty sequence of action should result in 0 dps.
Made a function that loops and generate random test cases.
Thanks, edited the description to more precisely indicate what would happen when shooting with less than 20 energy
Made a function that loops and generate random test cases.
Made charging/shooting random lengths.
Thanks for your recommendation! I don't speak Javascript, but maybe I'll learn it later and give that one a shot.
If you want a slightly harder challenge: https://www.codewars.com/kata/63b1c240a4ade100500f665e
Fun kata imo.
I think that it should be a little more clear that the gun cannot shoot with less than 20 energy. I initially made the assumption that if the gun had energy, it could shoot. Say for example, when the gun has 15 energy. The only clarification is in the "special considerations" where it says that the gun cannot shoot with 0 energy. I think after some trial and error, this is easy to solve, but this clue can be misleading.
Can't wait to see the sequel to this! I can imagine an expansion of this kata where you give him an array of actions to simulate multiple encounters.
Yes, but
Yes, but it can depend on the situation. I think in this case
0
is acceptable.0
.