# Combine little questions

Use and, or, and ! to express player rules.

Last updated: 2026-09-09

Package: recipes | Status: complete-program

Tags: cpu, recipe

Sometimes one question is not enough. A door might need a key and a living player. A pause screen might open when a menu is visible or the player asks to pause. and requires both sides to be true. or needs at least one. ! flips a yes-or-no value. Read !paused as not paused.

```yh
start.yh
```


## Combine little questions

Use and, or, and ! to express player rules.

Verification: type checked

```yh
bool hasKey = true
bool alive = true
bool paused = false
bool canOpen = hasKey and alive and !paused
if canOpen { Console.Log("Come on in.") }
else { Console.Log("The door stays closed.") }
```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.recipe__logic"
version = "0.1.0"
languageEdition = "yeho-core-2026.1"

[app]
kind = "headless"

```

Expected output:

```text
Come on in.
```

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--logic/program --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


Flip hasKey, alive, and paused one at a time. Predict whether the door opens before each run.

Source: demonhunterlabs/app/lib/yeho-walkthrough.ts

AI training permission: https://demonhunterlabs.com/ai-use
