Ad
  • Custom User Avatar

    lol dont tell on us, just wanted to see the solutions

  • Custom User Avatar

    Dude, this is a hint, but make your jnz command such that, you allow it to jump to a location outside the code, and let the loop run out, and it's the end of the program. Your code will pass. But if you're still unsure about this, you can go to my github and find the answer, but you might have to find the first commit, because a lot of things changed. But remember Don't look at the solution for part 2 of this kata. If you want to contribute, you can contact me. AsmIntrp github location

  • Custom User Avatar

    I would say "no" to that, you don't need to go complete C style,
    step 1: stop using std::regex it's slow af at compiletime
    step 2: Stop using anything that takes more to compile, and make the no. of containers used in the code to a minimum, because it need to make different version of container for different types, because of templates.
    step 3: If your thing your code is fine, try running the test once more.

    As far as I know, std::string, std::vector and stuff works fine, and I would suggest using std::string_view, but it won't matter if your code doesn't make a lot of copies of the string.

  • Custom User Avatar

    I also think this. I asserted the existence of the register to check for 0 value at the "jnz" command, and it threw.

  • Custom User Avatar

    Dude your code is fine, But I don't know, why it returns false, maybe a server side issue. But I would change that ~int(command)+2 to 3-int(command) it's more readable that way. If you're use strings like "q1" "q2" to track states, might as well use an integer, and there's no need for self.states. Yeah, I know, I'm 1 year late. XD

  • Custom User Avatar

    You got it? it's been 5 months, the problem is you haven't defined your constructor at line 4

  • Custom User Avatar

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

  • Custom User Avatar

    This solution is wrong, consider the input {0,0}, the state inside the object should be q1, and the method should return false, but your method returns true. Your method is clever, but in this case this method of checking last command won't help. And keep in mind that commands can be one command vector, now you have undefined behaviour, if the input is {0}, this is undefined behaviour.

  • Custom User Avatar

    I'm coding in C++, and I just don't understand how to solve Complex2 test case for the final attempt. My code seems ok. and I have setup errors to show if something goes wrong, and my program tells me that, the code tried to jump with jnz to a code that doesn't exists (out of bounds). And please tell me, if this is a mistake, or if I'm missing something.