First Program
Welcome to EasyBite! In this guide, you will write and run your first EasyBite programs, learn how to output text with the show
keyword, and insert blank lines using the showline()
function. By the end, you’ll understand the basics of EasyBite I/O and be ready to explore more features.
Table of Contents
Prerequisites
- EasyBite v0.3.0+ installed and on your
PATH
(see Installation for details). - A text editor or IDE (e.g., VS Code with the EasyBite extension).
- Basic familiarity with writing and saving text files.
File Setup
- Open your editor.
- Create a new file named
FirstProgram.bite
(or use.eb
, both extensions are supported). - Save it in a directory you can easily access from your terminal.
show
Keyword
Syntax
show "Your text here"
show("Your text here")
show
is the primary output keyword in EasyBite.- Parentheses are optional. Both forms are equivalent.
- String literals must be enclosed in double quotes (
"
).
Examples
Example 1: Simple Greeting
HelloWorld.bite
// Prints a basic greeting
show "Hello, EasyBite!"
Example 2: Using Parentheses
// Prints a welcome message
show("Welcome to EasyBite programming.")
Tip: Use comments (
//
) to document your code.
showline()
Function
Syntax
showline()
- Inserts a single blank line into the console output.
- Takes no arguments.
Examples
Example 3: Separated Messages
FirstProgram.bite
// Two messages with a blank line between
show "First line"
showline()
show "Second line"
Running Your Program
- Open a terminal or command prompt.
- Change into the directory containing your file:
cd /path/to/your/file
- Execute the program:
or
easybite FirstProgram.bite
easybite FirstProgram.eb
Expected Output
For Example 1:
Hello, EasyBite!
For Example 2:
Welcome to EasyBite programming.
For Example 3:
First line
Second line
Next Steps
- Explore variables, control structures, and functions in EasyBite.
- Check out the Official Syntax Reference for detailed language features.
- Try combining
show
,showline()
, and comments to create a multi-line banner.
Happy coding with EasyBite!