sigildocs

Tutorial

Welcome to the Sigil tutorial! This series takes you from zero to building and distributing a complete text adventure game.

No prior Scheme or Lisp experience is required. We'll cover everything from basic expressions to advanced features like macros and concurrency.

What You'll Build

By the end of this tutorial, you'll have created a playable text adventure game that you can compile into a standalone executable and share with friends.

Chapters

Foundations

  1. Setup — Install dependencies and build Sigil
  2. The REPL — Interactive development at the REPL
  3. Basics — Expressions, variables, and procedures
  4. Data Types — Lists, vectors, strings, and records

Core Language

  1. Control Flow — Conditionals, pattern matching, and recursion
  2. Modules — Organizing code with define-library
  3. I/O — File I/O and user input
  4. Macros — Writing syntax-rules macros
  5. Error Handling — Exceptions and debugging

Building the Game

  1. Game Design — Planning our text adventure
  2. Game World — Rooms, items, and state
  3. Game Commands — Parsing and command dispatch
  4. Game Polish — Save/load and refinements
  5. Distribution — Building standalone executables

Prerequisites

Before starting, make sure you have Sigil built and working. See Getting Started if you haven't done this yet.

How to Use This Tutorial

Each chapter builds on the previous ones. Work through them in order, typing the examples yourself. The best way to learn Scheme is by doing.

Code examples look like this:

(define (square x)
  (* x x))

(square 5)  ; => 25

Comments starting with ; => show the expected result.

Ready? Let's start with Setup.