We are currently working on new rules for what content should and shouldn't be allowed on this website, and are looking for feedback! See Esolang:2026 topicality proposal to view and give feedback on the current draft.

Smileyface

From Esolang
Jump to navigation Jump to search
The title of this article is not correct because of technical limitations. The correct title is actually :).


:) is an esolang created by User:Martsadas that only uses smileys

Valid tokens are :), :P, :], :>, :D, and :O.

Valid instructions:


All instructions start with an instruction modification parameter kinda like Whitespace.

Instruction modification parameters
:) I/O
:P Cells
:] Arithmetic
:> Repeat same IMP as last instruction
:D Flow control
Instruction arguments are separated by :>. Lines are separated by :O.
I/O
:) :) [c] Prints cell [c] as an ASCII character
:P :P [c] Prints cell [c] as a number
:] :] [c] Asks the user to input a number and stores it into cell [c]
:> :> [c] Prints constant [c] as an ASCII character
:D :D [c] Asks the user to input a character and stores its ASCII value into cell [c]
:) stores variables in cells.
Cells
:) :) [c] :> [n] Sets cell [c] to value [n]
:P :P [a] :> [b] Sets cell [a] to the value of cell [b]
:] :] Moves the cell pointer left
:> :> Moves the cell pointer right
:D :D [c] Sets cell [c] to the cell pointer's position
Arithmetic
:) :) [a] :> [b] :> [c] Sets cell [c] to cell [a] + cell [b]
:P :P [a] :> [b] :> [c] Sets cell [c] to cell [a] - cell [b]
:] :] [a] :> [b] :> [c] Sets cell [c] to cell [a] * cell [b]
:> :> [a] :> [b] :> [c] Sets cell [c] to cell [a] / cell [b]
:D :D [a] :> [b] :> [c] Sets cell [c] to cell [a] % cell [b]
Flow control
:) :) [n] Creates a new label [n]
:P :P [n] Goes to label [n]
:] :] [n] :> [a] :> [b] Goes to label [n] if cell [a] and cell [b] are equal
:> :> [n] :> [a] :> [b] Goes to label [n] if cell [a] is greater than cell [b]
:D :D Halts the program

Numbers:


Numbers in :) are stored in base 4.

:) 0
:P 1
:] 2
:D 3

Notes:


The cell pointer

  • You can access the cell that the cell pointer points to by accessing cell 0.
  • The cell pointer can't move left when it's at 1.

Comments
You can write a comment by using ; which will make a single-line comment.

Example programs:

Hello, World!:

:) :> :P :) :] :) :O ; H
:) :> :P :] :P :P :O ; e
:) :> :P :] :D :) :O ; l
:) :> :P :] :D :) :O ; l
:) :> :P :] :D :D :O ; o
:) :> :] :D :) :O    ; ,
:) :> :] :) :) :O    ; [space]
:) :> :P :P :P :D :O ; W
:) :> :P :] :D :D :O ; o
:) :> :P :D :) :] :O ; r
:) :> :P :] :D :) :O ; l
:) :> :P :] :P :) :O ; d
:) :> :] :) :P :O    ; !

Truth-machine:

:) :] :D :O       ; Get input
:P :) :P :> :P :O ; Set another cell to 1

:D :) :] :O       ; Make a new label
:) :P :D :O       ; Print the input
:D :] :] :> :D :> :P :O ; Jump to the label if the input is equal to 1
:D :D :O          ; Halt the program

99 bottles of beer:

:P :) :P :> :P :] :) :D :O
:P :) :] :> :P :O

:D :) :] :O

:) :P :P :O

; Print ' bottles of beer on the wall'
:) :> :] :) :) :O
:) :> :P :] :) :] :O
:) :> :P :] :D :D :O
:) :> :P :D :P :) :O
:) :> :P :D :P :) :O
:) :> :P :] :D :) :O
:) :> :P :] :P :P :O
:) :> :P :D :) :D :O
:) :> :] :) :) :O
:) :> :P :] :D :D :O
:) :> :P :] :P :] :O
:) :> :] :) :) :O
:) :> :P :] :) :] :O
:) :> :P :] :P :P :O
:) :> :P :] :P :P :O
:) :> :P :D :) :] :O
:) :> :] :) :) :O
:) :> :P :] :D :D :O
:) :> :P :] :D :] :O
:) :> :] :) :) :O
:) :> :P :D :P :) :O
:) :> :P :] :] :) :O
:) :> :P :] :P :P :O
:) :> :] :) :) :O
:) :> :P :D :P :D :O
:) :> :P :] :) :P :O
:) :> :P :] :D :) :O
:) :> :P :] :D :) :O
:) :> :] :] :O

:) :P :P :O

; Print ' bottles of beer'
:) :> :] :) :) :O
:) :> :P :] :) :] :O
:) :> :P :] :D :D :O
:) :> :P :D :P :) :O
:) :> :P :D :P :) :O
:) :> :P :] :D :) :O
:) :> :P :] :P :P :O
:) :> :P :D :) :D :O
:) :> :] :) :) :O
:) :> :P :] :D :D :O
:) :> :P :] :P :] :O
:) :> :] :) :) :O
:) :> :P :] :) :] :O
:) :> :P :] :P :P :O
:) :> :P :] :P :P :O
:) :> :P :D :) :] :O
:) :> :] :] :O

