summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2020-12-22 04:08:34 +0100
committerNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2020-12-22 04:08:34 +0100
commitd0d6117176d68b2345d36e81ccdaa447e9caa724 (patch)
tree6cb8f3e4735a695be8c0922434df4c60f7cf82c7 /content/fate_v1/instructions/loops
Moving to Hugo.
Diffstat (limited to 'content/fate_v1/instructions/loops')
-rw-r--r--content/fate_v1/instructions/loops/_index.md34
1 files changed, 34 insertions, 0 deletions
diff --git a/content/fate_v1/instructions/loops/_index.md b/content/fate_v1/instructions/loops/_index.md
new file mode 100644
index 0000000..03c0f3b
--- /dev/null
+++ b/content/fate_v1/instructions/loops/_index.md
@@ -0,0 +1,34 @@
+---
+title: Loops
+---
+Allow the repetition of a group of instructions according to a computation.
+Every loop body defines its hierarchy level, from the local variables' point of
+view.
+
+### WHILE
+{{< fatecode >}}(while [BOOL] [I0 = INSTRUCTION] ... [IM = INSTRUCTION]){{< /fatecode >}}
+
+Executes `[I0]` ... `[IM]` if, and as long as, `[BOOL]` yields true.
+
+### DO WHILE
+{{< fatecode >}}(do_while [BOOL] [I0 = INSTRUCTION] ... [IM = INSTRUCTION]){{< /fatecode >}}
+
+Executes `[I0]` ... `[IM]`, and does so again as long as, `[BOOL]` yields
+true.
+
+### FOR
+{{< fatecode >}}(for <pre = INSTRUCTION> [BOOL] <post = INSTRUCTION> [I0 = INSTRUCTION] ... [IM = INSTRUCTION]){{< /fatecode >}}
+
+Executes `<pre>`, then, if and as long as `[BOOL]` yields true, executes
+`[I0]` ... `[IM]` followed by `<post>`.
+
+### FOR EACH
+{{< fatecode >}}(foreach [COLLECTION] {String} [I0 = INSTRUCTION] ... [IM = INSTRUCTION]){{< /fatecode >}}
+
+Executes `[I0]` ... `[IM]` for each member of `[COLLECTION]`, in order. The current
+member is stored in a new local variable named `{String}`.
+
+### BREAK
+{{< fatecode >}}(break){{< /fatecode >}}
+
+Exits the current loop.