# π§ BrainRotLang
> The only language that speaks fluent Gen Z.
> From `beta` variables to `ragequit` exits β you ain't cooking unless you're cooking in BrainRotLang.
---
## πΎ Installation
```bash
git clone https://github.com/CloudyDev-tech/BrainrotLanguage
python interpreter.py path/to/yourfile.brt
```
---
## π₯ Language Syntax
### π§ͺ Variables
| Slang | Meaning | Example |
| ------------ | ---------------------------- | ----------------------------- |
| `beta` | Basic variable (n<=9) | `beta x = 5` |
| `chad` | Constants (case-insensitive) | `chad PI = 3.14 sybau` |
| `gyat_level` | Mutable but thiccly reserved | `gyat_level cake = 100 sybau` |
---
### π§ Operators
| Slang | Meaning | Python Equivalent |
| --------------- | --------------------- | ----------------- |
| `frfr` | Equality | `==` |
| `not_my_brick` | Not equal | `!=` |
| `got_pegged_by` | Less than or equal | `<=` |
| `mogs` | Greater than or equal | `>=` |
| `w` | Increment | `+1` |
| `l` | Decrement | `-1` |
| `smash` | Division | `/` |
| `cap` | True | `True` |
| `no_cap` | False | `False` |
| `nah_fr` | is not | `is not` |
| `and` | and | `and` |
| `or` | or | `or` |
| `not` | not | `not` |
| `is` | is | `is` |
---
### π Comments
```brainrot
$igma This is a comment
```
Need to write $igma at start of line for using that as comment
These lines will be ignored by compiler
---
### π¬ Input/Output
```brainrot
gyat_level gooner = npc ask("what's your name?")
beta edging_streak = npc ask:money("What's your edging streak?")
npc ahh comment("Hello, " + name)
```
npc ask:money for Integer/Numerical Inputs
npc ask for direct input as String literals
npc ahh comment to Print Output to console
Evaluate expression
```brainrot
yo:gert("4*6")
```
Output: 24
---
### π Control Flow
```brainrot
if bruh age mogs 18 then ratio {
beta vibe = "adult"
} else if bruh age got_pegged_by 0 then ratio {
ragequit
} else delulu {
beta vibe = "kid"
}
```
---
### π Functions
```brainrot
grind gyat_boost() {
npc ahh comment("GYAT INCOMING")
}
summon gyat_boost()
```
---
## π¨ Custom Errors
* `Holy Cornball bro π€―`: Used undefined variable.
* `you are not tuff bro ππ`: General crash.
* `no rizz detected π₯Ά`: Syntax error.
* `NPC Behaviour not tolerated`: Nonchalant variable declaration, missing '=' .
* `Cooked too hard`: Operator slang error.
---
### π Program Control
| Keyword | Meaning | Python Equivalent |
| `ragequit` | quitting the program | `sys.exit(1)` |
| `ragebait` | terminate the loop | `break` |
---
## π‘ Unique Features
* Full meme operator support.
* `ragequit`, `ragebait`, `npc ask`, and `npc ahh comment` expressions.
* Evaluation with `yo:gert` : Evaluate expressions on the fly
* `sybau` suffix prints on assignment.
* Expressive Control Flow : `if bruh` , `then ratio` , and `else delulu` make your conditionals hit different.
* Function Grindset : Define functions with `grind` and call them with `summon` .
* **Ragequit Anytime** : Exit your program dramatically when things get too real.
* Compile to Python with custom error decoding.
---
## π§ͺ Example
1. Basic Variable Assignment and Expression Evaluation:
```brainrot
chad rizz = 100 sybau
beta x = 5
yo:gert("RIZZ + x")
```
Compiles to:
```python
RIZZ = 100
print(RIZZ)
x = 5
print(eval("RIZZ + x"))
```
2. Control Flow and Function Declaration + Calling:
```brainrot
$ This is a BrainRotLang example
chad VIBE = 100 sybau
beta edging_streak = npc ask:money("What's your edging streak?")
beta rizz = 2 sybau
if bruh rizz mogs 10 then ratio {
$igma this is inside comment
npc ahh comment("beta is now alpha")
} else if bruh rizz got_pegged_by 5 then ratio {
npc ahh comment("beta has no rizz")
} else delulu {
npc ahh comment("beta has absolute no rizz")
}
grind gyat_boost() {
npc ahh comment("GYAT INCOMING")
}
summon gyat_boost()
yo:gert("4*6")
$ end of script
```
3. Cooked Too Hard Error
```brainrot
npc ahh comment("hello world", 23, "again", 90/3)
$igma above line will throw error
```
* SyntaxError: π Line 1 cooked too hard: 'npc ahh comment("hello world", 23, "again", 90/3)
' β drop the '/' and speak the slang: 'smash' π§
4. w operator and not_my_brick operator
```brainrot
gyat_level start = 1
npc ahh comment(start w)
npc ahh comment(start not_my_brick 10)
```
Compiles to:
```python
start = 1
print(start +1)
print(start != 10)
```
5.
```brainrot
beta rizz = 4 sybau
yo:gert "9+0"
npc ahh comment(rizz got_pegged_by 10)
$igma gyat_level unaware
if bruh rizz mogs 10 then ratio{
beta g = 3
}
npc ahh comment(rizz frfr 10)
npc ahh comment(rizz not_my_brick 10)
gyat_level g = 19
```
Compiles to:
```python
rizz = 4
print(rizz)
print(eval("9+0"))
print(rizz <= 10)
# gyat_level unaware
if rizz >= 10 :
g = 3
print(rizz != 10)
print(rizz != 10)
g = 19
```
6. Constant with Print
```brainrot
chad FRONTMAN = 1 + 43 sybau
frontman = 1 + 43
npc ahh comment(frontman)
```
7.
```brainrot
gyat_level gamma = t + 12
```
BrainRotNameError: Holy Cornball bro π€― Variable 't' used before declaration.
AND MANY MORE...
Checkout the [.brt file examples](examples/) folder for more.
---
## π Try it Online
[Streamlit Demo](https://brainrotlanguage.streamlit.app/)
---
## π Contributing
Got slang ideas? Drop a PR or issue. Just donβt be an NPC π€
---
## π License
This project is licensed under the MIT License - see the LICENSE file for details.
---
Made with π― rizz and zero gooning skills.
Β© 2025 BrainRotLang