Spanish description in: https://github.com/DeybisMelendez/ni/blob/master/README-es.md
Ni is an esoteric programming language influenced by brainfuck. The name Ni comes from Nicaragua.
Like brainfuck, Ni operates on a tape containing cells, cells can store 64-bit integers.
The cells are pointed by a head, the head can move from left to right or jump to a cell directly.
There is also a clipboard where you can store data from one cell and insert any other.
Instruction | Description |
---|---|
> | Move the head to the right |
< | Move the head to the left |
+ | Increment the targeted cell |
- | Decrement the targeted cell |
@ | Reads the first character, converts it to its ASCII number and stores it in the pointed cell |
. | Print the number stored in the targeted cell |
! | Print the ASCII equivalent of the number stored in the pointed cell |
# | Set a hexadecimal number in the pointed cell |
? | Copy the number of the pointed cell |
= | Stores the copied number in the pointed cell |
* | Converts the number of the pointed cell to 0 |
$ | Moves the spindle to the cell indicated with a hexadecimal number |
[] | (While) Loop that continues execution if the pointed cell is not equal to 0 |
{} | (For) Loop that executes the instructions the number of times that the memory of the pointed cell indicates |
() | (if) Executes the set of instructions if the pointed number is equal to the clipboard |
/ | Ignore the rest of the line |
Download Ni here: https://github.com/DeybisMelendez/ni/releases
CMD -> ni yourcode.nic
Terminal -> ./ni yourcode.nic
Lua is required, you can install lua with brew.
Commands:
/bin/bash -c "$(curl -fsSL https://github.com/raw/Homebrew/install/master/install.sh)"
brew update
brew install lua
Then on terminal execute lua ni.lua yourcode.nic
CMD or Terminal -> lua ni.lua yourcode.nic
#48!#65!#6c!#6c!#6f!#20!#57!#6f!#72!#6c!#64!#21!#0a!
#01[@!#0a!]
More in examples/.
The main purpose of programming in Ni is fun, the challenge of creating a program that works, these programs are collected in the examples/ folder.
You can send pull requests if you write one, send it as an issue or Discord to add it.
There are a number of popular problems to solve and show the ability of an esoteric programming language, the list is here: https://esolangs.org/wiki/Popular_problem
The main problems to solve are:
- Program that calculates the factorial of a digit. (added by Discord user Jjony # 5227, fail on >=0.2.1)
- Program that prints the sequence of Thue-Morse or any other known sequence.
- Program that prints the Sierpinski Triangle.
- Program [Quine] (https://es.wikipedia.org/wiki/Quine_(program)).
Also, I add these:
- Program that executes the Game of life.
- Program that runs the Langton Ant.