Ad
  • Custom User Avatar

    Does anyone know what is the input for factorial 8?

  • Default User Avatar

    sorry, wrong testcase. @deconstrained already had the right hint

  • Custom User Avatar
  • Default User Avatar

    Did it in JavaScript right now.
    No problems, no infinite loops.

  • Custom User Avatar

    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.

  • Custom User Avatar

    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 as a-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.

  • Custom User Avatar

    Yes, and that is what this issue is about. It's still not resolved.

  • Default User Avatar

    you are missing a space somehow
    There should be 2 spaces before the ^ on the second line

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    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

  • Custom User Avatar

    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.

  • Custom User Avatar

    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.

  • Custom User Avatar

    It clearly moves down and and discards a value from the stack in an infinite loop.

  • Default User Avatar

    It's not infinite. There are 157 operations at all. Check your code.

  • Custom User Avatar

    This issue is still there. Pretty frustrating.

  • Loading more items...