blob: 4b54789e989b2d1ad1267cfdffef87a3b8da016d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
---
title: Player Choices
---
Player choices are the main way to interact with the user, by presenting them
with a list of `[TEXT]` choices, and executing a list of instructions
associated to the choice they have made.
### CHOICE OPTION
{{< fatecode >}}(option [TEXT]
[I0 = INSTRUCTION]
...
[IN = INSTRUCTION]
){{< /fatecode >}}
Adds a choice showing `[TEXT]` to the user, and executing `[I0]` ... `[IN]`
if chosen.
### CHOICE PROMPT
{{< fatecode >}}(player_choice!
[C0 = CHOICE]
...
[C1 = CHOICE]
){{< /fatecode >}}
Prompts the user to choose between `C0` ... `C1`. `[CHOICE]`. `[CHOICE]` is
either an option as shown above, a [conditional](../conditionals), or a
`for_each` (see [loops](../loops)) with `[CHOICE]` instead of `[INSTRUCTION]`.
A special version of the `for` loop is also possible, as described below:
### USER CHOICE - FOR
TODO
### INTEGER PROMPT
{{< fatecode >}}(prompt_integer! [INT REFERENCE] [MIN = INT] [MAX = INT] [TEXT]){{< /fatecode >}}
Prompts the user for an integer between `[MIN]` and `[MAX]` by displaying the
message `[TEXT]`. The result is stored in `[INT REFERENCE]`.
### STRING PROMPT
{{< fatecode >}}(prompt_string! [STRING REFERENCE] [MIN = INT] [MAX = INT] [TEXT]){{< /fatecode >}}
Prompts the user for a string of size between `[MIN]` and `[MAX]` by displaying
the message `[TEXT]`. The result is stored in `[STRING REFERENCE]`.
|