We are currently working on new rules for what content should and shouldn't be allowed on this website, and are looking for feedback! See Esolang:2026 topicality proposal to view and give feedback on the current draft.

Jezik

From Esolang
Jump to navigation Jump to search

Jezik (bos. Language, pronounced /jězik/) is a stack-based esolang made by User:Zopium, which is just your average esolang, but in the Bosnian language (but only on ijekavian speech :P). It's extension is .j

Instructions
Instruction Purpose
DODAJ BROJ [number] Pushes a decimal number onto the stack.
TRAŽI UNOS OD KORISNIKA Asks for user input. If it's a number it gets pushed onto the stack as a number, but if it's not a number the ASCII value gets pushed onto the stack.
UZMI DVA BROJA I ... Pops two numbers and decides what to do with them.
ISPRINTAJ REČENICU ... Basically an echo command. Also doesn't print out a line feed.
ISPRINTAJ BROJ ,,, Pops a number that's on top of the stack and prints it out.
ZAOKRUŽI BROJ Rounds a number that's on top of the stack.
DUPLICIRAJ BROJ Duplicates the top number.
STAVI PRETHODNI BROJ NA POZICIJI BROJA Basically a PUT command.
IZABERI BROJ KOJI JE NA POZICIJI BROJA Basically a PICK command.
DAJ NASUMICAN BROJ DO ZADNJEG BROJA Pops a number from the stack, and a random number with the maximum of that number gets pushed onto the stack.
DEFINIŠI LINIJU [line] Define a labeled line.
AKO JE BROJ ISTINIT SKOČI NA LINIJI [line] Jumps to a defined line if the popped number is truthy.
PRESTANI SE DERATI Terminates the program.

... is required, ,,, is optional.

Some arguments for instructions
Instruction Arguments
UZMI DVA BROJA I ... SABERI IH adds, ODUZMI IH subtracts, POMNOŽI IH multiplies, PODJELI IH divides, PODJELI IH I UZMI OSTATAK divides and gets the remainder, ZAMJENI IH SWAPs, VIDI DA LI SU JEDNAKI compares if they are equal, VIDI DA LI SU NEJEDNAKI compares if they are not equal, VIDI DA LI JE JEDAN MANJI compares if one is smaller than the other, VIDI DA LI JE JEDAN VEĆI compares if one is bigger than the other, OBAVI POBITNI AND NA NJIH does the bitwise AND, OBAVI POBITNI OR NA NJIH does the bitwise OR and OBAVI POBITNI XOR NA NJIH does the bitwise XOR. All else will throw an error.
ISPRINTAJ BROJ ,,, If KAO ASCII ZNAK is provided at the end, it will print the popped number as an ASCII character.

Examples

Hello, world!

ISPRINTAJ REČENICU Hello, world!

Or if you despise simplicity:

DODAJ BROJ 72
ISPRINTAJ BROJ KAO ASCII ZNAK
DODAJ BROJ 101
ISPRINTAJ BROJ KAO ASCII ZNAK
DODAJ BROJ 108
ISPRINTAJ BROJ KAO ASCII ZNAK
DODAJ BROJ 108
ISPRINTAJ BROJ KAO ASCII ZNAK
DODAJ BROJ 111
ISPRINTAJ BROJ KAO ASCII ZNAK
DODAJ BROJ 44
ISPRINTAJ BROJ KAO ASCII ZNAK
DODAJ BROJ 32
ISPRINTAJ BROJ KAO ASCII ZNAK
DODAJ BROJ 119
ISPRINTAJ BROJ KAO ASCII ZNAK
DODAJ BROJ 111
ISPRINTAJ BROJ KAO ASCII ZNAK
DODAJ BROJ 114
ISPRINTAJ BROJ KAO ASCII ZNAK
DODAJ BROJ 108
ISPRINTAJ BROJ KAO ASCII ZNAK
DODAJ BROJ 100
ISPRINTAJ BROJ KAO ASCII ZNAK
DODAJ BROJ 33
ISPRINTAJ BROJ KAO ASCII ZNAK

