SemiScript

From Esolang
Jump to navigation Jump to search

SemiScript is an esolang using 4 different characters:

; : , .


These symbols aren't commands, but when strung together, result in an output. For the interpreter, it simply translates SemiScript code into Node.JS code. For an example, let's look at the hello world program.

Some info

If you use version 1.1, you can use comments anywhere (the tokenizer ignores characters that aren't in the SemiScript alphabet)

Use ":" as a command separator

Use "." to function as a new line

Use "," for a space

SemiScript uses SSCT (SemiScript Character Translator) text that inserts into the translation

Use it

Versions

Version 1.0
Version 1.1 not available :(

Text translator

Useful SSCT encode/decoder

Cheat sheet

Functions

; - output

;;;; - binary to decimal

;;;;;;;;;;;;;;;;;;;;; - input

;;;;;;;;;;;;;;;;;;;;;;;;; - random integer

;;;;;;;;;;;;;;;;;;;;;;;;;; - to string

;;;;;;;;;;;;;;;;;;;;;;;;;;; - to integer


Symbols

;;;;; - (

;;;;;; - )

;;;;;;; - [

;;;;;;;; - ]

;;;;;;;;; - {

;;;;;;;;;; - }

,, - =

,,, - !

,,,, - '

,,,,, - ,

Operations

;;;;;;;;;;; - addition

;;;;;;;;;;;; - subtraction

;;;;;;;;;;;;; - multiplication

;;;;;;;;;;;;;; - division

;;;;;;;;;;;;;;; - exponentiation


Comparing

;;;;;;;;;;;;;;;;;; - is equal to?

;;;;;;;;;;;;;;;;;;; - x less than y?

;;;;;;;;;;;;;;;;;;;; - x greater than y?


Keywords

;;;;;;;;;;;;;;;;;;;;;; - variable declaration

;;;;;;;;;;;;;;;;;;;;;;; - constant declaration


Loops

,; - if

,;; - else if

,;;; - else

,;;;; - for

,;;;;; - while


Other

,,,,,, - true

,,,,,,, - false

;; - 1

;;; - 0

Text translator in tools part


Examples

That cheat sheet is cool and all, but how can we actually use them?

Let's start with making the console say "Hello world":

Hello world
;
;;;;;
,,,,
,;.......:....:;..........:;..........:..........:,:...:..........:.....:;..........:;....:
,,,,
;;;;;;

So, basically, this is what it is doing:

  1. start display function
  2. start parenthesis
  3. start quotes
  4. ssct text saying "Hello world"
  5. end quotes
  6. end parenthesis

This outputs "Hello world".

Alternatively, if you don't like seeing what your code does, go for this:

;:;;;;;:,,,,:,;.......:....:;..........:;..........:..........:,:...:..........:.....:;..........:;....::,,,,:;;;;;;

This well, is the same thing but taking advantage of ":" to separate commands.