🎯 Learning Goals
By the end of this tutorial, you will:
- Understand B3D's program structure
- Create your first B3D program
- Learn about variables and basic data types
- Use simple string interpolation
- Run B3D programs successfully
Understanding B3D Structure
Every B3D program has a specific structure with four main blocks:
The Four Blocks
Your First B3D Program
Create hello.b3d
Create a new file called hello.b3d and enter this code:
Run Your Program
Open your terminal and run:
Hello, B3D World!
Welcome, Developer!
You are using B3D v1.0.0
Understanding Variables
In B3D, variables are declared in the <Data> block and can be used throughout your program.
Basic Data Types
String Interpolation Magic
B3D's string interpolation lets you embed variables directly in strings using {variable} syntax.
Interpolation Examples
Practical Exercises
🎯 Exercise 1: Personal Introduction
Create a program that introduces yourself with your name, age, and favorite hobby.
Hint: Use string interpolation to make it dynamic!
🎯 Exercise 2: Simple Calculator
Create a program that declares two numbers and shows their sum, difference, product, and quotient.
Challenge: Use string interpolation to show the calculations!
🎯 Exercise 3: List Operations
Create a list of your favorite foods and display the first and last items.
Bonus: Show how many foods are in your list!
Common Mistakes to Avoid
- Wrong block order: Always use Config → Include → Data → Main
- Missing includes: Don't forget
include std.iofor basic functions - Variable scope: Declare all variables in the Data block
- String interpolation: Use
{variable}not${variable}
🎉 Congratulations!
You've completed the basics tutorial! You now know:
- ✅ B3D program structure
- ✅ Variable declaration and usage
- ✅ Basic data types
- ✅ String interpolation
- ✅ Running B3D programs