Nine
Jump to navigation
Jump to search
Nine (Next Line) is an esoteric programming language, created by User:CMinusMinus.
Instructions
Instruction | Action |
---|---|
#VAR.VAL | VAR = VAL ("_" is replaced with a space) |
#VAR+<value> | VAR += <value> |
#VAR-<value> | VAR -= <value> |
#VAR.* | VAR = user-input |
$VAR$ | Call a variable |
>TEXT | Print Text |
>TEXT* | Print Text without \n |
>$VAR$ | Print Variable |
>$VAR$* | Print Variable without \n |
! | One line down |
end | End program |
(A|B) | if A = B, one line down |
(A%B) | if A % B = 0, one line down |
; | Begin of a comment, have to be at the start of a line |
~INSTRUCTION | Run a command once (Then ignored in main-loop) |
A program is running infinitely, until the "end" command. With this, you are able to easily run a while loop.
Every instruction got no spaces, so its possible to write those next to each other, separated with a space, for example:
>Hello,_World! end
becomes
>Hello,_World! end
Examples
Hello, World!
>Hello,_World! end
FizzBuzz
~#num.1 #num+1 >$num$ ($num$%3) >Fizz ($num$%5) >Buzz ($num$%15) >FizzBuzz
cat
#i.* >$i$
Fibonacci numbers
~#a.0 ~#b.1 >$b$ #c.$a$ #a.$b$ #b+$c$
Swapping the Words "Good" and "Bad"
#word.* ($word$|Bad) >Good end >Bad end