Draft:Stupidity and Silliness
Stupdidity and Sillliness is an esoteric programming language by User:Dragoneater67.
Overview
The esolang is made out of 2 smaller esoteric programming languages that run in parallel using round-robin scheduling. A Stupidity and Silliness program is a .sus file which starts with a Stupidity program, followed by a line that only contains ., followed by a Silliness program.
Stupidity
Stupidity is an esoteric programming language. A program in Stupidity is a newline-separated list of instructions executed top-to-bottom in an implicit infinite loop. Each instruction is an integer triplet written with this syntax:
(A, B, C)
Which means "Append Ath Silliness instruction from Bth thread to Cth thread".
Silliness
Silliness is a multi-threaded esoteric programming language. It uses lottery scheduling. Each line is a thread and starts with space-separated thread ID, ticket count, and instruction list. Each thread has its own unbounded nonnegative integer register and halts when it executes its last instruction. The program halts only when all threads halt.
| Instruction | Description |
|---|---|
x+ |
Add x to this thread's register. |
x/ |
Swap this thread's ticket count with thread x's ticket count. |
x( |
Compare this thread's register with thread x's register, if they're equal, jump forward past matching ).
|
! |
Output this thread's register mod 256 as an ASCII character. |
? |
Input an ASCII character, add it to current thread's register. |
) |
Do nothing. |
Examples
XKCD Random Number
. 0 1 52+ !