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.
Also, generate tests that expect true and false as answers, generating random numbers only will expect false (99.9% of the time) ;)
Actual and expected values are flipped in tests.
Put your solution in the fixture, write a random test generator, run it 100 times (or as many times as you find appropriate) comparing the result of the reference and user's codes.
Hey, it is my first kata, so I have some questions. What is the correct way to do it? I understand that I should generate int array and then compare result of my own function with result of tested one. Is it right? Where should I place code of my function? In code of test cases?
No random tests.
This comment is hidden because it contains spoiler information about the solution
Tests are not executed. Use
Test.assertEquals
instead.Good to know! Super useful for very small values of p0 and or very large values of p. It really helps to be familiar with compound interest/annuities, otherwise it's really easy to get lost working out the logic.
Happy coding
^_^
The task is formulated so easy, but I've spend about 5 hours to solve it. myjinxin2015, you've made excellent kata. Thank you!
The task is formulated so easy, but I've spent about 5 hours to solve it. myjinxin2015, you've made excellent kata. Thank you!
It is simple to solve if you will use the automata that is given by link. I was trying to solve it during few hours, then I looked the automata and solved it in few minutes.
If mx = 2, then gap(3, 5, 6) return [2, 5], but 2 isn't between 5 and 6.
I believe that the correct way is to write 'mx && m - mx === g'
What do you mean? I meant that it could be solved by using explicit formula with Math.log() function. In this case, there are not loops.
This comment is hidden because it contains spoiler information about the solution
Loading more items...