1 Getting Started

First, the easiest place to run Pyret is https://code.pyret.org, which runs Pyret entirely within your browser.

If you’re interested in a textbook, you can try out Programming and Programming Languages (PAPL), which has all its programs in Pyret.

You can follow a short tour of Pyret’s features to get a feel for the language, and for a more in-depth introduction, this documentation comes with a tutorial that you can follow to build up a simple animated game:

    1.1 A Tour of Pyret

      1.1.1 Testing and Assertions

      1.1.2 Primitive Values and Operators

        1.1.2.1 Numbers

      1.1.3 Booleans

      1.1.4 Strings

      1.1.5 Lists

      1.1.6 Identifiers and Binding

        1.1.6.1 Identifiers

      1.1.7 Variables

      1.1.8 Functions

      1.1.9 Data

        1.1.9.1 Definitions

      1.1.10 Cases

      1.1.11 Annotations

      1.1.12 Control

        1.1.12.1 For loops

      1.1.13 If

        1.1.13.1 When blocks

      1.1.14 And more...

    1.2 Tutorial: A Flight Lander Game

      1.2.1 Introduction

      1.2.2 About Reactive Animations

      1.2.3 Preliminaries

      1.2.4 Version: Airplane Moving Across the Screen

        1.2.4.1 Updating the World State

        1.2.4.2 Displaying the World State

        1.2.4.3 Observing Time (and Combining the Pieces)

      1.2.5 Version: Wrapping Around

      1.2.6 Version: Descending

        1.2.6.1 Moving the Airplane

        1.2.6.2 Drawing the Scene

        1.2.6.3 Finishing Touches

      1.2.7 Version: Responding to Keystrokes

      1.2.8 Version: Landing

      1.2.9 Version: A Fixed Balloon

      1.2.10 Version: Keep Your Eye on the Tank

      1.2.11 Version: The Balloon Moves, Too

      1.2.12 Version: One, Two, ..., Ninety-Nine Luftballons!