XKCD Random Number

// chosen by fair dice roll.
// guaranteed to be random.
DODAJ BROJ 4
ISPRINTAJ BROJ

A+B Problem

TRAŽI UNOS OD KORISNIKA
TRAŽI UNOS OD KORISNIKA
UZMI DVA BROJA I SABERI IH
ISPRINTAJ BROJ

iExpress repeater

TRAŽI UNOS OD KORISNIKA
DEFINIŠI LINIJU l
DUPLICIRAJ BROJ
ISPRINTAJ REČENICU IEXPRESS!
DODAJ BROJ 10
ISPRINTAJ BROJ KAO ASCII ZNAK
DODAJ BROJ 1
UZMI DVA BROJA I ODUZMI IH
DUPLICIRAJ BROJ
AKO JE BROJ ISTINIT SKOČI NA LINIJI l

Truth-machine

TRAZI UNOS OD KORISNIKA
DODAJ BROJ 0
IZABERI BROJ KOJI JE NA POZICIJI BROJA
DODAJ BROJ 0
UZMI DVA BROJA I VIDI DA LI SU JEDNAKI
AKO JE BROJ ISTINIT SKOCI NA LINIJI 0
DODAJ BROJ 0
IZABERI BROJ KOJI JE NA POZICIJI BROJA
DODAJ BROJ 1
UZMI DVA BROJA I VIDI DA LI SU JEDNAKI
AKO JE BROJ ISTINIT SKOCI NA LINIJI 1
PRESTANI SE DERATI
DEFINISI LINIJU 0
ISPRINTAJ RECENICU 0
PRESTANI SE DERATI
DEFINISI LINIJU 1
DODAJ BROJ 1
DUPLICIRAJ BROJ
ISPRINTAJ BROJ
AKO JE BROJ ISTINIT SKOCI NA LINIJI 1

Or a short version.

TRAZI UNOS OD KORISNIKA
DEFINISI LINIJU t
DUPLICIRAJ BROJ
ISPRINTAJ BROJ
DUPLICIRAJ BROJ
AKO JE BROJ ISTINIT SKOCI NA LINIJI t

Fibonacci sequence

This implementation makes it different from most implementations because this lets you input how many first fibonacci numbers do you want to be printed out.

TRAZI UNOS OD KORISNIKA How many fibonacci numbers do you want? 
DUPLICIRAJ BROJ
DODAJ BROJ 0
UZMI DVA BROJA I VIDI DA LI SU JEDNAKI
AKO JE BROJ ISTINIT SKOCI NA LINIJI odjebi

DODAJ BROJ 0
DODAJ BROJ 1

DEFINISI LINIJU fib
DODAJ BROJ 1
IZABERI BROJ KOJI JE NA POZICIJI BROJA
DUPLICIRAJ BROJ
ISPRINTAJ BROJ
ISPRINTAJ RECENICU , 
DODAJ BROJ 2
IZABERI BROJ KOJI JE NA POZICIJI BROJA
DODAJ BROJ 1
STAVI PRETHODNI BROJ NA POZICIJI BROJA
UZMI DVA BROJA I SABERI IH
DODAJ BROJ 0
IZABERI BROJ KOJI JE NA POZICIJI BROJA
DODAJ BROJ 1
UZMI DVA BROJA I ODUZMI IH
DUPLICIRAJ BROJ
DODAJ BROJ 0
STAVI PRETHODNI BROJ NA POZICIJI BROJA
AKO JE BROJ ISTINIT SKOCI NA LINIJI fib
ISPRINTAJ RECENICU and thats it!
PRESTANI SE DERATI

DEFINISI LINIJU odjebi
ISPRINTAJ RECENICU Then why did you even come here?

Links

The NodeJS implementation on Codeberg