Make the game a graph
This commit is contained in:
parent
26958c14eb
commit
e55b34ebcb
|
@ -6,7 +6,7 @@
|
|||
|
||||
The programming language in (set self win) is inspired by [Lisp](https://en.wikipedia.org/wiki/Lisp_(programming_language)), especially the idea of equivalence between code and data. One key difference is that (set self win) has a lot of side effects. In functional programming, side effects make programs difficult to reason about, but here, it makes the game fun! It also has powerful self-referential capabilities using `self` and `history`.
|
||||
|
||||
In the game (set self win), the language is displayed as a tree. Here, we will instead use the equivalent representation of [s-expressions](https://en.wikipedia.org/wiki/S-expression) since it's much easier to type. When playing (set self win), you can click on any node of the tree, which causes the node and its children to be executed in depth-first order and replaced with its return value. You win once the program tree becomes the single node `win`. In (set self win), everything is a function! Here is an overview of the functions:
|
||||
In the game (set self win), the language is displayed as a graph. When playing (set self win), you can click on any node of the tree, which causes the node and its children to be executed in depth-first order and replaced with its return value. There are no variables because only the graph is allowed to persist state between clicks. You win once the program tree becomes the single node `win`. In (set self win), everything is a function! Here is an overview of the functions:
|
||||
- Numbers: Returns themself.
|
||||
- Strings: Returns themself.
|
||||
- `list`: Returns a list of its children.
|
||||
|
|
Loading…
Reference in a new issue