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 args Command Create a task and push it to task stack(args are the arguments of run)
run n : args Command Run task[x] item of task stack and remove it, with args as arguments
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 you run x
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 x Command Empty the variable x(set it to a empty list)
return x Command Return x
call x : args Subcommand Call task x with args
duplicate x y Command Push item x of y to the top of y
x ^ y Subcommand Exponenciation

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!