# Language tour

Every example is a complete program: save it as a `.agc` file and run it with `agentica file.agc`. The box under each program shows what it prints.

Read the pages in order the first time. The formal rules are in the [language specification](https://www.agentica-lang.com/agentica/reference/index.md).

## Pages in this section

- [Values and types](https://www.agentica-lang.com/agentica/tour/values-and-types/index.md): The basic types, how to print values, and the program shape.
- [Variables](https://www.agentica-lang.com/agentica/tour/variables/index.md): Create and update variables, type annotations and scope.
- [Strings and interpolation](https://www.agentica-lang.com/agentica/tour/strings/index.md): String literals, escapes, interpolation and string methods.
- [Numbers](https://www.agentica-lang.com/agentica/tour/numbers/index.md): Int and Float, arithmetic, comparison and conversion.
- [Control flow](https://www.agentica-lang.com/agentica/tour/control-flow/index.md): if, while, for, break, next, boolean operators and case on values.
- [Functions](https://www.agentica-lang.com/agentica/tour/functions/index.md): Define functions, return values, recursion and function values.
- [Blocks](https://www.agentica-lang.com/agentica/tour/blocks/index.md): Blocks with do ... end, closures and passing blocks to your own functions.
- [Lists](https://www.agentica-lang.com/agentica/tour/lists/index.md): List literals, indexing, adding elements and the common list methods.
- [Maps](https://www.agentica-lang.com/agentica/tour/maps/index.md): Map literals, reading keys, adding and removing entries.
- [Structs](https://www.agentica-lang.com/agentica/tour/structs/index.md): Declare records with typed fields, build them, read their fields and copy them with some fields changed.
- [Enums and case](https://www.agentica-lang.com/agentica/tour/enums-and-case/index.md): Enums with and without payloads, generic enums and case pattern matching.
- [Result and try](https://www.agentica-lang.com/agentica/tour/results-and-try/index.md): Return errors as values with Result, check them, and pass them on with try.
- [Modules and imports](https://www.agentica-lang.com/agentica/tour/modules/index.md): Split a program into files, make declarations public and use the standard library.
- [Constants](https://www.agentica-lang.com/agentica/tour/constants/index.md): Name a fixed value once at the top of a file, build a table once and share it between files.
- [Tasks](https://www.agentica-lang.com/agentica/tour/tasks/index.md): Run work at the same time with lightweight tasks.
