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.
Does anyone know what is the input for factorial 8?
sorry, wrong testcase. @deconstrained already had the right hint
LOL
Did it in JavaScript right now.
No problems, no infinite loops.
I didn't have any infinite loop in my JS solution. I don't think there's an actual issue with the test case, or else it has been solved since.
The code that is output if one prints it seems to differ from what code is actually being run, or there's an issue with copy/paste. I've tried copying into external editors only to find whitespaces missing. I believe that copying directly (at least on my system/browser) omits leading whitespace on lines, so I had to manually count the number of spaces and insert them.
Another possible cause of infinite looping (check the stack contents) is the order of operands in the non-commutative binary operators. If
-
is carried out asa-b
the result is an infinite series of-7,8...
accumulating in the stack. I ran into this and found out only after looking at the stack and my interpreter passed the test once I fixed this detail.Yes, and that is what this issue is about. It's still not resolved.
you are missing a space somehow
There should be 2 spaces before the ^ on the second line
This comment is hidden because it contains spoiler information about the solution
works for me as well, double check where you want to put an integer on a stack or value of ASCII, javascript is pretty hipster for programming
The instructions clearly state that it should move down (v) and then discard a value from the stack ($), but after this there are no other instructions, so it wraps around and lands on "v" again forever and ever. At least for me.
If I run the code in another interpreter online it also loops forever.
Factorial (8! = 40320)
08>:1-:v v *_$.@
^ _$>:^
Test Passed: Value == 40320
I'm not having a problem with this. But the Sieve of Eratosthenes is still not working for my interpreter.
It clearly moves down and and discards a value from the stack in an infinite loop.
It's not infinite. There are 157 operations at all. Check your code.
This issue is still there. Pretty frustrating.
Loading more items...