Talk:Z

From Esolang
Jump to navigation Jump to search

I am trying to implement (well, re-implement) Z, but I'm having trouble understanding what some instructions are supposed to do and running examples.

  • zz Z, zZ, Zz and ZZ, and the memory handling in general, are badly explained. Can you give a better explanation or a pseudocode?
  • Are zzz and zzZ 0- or 1- based?
  • How should A be rounded to give memory addresses (tw/ 0, tw/ -inf, tw/ +inf, tw/ closest integer, something else), assuming it is supposed to be floating point (as there is a decimal point for zz z)?
  • Is I/O numeric or character based?
  • How is EOF handled?

TuxCrafting (talk) 07:59, 18 May 2019 (UTC)

Wow, in retrospect, this language was very poorly thought through, but I'll try to give a belated explanation based on how I remember it working.
  1. Aside from the A register, there is an index P which points to a location on the tape.
    • zz Z means A = tape[A].
    • zZ means P = A.
    • Zz means tape[P] = A.
    • ZZ z and ZZ Z mean tape[P] += A and tape[P] -= A respectively.
  2. Judging from the example programs, 1-based.
  3. It's too poorly specified for me to know, and including floating point was a bad idea anyway, so I'll just remove it.
  4. Either one is spec-compliant.
  5. It's UB.
Challenger5 (talk) 01:03, 1 April 2020 (UTC)

Hello! I've made an implementation available here https://github.com/Yul3n/esoo, however further tests are needed. Yul3n (talk) 08:31, 31 March 2020 (UTC)

See my reply to User:TuxCrafting above in case that helps disambiguate anything. Challenger5 (talk) 01:04, 1 April 2020 (UTC)