RustArena

Step 1 of 6

Your first program

A program is a list of instructions the computer follows from top to bottom. Rust is a compiled language: you write the instructions as text (the source code), the Rust compiler (rustc) checks them very carefully and translates them into machine code, and then the program runs. Every time you press Check, a real Rust compiler builds and runs your code.

The shape of every Rust program

fn main() {
    println!("Hi!");
}
Hi!

Piece by piece:

Common mistakes

Your task

Fill in the blank so the program prints Hello, World!.

Challenge 2

Fill in both blanks: the keyword that starts a function, and the name of the function every program starts in. The program should print GG, well played!.

Challenge 3

This time there's no starter program. Write the whole thing yourself: fn main, its braces, and a println!. It should print Welcome to the arena.

Next: Printing your own text