SimPPLe

From Esolang
Jump to navigation Jump to search

SimPPLe (Simple Probabilistic Programming Language) is a probabilistic programming language. Most programs written in this language, produce different results every time they're executed. You can only assign random values to variables. Even data inputed by the user will only assign a random value.

Language Overview

Command Description
int [var] declare a new integer and initialize it with random value
flt [var] declare a new float and initialize it with random value
add [var] [var2] add [var] to [var2] and save the result in [var]
sub [var] [var2] subtract [var] of [var2] and save the result in [var]
mul [var] [var2] multiplicate [var] by [var2] and save the result in [var]
div [var] [var2] divide [var] by [var2] and save the result in [var]
out [var] output the value of the variable
chrOut [var] output the value of the variable as character
intIn [var] set variable to random value between 0 and the userinput
chrIn [var] set variable to random value between 0 and ASCII value of the userinput
jmp [var] jump to the value of the variable
jmpGtr [var] [var2] jump to the greater value or if both values are equal continue execution normally
jmpLss [var] [var2 ] jump to the lesser value or if both values are equal continue execution normally
end end the program

Examples

Output a random number

int y
out y

Adding to random numbers in user set limit

intIn y
intIn x
add y x
out y

Print random amount of random characters

int y
int x
chrOut y
chrOut x
jmp y
jmp x

The program execution can also end in an endless loop.

Endless loop

int j
jmp j

Implementations

There is an interpreter written in Python.