NRP

From Esolang
Jump to navigation Jump to search
This is still a work in progress. It may be changed in the future.

NRP (or Number-rewriting paradigm) is an esolang created by User:Ractangle. Based on the String-rewriting paradigm and Forte mostly

Syntax

To rewrite an integer. You do this:

5 <--- integer/variable to replace.
=
6 <--- replacement (in this example. 5 will become 6).

If there is another rule for the same integer. The program will follow the new rule for that integer only for the rest of the program.
. is used to either end a rule or print the first number included in main (A.K.A. m=) and remove it.
Every number, rule and command (excluding the ending dot at rules) MUST have a space to split the number (if you don't get it:"75 "="". m=75 25 .)
Variable declaration also exists in this esolang:name==integer
# Halts program

Examples

Truth-machine

I==1 1="1 . 1". 0="0 . #". m="I"

I must be set to the input