Skip to content

Beginner Examples

Welcome to the Beginner Examples section! These examples are designed for new learners of Ellex, focusing on simple concepts and basic commands. If you’re just starting out with programming or exploring Ellex for the first time, this is the perfect place to begin.

Ellex is a natural language programming environment that lets you write code as if you’re speaking or giving instructions. These examples will help you understand the fundamental building blocks of Ellex, such as outputting text, getting user input, and using basic control structures.

In this section, you’ll explore:

  • Basic Output: How to display messages using the tell command.
  • User Input: How to ask for and use input with the ask command.
  • Simple Loops: Repeating actions with repeat.
  • Variables: Storing and reusing information in your programs.

Below are the beginner examples to help you get started with Ellex. Click on any example to see the code and learn how it works:

  • Hello World: A classic first program to output “Hello, World!” using Ellex.
    • Learn how to use the tell command to display text.

Start with “Hello World” to see how easy it is to write your first Ellex program. As you work through these examples, you’ll build confidence in using natural language commands to create small programs.

  1. Start the Ellex REPL: Open the interactive environment by running make dev or cargo run --bin ellex_cli repl in your terminal.
  2. Copy and Paste: Copy the code from any example and paste it into the REPL.
  3. Run and Experiment: Run the code to see the output, then modify it to try your own ideas!

If you don’t have Ellex set up yet, check out the Getting Started Guide for instructions on installing and running the environment.

These beginner examples are crafted to be accessible for young learners (ages 6-16) and anyone new to coding. They use Ellex’s natural language syntax to make programming feel like storytelling or giving directions, reducing the frustration of learning complex syntax. Each example includes explanations and tips to help you understand the “why” behind the code.

Ready to code? Dive into the Hello World example and see how simple programming in Ellex can be! Once you’re comfortable with these basics, move on to the Intermediate Examples for more challenges.