Bangla Script Code Examples

Back
// ๐Ÿง‘โ€๐Ÿซ Lesson 1: Your First Output
output("Hello EduBox!");

// ๐Ÿ“ฆ Lesson 2: Variables and Values
box name = "Sky";
box age = 12;
output("Name: " + name);
output("Age: " + age);

// โž• Lesson 3: Doing Math
box a = 8;
box b = 3;
box sum = a + b;
box product = a * b;
output("Sum: " + sum);
output("Product: " + product);

// ๐Ÿ”ค Lesson 4: String Fun
box word = "cool";
output(word + " " + word);

// ๐Ÿ“ฅ Lesson 5: Getting User Input
input(name);
output("Hello " + name);

// ๐Ÿ” Lesson 6: Looping Things
box count = 1;
loop(5) {
  output("Count = " + count);
  count = count + 1;
}

// ๐Ÿ”„ Lesson 7: Conditional Logic
box score = 85;
if (score >= 60) {
  output("Pass");
} else {
  output("Fail");
}

// ๐Ÿ”ฃ Lesson 8: Comparison Operators
box x = 10;
if (x != 5) {
  output("x is not 5");
}

// ๐Ÿงฎ Lesson 9: Logical Operators
box age = 16;
box hasID = 1;
if (age >= 18 and hasID) {
  output("Allowed");
} else {
  output("Denied");
}

// ๐Ÿ“‰ Lesson 10: While-style Loop with Conditions
box n = 5;
loop(n > 0) {
  output("n = " + n);
  n = n - 1;
}

// ๐ŸŽ“ Final Challenge
input(name);
input(n);
box i = 1;
loop(n > 0) {
  output("Hello " + name);
  n = n - 1;
}

// ๐Ÿงฉ Advanced Lesson 1: Custom Calculator
input(a);
input(b);
box result1 = (a + b) * 2;
box result2 = (a * a + b * b) / (a + b);
output("Double sum: " + result1);
output("Weighted average: " + result2);

// ๐ŸŽฐ Advanced Lesson 2: Number Guess Game
box target = 7;
box guess = 0;
loop(guess != target) {
  input(guess);
  if (guess < target) {
    output("Too low");
  } else if (guess > target) {
    output("Too high");
  }
}
output("You guessed it!");

// ๐Ÿง  Advanced Lesson 3: Truth Table Evaluator
box A = 1;
box B = 0;
box result = (A or B) and !(A and B);
output("Result = " + result);

// ๐ŸŽˆ Advanced Lesson 4: Countdown with Condition
box x = 10;
box done = 0;
loop(x > 0, done == 0) {
  output("x = " + x);
  x = x - 1;
  if (x == 5) {
    done = 1;
    output("Midway!");
  }
}

// ๐Ÿงช Advanced Lesson 5: Basic Function Simulation
input(x);
box sq = x * x;
output("Square = " + sq);
if (sq > 100) {
  output("Large square");
}

// ๐Ÿ”„ Advanced Lesson 6: Loop with Dynamic Count
input(n);
box i = 0;
loop(i < n) {
  output("i = " + i);
  i = i + 1;
}

// โœ๏ธ Advanced Lesson 7: Text Repetition & Framing
input(word);
box count = 1;
loop(5) {
  output(">>> " + word + " <<<");
  count = count + 1;
}

// ๐Ÿงฎ Advanced Lesson 8: Modular Arithmetic Table
input(base);
box i = 1;
loop(10) {
  output(i + " % " + base + " = " + (i % base));
  i = i + 1;
}

// ๐Ÿšฆ Advanced Lesson 9: Multi-condition Filter
input(num);
if (num % 2 == 0 and num > 10) {
  output("Even and big");
} else if (num % 2 != 0 and num < 10) {
  output("Odd and small");
} else {
  output("Doesn't match");
}

// ๐ŸŽณ Advanced Lesson 10: Table Generator
input(base);
box i = 1;
loop(10) {
  output(base + " ร— " + i + " = " + (base * i));
  i = i + 1;
}