ALIMBIHNN

From Esolang
Jump to navigation Jump to search

A Language I Made But It Has No Name

The language is supposed to be similar to English written text and rather easy to use and read. Each line ends with a dot (.) unless it is the end of an if-statement (ends with :) or end of if-clause (ends with ;).

The language operates on cells and a stack. Code is written in lowercase. If-clauses can be nested. A command consists of several words and sometimes require an argument. Input can be a number or a single character. Loops are done with a "jump to line" command (spaghetti). All programs need the "end program." command in order to stop. If the stack is used, the top value is popped. Strings require no ". The "output string" outputs a newline while "output cell as <>" does not.

Interpreter [1], the alim.py file.

Commands:

Command Arguments
set cell as <number>, stack, input, file (next char)
push onto stack <number>, cell
move pointer to the right. None
move pointer to the left. None
move pointer to cell <number>, cell
output cell as number, character (no newline)
output string <string> (+newline)
increase cell by <number>, stack
decrease cell by <number>, stack
multiply cell by <number>, stack
divide cell by <number>, stack
modulus cell by <number>, stack
raise cell to the power of <number>, stack
if cell equals <number>:, stack:
if cell is less than <number>:, stack:
if cell is larger than <number>:, stack:
jump to line <number>, cell
randomize cell as a number between 0 and <number>, cell
read file <filename>
write to file <string>
move file pointer left. None (used to re-read characters)
halt program for <number>, cell (seconds)
end program. None

FIBONACCI

move pointer to the right.
set cell as 1.
push onto stack cell.
move pointer to the left.
set cell as 1.
output cell as number.
output string  .
if cell is larger than 100:
end program.;
push onto stack cell.
move pointer to the right.
increase cell by stack.
move pointer to the left.
set cell as stack.
move pointer to the right.
push onto stack cell.
move pointer to the left.
jump to line 6.

Hello World

output string Hello, World!.
end program.