Unispace

From Esolang
Jump to navigation Jump to search

Unispace is an esoteric programming language designed by User:Zzo38 in 2010. It is based on the idea of Whitespace but it uses Unicode. (And if you print out your program (if it has no comments and page numbers), the paper can be reused, and it won't use up the ink!)

Spaces

The Unicode characters that can be used are as follows, and the letter used to represent for Visible Unispace:

  • A (normal ASCII space, U+0020)
  • C (thin space, U+2009)
  • F (figure space, U+2007)
  • I (ideo space, U+3000)
  • J (new line, U+000A/U+000D)
  • M (em space, U+2003)
  • N (en space, U+2002)
  • P (punctuation space, U+2008)
  • T (tab, U+0009)
  • X (no break space, U+00A0)
  • Z (zero width space, U+200B)

Commands

  • A(number) = goto label
  • C(number) = push number to data stack
  • F(number) = push address of label to return stack
  • I(number) = call subroutine
  • J(number) = set accumulator
  • M(command) = do command only if accumulator is zero
  • NAA = INTERCAL interleave top two of data stack
  • NAC = INTERCAL select of top two of data stack
  • NAF = NAND of top two of data stack
  • NAI = increment accumulator
  • NAJ = decrement accumulator
  • NAM = input character into accumulator
  • NAN = output character from accumulator
  • NAP = output newline
  • NAT = output roman number from accumulator
  • NCA = swap data stack with return stack
  • NCC = swap program memory with data memory
  • NCI = output decimal number from accumulator
  • NII = like ! in Forth
  • NIJ = change top of data stack to address of that label number, move to top of return stack
  • NJJ = like @ in Forth
  • NM(single) = remove from end of program memory if it is the same as the one at the end (note: if this is NMX it will also be treated as a label starting here)
  • NN(single) = append to end of program memory (note: if this is NNX it will also be treated as a label starting here)
  • NPP = reverse direction of data stack
  • NPT = move top of data stack to top of return stack
  • NTP = move top of return stack to top of data stack
  • NTT = reverse direction of return stack
  • NZT = return from subroutine
  • PA = drop top of data stack
  • PC = duplicate top of data stack
  • PF = swap top two entries of data stack
  • PI = increment value at top of data stack
  • PJ = decrement value at top of data stack
  • PM = pop top of data stack into accumulator
  • PN = push accumulator value to top of data stack
  • PP = ignore all changes to data stack
  • PT = stop ignoring changes to data stack
  • TA = drop top of return stack
  • TC = duplicate top of return stack
  • TF = swap top two entries of return stack
  • TI = skip address at top of return stack forwards to a label
  • TJ = skip address at top of return stack backwards to a label
  • TM = pop top of return stack into accumulator
  • TN = push accumulator value to top of return stack
  • TP = ignore all changes to return stack
  • TT = stop ignoring changes to return stack
  • X(number) = set label
  • Z = no operation

Numbers

Numbers must be written as the digits backwards in base 9 with Z at the end. The digits are 012345678 as ACFIJMNPT