Briefscript

From Esolang
Jump to: navigation, search

Briefscript

Briefscript is created to be as short-code as possible. It always had shorter code than Microscript.

Syntax

1
Jump to the 1st character in code
2
square CX and print it
i
input a number into CX
o
output CX
O
output 1
Q
print Q
z
print 0
s
selection jump(jump to the 2nd byte in code if AX=1, else halts program.)
I
input 2 numbers into CX and BX
R
convert roman numerals to decimal
a
add CX and BX , store it in CX and print it
[
If CX == 0, jump over ].
]
subtract CX by 1. Jump to [ if CX != 0.
F
find the factorial of CX
C
coin program(Print 1 if input is "heads", -1 if input is "tails")
H
print "Hello, world!"
9
print the "99 bottles of beer"
C
check if CX is a palindrome
U
Underload
S
Stramge numbers

Example

Infinite Loop(1 byte)

1

Truth-machine(2 bytes)

is

Sum of 2 inputs(2 bytes)

Ia

Calculate square of input(2 bytea)

i2

CAT program(2 bytes)

io

Take input and print 1, followed br that many 0s(4 bytes)

iO[z]

reverse quine(1 byte)

Q

Quine(1 byte)

Q

Factorial(2 bytes)

iF

Print 1 if input is "heads", -1 if input is "tails"(1 byte)

C

Hello, world!(1 byte)

H

Beer program(1 byte)

9

Check if a number is palindrome(2 bytes)

iC

Convert roman numerals to decimal(1 byte)

R

Underload

U

Strange numbers

S