Bantas

From Esolang
Jump to: navigation, search

Bantas is an esoteric programming language developed by Jon Velasco and inspired by Blank. The word Bantas is a Filipino/Tagalog term for punctuation mark.

Commands

Cmd Description
@ sets the position
? print
> input
< puts a value to a stack
~ used for debugging. It simply displays the values of stack and outputs to a file
x a loop that displays the value of a stack horizontally
X a loop that displays the value of a stack vertically
% sets the title of the console
+ addition operator (adds a value/stack's value to a stack)
- subtraction operator (subtracts a value/stack's value to a stack)
* multiplication operator (multiplies a value/stack's value to a stack)
/ division operator (divides a value/stack's value to a stack)
^ exponent
& used to concatenate
| loads values in the stack
[] repeats a process (see sample codes)
() manipulates strings
_ gets the length of a string
{ sine
} cosine
\ tangent

Examples

Hello World

?,Hello World!

99 bottles of beer

%,PROGRAM : 99 Bottles of Beer
@,1
<,99
[,1
   @,2
   <,@1
   @,3
   <,@1
   &, 
   &,bottles of beer on the wall, 
   &,@1
   &, bottles of beer
   ?,@3
   @,2
   -,1
   @,4
   <,Take one down, pass it around, 
   &,@2
   &, bottles of beer
   ?,@4
   ?,
   @,1
   -,1
],1

Fibonacci sequence

%,PROGRAM : Fibonacci Sequence
@,1
<,1
@,2
<,1
@,3
<,
@,4
<,1
[,4
   @,3
   &,@1
   &, 
   &,@2
   &, 
   @,1
   +,@2
   @,2
   +,@1
   @,4
   +,1
],10
?,@3

Factorial of a Number

@,1
>,Enter a number:
@,2
<,1
[,1
   @,2
   *,@1
   @,1
   -,1
],1
?,@2

Reverse

%,PROGRAM : REVERSE A STRING
@,1
<,1
@,2
>,Enter a string:
@,4
<,
@,5
_,@2
[,1
   @,3
   <,@2
   ),@1
   (,1
   @,4
   &,@3
   @,1
   +,1
],@5
?,@4

Radians to degrees

%,PROGRAM : RADIANS TO DEGREES
@,1
>,Enter angle value in radians:
@,2
<,180
/,3.1416
*,@1
@,3
<,The value in degrees is 
&,@2
?,@3

External resources