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 Numbers

      1.1.3 Booleans

      1.1.4 Strings

      1.1.5 Lists

      1.1.6 Identifiers and Binding Identifiers

      1.1.7 Variables

      1.1.8 Functions

      1.1.9 Data Definitions

      1.1.10 Cases

      1.1.11 Annotations

      1.1.12 Control For loops

      1.1.13 If 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 Updating the World State Displaying the World State Observing Time (and Combining the Pieces)

      1.2.5 Version: Wrapping Around

      1.2.6 Version: Descending Moving the Airplane Drawing the Scene 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!