🛠️ Step 1: Install the Engine
Lodu Code runs on a custom Python-based interpreter. Install it globally using pip in your terminal:
pip install lodu-code
🦊 Step 2: VS Code Extension
Get the ultimate coding experience with syntax highlighting and the official file icon.
- Open Visual Studio Code.
- Go to the Extensions Marketplace (Ctrl+Shift+X).
- Search for "Lodu Code Support" and install it.
- Now create any file with the .lodu extension!
🚀 Step 3: Run Your First Code
Write your Lodu code in a file (e.g., hello.lodu) and run it in the terminal:
lodu hello.lodu
Pro Tip: If Windows throws a PATH error saying 'lodu is not recognized', run it like this:
python -m lodu_runner hello.lodu
The Rules of Sanskar (Structure)
Lodu Code is extremely strict about manners. If you forget to greet or end properly, the compiler will roast you. The engine is case-insensitive, so NaMaSte works just fine.
- Namaste : Must be the first line to show respect.
- ab sun { ... } : Your main logic MUST go inside this block. Anything outside is ignored or throws an error.
- Khatm, tata, goodbye : Must be the last line to exit gracefully.
- @@ : Use this for writing comments. The engine ignores these lines.
@@ Ye mera pehla program hai
Namaste
ab sun {
@@ Asli logic yahan likho!
chl ab print kar("Jalwa hai bhai ka!")
}
Khatm, tata, goodbye
Variables & User Input
Memory management is straightforward. Declare variables using the bkl keyword. You can cast types using int(), str(), float(), or boolean().
Namaste
ab sun {
@@ Taking input from the terminal
bkl age = int(bsdk input daal("Apni age bata: "))
@@ Math operations work normally
bkl target = age + 10
@@ Printing (You can use 'chl' or 'mkc' prefix)
chl ab print kar("10 saal baad tu", target, "saal ka hoga!")
}
Khatm, tata, goodbye
Conditions (Agar - Varna)
Make decisions using agar (condition) { and } varna {. Be careful, the } varna { must be exactly on the same line!
Namaste
ab sun {
bkl marks = 95
agar (marks >= 90) {
chl ab print kar("Bhai tu toh Topper nikla!")
} varna {
chl ab print kar("Chup chap padhai kar le bkl")
}
}
Khatm, tata, goodbye
Loops (Jab Tak)
Repeat tasks using the jab tak loop. It works exactly like a 'while' loop in other languages.
Namaste
ab sun {
bkl count = 1
jab tak (count <= 3) {
chl ab print kar("Ginti: ", count)
@@ Increment variable
bkl count = count + 1
}
}
Khatm, tata, goodbye
Custom Functions & Built-in Tools
Define custom functions using abe saale and return values using wapas aa.
Namaste
ab sun {
abe saale jod_de(x, y) {
bkl ans = x + y
wapas aa ans
}
bkl result = jod_de(50, 50)
chl ab print kar("Ans hai:", result)
}
Khatm, tata, goodbye
Built-in Desi Globals
- raand(max): Generates random integers.
- sabar kar(seconds): Pauses the execution (sleep).
- naap(item): Returns the length of a string or array.
- Array([1, 2, 3]): Creates a list.