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 natan, I will give that a try.
This comment is hidden because it contains spoiler information about the solution
Nice job on your first kata, Alex!
When I was 27, I thought I had invented run-length encoding. Then I found out it had been used 20 years earlier in the transmission of analog television signals. Oh well.
Here's a case where a Sieve of Eratosthenes worked better for me than a primality test.
Tried my hand at a little memoization here. I'm not sure it made much difference in execution speed on this kata, but it was good practice, anyway.
Sometimes it really pays to come back to a kata that you gave up on earlier. Somehow the first time I looked at this, I didn't recognize that a relatively simple "binary search" approach would work.
Funny how I used to think it was always faster to generate all the primes that you might possibly need, using something like the Sieve of Eratosthenes, but in the meantime I've learned that sometimes a primality test is actually faster. It depends on the task.
Interesting that some other solvers also hard-coded that one case. It seems that some approaches (like mine) work for all tests except that single case.
This is the second game-related, object-oriented kata I've done recently in which I had to set the current player (in the constructor) to the opposite of the player who's supposed to start the game -- because the current player is reset near the beginning of each round of play.
Why is there no dinglemouse in the zoo? And what would it eat?
This comment is hidden because it contains spoiler information about the solution
Yeah, there's something weird going on in that 6000-6200 range. I still haven't really figured it out. [shrug emoji]
I passed it with some hard-coding. Shame on me. I still don't understand when to go high or low in the range of 6000-6200. I'll go back and train again, trying again to figure it out and solve it more honestly. (In my defense, I planned to only hard-code until I discovered the pattern or rule. But I'm still working on that... )
What happens to the result of the add, sub, mul, and div operations? Specifically: Is the result pushed onto the stack as a new top value, or does it change the value of the current top value on the stack? This isn't clear from the description or the example.
Loading more items...