# Unit 1 – Basic Demo: Pet

A `Pet` is a virtual pet — similar to a Tamagotchi, a handheld toy
popular since the 1990s where you care for a digital creature by
feeding it and keeping it happy.

Each pet has a **name** that is set at creation and never changes.
It also has two stats that change as you interact with it:

| Stat        | 0 means... | 10 means... | Starts at |
|-------------|------------|-------------|-----------|
| `hunger`    | full       | very hungry | 5         |
| `happiness` | miserable  | very happy  | 5         |

## Setting up

1. Compile `Pet`.
2. Create a pet: `Pet("Luna")`.
3. Call `describe()` — both stats start at 5.

## Experimenting

4. Call `feed()` twice, then `describe()` — hunger drops. Call it
   several more times and notice it stops at 0: a pet cannot be less
   than full.
5. Call `play()` three times, then `describe()` — happiness went up,
   but hunger also increased. Playing makes a pet hungry.
6. Call `ignore()` a few times, then `describe()` — hunger rises and
   happiness falls. Ignoring your pet has consequences.
7. Create a second pet: `Pet("Max")`.
8. Feed Max several times, then call `describe()` on both pets.
   Luna's hunger has not changed — each object holds its own stats
   independently.

## What to look at in the code

9. Look at the class: `name` is declared with `val`, while
   `hunger` and `happiness` are `var`. Inspect the available methods —
   you will notice that all three variables have a get method, but
   only `hunger` and `happiness` have a set method.
