1. Welcome to the Functional Programming Game!

    We'll learn by fighting this Yeti Monster.

    Next
  2. Attack the Yeti!

    Your attacks are here.

    Next to each attack is a predicate, like (left? data).

    In order to perform an attack, we must satisfy a predicate.

    BackNext
  3. Satisfy a Predicate!

    A predicate asks a question about the data.

    You can see the data here.

    Currently, the data is a red triangle pointing up

    BackNext
  4. Satisfy a Predicate!

    These three predicates each ask a different question:

    As you can see, none of the predicates answer yes. So we need to change the data.

    BackNext
  5. Change the Data!

    We can change the data by creating a function.

    Below is the function definition. Do you see that purple box?

    BackNext
  6. Create a Function!

    This box is our function body.

    This is where the magic really happens!

    BackNext
  7. Create a Function!

    You can move the expressions from down here up to the function body.

    BackNext
  8. Try it Yourself!

    Try dragging that Blue Star Facing Right onto the Function Body.

    Then click this button to watch the magic happen!

    Try it!
  1. Congratulations!

    You landed a nice attack against that Yeti.

    Now let's do something more complicated.

    Next
  2. Nested Expressions

    First drag the (greenify <image>) expression to the function body...

    BackNext
  3. Nested Expressions

    ... Then drag this data expression inside of the (greenify <image>) expression's slot.

    BackNext
  4. Nested Expressions

    Then click here to run your Nested Expression!

    Try it!

Attacks

Make these true:
...

Tiles

Table: data
Hand:





Function

Drag tiles here: