Talk:Mogus

From Esolang
Jump to navigation Jump to search

Attempt at an interpreter

Hi, I attempted to make an interpreter for this language link to the C source file I did notice a couple of oddities, idk if I screwed up the interpreter somewhere (please let me know if it's non-compliant) or if there might be slight logical errors in the sample programs. But here are some observations when interacting with my interpreter

cat program

the supplied program

mmouumg

underflows the stack after printing one character however a slight tweak

mmouummg

renders a fully functional cat program that accepts input after it's done printing a string

truth machine

mmoummmomomomomomomomomomomomomomomomomomomomomomomomomomomomomomomomomomomomomomomomomomomomomomooog
mmmomomomomomomomomomomomomomomomomomomomomomomomomomomomomomomomomomomomomomomomomomomomomomomomooummog
mmmomomomomomomomomomomomomomomomomomomomomomomomomomomomomomomomomomomomomomomomomomomomomomomomomooummmomomoog

there may be a similar tweak possible with the truth machine though I'm not familiar enough with Mogus to know what that tweak would be or if it even needs one.

my interpreter responds to the program the following way.

  • input 0
    • prints 0 once and then throws a stack underflow
  • input 1
    • terminates without error but no output

I hope that this helps you with making your official interpreter. "ArthroStar11 (talk) 20:50, 8 September 2021 (UTC)"

PS there's some debug code commented out in the interpreter if you want to give that a look.

I'm not that familiar with C but does your interpreter skip the first character of the line when funcG() runs and then codeptr increments? --VilgotanL (talk) 10:50, 10 September 2021 (UTC)
Update: I fixed a bug in the truth-machine and now it works, I also made a working implementation in python --VilgotanL (talk) 11:49, 10 September 2021 (UTC)

Lol you're right! my interpreter does skip the first cmd after a jump. How did I not notice that? Also props on getting an implementation going "ArthroStar11 (talk) 09:18, 13 September 2021 (UTC)"