On Esolangs SMILLVM PySMIL

Playground


Verbose mode Golf mode

Help

Every program starts with <3 (heart) and ends with </3 (broken heart), like HTML markup:

<3

;) body here

</3

Smileys are only two characters long (except for the broken heart </3 to end a program) for performance purposes.

White-spaces (_), tabs (\t) and line breaks (\n) can separate smileys and are ignored, even into variable name; are they are called skipable characters.

Example: :( \n :$ \t :) is the same as :(:$:)

Extension:

The file extension is .sl, like myawesomeprog.sl.

Comment:

Get input value:

Note: theses values cannot be assigned (changed) and there is no skipable characters between each :$ (Example: :$ :$ is like :$ :$, two times the first input :$, but not the same as :$:$)

Variable:

Example: If first input is "12",

:( :$ :) =; :$ creates a variable named ":$" with the value of "12",

:( :( :$ :) :) ;= :$ :* :$ create a variable named "12" with the value of "144".

Example: If first input is "123":

:( :P :) =; :$

x( :O :) =; x( :P :), ":O" equals "true", ":P" equals 123

Initialization:

Nop (do nothing, absolutely nothing, not even eating cherries):

Print:

Example: print the first argument (:$): :@ :( :$ :) :$:$ :$ @): "4 = 2" if inputs are: ["2", "="], and the variable ":$" is equal to 4.

Example (with first input is "Hello" and second "1"):

<3

:( :$ :) =; :$:$ ;) ":$" = 2nd input

:( :P :) =; x( :$ :) ;) ":P" = not ( ":$" )

:@ :$ :( :P :) @) ;) print "Hello, 0!"

</3

Without spaces and comments:

<3:(:$:)=;:$:$

:(:P:)=;:x(:$:)

:@:$:(:P:)@)</3

Operators (binary):

With integers:

Note: :& and :| are binary and and or, the result will be binary number, zero or one.

Example (set a variable named ":P" with the addition of the first and second arguments):

:( :P :) =; :$ :# :$:$

With string:

Example: If inputs are: "Hello" ", " "World" "!":

:$ :# :$:$ :# :$:$:$ :# :$:$:$:$ ("Hello, World!")

Example 2: If inputs are: "Hello" and "el":

:$ :> :$:$ ("Hlo")

Example 3: If inputs are "Hello" and 2:

:$:$ :# :$ ("Hello2")

:$:$ :> :$ ("Hel")

:$:$ :* :$ ("HelloHello")

:$:$ :/ :$ ("He")

:$:$ %) :$ ("loHel")

Stack:

Build-in functions:

Example: the variable ":$" contains the length of the first input:

:( :$ :) =; L) :$

The then block is called until the condition is true (superior to zero, compared as [integer | length(string)] > 0). The thelse (then else) block is called once if the condition is false before the loop (and not if becomming false during the execution of the then block) and then exits the loop.

Example 1: loop and push the variable named ":$" until :$ is true and then push the content of the variable named ":$:$":

8| :$ |) :P :( :$ :) 8) :P :( :$:$ :) 8}

Note: the thelse block is not called in this example

Example 2: push the maximum between the first and the second input:

:( :P :) =; :$:$ :> :$

8| :( :P :) |) :P :( :$:$ :) :( :P :) ;= :$ :> :$ 8) :P :( :$ :) 8}

Smileys descriptions:

L) loser
#0 d'oh
%) drunk
8} silly
8| rolling eyes
:$ don't tell anyone
:> smug
:v pacman
8) dumb person
:P drooling
=; talk to my hand
:O clown
:/ confused
:& sick
:# Sealed lips
x( angry
B) cool
|) sleepy
<3 heart
</3 broken heart
:( sad
:) happy
;) wink
:D smile
:$ embarrassed
:* kiss
@) hypnotized
:@ exclamation
:| disappointed
:B geek