Ni

From Esolang
Jump to navigation Jump to search
Ni Logo

Ni is an esoteric programming language influenced by brainfuck. The name Ni comes from Nicaragua. Created by User:DeybisMelendez.

Language Overview

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.

Commands

Command 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

Examples

Hello World!

#48!#65!#6c!#6c!#6f!#20!#57!#6f!#72!#6c!#64!#21!#0a!

Cat program

#01[@!#0a!]

Truth-machine

@>#30[<->-]<.[.]

Fibonacci

#0a>#00>#01.<<!>>>>#1f{<<?>=<<[>>+<<-]>?<=>>?<=.<<!>>>>}

Computational class

Ni is Turing-complete, as ><+-@![] correspond directly to brainfuck's ><+-,.[].

External resources

Official Github page of Ni