Core Beginner

00  Variables

Rust bindings are immutable unless you say otherwise, and constants carry an explicit type.

Step 2 / 3

Define a constant MAX_HP equal to 100. Constants need an explicit type.

Hints
  • Constants: const NAME: TYPE = value; -- the type is required.
00_variables.rs
Reset to starterCompiled in a sandbox; hidden checks must pass.
Reveal solution
const MAX_HP: i32 = 100;