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.

C!

From Esolang
Jump to navigation Jump to search

C! is a Turing-complete esoteric programming language inspired by C++, and was made to simplify it to one letter commands. It requires no whitespace and has basic instructions. It was made by User:PeRsOn.

Overview

C! instruction table
Instruction Description Long form
O:: x outputs x Out
G:: x turns x into an input string Get
P:: x, y puts a black pixel at x, y Pixel
F: x,n makes x a float with value n Float
S: x,n makes x a string with n as its value String
C: x,n makes x a char with n as its character Character
I: x,n makes x an integer with value n Integer
B: x n makes x a bool of n Boolean
T < x turns x into type T N/A
+, - mathematics N/A
>, <, = conditionals / comparators N/A
!, ^, v boolean operations N/A
D: x, {n} makes x a function with instructions n Define
Q[c, i] does instructions i if conditional c is true Question
R[i] repeats instructions i until E is called Repeat
E ends a loop End
M[x,y,n] Replaces all instances of y with n in x. Match
J[x,n] Concatenates x and n Join
L[x,n] gets the nth letter of string x look

Examples

Truth machine

G::x;
I:x, I<x;
R[
O::x;
Q[x = 0, E];
];

Without whitespace

G::x;I:x,I<x;R[O::x;Q[x=0,E];];

Hello, world!

O::"Hello World!"

Slime fighting game (Inspired by Truttle1)

I: playerHp, 5;
I: potions, 2;
I: slimeOneHp, 3;
I: slimeTwoHp, 3;
R[
Q[slimeOneHp=0^slimeTwoHp=0,E;O::”You win!”];
Q[playerHp=0,E;O::”You lost.”;];
O:: “You have ”;
O:: S < playerHp;
O:: “ health, and ”;
O:: S < potions;
O:: “ potion.\n Slime 1 has ”;
O:: S < slimeOneHp;
O:: “health and slime 2 has”;
O:: S < slimeTwoHp;
O:: “health.\nEnter your choice. A - attack slime 1, B - attack slime 2, C - drink a potion (heals 2 health).\n”;
G:: playerChoice;
Q[playerChoice = “A” ^ !(slimeOneHp = 0), I: slimeOneHp, slimeOneHp - 1; O:: “You attack slime 1”;];
Q[playerChoice = “B” ^ !(slimeTwoHp = 0), I: slimeTwoHp, slimeTwoHp - 1; O:: “You attack slime 2”;];
Q[playerChoice = “C” ^ !(potions = 0), I: potions,potions - 1; I: playerHp, playerHp + 2; O:: “You drink a potion.”;];
Q[(!(playerChoice = “A”) V slimeOneHp = 0)^(!(playerChoice = “B”) V slimeTwoHp = 0)^(!(playerChoice = “C”) V potions = 0), O:: “This move could not be done.\n”;];
Q[slimeOneHp > 0^(playerChoice = “A” ^ !(slimeOneHp = 0))V(playerChoice = “B” ^ (!slimeTwoHp = 0))V(playerChoice = “C” ^ potions = 0), I: playerHp, playerHp - 1; O:: “Slime 1 attacks you.\n”;];
Q[slimeTwoHp > 0^(playerChoice = “A” ^ !(slimeOneHp = 0))V(playerChoice = “B” ^ !(slimeTwoHp = 0))V(playerChoice = “C” ^ potions = 0), I: playerHp, playerHp - 1; O:: “Slime 2 attacks you.\n”;];
]