BroCode syntax is designed to be simple and relatable, making coding feel like a breeze. Let’s break down the essentials you’ll need to start coding like a pro.
Quick Reference 🛠️
Declare variables using 'maanle' – simple and straight to the point!
bro maanle x hai 10;
You can declare a variable by specifying its name and assigning it a value. It's that easy!
Conditional statements use 'agar' – check if something is true or false.
bro agar (x > 5) {
bro dikha de("X is greater than 5");
}
Conditionals let you control the flow of your program based on certain conditions, just like 'if' statements in other languages.
Use 'jbb tk' for loops – loop while a condition is true!
bro jbb tk (x < 10) {
bro dikha de(x);
x++;
}
Loops are perfect for repeating actions until a condition is no longer true. 'jbb tk' is like a while loop.
Print values or messages using 'dikha de'.
bro dikha de("Hello, BroCode!");
Use this to output messages or variable values. It’s equivalent to 'console.log' in JavaScript.
Define functions using 'function' and call them as needed.
bro function ADD(a, b) {
bro dikha de(a + b);
}
ADD(5, 3);
Functions allow you to organize code into reusable blocks. Define once, use many times!
Example 💡
Define and call a function to add two numbers and display the result.
bro function ADD(a, b) {
bro dikha de(a + b);
}
ADD(5, 3);