Created
August 3, 2017 01:21
-
-
Save felixyz/74ca89d1196131e9f1de09e70dba3503 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
``` | |
commit | |
[#world tick: 0] | |
[#time #system/timer resolution: 1000] | |
[#thing value: 1 delta: 1] | |
``` | |
Update | |
~~~ | |
search | |
thing = [#thing value delta] | |
value > 5 | |
delta > 0 | |
commit | |
thing.delta := delta * -1.1 | |
~~~ | |
~~~ | |
search | |
thing = [#thing value delta] | |
value < 1 | |
delta < 0 | |
commit | |
thing.delta := delta * -1.1 | |
~~~ | |
~~~ | |
search | |
[#time second] | |
world.tick != second | |
thing = [#thing] | |
commit | |
world.tick := second | |
thing <- [value: thing.value + thing.delta] | |
~~~ | |
~~~ | |
search | |
world = [#world] | |
thing = [#thing] | |
bind | |
[#ui/text text: "value:{{thing.value}}, delta: {{thing.delta}}"] | |
~~~ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment