Neko

From Esolang
(Redirected from Nekol)
Jump to navigation Jump to search

Neko is a esolang created to be simple

Exist two types of commands, the commands and subcommands

The commands are used as commands, like in python

The subcommands are used in commands and are writen with ( and )

Codes are represented with { and }

He have this commands:

Caption text
Command Type Description
in x replace y with z Command Set stack[last] to replace every y with z in x
read x Subcommand Read Variable x
x + y Subcommand Addition
x - y Subcommand Subtraction
x * y Subcommand Multiplication
x / y Subcommand Division
switch/case Command This command are like any switch/case in programing languages
input Subcommand Pick an input and return it
random x y Subcommand random number from x to y
task c Command Create a task and push it to task stack
run n Command Run task[x] item of task stack and remove it(if null, run last task)
push x Command Push x to stack
pop Subcommand Pop stack
join Subcommand Join chars into a string
out x Command Output x
unicode x Subcommand Return the ascii from a decimal
as x Subcommand Return the equivalent ascii decimal of charter x
round x Subcommand Round number x
task Subcommand Pop the task list
shift x y Command Shift items x and y in stack
length x Subcommand Return length of x
catch x y Command Run y until hit a throw command with x
throw x Command Jumps out of tag x(see catch)
loop x y Command Run y and set x to the script itself
ignore x Command Run x and ignoring the return value
x : y Subcommand Set variable x to y and return y
empty Command Empty the stack

Hello, World!:

out Hello, World!

Cat:

out (input)

Truth-machine

switch (input) {
 case 1 {
  loop x {
   ignore task
   out 1
   task x
   run
  }
 }
 case 0 {
  out 0
 }
}


Interpreter:
Here Neko interpreter in Snap!