Jeb

From Esolang
Jump to navigation Jump to search

Jeb, pronounced /ʤev/ is an esolang created by User:Infinitehexagon with 14 instructions. This is his first esolang in months.

Syntax

Almost all instructions require at least one or two arguments.

je a
ej a b

Only two instructions use three or more arguments, and that's bjej, beej, and bje . The bje instruction can have an infinite amount of instructions because its for statements.

bjej a b c

Operators

jjj NOT (!)
jj =
j ==
eeee %
eee >
bbbb AND (&)
bbb <
bb /
b *

For operators that dont exist such as >= or <= you combine them. Greater than or equal to would be (eee jj), less than or equal to would be (bbb jj) and not equal to would be (jjj jj).

Instructions

Caption text
Command Description Eqiuvalent Usage Example
ee increment a variable by a value. var += x ee var 15
eb create an array and give values to it. var = [] eb array [1, 2, 3]
ej set a variable to a value or an operation. leave second argument blank for declaring a variable. var = x ej var 15
bj store user input into a given variable. bj var
je output the given variable. print(var) je var
be while statement is matched, initiate a loop. while x do{ be var jj 15
bee close a loop. }
bej create a function. function function() { bej func { (code)...} bej
jeb start program. jeb (code)...
jje set a variable to a random value ranging from 1 to the number. random(1, n) jje var 6
bje if statement. performs code below if the statement is true. if var = x then... bje var (operator) x ... bje
beej set variable to the value in the index number of an array. var = array[index] beej var array 0
bjej append a value to an array. bjej
jeeb halt / end program. (code)... jeeb

Programs

Hello World program

ej helloworld "Hello, World!"
je helloworld

Cat program

bj input
je input 

Count up to 100

ej count_up 0
be count_up bbb jj 100
ee count_up 1
je count_up
bee

FizzBuzz program

ej fizzbuzz 100
ej counter 0
ej output "empty"
eb text ["Fizz", "Buzz", "FizzBuzz"]
be fizzbuzz eee counter
ee counter 1
bje counter eeee 3 jj 0
beej output text 0 
je output
bje
bje counter eeee 5 jj 0
beej output text 1 
je output
bje
bje counter eeee 3 b 5 jj 0
beej output text 2 
je output
bje
bje counter jjj eeee 3 bbbb eeee 5
je counter
bje
bee