Betul Betul BetulLang

From Esolang
Jump to navigation Jump to search
Betul Betul BetulLang
Designed by IkenusDisnem (talk)
Appeared in 2022
Memory system Cell-based and Stack-based
Dimensions one-dimensional
Computational class Unknown
Major implementations JAR Compiler
Influenced by Upin & Ipin
File extension(s) .b3l, .bbb

Betul Betul BetulLang or just BetulLang is an esolang made by IkenusDisnem (talk) in 05/03/2022. The idea for Betul Betul BetulLang came from an iconic line of "Betul Betul Betul!" in the Malaysian animated TV show, Upin & Ipin. The commands are similar to Length (but instead how many charaters, it's how many Betuls). The language is both stack based and cell based as it has both a tape and a stack.

Syntax

Here is how you type a command:

Betul Betul Betul!

Here is how you type a comment:

Tak this is a comment

For readability, use something to seperate Tak from the comment's content:

Tak | this comment is more readable

Here is how you write arguments for a command (The command's argument is always a number, to write numbers, you just write how many Betuls based of your number, eg: if you want to write 3, you write Betul Betul Betul. to write zero, simply write nothing):

Betul Betul Betul Betul Betul Betul: Betul.

For negative numbers use Tak:

Betul Betul Betul Betul Betul Betul Betul: Tak Betul Tak Betul Tak Betul.

Commands

Here are the list of commands in Betul Betul BetulLang

Commands
Amount of Betuls Command Name Amount of Arguments Description
1 goto 1 jumps to a line in the code with the first argument being the line to jump to (note: it can not jump into a line with no command in it)
2 gotoif 2 similar to goto, but comapares the popped element of the stack and the cell of the tape that the pointer is pointing to, with the second argument (-1 to 1) being how to compare (-1 = less than, 0 = equals, 1 = greater than). if the comparison is not true, it will not jump to the given line.
3 output 0 pops every element in the stack and outputs it.
4 input 0 recieves input and pushes it into the stack.
5 asciimode 1 by default is not active. If so, then the input command will turn any ASCII characters into ASCII decimal numbers, and the output command will display numbers as ASCII characters. if the first argument is 0, it will deactivate asciimode. Else if 1, it will activate it
6 move 1 moves the tape pointer, the first argument can be anything but 0. Any positve numbers will move the pointer by 1 and any negative numbers will move the pointer by -1.
7 set 2 will set the pointed cell on the tape to the value of the first argument, the second argument will decide what the command will do:
  • 0 just sets the value of the cell to the value of the first argument
  • 1 will sets the value of the cell as the result of the value of the cell + (addition) the value of the first argument
  • 2 will sets the value of the cell as the result of the value of the cell - (subtraction) the value of the first argument
  • 3 will sets the value of the cell as the result of the value of the cell * (multiplication) the value of the first argument
  • 4 will sets the value of the cell as the result of the value of the cell / (division) the value of the first argument
  • 5 will sets the value of the cell as the result of the value of the cell % (modulus) the value of the first argument
8 store 1 pushes the value of the pointed cell of the tape to the stack and setting the value of the pointed cell of the tape to 0
9 stash 1 pops an element from the stack, then sets the value of the pointed cell of the tape to the value of the popped element of the stack
10 clear 0 pops all of the elements off of the stack
11 reverse 0 reverses the stack (putting the first element to the last, first second to last second and so on.)
12 duplicate 0 pops the last element of the stack and pushes it 2 times into the stack.

Some Examples

A Truth-machine program

Tak | A truth-machine program
Betul Betul Betul Betul Betul Betul: Betul.
Betul Betul Betul Betul Betul Betul Betul: Betul, .
Betul Betul Betul Betul Betul Betul: Tak Betul.
Tak | Recieving input
Betul Betul Betul Betul!
Tak | Jumps to line 19
Betul Betul: Betul Betul Betul Betul Betul Betul Betul Betul Betul Betul Betul Betul Betul Betul Betul Betul Betul Betul Betul, .
Tak | the 1 part
Betul Betul Betul Betul Betul Betul: Betul.
Betul Betul Betul Betul Betul Betul Betul Betul!
Betul Betul Betul Betul Betul Betul Betul Betul Betul Betul Betul Betul!
Betul Betul Betul Betul Betul Betul Betul Betul Betul!
Betul Betul Betul!
Tak | Jumps to line 11
Betul: Betul Betul Betul Betul Betul Betul Betul Betul Betul Betul Betul. 

Tak | the 0 part
Betul Betul Betul Betul Betul Betul Betul Betul!
Betul Betul Betul!

External Sources

  1. Compiler