LEARN VOID / 01
Syntax basics
Read your first VOID program.
Indentation, comments and a small function that returns a value.
# Add a fixed amount to the input.
func entry(value: i32) -> i32:
return value + 42Input 10Expected result 52
Read the shape of the program
func introduces a function. Its name is followed by parameters in parentheses, and -> i32 declares the result type. A colon opens the body.
Indent the body with four spaces. VOID uses indentation to group statements, so ordinary blocks do not need braces or statement-ending semicolons.
Comments and names
A # starts a comment. Use lowercase snake_case names such as total_score and calculate_damage.
About entry
The current compiler’s command-line adapter calls entry with an i32 input and displays its returned result. Here, input 10 produces 52. This adapter makes the guide programs small and self-contained.