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.
This comment is hidden because it contains spoiler information about the solution
Sorry, wrong test is now corrected.
you decribe undefined values behavior in some cases, but don't test it.
I suggest tests like: Test.assertEquals((new Interpreter()).read('>.'),'','At empty stack, a "." shall generate no output');
A loop, prefixed by an asterisk ("*")should be ignored ("*[.....]" should have empty result), because when entering the "[", the current value is NOT bigger than 0.
But that is never tested. Some accepted solutions will produce a "00000" instead of the empty string at the above example. Maybe you want to add a test.
EDIT: I just read: "When doing the loop check the condition at the end of each loop.", so my accepted code is wrong. I suggest to enhance the decription. Simply write loop start to the "["-char and describe the logic at the "]"-char, because it's done there.
and .... the test is definitely missing
The description clearly states: " numbers starting with 1". So, if the list does not start with 1, but is ordered anyhow, then the smallest missing number is 1.
It's the same result as for invalid lists, but that's as requested.
Thanks Johan, your review was a great help. It's a real challenge to write appropriate tests to prohibit a too simple solution. In fact, now using const suspicious is possible again. I very much doubt, that any solution without rewriting toString() is able to succeed with a const solution, but however, it's allowed to try now.
I really ended up with an externally frozen toString() method. You may completely overwrite suspicious, but i may use another toString() ;-)
Really hope, I'm through with writing tests now. Again, MANY thanks to all, who revealed holes in my tests.
Last point: Until now, there is only ONE correct solution (without modifying toString()). What kyu would you give to that kata. I supposed a 4, but I'm unsure now. Is it harder??
So finally I hope I got it. Currently only one solution is not based on toString() changing and thus still valid after test sharpening.
thanks to showing missing tests. I really hope I have fixed that toString()-behaviour changing will be declined by the tests.
you may want to try to find a solution which does NOT modify toString(). There is one! :-)
Johan, your current solution is quite hard to detect as false. I try to prohibit changes to the 'toString()' function, but my tests currently do not detect your solution as false.
Can you give me a tipp, how to catch your change to the toString() as well as others? To get the focus on implementing the 'suspicious()' function.
thanks for your answer. I see a problem with this "how satisfied are you?" question in general.
An 8kiu kata might be boring easy for someone, like simply lighting a fire for an astronaut riding on a rocket to mars. For the other one it's the very first step to handle rockets and start to the stars himself. Very personally.
On the other hand the very easy kata might have an excellent description, while another kata with very interesting task may be described very poor.
So, i (personally) try to answer that question only with the creation and description of the kata.
At last, i really did not think about simply rewrite toString() as possible solution. I felt, that would be too easy, so i disabled that way to solve the kata. Nevertheless, I think this kata is not very difficult, especially for experienced js developers.
I added a new test to inhibit solutions by simply changing toString()-Method.
This comment is hidden because it contains spoiler information about the solution
it should be stated clearer, that position counting starts with zero and also, that the worse occurance of "" has precedence over an earlyer occurance of "/" (which is beyond every days logic).
That was fun. What about the next stage of skill: a new kata to implement a function to create the solution function for this kata. The function will take 4 parameters: boat count, boat rest, car count, car rest and will output a function to solve this kata. E.g. the call to createSolutionFunction(9,1,7,2) should return a function, which will solve this 'how much' kata.
At least with JavaScript this will be possible and the next fun!
I cannot submit a successful attempt. What's wrong?
Is it the 'draft' state? When is beta state expected for this kata?
Loading more items...