summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2022-01-15 00:13:48 +0100
committerNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2022-01-15 00:13:48 +0100
commitd272efa49173c3708ddde54a96486261b73d7908 (patch)
treec6b5fa20c04593552fb378777cdc78471b1892b8 /content
parent0a32a8eeb98d5f3507edf5e303ae655f4b923c74 (diff)
...
Diffstat (limited to 'content')
-rw-r--r--content/fate_v1/_index.md4
-rw-r--r--content/fate_v1/instructions/player_choices/_index.md14
-rw-r--r--content/wyrd_v1/_index.md92
-rw-r--r--content/wyrd_v1/computation/_index.md179
-rw-r--r--content/wyrd_v1/computations/_index.md100
-rw-r--r--content/wyrd_v1/extensions/_index.md5
-rw-r--r--content/wyrd_v1/file/_index.md5
-rw-r--r--content/wyrd_v1/input/_index.md5
-rw-r--r--content/wyrd_v1/instruction/_index.md291
-rw-r--r--content/wyrd_v1/instruction_result/_index.md5
-rw-r--r--content/wyrd_v1/instructions/_index.md76
-rw-r--r--content/wyrd_v1/state/_index.md46
-rw-r--r--content/wyrd_v1/value/_index.md11
13 files changed, 600 insertions, 233 deletions
diff --git a/content/fate_v1/_index.md b/content/fate_v1/_index.md
index 2b14b63..43075d1 100644
--- a/content/fate_v1/_index.md
+++ b/content/fate_v1/_index.md
@@ -1,6 +1,6 @@
---
-title: "Fate (Version 1)"
-menuTitle: "Fate"
+title: "Fate Language (Version 1) Documentation"
+menuTitle: "Fate Language"
weight: 3
---
diff --git a/content/fate_v1/instructions/player_choices/_index.md b/content/fate_v1/instructions/player_choices/_index.md
index 4b54789..7b7ac58 100644
--- a/content/fate_v1/instructions/player_choices/_index.md
+++ b/content/fate_v1/instructions/player_choices/_index.md
@@ -30,6 +30,20 @@ A special version of the `for` loop is also possible, as described below:
### USER CHOICE - FOR
TODO
+### COMMAND PROMPT
+{{< fatecode >}}(prompt_command! [(STRING LIST) REFERENCE] [MIN = INT] [MAX = INT] [TEXT]){{< /fatecode >}}
+
+Prompts the user for a list of strings separated by spaces. `[MIN]` and `[MAX]`
+indicate the total number of characters (spaces included) allowed as input.
+The `[TEXT]` message is prompted to the user. The result is stored in
+`[(STRING LIST) REFERENCE]`.
+
+### FLOAT PROMPT
+{{< fatecode >}}(prompt_float! [FLOAT REFERENCE] [MIN = FLOAT] [MAX = FLOAT] [TEXT]){{< /fatecode >}}
+
+Prompts the user for a float between `[MIN]` and `[MAX]` by displaying the
+message `[TEXT]`. The result is stored in `[FLOAT REFERENCE]`.
+
### INTEGER PROMPT
{{< fatecode >}}(prompt_integer! [INT REFERENCE] [MIN = INT] [MAX = INT] [TEXT]){{< /fatecode >}}
diff --git a/content/wyrd_v1/_index.md b/content/wyrd_v1/_index.md
index c6e6e97..ac49ebe 100644
--- a/content/wyrd_v1/_index.md
+++ b/content/wyrd_v1/_index.md
@@ -1,57 +1,49 @@
---
-menuTitle: Wyrd
-title: Wyrd (Version 1)
+menuTitle: Wyrd Interpreter
+title: Coding a Wyrd (Version 1) Interpreter
weight: 4
---
Wyrd is the language in which the narrative is given to the game engine. It is
purposefully kept small and simple to facilitate porting Tonkadur to a new
engine.
-The memory is seen as a table mapping strings to values. These values may also
-be tables. Thus a reference is a list of strings corresponding to a move from
-one table to the next.
-
-The program is a list of instructions. These instructions may use computations
-as parameters. They sometimes use hard-coded strings parameters as well.
-Instructions cannot take instructions as parameters. Instructions are not
-associated to any value.
-
-An integer, called _Program Counter_ is used to indicate the current
-instruction. In most cases, this integer is incremented by one after every
-instruction. There is an instruction to modify the value of the Program Counter,
-which allows conditional jumps and loops to be described.
-
-Computations are values and operations returning values. These are solely used
-as parameters of instructions. They do not alter memory (with one exception)
-and do not interact with the Program Counter in any way. An execution cannot be
-stopped during the evaluation of a computation: it is part of its parent
-instruction and is thus completed exactly when that instruction is performed.
-Computations may _read_ from the memory, as they may need to fetch the value
-associated with an address or traverse tables. All computations have a return
-type.
-
-Wyrd does not have the notion of sequence or that lambda functions. It does not
-even associate player choices with lists of actions. It's all done by carefully
-managing the Program Counter.
-
-Lambda functions are stored as an `INT` corresponding to a line in the program.
-
-## Types
-* `ADDRESS` (or `POINTER`, or `REFERENCE`), a list of `STRING` (note: not a
- `STRING COLLECTION`).
-* `BOOL`. This should be changed to `BOOL` soon, for consistency's sake.
-* `[SOMETHING] COLLECTION`, table mapping `STRING` to `[SOMETHING]`.
-* `FLOAT`.
-* `INT`.
-* `TEXT`, a list of `STRINGS` with attributes attached.
-* `STRING`.
-* `STRUCTURE` (or `DICTIONARY`), table mapping `STRING` to values of any type.
-* `{String}`, a hard-coded string.
-
-#### Aliases sometimes used to refer to types
-* `? ADDRESS`: an `ADDRESS` pointing to a particular type.
-* `BASE TYPE`: `INT`, `FLOAT`, `BOOL`, `STRING`.
-* `COMPARABLE`: `INT`, `FLOAT`, `BOOL`, `STRING`, `TEXT`, `ADDRESS`.
-* `COLLECTION`: any `? COLLECTION`.
-* `COMPUTATION`: any type.
-* `NUMBER`: `INT` or `FLOAT`.
+This part of the website guides you through the implementation of a Wyrd
+interpreter.
+
+Wyrd files are meant to use easily parsable formats. Tonkadur provides Wyrd
+files as JSON, since JSON parsers are commonly available in pretty much any
+general programming language. However, the code generating this output is
+cleanly separated from the rest of the compiler, so changing the compiler to
+output in a different format should be approachable.
+
+As with Fate, Wyrd is split into computations and instructions. As a
+reminder, computations do not modify the memory, whereas instructions may.
+Furthermore, a computation in Fate may actually result in instructions in
+Wyrd (a notable example being the `random` Fate computation, which is actually
+implemented using the `set_random` Wyrd instruction).
+
+Here is an overview of the Wyrd interpreter:
+{{< svg "static/images/wyrd_interpreter_overview.svg" "1000px" >}}
+
+The state a Wyrd story is described by `<State>`, a structure defined on [this
+page](/wyrd_v1/state).
+
+* `execute(<State>)` executes the next `<Instruction>` and returns the updated
+ `<State>`. The semantics of each `<Instruction>` is explained on [this
+ page](/wyrd_v1/instruction). Their effect on the `{User Interface}` is
+ communicated by a `<InstructionResult>` member of `<State>`, but this it can
+ alternatively be returned alongside the updated `<State>` if the
+ implementation language permits it. All possible such effects are described
+ on [this page](/wyrd_v1/instruction_result).
+* Calls to `compute(<State>, <Computation>)` come from two sources: resolving
+ the parameters of an `<Instruction>` and resolving the parameters of
+ `<Computation>` (recursive call). The semantics of each `<Computation>` is
+ defined on [this page](/wyrd_v1/computation) and is computed according to
+ current `<State>` (they do not, however, modify it). The result is given as a
+ `<Value>`, the semantics of which can be found on [this page](/wyrd_v1/value).
+* The user may be called to provide an `<Input>`. This is presented by
+ `handle_input(<Input>, <State>)` on the figure above. The different
+ `<Input>`s and how to handle them are described on [this
+ page](/wyrd_v1/input).
+* The parsing process (`parse(<File>)`) is described on [this
+ page](/wyrd_v1/file).
diff --git a/content/wyrd_v1/computation/_index.md b/content/wyrd_v1/computation/_index.md
new file mode 100644
index 0000000..d0462a0
--- /dev/null
+++ b/content/wyrd_v1/computation/_index.md
@@ -0,0 +1,179 @@
+---
+menuTitle: <Computation>
+title: Computation
+weight: 3
+---
+This page presents all the `<Computation>`s that can be performed in Wyrd.
+`<Computation>`s do not modify the memory, but they always return a `<Value>`.
+
+**Shortcut to each `<Computation>`:**
+* [`(add_text_effect {name: String} {parameters: <Computation> List} {values: <Computation> list})`](#add_text_effect)
+* [`(address <value_or_target: Computation>)`](#address)
+* [`(cast {from: String} {to: String} <content: Computation>)`](#cast)
+* [`(constant {type: String} {value: String})`](#constant)
+* [`(get_allocable_address)`](#get_allocable_address)
+* [`(if_else <condition: Computation> <if_true: Computation> <if_false: Computation>)`](#if_else)
+* [`(last_choice_index)`](#last_choice_index)
+* [`(newline)`](#newline)
+* [`(operation {operator: String} <x: Computation>)`](#unary-operation)
+* [`(operation {operator: String} <x: Computation> <y: Computation>)`](#operation)
+* [`(relative_address <target: Computation> <extra: Computation>)`](#relative_address)
+* [`(size <target: Computation>)`](#target)
+* [`(text {values: <Computation> List})`](#text)
+* [`(value_of <target: Computation>)`](#value_of)
+* [`({extra_computation} {parameters: <Computation> List})`](#extra_computation)
+
+### add_text_effect
+`(add_text_effect {name: String} {parameters: <Computation> List} {values: <Computation> list})`
+
+Add an effect to a list of texts, returning it as a single text.
+
+**Parameters:**
+* `name` is a `{String}` indicating the name of the effect.
+* `parameters` is a `{List}` of `<Computation>` that will yield the `<Value>`s
+ used as parameters for the effect.
+* `values` is a `{<Computation> List}` that will yield the texts to merge and
+ apply the effect to. These will yield `<TextValue>`s.
+
+**Process:**
+* Compute the `{params: <Value> List}` corresponding to `parameters` (keep the
+ order).
+* Compute the `{texts: <Value> List}` corresponding to `values` (keep the
+ order).
+* Return a new `<AugmentedText>` `<TextValue>` with `texts` as `content`,
+ `name` as `effect_name`, and `params` as `effect_parameters`.
+
+### address
+`(address <value_or_target: Computation>)`
+
+Converts to an address.
+
+**Parameters:**
+* `value_or_target` is a `<Computation>` that will either result in in a
+ `<PointerValue>` or a `<StringValue>`.
+
+**Process:**
+* Compute the `<Value>` corresponding to `value_or_target`.
+* If this resulted in a `<PointerValue>`, return the value as is.
+* If this resulted in a `<StringValue>`, interpret the value as
+ `{addr: String}`, return a new `<PointerValue>` built from a singleton list
+ with `addr` as its only element.
+
+### cast
+`(cast {from: String} {to: String} <content: Computation>)`
+
+Convert from one type to another.
+
+**Parameters:**
+* `from` is a `{String}` naming the type `content` will result to.
+* `to` is a `{String}` naming the type to convert `content` to.
+* `content` is a `<Computation>` that will yield the `<Value>` to convert.
+
+**Process:**
+* Compute the `<Value>` associate with `content`.
+* Convert this `<Value>` from `from` to `to`.
+* Return the converted value.
+
+**Note:**
+The following conversions are expected to be available:
+* A type to the same type, returning the same value.
+* `<BoolValue>` to `<StringValue>`, returning `(StringValue "true")` if
+ `<Value>` is `(BoolValue TRUE)` and `(StringValue "false")` otherwise.
+* `<BoolValue>` to `<TextValue>`, same as above, but with text instead of
+ string.
+* `<FloatValue>` to `<StringValue>`.
+* `<FloatValue>` to `<TextValue>`.
+* `<FloatValue>` to `<IntValue>`, using a *floor* function.
+* `<IntValue>` to `<StringValue>`.
+* `<IntValue>` to `<TextValue>`.
+* `<IntValue>` to `<FloatValue>`.
+* `<IntValue>` to `<BoolValue>`, with `0` being `(BoolValue FALSE)` and
+ anything else being `(BoolValue TRUE)`.
+* `<StringValue>` to `<FloatValue>`.
+* `<StringValue>` to `<IntValue>`.
+* `<StringValue>` to `<BoolValue>`, `(BoolValue TRUE)` if the string is
+ `"true"`, `(BoolValue FALSE)` if it is `"false"`. Convert to lowercase prior
+ to checking.
+* `<TextValue>` to `<StringValue>`, by recursively converting all content to
+ `{String}`, discarding effects and newlines, and appending it all.
+* `<TextValue>` to `<IntValue>`, by converting it to `<StringValue>` first.
+* `<TextValue>` to `<FloatValue>`, by converting it to `<StringValue>` first.
+* `<TextValue>` to `<BoolValue>`, by converting it to `<StringValue>` first.
+
+### constant
+`(constant {type: String} {value: String})`
+
+**Parameters:**
+
+**Process:**
+
+### get_allocable_address
+`(get_allocable_address)`
+
+**Process:**
+
+### if_else
+`(if_else <condition: Computation> <if_true: Computation> <if_false: Computation>)`
+
+**Parameters:**
+
+**Process:**
+
+### last_choice_index
+`(last_choice_index)`
+
+**Process:**
+
+### newline
+`(newline)`
+
+**Process:**
+
+### Unary operation
+`(operation {operator: String} <x: Computation>)`
+
+**Parameters:**
+
+**Process:**
+
+### operation
+`(operation {operator: String} <x: Computation> <y: Computation>)`
+
+**Parameters:**
+
+**Process:**
+
+### relative_address
+`(relative_address <target: Computation> <extra: Computation>)`
+
+**Parameters:**
+
+**Process:**
+
+### size
+`(size <target: Computation>)`
+
+**Parameters:**
+
+**Process:**
+
+### text
+`(text {values: <Computation> List})`
+
+**Parameters:**
+
+**Process:**
+
+### value_of
+`(value_of <target: Computation>)`
+
+**Parameters:**
+
+**Process:**
+
+### extra_computation
+`({extra_computation} {parameters: <Computation> List})`
+
+**Parameters:**
+
+**Process:**
diff --git a/content/wyrd_v1/computations/_index.md b/content/wyrd_v1/computations/_index.md
deleted file mode 100644
index bc30f12..0000000
--- a/content/wyrd_v1/computations/_index.md
+++ /dev/null
@@ -1,100 +0,0 @@
----
-title: Computations
-weight: 1
----
-This page presents all the computations that can be performed in Wyrd.
-Computations may access the current memory, but, with one exception, do not
-change it. The one exception is `(new t)`. All computations return values.
-The terms 'value' and 'computation' are interchangeable.
-
-## CONSTANT
-{{< fatecode >}}(const [BASE TYPE] {string}){{< /fatecode >}}
-Returns the `[BASE TYPE]` represented by `{string}`.
-
-## CAST
-{{< fatecode >}}(cast [COMPUTATION] [BASE TYPE]){{< /fatecode >}}
-Converts `[COMPUTATION]` to `[BASE TYPE]`, returns the result.
-
-Note:
-* Converting from `FLOAT` to `INT` returns `floor(v)`.
-* Converting from `BOOL` to `STRING` yields either `True` or `False`.
-
-The following must be supported:
-* `[FLOAT]` to `[FLOAT]`, `[INT]`, and `[STRING]`.
-* `[INT]` to `[FLOAT]`, `[INT]`, and `[STRING]`.
-* `[BOOL]` to `[BOOL]` and `[STRING]`.
-* `[STRING]` to `[BOOL]` (`true` and `false`), `[FLOAT]`, `[INT]`, and`[STRING]`.
-
-## IF-ELSE
-{{< fatecode >}}(if_else [BOOL] [C0 = COMPUTATION] [C1 = COMPUTATION]){{< /fatecode >}}
-Returns `C0` if `[BOOL]` holds _true_, `C1` otherwise. `C0` and `C1` both
-have the same type.
-
-## EQUALS
-{{< fatecode >}}(equals [C0 = COMPUTATION] [C1 = COMPUTATION]){{< /fatecode >}}
-Returns a `BOOL`, _true_ if `C0` and `C1` hold the same value. `C0` and `C1`
-are both of the same type.
-
-## MATHEMATICAL OPERATORS
-{{< fatecode >}}(divide [C0 = NUMBER] [C1 = NUMBER]){{< /fatecode >}}
-
-{{< fatecode >}}(minus [C0 = NUMBER] [C1 = NUMBER]){{< /fatecode >}}
-
-{{< fatecode >}}(plus [C0 = NUMBER] [C1 = NUMBER]){{< /fatecode >}}
-
-{{< fatecode >}}(power [C0 = NUMBER] [C1 = NUMBER]){{< /fatecode >}}
-
-{{< fatecode >}}(times [C0 = NUMBER] [C1 = NUMBER]){{< /fatecode >}}
-The operation returns a value of the same type as `C0` and `C1` (both `C0` and
-`C1` are also of the same type). Thus, `(divide C0 C1)` is an integer division
-(the remainder is discarded) if `C0` and `C1` are of type `INT`, and a standard
-division if they are of type `FLOAT`.
-
-{{< fatecode >}}(rand [C0 = INT] [C1 = INT]){{< /fatecode >}}
-Returns a random value between `C0` and `C1`, inclusive. Raises a runtime error
-if `C0 > C1`.
-
-## MATHEMATICAL COMPARISON
-{{< fatecode >}}(less_than [C0 = COMPARABLE] [C1 = COMPARABLE]){{< /fatecode >}}
-Returns a `[BOOL]` indicating if `C0` is strictly less than `C1`.
-`C0` and `C1` are both of the same type.
-
-## LOGICAL OPERATORS
-{{< fatecode >}}(and [C0 = BOOL] [C1 = BOOL]){{< /fatecode >}}
-
-{{< fatecode >}}(not [C0 = BOOL]){{< /fatecode >}}
-
-## SIZE
-{{< fatecode >}}(size [COLLECTION ADDRESS]){{< /fatecode >}}
-Returns the number of elements held by the collection at
-`[COLLECTION ADDRESS]`.
-
-## REFERENCES
-{{< fatecode >}}(address [COMPUTATION]){{< /fatecode >}}
-Returns an `ADDRESS` to the memory element at address `[COMPUTATION]`. Raises a
-runtime error if `[COMPUTATION]` is not a memory element.
-
-{{< fatecode >}}(relative_address [R0 = (COLLECTION|STRUCTURE) ADDRESS] [STRING]){{< /fatecode >}}
-Returns a `REFERENCE` to member `[STRING]` of `R0`.
-
-{{< fatecode >}}(value_of [ADDRESS]){{< /fatecode >}}
-Returns the value held at the memory location `[ADDRESS]`.
-
-{{< fatecode >}}(new [TYPE]){{< /fatecode >}}
-Returns an `[TYPE] ADDRESS` to a newly allocated memory element of
-type `[TYPE]`.
-
-## TEXT
-{{< fatecode >}}(newline){{< /fatecode >}}
-Returns a `TEXT` value corresponding to a newline.
-
-{{< fatecode >}}(text [S0 = STRING] ... [SN = STRING]){{< /fatecode >}}
-Returns a single value `[TEXT]` representing the elements `S0` ... `S1`.
-
-{{< fatecode >}}(add_text_effect ({string} [V0 = COMPUTATION] ... [VN = COMPUTATION]) [TEXT]){{< /fatecode >}}
-Returns a `[TEXT]` value of `[TEXT]` with the given effect enabled.
-
-## LAST USER CHOICE
-{{< fatecode >}}(get_last_user_choice){{< /fatecode >}}
-Returns the number corresponding to the option last chosen by the user in a
-`(resolve_choices)`, or `-1` if there is no such value.
diff --git a/content/wyrd_v1/extensions/_index.md b/content/wyrd_v1/extensions/_index.md
deleted file mode 100644
index 5ce9946..0000000
--- a/content/wyrd_v1/extensions/_index.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-title: Extensions
-weight: 3
----
-Not available in Version 1.
diff --git a/content/wyrd_v1/file/_index.md b/content/wyrd_v1/file/_index.md
new file mode 100644
index 0000000..e0aa619
--- /dev/null
+++ b/content/wyrd_v1/file/_index.md
@@ -0,0 +1,5 @@
+---
+menuTitle: <File>
+title: File
+weight: 7
+---
diff --git a/content/wyrd_v1/input/_index.md b/content/wyrd_v1/input/_index.md
new file mode 100644
index 0000000..d6bbc87
--- /dev/null
+++ b/content/wyrd_v1/input/_index.md
@@ -0,0 +1,5 @@
+---
+menuTitle: <Input>
+title: Input
+weight: 6
+---
diff --git a/content/wyrd_v1/instruction/_index.md b/content/wyrd_v1/instruction/_index.md
new file mode 100644
index 0000000..d441ee1
--- /dev/null
+++ b/content/wyrd_v1/instruction/_index.md
@@ -0,0 +1,291 @@
+---
+menuTitle: <Instruction>
+title: Instruction
+weight: 2
+---
+This page presents all the `<Instruction>`s that can be performed in Wyrd.
+`<Instruction>`s do not return values.
+
+Unless otherwise specified, all `<Instruction>`s:
+* Increment the `<State>`'s `program_counter` by 1.
+* Set the `<State>`'s `last_instruction_result` to `(MUST_CONTINUE)`.
+
+Implementing `execute(<State>)` to recurse/loop as long as the newly updated
+`<State>`'s `last_instruction_result` is `(MUST_CONTINUE)` is acceptable.
+
+**Shortcut to each `<Instruction>`:**
+* [`(add_event_option! {name: String} {parameters: <Computation> List})`](#add_event_option)
+* [`(add_text_option! <value: Computation>)`](#add_text_option)
+* [`(assert! <condition: Computation> <message: Computation>)`](#assert)
+* [`(display! <value: Computation>)`](#display)
+* [`(end!)`](#end)
+* [`(initialize! {type: String} <target: Computation>)`](#initialize)
+* [`(prompt_command! <min: Computation> <max: Computation> <target: Computation> <message: Computation>)`](#prompt_command)
+* [`(prompt_float! <min: Computation> <max: Computation> <target: Computation> <message: Computation>)`](#prompt_float)
+* [`(prompt_integer! <min: Computation> <max: Computation> <target: Computation> <message: Computation>)`](#prompt_integer)
+* [`(prompt_string! <min: Computation> <max: Computation> <target: Computation> <message: Computation>)`](#prompt_string)
+* [`(remove! <target: Computation>)`](#remove)
+* [`(resolve_choice!)`](#resolve_choice)
+* [`(set_pc! <value: Computation>)`](#set_pc)
+* [`(set_random! <min: Computation> <max: Computation> <target: Computation>)`](#set_random)
+* [`(set_value! <target: Computation> <value: Computation>)`](#set_value)
+* [`({extra_instruction: String}! {parameters: <Computation> List})`](#extra_instruction)
+
+### add_event_option
+`(add_event_option! {name: String} {parameters: <Computation> List})`
+
+Adds an `<Option>` based on an `<Event>` for the user.
+
+**Parameters:**
+* `value` is a `{String}` indicating the name of the `<Event>`.
+* `parameters` is a `{List}` of `<Computation>` that will yield the `<Value>`s
+ required for this option to be chosen when the `<Event>` occurs on the next
+ `(resolve_choice!)`.
+
+**Process:**
+* Compute the `<Value>` corresponding to each member of `parameters`, store them
+ in a `{List}` while keeping the order.
+* Create a new `<EventOption>` with name `name` and the aforementioned
+ `{<Value> List}` as parameters.
+* Append the newly created `<EventOption>` to the end of the `<State>`'s
+ `available_options`.
+
+### add_text_option
+`(add_text_option! <value: Computation>)`
+
+Adds an `<Option>` based on an `<TextValue>` for the user.
+
+**Parameters:**
+* `value` is a `<Computation>` that will yield the `<TextValue>` displayed to
+ the user for this option on the next `(resolve_choice!)`.
+
+**Process:**
+* Compute the `<Value>` yielded by `value`.
+* Create a new `<TextOption>` corresponding to the aforementioned
+ `<Value>`.
+* Append the newly created `<TextOption>` to the end of the `<State>`'s
+ `available_options`.
+
+### assert
+`(assert! <condition: Computation> <message: Computation>)`
+
+Checks if a condition is fulfilled and prints an error message if it is not.
+
+**Parameters:**
+* `condition` is a `<Computation>` corresponding to what needs to be tested.
+* `message` is a `<Computation>` defining the error message displayed to the
+ user if the condition is not verified.
+
+**Process:**
+* Compute the `<Value>` yielded by `condition`.
+* Interpret this `<Value>` as `{Boolean}`.
+* If it is `TRUE`, the `<Instruction>` has completed.
+* Otherwise, compute the `<msg: Value>` corresponding to the `message`.
+* Set the `<State>`'s `last_instruction_result` to
+ `(MUST_DISPLAY_ERROR <msg: Value>)`.
+
+### display
+`(display! <value: Computation>)`
+
+Displays text to the user.
+
+**Parameters:**
+* `value` is a `<Computation>` corresponding to what has to be displayed.
+
+**Process:**
+* Compute the `<msg: Value>` corresponding to `value`.
+* Set the `<State>`'s `last_instruction_result` to
+ `(MUST_DISPLAY <msg: Value>)`.
+
+### end
+`(end!)`
+
+Ends the story.
+
+**Process:**
+* Do **not** increase the `<State>`'s `program_counter`.
+* Set the `<State>`'s `last_instruction_result` to `(MUST_END)`
+
+### initialize
+`(initialize! {type: String} <target: Computation>)`
+
+Adds an element to `memory` with a deterministic default value.
+
+**Parameters:**
+* `type` is a `{String}` corresponding to the type that will be used by
+ `target`.
+* `target` is `<Computation>` that will yield the address to initialize.
+
+**Process:**
+* Compute the `<Value>` resulting from `target`. This is a `<PointerValue>`.
+* Interpret this `<PointerValue>` as a `{{String} List}`.
+* Update the `<State>`'s `memory` so that the element pointed to by the
+ `<PointerValue>` takes the default value for a `<Value>` of type `type`. Note
+ that the `target` might point to an element that does not exist yet.
+
+### prompt_command
+`(prompt_command! <min: Computation> <max: Computation> <target: Computation> <message: Computation>)`
+
+Asks the user to provide a list of strings as input.
+
+**Parameters:**
+* `min` is a `<Computation>` indicating the minimum size the user `{String}`
+ input should be (in characters).
+* `max` is a `<Computation>` indicating the maximum size the user `{String}`
+ input should be (in characters).
+* `target` is a `<Computation>` indicating where to store the result.
+* `message` is a `<Computation>` corresponding to the message displayed to the
+ user for this prompt.
+
+**Process:**
+* Compute the `<Value>` corresponding to each of these parameter.
+* Update the `<State>`'s `memorized_target` to be the `<Value>` resulting from
+ `target`.
+* Set the `<State>`'s `last_instruction_result` to
+ `(MUST_PROMPT_COMMAND <min_val: Value> <max_val: Value> <msg: Value>)`.
+
+### prompt_float
+`(prompt_float! <min: Computation> <max: Computation> <target: Computation> <message: Computation>)`
+
+Asks the user to provide a float as input.
+
+**Parameters:**
+* `min` is a `<Computation>` indicating the minimum float the user is allowed
+ to input
+* `max` is a `<Computation>` indicating the maximum float the user is allowed
+ to input
+* `target` is a `<Computation>` indicating where to store the result.
+* `message` is a `<Computation>` corresponding to the message displayed to the
+ user for this prompt.
+
+**Process:**
+* Compute the `<Value>` corresponding to each of these parameter.
+* Update the `<State>`'s `memorized_target` to be the `<Value>` resulting from
+ `target`.
+* Set the `<State>`'s `last_instruction_result` to
+ `(MUST_PROMPT_FLOAT <min_val: Value> <max_val: Value> <msg: Value>)`.
+
+
+### prompt_integer
+`(prompt_integer! <min: Computation> <max: Computation> <target: Computation> <message: Computation>)`
+
+Asks the user to provide an integer as input.
+
+**Parameters:**
+* `min` is a `<Computation>` indicating the minimum integer the user is allowed
+ to input
+* `max` is a `<Computation>` indicating the maximum integer the user is allowed
+ to input
+* `target` is a `<Computation>` indicating where to store the result.
+* `message` is a `<Computation>` corresponding to the message displayed to the
+ user for this prompt.
+
+**Process:**
+* Compute the `<Value>` corresponding to each of these parameter.
+* Update the `<State>`'s `memorized_target` to be the `<Value>` resulting from
+ `target`.
+* Set the `<State>`'s `last_instruction_result` to
+ `(MUST_PROMPT_INTEGER <min_val: Value> <max_val: Value> <msg: Value>)`.
+
+### prompt_string
+`(prompt_string! <min: Computation> <max: Computation> <target: Computation> <message: Computation>)`
+
+Asks the user to provide a string as input.
+
+**Parameters:**
+* `min` is a `<Computation>` indicating the minimum size the user `{String}`
+ input should be (in characters).
+* `max` is a `<Computation>` indicating the maximum size the user `{String}`
+ input should be (in characters).
+* `target` is a `<Computation>` indicating where to store the result.
+* `message` is a `<Computation>` corresponding to the message displayed to the
+ user for this prompt.
+
+**Process:**
+* Compute the `<Value>` corresponding to each of these parameter.
+* Update the `<State>`'s `memorized_target` to be the `<Value>` resulting from
+ `target`.
+* Set the `<State>`'s `last_instruction_result` to
+ `(MUST_PROMPT_STRING <min_val: Value> <max_val: Value> <msg: Value>)`.
+
+### remove
+`(remove! <target: Computation>)`
+
+Removes an element from memory.
+
+**Parameter:**
+* `target` is a `<Computation>` indicating where the element to remove is.
+
+**Process:**
+* Compute the `<Value>` corresponding to `target`.
+* Interpet this `<Value>` as an address.
+* Remove the element at this address from the `<State>`'s `memory`.
+
+### resolve_choice
+`(resolve_choice!)`
+
+Makes the user choose between all previously added options.
+
+**Process:**
+* Set the `<State>`'s `last_instruction_result` to `(MUST_PROMPT_CHOICE)`.
+
+
+### set_pc
+`(set_pc! <value: Computation>)`
+
+Sets the program counter to a given value.
+
+**Parameter:**
+* `value` is a `<Computation>` indicating what to set the program counter to.
+
+**Process:**
+* Compute the `<Value>` for `value`.
+* Interpret this `<Value>` as an `{Integer}`.
+* Set the `<State>`'s `program_counter` to this value.
+* Do **not** otherwise increase the `<State>`'s `program_counter`.
+
+### set_random
+`(set_random! <min: Computation> <max: Computation> <target: Computation>)`
+
+Replaces the `<Value>` at a given address with a random integer. This is not
+a computation as some languages will require state updates to keep generating
+new random values.
+
+**Parameters:**
+* `min` is a `<Computation>` indicating the minimum integer allowed.
+ to input
+* `max` is a `<Computation>` indicating the maximum integer allowed.
+* `target` is a `<Computation>` indicating where to store the result.
+
+**Process:**
+* Compute the `<Value>` corresponding to each of these parameter.
+* Generate a random `{Integer}` between `min` and `max` (included).
+* Update the `<State>`'s `memory`so that the element at `target` is to be the
+ `<Value>` resulting from `target`.
+
+### set_value
+`(set_value! <target: Computation> <value: Computation>)`
+
+Sets the value of an element in memory.
+
+**Parameters:**
+* `target` is a `<Computation>` indicating what element to set to the value.
+* `value` is a `<Computation>` corresponding to the value to give the element.
+
+**Process:**
+* Compute `target` as `<addr: Value>`.
+* Modify the `<State>`'s `memory` so that the element at `addr` takes the
+ `<Value>` resulting from `value`'s computation.
+
+### extra_instruction
+`({extra_instruction: String}! {parameters: <Computation> List})`
+
+Executes non-standard instruction.
+
+**Parameters:**
+* `extra_instruction` is the name of the extra instruction.
+* `parameters` is a list of parameters for this instruction call.
+
+**Process:**
+* Undetermined. This is where you choose the process according to the value of
+ `extra_instruction` so that you can add non-standard instructions.
diff --git a/content/wyrd_v1/instruction_result/_index.md b/content/wyrd_v1/instruction_result/_index.md
new file mode 100644
index 0000000..b77b496
--- /dev/null
+++ b/content/wyrd_v1/instruction_result/_index.md
@@ -0,0 +1,5 @@
+---
+menuTitle: <InstructionResult>
+title: Instruction Result
+weight: 5
+---
diff --git a/content/wyrd_v1/instructions/_index.md b/content/wyrd_v1/instructions/_index.md
deleted file mode 100644
index 500f884..0000000
--- a/content/wyrd_v1/instructions/_index.md
+++ /dev/null
@@ -1,76 +0,0 @@
----
-title: Instructions
-weight: 2
----
-This page presents all the instructions that can be performed in Wyrd.
-Instructions do not return values. With one exception, all instructions increase
-the Program Counter by 1.
-
-
-## ADD CHOICE
-{{< fatecode >}}(add_choice [TEXT]){{< /fatecode >}}
-Adds a new option for the next `resolve_choices` instruction. The new option
-presents the player with `[TEXT]`.
-
-## 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]`.
-
-
-## ASSERT
-{{< fatecode >}}(assert [BOOL] [TEXT]){{< /fatecode >}}
-If `[BOOL]` isn't _true_, raise a runtime error containing `[TEXT]`.
-
-
-## DISPLAY
-{{< fatecode >}}(display [TEXT]){{< /fatecode >}}
-Displays `[TEXT]` to the player.
-
-
-## END
-{{< fatecode >}}(end){{< /fatecode >}}
-Marks the end of the narration. Interrupts the execution.
-
-
-## EVENT CALL
-{{< fatecode >}}(event_call {string} [C0 = COMPUTATION] ... [CN = COMPUTATION]){{< /fatecode >}}
-Interrupts execution, informs the interpreter that the given event `{String}`
-was triggered with the parameters `C0 ... CN`.
-
-
-## REMOVE
-{{< fatecode >}}(remove [ADDRESS]){{< /fatecode >}}
-The memory at `[ADDRESS]` is freed.
-
-
-## RESOLVE CHOICES
-{{< fatecode >}}(resolve_choices){{< /fatecode >}}
-Present the player with all options that where added using `add_choice` since
-the last `resolve_choices`. The execution is paused and should be resumed by
-the interpreter setting the Program Counter according to the chosen option.
-
-
-## SET PC
-{{< fatecode >}}(set_pc [INT]){{< /fatecode >}}
-Sets the Program Counter to `[INT]`. The program counter is not automatically
-increased by 1 in this case.
-
-
-## SET VALUE
-{{< fatecode >}}(set_value [ADDRESS] [COMPUTATION]){{< /fatecode >}}
-Sets the memory pointed by `[ADDRESS]` to `[COMPUTATION]`.
-`[COMPUTATION]` is passed by value, not reference (i.e. no aliasing can occur
-without it being done explicitly through pointers).
-
-## INITIALIZE MEMORY ELEMENT
-{{< fatecode >}}(initialize [ADDRESS] [TYPE]){{< /fatecode >}}
-Initializes a memory element at `[ADDRESS]` with the default value for the type
-`[TYPE]`.
diff --git a/content/wyrd_v1/state/_index.md b/content/wyrd_v1/state/_index.md
new file mode 100644
index 0000000..f42e2ae
--- /dev/null
+++ b/content/wyrd_v1/state/_index.md
@@ -0,0 +1,46 @@
+---
+menuTitle: <State>
+title: State
+weight: 1
+---
+* `memory: {{String} -> <Value>}`, which is pretty self-explanatory.
+* `user_types: {{String} -> <Value>}`, providing the default value for each
+ user-defined type.
+* `sequences: {{String} -> {Int}}`, an optional member that gives you the value
+ to give `program_counter` in order to jump to a certain sequence (untested).
+* `code: {{Int} -> <Instruction>}`, to retrieve the `<Instruction>`
+ corresponding to a line.
+* `program_counter: {Int}`, the line of the next `<Instruction>` to be executed.
+* `last_choice_index: {Int}`, the index (starting from 0) corresponding to the
+ `<Option>` chosen by the user following a `(resolve_choice!)`.
+* `available_options: {<Option> List}`, the list of `<Option>`s to present to
+ the user upon encountering a `(resolve_choice!)`.
+* `memorized_target: <Value>`, the address in which to store the next user
+ input.
+* `last_instruction_effect: <InstructionEffect>`, the result of the last
+ executed `<Instruction>`. Developers may choose to keep it separate from the
+ `<State>` structure if it makes more sense to do so in their chosen language
+ (e.g. languages allowing functions with multiple returned values).
+
+In order to manage unique address allocation, the proposed solution is to
+include the following members. There is no issue with employing other solutions,
+when more appropriate:
+* `allocated_data: {Int}`, a value that has not been used to generate any
+ allocable `<Address>`es before.
+* `freed_addresses: {{String} Collection}`, a collection of freed allocable
+ `<Address>`es, so that they may be re-used.
+
+Lastly, randomness management might call for an additional member, depending on
+the language:
+* `random_seed: {RandomSeed}`, the next randomness seed to be used.
+
+### Note on `memory`
+One will notice that `memory` is `{{String} -> <Value>}`, yet addresses are
+converted to `{{String} List}` before use. This is because some `<Value>`s
+returned by `memory` can also be converted to `{{String} -> <Value>}` (see
+`<ListValue>` and `<StructureValue>` on [this page](/wyrd_v1/value)). As a
+result, the list is used to traverse/update these.
+
+It is likely that you will want to treat the last element of the address
+differently from the rest, as its parent would be the `{{String} -> Value}`
+construction to consult or modify.
diff --git a/content/wyrd_v1/value/_index.md b/content/wyrd_v1/value/_index.md
new file mode 100644
index 0000000..18e2a6a
--- /dev/null
+++ b/content/wyrd_v1/value/_index.md
@@ -0,0 +1,11 @@
+---
+menuTitle: <Value>
+title: Value
+weight: 4
+---
+
+`{Integer}` and `{Float}` are meant to represent the largest available integer
+and float point value types available in the interpreter's language. This is not
+mandatory, but be especially wary of using too small a type for `{Integer}`, as
+the `<State>` `program_counter` value will need to be able to be as big as there
+are instructions in the program.