8

From Esolang
Jump to navigation Jump to search

8 is an esoteric programming language made by User:AmNow.

Commands

8 runs in an infinite loop, until it hits the 0 command. (see below)

1:[x]: = Print X. Replace the colons with semicolons if you don’t want a newline.
2:[x]<[y]: = Set X to the value of Y.
3:[x]: = Gets variable X’s value.
4:[x]: = Input Into Variable X.
5:[x];(y): = While X is true, Do Y.
6:[x]’[op]’[y]: = Do X OP Y and store the result in X. Replace the apostrophes with commas to return the value and not store in a variable 
7:[x]§(y): = Like 5, but do it once.
0:: = Halt Execution.

Programs

Hello, World!

1:[“Hello, World!”]:
0::

Truth Machine

4:[inp]:
1;[3:[inp]:];
5:[6:[3:[inp]:],[==],[1]:];(
    1;[1];
):
0::

Cat Program

An infinitely repeating cat program, which terminates on an empty input, is demonstrated:

4:[input]:
5:[6:[3:[input]:],[!=],[“”]:];
(
  1:[3:[input]:]:
  4:[input]:
):
0::

Counter in Range

This program queries the user for a counter's start and end values, the former of which must be less than or equal to the latter, and prints all integer numbers in the contained closed range.

1:[“Please input the counter start value: ”]:
4:[counterStart]:

1:[“Please input the counter end value: ”]:
4:[counterEnd]:

2:[counter]<[3:[counterStart]:]:

5:[6:[3:[counter]:],[<=],[3:[counterEnd]:]:];
(
  1:[3:[counter]:]:
  6:[counter]’[+]’[1]:
):
0::

Computational Class

8 is (obviously) Turing Complete.

Interpreter

  • Common Lisp implementation of the 8 programming language. Please note that the concrete character set deployed constitutes a dependency on the Common Lisp implementation; in corollary, Unicode support may or may not be a feature incorporated in the personal environment. The interpreter at hand has been developed and tested with Steel Bank Common Lisp (SBCL) version 1.1.4 as part of the Lisp Cabinet 0.3.5 bundle.