🛠️ 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
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.
- Namaste : Must be the first line to show respect.
- ab sun { ... } : Your main logic MUST go inside this block.
- Khatm, tata, goodbye : Must be the last line to exit gracefully.
- @@ : Use this for writing comments.
@@ 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
Declare variables using the bkl keyword. You can cast types using int(), str(), float().
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
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 {.
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.
Namaste
ab sun {
bkl count = 1
jab tak (count <= 3) {
chl ab print kar("Ginti: ", count)
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
Arrays (Jhund) & External Modules
In Lodu Code, Arrays are used as modules. You must import the array module first, and then you can push, pop, or check the length!
- bhadwe add kar Array as jhund: Imports the Array module with an alias.
- alias.(1, 2): Creates a new array.
- daal(arr, val): Pushes/Appends a value.
- nikal(arr): Pops the last value.
- naap(arr): Returns the size of the array.
bhadwe add kar Array as pp
Namaste
ab sun {
@@ Array Declare Karna
bkl marks = pp.(10, 20, 30)
chl ab print kar("Original Array:", marks)
@@ Value Daalna
daal(marks, 40)
chl ab print kar("40 daalne ke baad:", marks)
@@ Size Naapna
bkl size = naap(marks)
chl ab print kar("Array ka total size hai:", size)
@@ Index Update Karna
bkl marks[0] = 999
chl ab print kar("Index 0 update karne ke baad:", marks)
}
Khatm, tata, goodbye