beginner
+100 XP

Hello Move!

Learn the fundamental syntax of Move - modules, variables, types, and functions

Lesson Syllabus

Welcome to Move
🚗

What is Move?

Move is a programming language for blockchains. It's designed for digital assets and safety. Used by Sui blockchain. We'll start with basic syntax, just like learning any programming language!

📦

Your First Module

Everything in Move lives in a module. A module is like a container for your code. Syntax: module package_name::module_name { ... }

💬

Comments - Talking to Humans

Comments help explain your code to other developers (and future you!). Move supports single-line (//) and multi-line (/* */) comments.

Types and Variables
🔢

Numbers in Move

Move has integer types for different size numbers. u8 for small (0-255), u64 for large numbers, u128 for very large numbers. The 'u' means unsigned (no negative numbers).

✓✗

Booleans - True or False

Boolean type (bool) represents true or false values. Used for yes/no decisions in your code.

📝

Variables - Storing Values

Use 'let' to create variables. You must specify the type. Syntax: let name: type = value;

🔄

Changing Variables

Variables are immutable by default (can't change). Use 'let mut' to make them mutable (changeable).

Operations and Functions

Math Operations

Move supports standard arithmetic: addition (+), subtraction (-), multiplication (*), division (/), and modulo (%).

⚖️

Comparison Operations

Compare values with: equal (==), not equal (!=), greater (>), greater/equal (>=), less (<), less/equal (<=). All return true or false.

⚙️

Your First Function

Functions do a specific task. Syntax: fun name(param: type): return_type { ... }. The last expression is returned automatically!

📞

Calling Functions

Call functions with function_name(arguments). Must provide all required parameters.