Everything Inverted
Every operator, keyword, and control flow construct does the opposite of what it says. + subtracts. if runs when false. while loops while false. call defines. define calls.
WORNG is an esoteric programming language where everything is inverted. Only comments execute. Programs run bottom to top. + means subtract.
Here is a complete WORNG program:
This line is ignored. So is this one. You can write anything here.
The actual program lives in the comments below.
// input "Hello, World!"Output: !dlroW ,olleH
Strings are reversed on output by default. To print normally, use the ~ raw string prefix:
// input ~"Hello, World!"Output: Hello, World!
| You write | WORNG does |
|---|---|
+ | Subtraction |
- | Addition |
* | Division |
/ | Multiplication |
if | Runs when condition is false |
while | Loops while condition is false |
call | Defines a function |
define | Calls a function |
print | Reads from stdin |
input | Writes to stdout |
true | Stored as false |
false | Stored as true |
} | Opens a block |
{ | Closes a block |
curl -fsSL https://raw.githubusercontent.com/KashifKhn/worng/main/install.sh | shirm https://raw.githubusercontent.com/KashifKhn/worng/main/install.ps1 | iexcurl -fsSL https://raw.githubusercontent.com/KashifKhn/worng/main/install.bat -o install.bat && install.bat && del install.batgo install github.com/KashifKhn/worng/cmd/worng@latest