; Print 'take 1 down'
:) :> :P :D :P :) :O
:) :> :P :] :) :P :O
:) :> :P :] :] :D :O
:) :> :P :] :P :P :O
:) :> :] :) :) :O
:) :> :D :) :P :O
:) :> :] :) :) :O
:) :> :P :] :P :) :O
:) :> :P :] :D :D :O
:) :> :P :D :P :D :O
:) :> :P :] :D :] :O
:) :> :] :] :O

; Print 'pass it around'
:) :> :P :D :) :) :O
:) :> :P :] :) :P :O
:) :> :P :D :) :D :O
:) :> :P :D :) :D :O
:) :> :] :) :) :O
:) :> :P :] :] :P :O
:) :> :P :D :P :) :O
:) :> :] :) :) :O
:) :> :P :] :) :P :O
:) :> :P :D :) :] :O
:) :> :P :] :D :D :O
:) :> :P :D :P :P :O
:) :> :P :] :D :] :O
:) :> :P :] :P :) :O
:) :> :] :] :O
:) :> :] :] :O

:] :P :P :> :] :> :P :O

:D :> :] :> :P :> :] :O

; Print '1 bottle of beer on the wall
;        1 bottle of beer
;        take 1 down
;        pass it around'

:) :> :D :) :P :O
:) :> :] :) :) :O
:) :> :P :] :) :] :O
:) :> :P :] :D :D :O
:) :> :P :D :P :) :O
:) :> :P :D :P :) :O
:) :> :P :] :D :) :O
:) :> :P :] :P :P :O
:) :> :] :) :) :O
:) :> :P :] :D :D :O
:) :> :P :] :P :] :O
:) :> :] :) :) :O
:) :> :P :] :) :] :O
:) :> :P :] :P :P :O
:) :> :P :] :P :P :O
:) :> :P :D :) :] :O
:) :> :] :) :) :O
:) :> :P :] :D :D :O
:) :> :P :] :D :] :O
:) :> :] :) :) :O
:) :> :P :D :P :) :O
:) :> :P :] :] :) :O
:) :> :P :] :P :P :O
:) :> :] :) :) :O
:) :> :P :D :P :D :O
:) :> :P :] :) :P :O
:) :> :P :] :D :) :O
:) :> :P :] :D :) :O
:) :> :] :] :O
:) :> :D :) :P :O
:) :> :] :) :) :O
:) :> :P :] :) :] :O
:) :> :P :] :D :D :O
:) :> :P :D :P :) :O
:) :> :P :D :P :) :O
:) :> :P :] :D :) :O
:) :> :P :] :P :P :O
:) :> :] :) :) :O
:) :> :P :] :D :D :O
:) :> :P :] :P :] :O
:) :> :] :) :) :O
:) :> :P :] :) :] :O
:) :> :P :] :P :P :O
:) :> :P :] :P :P :O
:) :> :P :D :) :] :O
:) :> :] :] :O
:) :> :P :D :P :) :O
:) :> :P :] :) :P :O
:) :> :P :] :] :D :O
:) :> :P :] :P :P :O
:) :> :] :) :) :O
:) :> :D :) :P :O
:) :> :] :) :) :O
:) :> :P :] :P :) :O
:) :> :P :] :D :D :O
:) :> :P :D :P :D :O
:) :> :P :] :D :] :O
:) :> :] :] :O
:) :> :P :D :) :) :O
:) :> :P :] :) :P :O
:) :> :P :D :) :D :O
:) :> :P :D :) :D :O
:) :> :] :) :) :O
:) :> :P :] :] :P :O
:) :> :P :D :P :) :O
:) :> :] :) :) :O
:) :> :P :] :) :P :O
:) :> :P :D :) :] :O
:) :> :P :] :D :D :O
:) :> :P :D :P :P :O
:) :> :P :] :D :] :O
:) :> :P :] :P :) :O
:) :> :] :] :O
:) :> :] :] :O
:) :> :D :) :) :O
:) :> :] :) :) :O
:) :> :P :] :) :] :O
:) :> :P :] :D :D :O
:) :> :P :D :P :) :O
:) :> :P :D :P :) :O
:) :> :P :] :D :) :O
:) :> :P :] :P :P :O
:) :> :P :D :) :D :O
:) :> :] :) :) :O
:) :> :P :] :D :D :O
:) :> :P :] :P :] :O
:) :> :] :) :) :O
:) :> :P :] :) :] :O
:) :> :P :] :P :P :O
:) :> :P :] :P :P :O
:) :> :P :D :) :] :O
:) :> :] :) :) :O
:) :> :P :] :D :D :O
:) :> :P :] :D :] :O
:) :> :] :) :) :O
:) :> :P :D :P :) :O
:) :> :P :] :] :) :O
:) :> :P :] :P :P :O
:) :> :] :) :) :O
:) :> :P :D :P :D :O
:) :> :P :] :) :P :O
:) :> :P :] :D :) :O
:) :> :P :] :D :) :O

; Halt
:D :D :O

Interpreter

  • Common Lisp implementation of the :) programming language.