# Describe your own thing

Group values that belong to one character.

Last updated: 2026-09-09

Package: recipes | Status: complete-program

Tags: cpu, recipe

A name, a life count, and a score all belong to a player. A thing lets us describe that bundle once and give it a useful name. The fields inside Player are the pieces of data it carries. The dot in pip.lives means the lives field of this particular Player value. Two players can have different values.

```yh
start.yh
```


## Describe your own thing

Group values that belong to one character.

Verification: type checked

```yh
thing Player
{
    text name
    int lives
}

Player pip = Player()
pip.name = "Pip"
pip.lives = 3
pip.lives = pip.lives - 1
Console.Log(Text.Format("{0} has {1} lives", pip.name, pip.lives))
```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.recipe__things"
version = "0.1.0"
languageEdition = "yeho-core-2026.1"

[app]
kind = "headless"

```

Expected output:

```text
Pip has 2 lives
```

Extract the example archive beside the yeho and dolphin checkouts. This example requires those source dependencies and a current developer compiler.

```sh
./yeho/build/dolphin-metal/yehoc ./api-examples/recipe--things/program --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


Create a second player named Fern with five lives. Print both players after changing only Pip.

Source: demonhunterlabs/app/lib/yeho-walkthrough.ts

AI training permission: https://demonhunterlabs.com/ai-use
