@almadar/std 16.173.0 → 16.174.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (203) hide show
  1. package/behaviors/lolo/infra/atoms/std-cross-reference.lolo +2 -4
  2. package/behaviors/lolo/ui/core/atoms/std-board.lolo +5 -9
  3. package/behaviors/lolo/ui/core/atoms/std-browse.lolo +8 -1
  4. package/behaviors/lolo/ui/core/atoms/std-esign-flow.lolo +2 -2
  5. package/behaviors/lolo/ui/core/atoms/std-event-log.lolo +3 -7
  6. package/behaviors/lolo/ui/core/atoms/std-form-advanced.lolo +1 -1
  7. package/behaviors/lolo/ui/core/atoms/std-image-upload-multi.lolo +1 -1
  8. package/behaviors/lolo/ui/core/atoms/std-list.lolo +3 -3
  9. package/behaviors/lolo/ui/core/atoms/std-modal.lolo +2 -2
  10. package/behaviors/lolo/ui/core/atoms/std-multi-party-flow.lolo +2 -4
  11. package/behaviors/lolo/ui/core/atoms/std-rating-review.lolo +5 -13
  12. package/behaviors/lolo/ui/core/atoms/std-recurrence.lolo +3 -7
  13. package/behaviors/lolo/ui/core/atoms/std-saved-search.lolo +1 -1
  14. package/behaviors/lolo/ui/core/atoms/std-signature-capture.lolo +2 -2
  15. package/behaviors/lolo/ui/core/atoms/std-step-flow.lolo +2 -4
  16. package/behaviors/lolo/ui/core/atoms/std-tag-taxonomy.lolo +1 -1
  17. package/behaviors/lolo/ui/core/atoms/std-thread.lolo +2 -2
  18. package/behaviors/lolo/ui/core/atoms/std-vote.lolo +2 -2
  19. package/behaviors/lolo/ui/core/atoms/std-wizard.lolo +3 -7
  20. package/behaviors/lolo/ui/core/atoms/ui-atlas-image.lolo +1 -1
  21. package/behaviors/lolo/ui/core/atoms/ui-atlas-panel.lolo +1 -1
  22. package/behaviors/lolo/ui/core/atoms/ui-center.lolo +1 -1
  23. package/behaviors/lolo/ui/core/atoms/ui-hstack.lolo +1 -1
  24. package/behaviors/lolo/ui/core/atoms/ui-icon.lolo +1 -1
  25. package/behaviors/lolo/ui/core/atoms/ui-stack.lolo +1 -1
  26. package/behaviors/lolo/ui/core/atoms/ui-typography.lolo +1 -1
  27. package/behaviors/lolo/ui/core/atoms/ui-vstack.lolo +1 -1
  28. package/behaviors/lolo/ui/core/molecules/ui-content-renderer.lolo +1 -1
  29. package/behaviors/lolo/ui/core/molecules/ui-form-layout.lolo +1 -1
  30. package/behaviors/lolo/ui/core/molecules/ui-grid.lolo +1 -1
  31. package/behaviors/lolo/ui/core/organisms/ui-chat-bar.lolo +1 -1
  32. package/behaviors/lolo/ui/core/organisms/ui-dashboard-grid.lolo +1 -1
  33. package/behaviors/lolo/ui/core/organisms/ui-detail-panel.lolo +1 -1
  34. package/behaviors/lolo/ui/core/organisms/ui-entity-cards.lolo +1 -1
  35. package/behaviors/lolo/ui/core/organisms/ui-entity-list.lolo +1 -1
  36. package/behaviors/lolo/ui/core/organisms/ui-entity-table.lolo +1 -1
  37. package/behaviors/lolo/ui/core/organisms/ui-form-section.lolo +9 -3
  38. package/behaviors/lolo/ui/core/organisms/ui-form.lolo +9 -3
  39. package/behaviors/lolo/ui/core/organisms/ui-master-detail.lolo +1 -1
  40. package/behaviors/lolo/ui/core/organisms/ui-media-gallery.lolo +1 -1
  41. package/behaviors/lolo/ui/core/organisms/ui-segment-renderer.lolo +7 -1
  42. package/behaviors/lolo/ui/core/organisms/ui-stat-card.lolo +1 -1
  43. package/behaviors/lolo/ui/core/organisms/ui-subagent-trace-panel.lolo +1 -1
  44. package/behaviors/lolo/ui/game/atoms/ui-action-tile.lolo +1 -1
  45. package/behaviors/lolo/ui/game/atoms/ui-draw-shape-layer.lolo +41 -9
  46. package/behaviors/lolo/ui/game/atoms/ui-draw-shape.lolo +40 -8
  47. package/behaviors/lolo/ui/game/atoms/ui-draw-sprite-layer.lolo +13 -3
  48. package/behaviors/lolo/ui/game/atoms/ui-draw-sprite.lolo +12 -2
  49. package/behaviors/lolo/ui/game/atoms/ui-draw-text-layer.lolo +3 -3
  50. package/behaviors/lolo/ui/game/atoms/ui-draw-text.lolo +2 -2
  51. package/behaviors/lolo/ui/game/organisms/std-tactics-board-3d.lolo +32 -2
  52. package/behaviors/lolo/ui/learning/atoms/std-learn-classify.lolo +1 -1
  53. package/behaviors/lolo/ui/learning/atoms/std-learn-compare.lolo +397 -0
  54. package/behaviors/lolo/ui/learning/atoms/std-learn-coupled-sim.lolo +537 -0
  55. package/behaviors/lolo/ui/learning/atoms/std-learn-estimate.lolo +419 -0
  56. package/behaviors/lolo/ui/learning/atoms/std-learn-goal-seek.lolo +591 -0
  57. package/behaviors/lolo/ui/learning/atoms/std-learn-grid-sim.lolo +425 -0
  58. package/behaviors/lolo/ui/learning/atoms/std-learn-hotspot.lolo +398 -0
  59. package/behaviors/lolo/ui/learning/atoms/std-learn-measure.lolo +325 -0
  60. package/behaviors/lolo/ui/learning/atoms/std-learn-perturb.lolo +494 -0
  61. package/behaviors/lolo/ui/learning/atoms/std-learn-predict.lolo +408 -0
  62. package/behaviors/lolo/ui/learning/atoms/std-learn-scenario.lolo +307 -0
  63. package/behaviors/lolo/ui/learning/atoms/std-learn-sim-3d.lolo +318 -0
  64. package/behaviors/lolo/ui/learning/atoms/std-learn-speed-drill.lolo +336 -0
  65. package/behaviors/lolo/ui/learning/atoms/std-learn-tour-3d.lolo +380 -0
  66. package/behaviors/lolo/ui/learning/atoms/ui-biology-canvas.lolo +43 -4
  67. package/behaviors/lolo/ui/learning/atoms/ui-chemistry-canvas.lolo +41 -4
  68. package/behaviors/lolo/ui/learning/atoms/ui-physics-canvas.lolo +43 -4
  69. package/behaviors/lolo/ui/marketing/organisms/ui-book-viewer.lolo +1 -1
  70. package/behaviors/lolo/ui/marketing/organisms/ui-case-study-organism.lolo +1 -1
  71. package/behaviors/lolo/ui/marketing/organisms/ui-feature-grid-organism.lolo +1 -1
  72. package/behaviors/lolo/ui/marketing/organisms/ui-hero-organism.lolo +1 -1
  73. package/behaviors/lolo/ui/marketing/organisms/ui-pricing-organism.lolo +1 -1
  74. package/behaviors/lolo/ui/marketing/organisms/ui-showcase-organism.lolo +1 -1
  75. package/behaviors/lolo/ui/marketing/organisms/ui-stats-organism.lolo +1 -1
  76. package/behaviors/lolo/ui/marketing/organisms/ui-step-flow-organism.lolo +1 -1
  77. package/behaviors/lolo/ui/marketing/organisms/ui-team-organism.lolo +1 -1
  78. package/behaviors/registry/agent/atoms/std-agent-session.orb +22 -1
  79. package/behaviors/registry/agent/atoms/std-agent-tool-call.orb +38 -2
  80. package/behaviors/registry/agent/atoms/std-agent-tool-loop.orb +38 -2
  81. package/behaviors/registry/agent/organisms/std-agent-rabit.orb +23 -1
  82. package/behaviors/registry/infra/atoms/std-approval-gate.orb +8 -16
  83. package/behaviors/registry/infra/atoms/std-cache-aside.orb +31 -62
  84. package/behaviors/registry/infra/atoms/std-circuit-breaker.orb +16 -32
  85. package/behaviors/registry/infra/atoms/std-cross-reference.orb +32 -4
  86. package/behaviors/registry/infra/atoms/std-data-erasure.orb +8 -16
  87. package/behaviors/registry/infra/atoms/std-mod-queue.orb +8 -16
  88. package/behaviors/registry/infra/atoms/std-rate-limiter.orb +14 -28
  89. package/behaviors/registry/infra/atoms/std-row-access-control.orb +30 -2
  90. package/behaviors/registry/ui/core/atoms/std-billable-hour.orb +1 -2
  91. package/behaviors/registry/ui/core/atoms/std-board.orb +19 -5
  92. package/behaviors/registry/ui/core/atoms/std-browse.orb +29 -7
  93. package/behaviors/registry/ui/core/atoms/std-dashboard-grid-embedded.orb +1 -2
  94. package/behaviors/registry/ui/core/atoms/std-esign-flow.orb +3 -5
  95. package/behaviors/registry/ui/core/atoms/std-esign-request.orb +3 -6
  96. package/behaviors/registry/ui/core/atoms/std-event-log.orb +17 -3
  97. package/behaviors/registry/ui/core/atoms/std-export.orb +2 -4
  98. package/behaviors/registry/ui/core/atoms/std-form-advanced.orb +1 -1
  99. package/behaviors/registry/ui/core/atoms/std-gallery.orb +9 -18
  100. package/behaviors/registry/ui/core/atoms/std-graphs.orb +15 -1
  101. package/behaviors/registry/ui/core/atoms/std-import.orb +2 -4
  102. package/behaviors/registry/ui/core/atoms/std-list.orb +4 -6
  103. package/behaviors/registry/ui/core/atoms/std-modal.orb +2 -2
  104. package/behaviors/registry/ui/core/atoms/std-multi-party-flow.orb +16 -2
  105. package/behaviors/registry/ui/core/atoms/std-pagination.orb +15 -1
  106. package/behaviors/registry/ui/core/atoms/std-rating-review.orb +19 -5
  107. package/behaviors/registry/ui/core/atoms/std-recurrence.orb +17 -3
  108. package/behaviors/registry/ui/core/atoms/std-rich-editor.orb +15 -1
  109. package/behaviors/registry/ui/core/atoms/std-scatter.orb +15 -1
  110. package/behaviors/registry/ui/core/atoms/std-signature-capture.orb +2 -2
  111. package/behaviors/registry/ui/core/atoms/std-stats.orb +15 -1
  112. package/behaviors/registry/ui/core/atoms/std-step-flow.orb +16 -2
  113. package/behaviors/registry/ui/core/atoms/std-thread.orb +2 -2
  114. package/behaviors/registry/ui/core/atoms/std-vote.orb +2 -2
  115. package/behaviors/registry/ui/core/atoms/std-wizard.orb +17 -3
  116. package/behaviors/registry/ui/core/atoms/ui-atlas-image.orb +4 -1
  117. package/behaviors/registry/ui/core/atoms/ui-atlas-panel.orb +4 -1
  118. package/behaviors/registry/ui/core/atoms/ui-center.orb +4 -1
  119. package/behaviors/registry/ui/core/atoms/ui-hstack.orb +4 -1
  120. package/behaviors/registry/ui/core/atoms/ui-icon.orb +4 -1
  121. package/behaviors/registry/ui/core/atoms/ui-stack.orb +4 -1
  122. package/behaviors/registry/ui/core/atoms/ui-typography.orb +4 -1
  123. package/behaviors/registry/ui/core/atoms/ui-vstack.orb +4 -1
  124. package/behaviors/registry/ui/core/molecules/ui-accordion.orb +3 -3
  125. package/behaviors/registry/ui/core/molecules/ui-content-renderer.orb +4 -1
  126. package/behaviors/registry/ui/core/molecules/ui-form-layout.orb +4 -1
  127. package/behaviors/registry/ui/core/molecules/ui-grid.orb +4 -1
  128. package/behaviors/registry/ui/core/molecules/ui-tabs.orb +2 -2
  129. package/behaviors/registry/ui/core/molecules/ui-wizard-container.orb +1 -1
  130. package/behaviors/registry/ui/core/organisms/ui-chat-bar.orb +4 -1
  131. package/behaviors/registry/ui/core/organisms/ui-dashboard-grid.orb +5 -2
  132. package/behaviors/registry/ui/core/organisms/ui-detail-panel.orb +5 -2
  133. package/behaviors/registry/ui/core/organisms/ui-entity-cards.orb +4 -1
  134. package/behaviors/registry/ui/core/organisms/ui-entity-list.orb +4 -1
  135. package/behaviors/registry/ui/core/organisms/ui-entity-table.orb +4 -1
  136. package/behaviors/registry/ui/core/organisms/ui-form-section.orb +34 -2
  137. package/behaviors/registry/ui/core/organisms/ui-form.orb +34 -2
  138. package/behaviors/registry/ui/core/organisms/ui-master-detail.orb +4 -1
  139. package/behaviors/registry/ui/core/organisms/ui-media-gallery.orb +4 -1
  140. package/behaviors/registry/ui/core/organisms/ui-segment-renderer.orb +24 -2
  141. package/behaviors/registry/ui/core/organisms/ui-stat-card.orb +4 -1
  142. package/behaviors/registry/ui/core/organisms/ui-subagent-trace-panel.orb +4 -1
  143. package/behaviors/registry/ui/core/organisms/ui-tabbed-container.orb +1 -1
  144. package/behaviors/registry/ui/core/organisms/ui-ui-slot-renderer.orb +1 -1
  145. package/behaviors/registry/ui/game/atoms/std-fx-particles.orb +35 -1
  146. package/behaviors/registry/ui/game/atoms/ui-action-tile.orb +4 -1
  147. package/behaviors/registry/ui/game/atoms/ui-draw-shape-layer.orb +183 -13
  148. package/behaviors/registry/ui/game/atoms/ui-draw-shape.orb +104 -9
  149. package/behaviors/registry/ui/game/atoms/ui-draw-sprite-layer.orb +56 -2
  150. package/behaviors/registry/ui/game/atoms/ui-draw-sprite.orb +36 -4
  151. package/behaviors/registry/ui/game/atoms/ui-draw-text-layer.orb +21 -2
  152. package/behaviors/registry/ui/game/atoms/ui-draw-text.orb +19 -4
  153. package/behaviors/registry/ui/game/organisms/std-tactics-board-3d.orb +173 -2
  154. package/behaviors/registry/ui/learning/atoms/std-learn-classify.orb +1 -1
  155. package/behaviors/registry/ui/learning/atoms/std-learn-compare.orb +2814 -0
  156. package/behaviors/registry/ui/learning/atoms/std-learn-coupled-sim.orb +3183 -0
  157. package/behaviors/registry/ui/learning/atoms/std-learn-estimate.orb +2394 -0
  158. package/behaviors/registry/ui/learning/atoms/std-learn-goal-seek.orb +3951 -0
  159. package/behaviors/registry/ui/learning/atoms/std-learn-grid-sim.orb +3458 -0
  160. package/behaviors/registry/ui/learning/atoms/std-learn-hotspot.orb +2646 -0
  161. package/behaviors/registry/ui/learning/atoms/std-learn-measure.orb +1979 -0
  162. package/behaviors/registry/ui/learning/atoms/std-learn-perturb.orb +2994 -0
  163. package/behaviors/registry/ui/learning/atoms/std-learn-predict.orb +2682 -0
  164. package/behaviors/registry/ui/learning/atoms/std-learn-scenario.orb +1842 -0
  165. package/behaviors/registry/ui/learning/atoms/std-learn-sim-3d.orb +1648 -0
  166. package/behaviors/registry/ui/learning/atoms/std-learn-speed-drill.orb +2307 -0
  167. package/behaviors/registry/ui/learning/atoms/std-learn-tour-3d.orb +2947 -0
  168. package/behaviors/registry/ui/learning/atoms/ui-algorithm-canvas.orb +173 -4
  169. package/behaviors/registry/ui/learning/atoms/ui-biology-canvas.orb +267 -7
  170. package/behaviors/registry/ui/learning/atoms/ui-chemistry-canvas.orb +263 -8
  171. package/behaviors/registry/ui/learning/atoms/ui-learning-canvas.orb +116 -1
  172. package/behaviors/registry/ui/learning/atoms/ui-math-canvas.orb +200 -4
  173. package/behaviors/registry/ui/learning/atoms/ui-physics-canvas.orb +264 -7
  174. package/behaviors/registry/ui/marketing/atoms/std-marketing-article.orb +1 -2
  175. package/behaviors/registry/ui/marketing/atoms/std-marketing-footer.orb +1 -2
  176. package/behaviors/registry/ui/marketing/atoms/std-marketing-split.orb +1 -2
  177. package/behaviors/registry/ui/marketing/atoms/std-marketing-stats.orb +1 -2
  178. package/behaviors/registry/ui/marketing/atoms/std-marketing-steps.orb +1 -2
  179. package/behaviors/registry/ui/marketing/atoms/std-marketing-team.orb +1 -2
  180. package/behaviors/registry/ui/marketing/organisms/ui-book-viewer.orb +4 -1
  181. package/behaviors/registry/ui/marketing/organisms/ui-case-study-organism.orb +4 -1
  182. package/behaviors/registry/ui/marketing/organisms/ui-feature-grid-organism.orb +4 -1
  183. package/behaviors/registry/ui/marketing/organisms/ui-hero-organism.orb +4 -1
  184. package/behaviors/registry/ui/marketing/organisms/ui-pricing-organism.orb +4 -1
  185. package/behaviors/registry/ui/marketing/organisms/ui-showcase-organism.orb +4 -1
  186. package/behaviors/registry/ui/marketing/organisms/ui-stats-organism.orb +4 -1
  187. package/behaviors/registry/ui/marketing/organisms/ui-step-flow-organism.orb +4 -1
  188. package/behaviors/registry/ui/marketing/organisms/ui-team-organism.orb +4 -1
  189. package/dist/behaviors/exports-reader.js +3440 -2189
  190. package/dist/behaviors/functions/index.d.ts +1751 -154
  191. package/dist/behaviors/functions/index.js +3402 -2190
  192. package/dist/behaviors/index.d.ts +1 -1
  193. package/dist/behaviors/index.js +3441 -2190
  194. package/dist/behaviors/query.js +3440 -2189
  195. package/dist/behaviors-embeddings.hash.json +3 -3
  196. package/dist/behaviors-embeddings.json +230 -178
  197. package/dist/behaviors-registry.json +4397 -171
  198. package/dist/index.d.ts +1 -1
  199. package/dist/index.js +3441 -2190
  200. package/dist/knob-embeddings.hash.json +3 -3
  201. package/dist/knob-embeddings.json +1 -1
  202. package/dist/registry/factory-signatures.json +1 -1
  203. package/package.json +2 -2
@@ -0,0 +1,3458 @@
1
+ {
2
+ "description": "Generic grid-world simulation — a tappable cellular grid evolves under a config-selected local rule: life (Conway's birth-3, survive-2-or-3), spread (anything with an active 4-neighbour activates — wavefronts, fire, contagion), or diffusion (each cell relaxes toward its neighbourhood average with decay — heat, concentration). The learner seeds the world by tapping cells directly on the canvas, then Runs, Pauses, or single-Steps the evolution, with a generation counter and live active-cell census. Rule, grid dimensions, seeds, and palette are all config-declared, so one mechanism serves emergence, percolation, epidemic fronts, heat flow, and any local-rules-global-behaviour lesson. Standalone by default; behind a lab router set matchMode and it renders only when MODE_SELECTED matches.",
3
+ "ledger": {
4
+ "entries": {
5
+ "ent_01M07580Z0TCQ8MXCVM83VY64W": {
6
+ "bakedName": "GridSimScene",
7
+ "curName": "GridSimScene",
8
+ "id": "ent_01M07580Z0TCQ8MXCVM83VY64W",
9
+ "kind": "entity",
10
+ "owner": "workspace",
11
+ "renames": []
12
+ },
13
+ "evt_01M07580Z07WFR9K4P23VT04GJ": {
14
+ "bakedName": "INIT",
15
+ "curName": "INIT",
16
+ "id": "evt_01M07580Z07WFR9K4P23VT04GJ",
17
+ "kind": "event",
18
+ "owner": "workspace",
19
+ "parent": "trt_01M07580Z0ZBVSWZ4K8C6V4AV1",
20
+ "renames": []
21
+ },
22
+ "evt_01M07580Z41VWS89NNN7YDX34F": {
23
+ "bakedName": "TAP_CELL",
24
+ "curName": "TAP_CELL",
25
+ "id": "evt_01M07580Z41VWS89NNN7YDX34F",
26
+ "kind": "event",
27
+ "owner": "workspace",
28
+ "parent": "trt_01M07580Z0ZBVSWZ4K8C6V4AV1",
29
+ "renames": []
30
+ },
31
+ "evt_01M07580Z441ZJSFAD3XH30WRH": {
32
+ "bakedName": "RUN_TOGGLED",
33
+ "curName": "RUN_TOGGLED",
34
+ "id": "evt_01M07580Z441ZJSFAD3XH30WRH",
35
+ "kind": "event",
36
+ "owner": "workspace",
37
+ "parent": "trt_01M07580Z0ZBVSWZ4K8C6V4AV1",
38
+ "renames": []
39
+ },
40
+ "evt_01M07580Z46A409AK5X875SRW8": {
41
+ "bakedName": "STEP",
42
+ "curName": "STEP",
43
+ "id": "evt_01M07580Z46A409AK5X875SRW8",
44
+ "kind": "event",
45
+ "owner": "workspace",
46
+ "parent": "trt_01M07580Z0ZBVSWZ4K8C6V4AV1",
47
+ "renames": []
48
+ },
49
+ "evt_01M07580Z46NBJ8DSFXVB2KQM6": {
50
+ "bakedName": "RESET",
51
+ "curName": "RESET",
52
+ "id": "evt_01M07580Z46NBJ8DSFXVB2KQM6",
53
+ "kind": "event",
54
+ "owner": "workspace",
55
+ "parent": "trt_01M07580Z0ZBVSWZ4K8C6V4AV1",
56
+ "renames": []
57
+ },
58
+ "evt_01M07580Z4ABT9YBQ1WE4J2Z74": {
59
+ "bakedName": "GRID_STEPPED",
60
+ "curName": "GRID_STEPPED",
61
+ "id": "evt_01M07580Z4ABT9YBQ1WE4J2Z74",
62
+ "kind": "event",
63
+ "owner": "workspace",
64
+ "parent": "trt_01M07580Z0ZBVSWZ4K8C6V4AV1",
65
+ "renames": []
66
+ },
67
+ "evt_01M07580Z4AKJB3934MXE7S8SQ": {
68
+ "bakedName": "RUN",
69
+ "curName": "RUN",
70
+ "id": "evt_01M07580Z4AKJB3934MXE7S8SQ",
71
+ "kind": "event",
72
+ "owner": "workspace",
73
+ "parent": "trt_01M07580Z0ZBVSWZ4K8C6V4AV1",
74
+ "renames": []
75
+ },
76
+ "evt_01M07580Z4BPGW69Q28NV26BQ5": {
77
+ "bakedName": "CELL_TOGGLED",
78
+ "curName": "CELL_TOGGLED",
79
+ "id": "evt_01M07580Z4BPGW69Q28NV26BQ5",
80
+ "kind": "event",
81
+ "owner": "workspace",
82
+ "parent": "trt_01M07580Z0ZBVSWZ4K8C6V4AV1",
83
+ "renames": []
84
+ },
85
+ "evt_01M07580Z4SY527GW89VRZRM77": {
86
+ "bakedName": "PAUSE",
87
+ "curName": "PAUSE",
88
+ "id": "evt_01M07580Z4SY527GW89VRZRM77",
89
+ "kind": "event",
90
+ "owner": "workspace",
91
+ "parent": "trt_01M07580Z0ZBVSWZ4K8C6V4AV1",
92
+ "renames": []
93
+ },
94
+ "evt_01M07580Z4WC03Q04K86EAARAQ": {
95
+ "bakedName": "GRID_RESET",
96
+ "curName": "GRID_RESET",
97
+ "id": "evt_01M07580Z4WC03Q04K86EAARAQ",
98
+ "kind": "event",
99
+ "owner": "workspace",
100
+ "parent": "trt_01M07580Z0ZBVSWZ4K8C6V4AV1",
101
+ "renames": []
102
+ },
103
+ "evt_01M07580Z4ZBCV8MXBRY5824Z6": {
104
+ "bakedName": "MODE_SELECTED",
105
+ "curName": "MODE_SELECTED",
106
+ "id": "evt_01M07580Z4ZBCV8MXBRY5824Z6",
107
+ "kind": "event",
108
+ "owner": "workspace",
109
+ "parent": "trt_01M07580Z0ZBVSWZ4K8C6V4AV1",
110
+ "renames": []
111
+ },
112
+ "orb_01M07580Z0K57SKR5RVGYKB7XW": {
113
+ "bakedName": "GridSimOrbital",
114
+ "curName": "GridSimOrbital",
115
+ "id": "orb_01M07580Z0K57SKR5RVGYKB7XW",
116
+ "kind": "orbital",
117
+ "owner": "workspace",
118
+ "renames": []
119
+ },
120
+ "pag_01M07580Z6K0WSH4T767R7DKN7": {
121
+ "bakedName": "GridSimPage",
122
+ "curName": "GridSimPage",
123
+ "id": "pag_01M07580Z6K0WSH4T767R7DKN7",
124
+ "kind": "page",
125
+ "owner": "workspace",
126
+ "renames": []
127
+ },
128
+ "trt_01M07580Z0ZBVSWZ4K8C6V4AV1": {
129
+ "bakedName": "GridSimSim",
130
+ "curName": "GridSimSim",
131
+ "id": "trt_01M07580Z0ZBVSWZ4K8C6V4AV1",
132
+ "kind": "trait",
133
+ "owner": "workspace",
134
+ "renames": []
135
+ }
136
+ },
137
+ "schemaVersion": 1
138
+ },
139
+ "name": "std-learn-grid-sim",
140
+ "orbitals": [
141
+ {
142
+ "entity": {
143
+ "fields": [
144
+ {
145
+ "name": "id",
146
+ "required": true,
147
+ "type": "string"
148
+ },
149
+ {
150
+ "default": false,
151
+ "name": "active",
152
+ "type": "boolean"
153
+ },
154
+ {
155
+ "name": "title",
156
+ "type": "string"
157
+ },
158
+ {
159
+ "items": {
160
+ "type": "number"
161
+ },
162
+ "name": "cells",
163
+ "type": "array"
164
+ },
165
+ {
166
+ "default": 0.0,
167
+ "name": "generation",
168
+ "type": "number"
169
+ },
170
+ {
171
+ "default": 0.0,
172
+ "name": "aliveCount",
173
+ "type": "number"
174
+ },
175
+ {
176
+ "default": false,
177
+ "name": "running",
178
+ "type": "boolean"
179
+ },
180
+ {
181
+ "items": {
182
+ "properties": {
183
+ "color": {
184
+ "name": "color",
185
+ "required": true,
186
+ "type": "string"
187
+ },
188
+ "fill": {
189
+ "name": "fill",
190
+ "required": true,
191
+ "type": "string"
192
+ },
193
+ "height": {
194
+ "name": "height",
195
+ "required": true,
196
+ "type": "number"
197
+ },
198
+ "id": {
199
+ "name": "id",
200
+ "required": true,
201
+ "type": "string"
202
+ },
203
+ "type": {
204
+ "name": "type",
205
+ "required": true,
206
+ "type": "string"
207
+ },
208
+ "width": {
209
+ "name": "width",
210
+ "required": true,
211
+ "type": "number"
212
+ },
213
+ "x": {
214
+ "name": "x",
215
+ "required": true,
216
+ "type": "number"
217
+ },
218
+ "y": {
219
+ "name": "y",
220
+ "required": true,
221
+ "type": "number"
222
+ }
223
+ },
224
+ "type": "object"
225
+ },
226
+ "name": "cellShapes",
227
+ "type": "array"
228
+ }
229
+ ],
230
+ "id": "ent_01M07580Z0TCQ8MXCVM83VY64W",
231
+ "name": "GridSimScene",
232
+ "persistence": "runtime"
233
+ },
234
+ "id": "orb_01M07580Z0K57SKR5RVGYKB7XW",
235
+ "name": "GridSimOrbital",
236
+ "pages": [
237
+ {
238
+ "id": "pag_01M07580Z6K0WSH4T767R7DKN7",
239
+ "name": "GridSimPage",
240
+ "path": "/learn-grid-sim",
241
+ "traits": [
242
+ {
243
+ "ref": "GridSimSim",
244
+ "refId": "trt_01M07580Z0ZBVSWZ4K8C6V4AV1"
245
+ }
246
+ ]
247
+ }
248
+ ],
249
+ "traits": [
250
+ {
251
+ "category": "interaction",
252
+ "config": {
253
+ "autoRun": {
254
+ "default": false,
255
+ "description": "Whether the evolution starts running immediately on load.",
256
+ "label": "Auto Run",
257
+ "tier": "domain",
258
+ "type": "boolean"
259
+ },
260
+ "backgroundColor": {
261
+ "default": "#f8fafc",
262
+ "label": "Background Color",
263
+ "tier": "presentation",
264
+ "type": "string"
265
+ },
266
+ "cellSize": {
267
+ "default": 26.0,
268
+ "label": "Cell Size",
269
+ "tier": "presentation",
270
+ "type": "number"
271
+ },
272
+ "cols": {
273
+ "default": 16.0,
274
+ "label": "Columns",
275
+ "tier": "domain",
276
+ "type": "number"
277
+ },
278
+ "decay": {
279
+ "default": 0.995,
280
+ "description": "Diffusion rule only: fraction of a cell's value retained each generation.",
281
+ "label": "Decay",
282
+ "tier": "domain",
283
+ "type": "number"
284
+ },
285
+ "diffuseRate": {
286
+ "default": 0.5,
287
+ "description": "Diffusion rule only: how strongly a cell moves toward its neighbourhood average each generation.",
288
+ "label": "Diffuse Rate",
289
+ "tier": "domain",
290
+ "type": "number"
291
+ },
292
+ "height": {
293
+ "default": 332.0,
294
+ "label": "Height",
295
+ "tier": "presentation",
296
+ "type": "number"
297
+ },
298
+ "lowColor": {
299
+ "default": "#bfdbfe",
300
+ "label": "Low Color",
301
+ "tier": "presentation",
302
+ "type": "string"
303
+ },
304
+ "matchMode": {
305
+ "default": "",
306
+ "description": "When composed behind a lab router, the MODE_SELECTED mode value this instrument responds to. Empty string means standalone — render immediately on INIT.",
307
+ "label": "Match Mode",
308
+ "tier": "presentation",
309
+ "type": "string"
310
+ },
311
+ "midColor": {
312
+ "default": "#60a5fa",
313
+ "label": "Mid Color",
314
+ "tier": "presentation",
315
+ "type": "string"
316
+ },
317
+ "offColor": {
318
+ "default": "#e2e8f0",
319
+ "label": "Off Color",
320
+ "tier": "presentation",
321
+ "type": "string"
322
+ },
323
+ "onColor": {
324
+ "default": "#1d4ed8",
325
+ "label": "On Color",
326
+ "tier": "presentation",
327
+ "type": "string"
328
+ },
329
+ "rows": {
330
+ "default": 12.0,
331
+ "label": "Rows",
332
+ "tier": "domain",
333
+ "type": "number"
334
+ },
335
+ "rule": {
336
+ "default": "life",
337
+ "description": "The local update rule: life (Conway birth-3 survive-2-3), spread (an active 4-neighbour activates a cell), or diffusion (cells relax toward the neighbourhood average with decay).",
338
+ "label": "Rule",
339
+ "synonyms": "game of life, contagion, wavefront, heat diffusion, cellular automaton rule",
340
+ "tier": "domain",
341
+ "type": "string"
342
+ },
343
+ "seeds": {
344
+ "default": [
345
+ 1.0,
346
+ 18.0,
347
+ 32.0,
348
+ 33.0,
349
+ 34.0,
350
+ 88.0,
351
+ 89.0,
352
+ 90.0
353
+ ],
354
+ "description": "Flat cell indexes (row·cols + col) active at the start — the default plants a glider and a blinker. Realizations declare their own starting pattern here.",
355
+ "items": {
356
+ "type": "number"
357
+ },
358
+ "label": "Seeds",
359
+ "tier": "domain",
360
+ "type": "[number]"
361
+ },
362
+ "stepLabel": {
363
+ "default": "Step",
364
+ "label": "Step Label",
365
+ "tier": "presentation",
366
+ "type": "string"
367
+ },
368
+ "taskText": {
369
+ "default": "Tap cells to seed the world, then Run — or Step one generation at a time to see the rule at work.",
370
+ "description": "One-sentence statement of what to explore.",
371
+ "label": "Task Text",
372
+ "tier": "domain",
373
+ "type": "string"
374
+ },
375
+ "title": {
376
+ "default": "Grid World",
377
+ "description": "Title shown above the grid.",
378
+ "label": "Title",
379
+ "tier": "presentation",
380
+ "type": "string"
381
+ },
382
+ "width": {
383
+ "default": 436.0,
384
+ "label": "Width",
385
+ "tier": "presentation",
386
+ "type": "number"
387
+ }
388
+ },
389
+ "emits": [
390
+ {
391
+ "description": "The evolution was started or paused — a composed listener (readout, grader) can subscribe; a harmless no-op when the atom runs standalone.",
392
+ "event": "RUN_TOGGLED",
393
+ "eventId": "evt_01M07580Z441ZJSFAD3XH30WRH",
394
+ "payloadSchema": [
395
+ {
396
+ "name": "running",
397
+ "type": "boolean"
398
+ }
399
+ ],
400
+ "scope": "external",
401
+ "tier": "domain"
402
+ },
403
+ {
404
+ "description": "A single-step advanced the world by one generation, with the new active-cell census.",
405
+ "event": "GRID_STEPPED",
406
+ "eventId": "evt_01M07580Z4ABT9YBQ1WE4J2Z74",
407
+ "payloadSchema": [
408
+ {
409
+ "name": "generation",
410
+ "type": "number"
411
+ },
412
+ {
413
+ "name": "aliveCount",
414
+ "type": "number"
415
+ }
416
+ ],
417
+ "scope": "external",
418
+ "synonyms": "cellular automaton, game of life, grid world, emergence, local rules, spread, diffusion",
419
+ "tier": "domain"
420
+ },
421
+ {
422
+ "description": "The learner toggled a cell by tapping it, with the new active-cell census.",
423
+ "event": "CELL_TOGGLED",
424
+ "eventId": "evt_01M07580Z4BPGW69Q28NV26BQ5",
425
+ "payloadSchema": [
426
+ {
427
+ "name": "index",
428
+ "type": "number"
429
+ },
430
+ {
431
+ "name": "aliveCount",
432
+ "type": "number"
433
+ }
434
+ ],
435
+ "scope": "external",
436
+ "tier": "domain"
437
+ },
438
+ {
439
+ "description": "The learner restored the world to its configured seeds.",
440
+ "event": "GRID_RESET",
441
+ "eventId": "evt_01M07580Z4WC03Q04K86EAARAQ",
442
+ "payloadSchema": [
443
+ {
444
+ "name": "seedCount",
445
+ "type": "number"
446
+ }
447
+ ],
448
+ "scope": "external",
449
+ "tier": "domain"
450
+ }
451
+ ],
452
+ "entityContract": {
453
+ "provides": [
454
+ "active",
455
+ "aliveCount",
456
+ "cellShapes",
457
+ "cells",
458
+ "generation",
459
+ "running",
460
+ "title"
461
+ ],
462
+ "requires": []
463
+ },
464
+ "entityRebindable": true,
465
+ "entityRefIds": {
466
+ "GridSimScene": "ent_01M07580Z0TCQ8MXCVM83VY64W"
467
+ },
468
+ "id": "trt_01M07580Z0ZBVSWZ4K8C6V4AV1",
469
+ "linkedEntity": "GridSimScene",
470
+ "linkedEntityId": "ent_01M07580Z0TCQ8MXCVM83VY64W",
471
+ "name": "GridSimSim",
472
+ "scope": "instance",
473
+ "stateMachine": {
474
+ "events": [
475
+ {
476
+ "id": "evt_01M07580Z07WFR9K4P23VT04GJ",
477
+ "key": "INIT",
478
+ "name": "Initialize"
479
+ },
480
+ {
481
+ "description": "Lab router broadcast naming the active mode; this instrument renders when the mode equals matchMode, otherwise renders null.",
482
+ "id": "evt_01M07580Z4ZBCV8MXBRY5824Z6",
483
+ "key": "MODE_SELECTED",
484
+ "name": "Mode Selected",
485
+ "payloadSchema": [
486
+ {
487
+ "name": "mode",
488
+ "type": "string"
489
+ }
490
+ ],
491
+ "tier": "domain"
492
+ },
493
+ {
494
+ "description": "Learner started the evolution; the grid advances one generation per tick until Pause.",
495
+ "id": "evt_01M07580Z4AKJB3934MXE7S8SQ",
496
+ "key": "RUN",
497
+ "name": "Run",
498
+ "tier": "domain"
499
+ },
500
+ {
501
+ "description": "Learner froze the evolution; tapping and single-stepping still work.",
502
+ "id": "evt_01M07580Z4SY527GW89VRZRM77",
503
+ "key": "PAUSE",
504
+ "name": "Pause",
505
+ "tier": "domain"
506
+ },
507
+ {
508
+ "description": "Learner advanced exactly one generation while paused — the microscope view of the rule.",
509
+ "id": "evt_01M07580Z46A409AK5X875SRW8",
510
+ "key": "STEP",
511
+ "name": "Step",
512
+ "tier": "domain"
513
+ },
514
+ {
515
+ "description": "Learner tapped a cell on the canvas — the canvas callback wraps its click info as payload { id, type, index }, where index is the flat cell index; the cell toggles between empty and active, seeding or editing the world.",
516
+ "id": "evt_01M07580Z41VWS89NNN7YDX34F",
517
+ "key": "TAP_CELL",
518
+ "name": "Tap Cell",
519
+ "payloadSchema": [
520
+ {
521
+ "name": "payload",
522
+ "properties": [
523
+ {
524
+ "name": "id",
525
+ "type": "string"
526
+ },
527
+ {
528
+ "name": "type",
529
+ "type": "string"
530
+ },
531
+ {
532
+ "name": "index",
533
+ "required": true,
534
+ "type": "number"
535
+ }
536
+ ],
537
+ "type": "object"
538
+ }
539
+ ],
540
+ "tier": "domain"
541
+ },
542
+ {
543
+ "description": "Learner restored the configured seed pattern and zeroed the generation counter.",
544
+ "id": "evt_01M07580Z46NBJ8DSFXVB2KQM6",
545
+ "key": "RESET",
546
+ "name": "Reset",
547
+ "tier": "domain"
548
+ },
549
+ {
550
+ "description": "The evolution was started or paused — a composed listener (readout, grader) can subscribe; a harmless no-op when the atom runs standalone.",
551
+ "id": "evt_01M07580Z441ZJSFAD3XH30WRH",
552
+ "key": "RUN_TOGGLED",
553
+ "name": "Run Toggled",
554
+ "payloadSchema": [
555
+ {
556
+ "name": "running",
557
+ "type": "boolean"
558
+ }
559
+ ],
560
+ "tier": "domain"
561
+ },
562
+ {
563
+ "description": "A single-step advanced the world by one generation, with the new active-cell census.",
564
+ "id": "evt_01M07580Z4ABT9YBQ1WE4J2Z74",
565
+ "key": "GRID_STEPPED",
566
+ "name": "Grid Stepped",
567
+ "payloadSchema": [
568
+ {
569
+ "name": "generation",
570
+ "type": "number"
571
+ },
572
+ {
573
+ "name": "aliveCount",
574
+ "type": "number"
575
+ }
576
+ ],
577
+ "synonyms": "cellular automaton, game of life, grid world, emergence, local rules, spread, diffusion",
578
+ "tier": "domain"
579
+ },
580
+ {
581
+ "description": "The learner toggled a cell by tapping it, with the new active-cell census.",
582
+ "id": "evt_01M07580Z4BPGW69Q28NV26BQ5",
583
+ "key": "CELL_TOGGLED",
584
+ "name": "Cell Toggled",
585
+ "payloadSchema": [
586
+ {
587
+ "name": "index",
588
+ "type": "number"
589
+ },
590
+ {
591
+ "name": "aliveCount",
592
+ "type": "number"
593
+ }
594
+ ],
595
+ "tier": "domain"
596
+ },
597
+ {
598
+ "description": "The learner restored the world to its configured seeds.",
599
+ "id": "evt_01M07580Z4WC03Q04K86EAARAQ",
600
+ "key": "GRID_RESET",
601
+ "name": "Grid Reset",
602
+ "payloadSchema": [
603
+ {
604
+ "name": "seedCount",
605
+ "type": "number"
606
+ }
607
+ ],
608
+ "tier": "domain"
609
+ }
610
+ ],
611
+ "states": [
612
+ {
613
+ "isInitial": true,
614
+ "name": "idle"
615
+ }
616
+ ],
617
+ "transitions": [
618
+ {
619
+ "effects": [
620
+ [
621
+ "set",
622
+ "@entity.active",
623
+ true
624
+ ],
625
+ [
626
+ "set",
627
+ "@entity.title",
628
+ "@config.title"
629
+ ],
630
+ [
631
+ "set",
632
+ "@entity.generation",
633
+ 0.0
634
+ ],
635
+ [
636
+ "set",
637
+ "@entity.running",
638
+ "@config.autoRun"
639
+ ],
640
+ [
641
+ "set",
642
+ "@entity.cells",
643
+ [
644
+ "array/map",
645
+ [
646
+ "array/range",
647
+ 0.0,
648
+ [
649
+ "*",
650
+ "@config.rows",
651
+ "@config.cols"
652
+ ]
653
+ ],
654
+ [
655
+ "fn",
656
+ [
657
+ "i"
658
+ ],
659
+ [
660
+ "if",
661
+ [
662
+ "array/includes",
663
+ "@config.seeds",
664
+ "@i"
665
+ ],
666
+ 1.0,
667
+ 0.0
668
+ ]
669
+ ]
670
+ ]
671
+ ],
672
+ [
673
+ "set",
674
+ "@entity.aliveCount",
675
+ [
676
+ "array/len",
677
+ [
678
+ "array/filter",
679
+ "@entity.cells",
680
+ [
681
+ "fn",
682
+ "v",
683
+ [
684
+ ">",
685
+ "@v",
686
+ 0.05
687
+ ]
688
+ ]
689
+ ]
690
+ ]
691
+ ],
692
+ [
693
+ "set",
694
+ "@entity.cellShapes",
695
+ [
696
+ "array/map",
697
+ [
698
+ "array/range",
699
+ 0.0,
700
+ [
701
+ "*",
702
+ "@config.rows",
703
+ "@config.cols"
704
+ ]
705
+ ],
706
+ [
707
+ "fn",
708
+ [
709
+ "i"
710
+ ],
711
+ [
712
+ "let",
713
+ [
714
+ [
715
+ "r",
716
+ [
717
+ "math/floor",
718
+ [
719
+ "/",
720
+ "@i",
721
+ "@config.cols"
722
+ ]
723
+ ]
724
+ ],
725
+ [
726
+ "c",
727
+ [
728
+ "math/mod",
729
+ "@i",
730
+ "@config.cols"
731
+ ]
732
+ ],
733
+ [
734
+ "v",
735
+ [
736
+ "array/nth",
737
+ "@entity.cells",
738
+ "@i"
739
+ ]
740
+ ],
741
+ [
742
+ "cellColor",
743
+ [
744
+ "if",
745
+ [
746
+ ">",
747
+ "@v",
748
+ 0.66
749
+ ],
750
+ "@config.onColor",
751
+ [
752
+ "if",
753
+ [
754
+ ">",
755
+ "@v",
756
+ 0.33
757
+ ],
758
+ "@config.midColor",
759
+ [
760
+ "if",
761
+ [
762
+ ">",
763
+ "@v",
764
+ 0.05
765
+ ],
766
+ "@config.lowColor",
767
+ "@config.offColor"
768
+ ]
769
+ ]
770
+ ]
771
+ ]
772
+ ],
773
+ {
774
+ "color": "@cellColor",
775
+ "fill": "@cellColor",
776
+ "height": [
777
+ "-",
778
+ "@config.cellSize",
779
+ 2.0
780
+ ],
781
+ "id": [
782
+ "str/concat",
783
+ "cell-",
784
+ "@i"
785
+ ],
786
+ "type": "rect",
787
+ "width": [
788
+ "-",
789
+ "@config.cellSize",
790
+ 2.0
791
+ ],
792
+ "x": [
793
+ "+",
794
+ 10.0,
795
+ [
796
+ "*",
797
+ "@c",
798
+ "@config.cellSize"
799
+ ]
800
+ ],
801
+ "y": [
802
+ "+",
803
+ 10.0,
804
+ [
805
+ "*",
806
+ "@r",
807
+ "@config.cellSize"
808
+ ]
809
+ ]
810
+ }
811
+ ]
812
+ ]
813
+ ]
814
+ ],
815
+ [
816
+ "render-ui",
817
+ "main",
818
+ {
819
+ "children": [
820
+ {
821
+ "children": [
822
+ {
823
+ "content": "@entity.title",
824
+ "type": "typography",
825
+ "variant": "h4"
826
+ },
827
+ {
828
+ "content": "@config.taskText",
829
+ "type": "typography",
830
+ "variant": "body"
831
+ },
832
+ {
833
+ "children": [
834
+ {
835
+ "action": "RUN",
836
+ "disabled": [
837
+ "if",
838
+ "@entity.running",
839
+ true,
840
+ false
841
+ ],
842
+ "label": "Run",
843
+ "type": "button",
844
+ "variant": "primary"
845
+ },
846
+ {
847
+ "action": "PAUSE",
848
+ "disabled": [
849
+ "if",
850
+ "@entity.running",
851
+ false,
852
+ true
853
+ ],
854
+ "label": "Pause",
855
+ "type": "button",
856
+ "variant": "secondary"
857
+ },
858
+ {
859
+ "action": "STEP",
860
+ "disabled": [
861
+ "if",
862
+ "@entity.running",
863
+ true,
864
+ false
865
+ ],
866
+ "label": "@config.stepLabel",
867
+ "type": "button",
868
+ "variant": "secondary"
869
+ },
870
+ {
871
+ "action": "RESET",
872
+ "label": "Reset",
873
+ "type": "button",
874
+ "variant": "ghost"
875
+ }
876
+ ],
877
+ "direction": "horizontal",
878
+ "gap": "sm",
879
+ "type": "stack"
880
+ },
881
+ {
882
+ "animate": false,
883
+ "backgroundColor": "@config.backgroundColor",
884
+ "height": "@config.height",
885
+ "interactive": true,
886
+ "onShapeClick": "TAP_CELL",
887
+ "shapes": "@entity.cellShapes",
888
+ "type": "learning-canvas",
889
+ "width": "@config.width"
890
+ },
891
+ {
892
+ "content": [
893
+ "str/concat",
894
+ "Generation ",
895
+ [
896
+ "str/concat",
897
+ "",
898
+ "@entity.generation"
899
+ ],
900
+ " · active cells: ",
901
+ [
902
+ "str/concat",
903
+ "",
904
+ "@entity.aliveCount"
905
+ ]
906
+ ],
907
+ "type": "typography",
908
+ "variant": "body"
909
+ }
910
+ ],
911
+ "direction": "vertical",
912
+ "gap": "md",
913
+ "type": "stack"
914
+ }
915
+ ],
916
+ "padding": "md",
917
+ "type": "box"
918
+ }
919
+ ]
920
+ ],
921
+ "event": "INIT",
922
+ "eventId": "evt_01M07580Z07WFR9K4P23VT04GJ",
923
+ "from": "idle",
924
+ "guard": [
925
+ "==",
926
+ "@config.matchMode",
927
+ ""
928
+ ],
929
+ "to": "idle"
930
+ },
931
+ {
932
+ "effects": [
933
+ [
934
+ "set",
935
+ "@entity.active",
936
+ true
937
+ ],
938
+ [
939
+ "set",
940
+ "@entity.title",
941
+ "@config.title"
942
+ ],
943
+ [
944
+ "set",
945
+ "@entity.generation",
946
+ 0.0
947
+ ],
948
+ [
949
+ "set",
950
+ "@entity.running",
951
+ "@config.autoRun"
952
+ ],
953
+ [
954
+ "set",
955
+ "@entity.cells",
956
+ [
957
+ "array/map",
958
+ [
959
+ "array/range",
960
+ 0.0,
961
+ [
962
+ "*",
963
+ "@config.rows",
964
+ "@config.cols"
965
+ ]
966
+ ],
967
+ [
968
+ "fn",
969
+ [
970
+ "i"
971
+ ],
972
+ [
973
+ "if",
974
+ [
975
+ "array/includes",
976
+ "@config.seeds",
977
+ "@i"
978
+ ],
979
+ 1.0,
980
+ 0.0
981
+ ]
982
+ ]
983
+ ]
984
+ ],
985
+ [
986
+ "set",
987
+ "@entity.aliveCount",
988
+ [
989
+ "array/len",
990
+ [
991
+ "array/filter",
992
+ "@entity.cells",
993
+ [
994
+ "fn",
995
+ "v",
996
+ [
997
+ ">",
998
+ "@v",
999
+ 0.05
1000
+ ]
1001
+ ]
1002
+ ]
1003
+ ]
1004
+ ],
1005
+ [
1006
+ "set",
1007
+ "@entity.cellShapes",
1008
+ [
1009
+ "array/map",
1010
+ [
1011
+ "array/range",
1012
+ 0.0,
1013
+ [
1014
+ "*",
1015
+ "@config.rows",
1016
+ "@config.cols"
1017
+ ]
1018
+ ],
1019
+ [
1020
+ "fn",
1021
+ [
1022
+ "i"
1023
+ ],
1024
+ [
1025
+ "let",
1026
+ [
1027
+ [
1028
+ "r",
1029
+ [
1030
+ "math/floor",
1031
+ [
1032
+ "/",
1033
+ "@i",
1034
+ "@config.cols"
1035
+ ]
1036
+ ]
1037
+ ],
1038
+ [
1039
+ "c",
1040
+ [
1041
+ "math/mod",
1042
+ "@i",
1043
+ "@config.cols"
1044
+ ]
1045
+ ],
1046
+ [
1047
+ "v",
1048
+ [
1049
+ "array/nth",
1050
+ "@entity.cells",
1051
+ "@i"
1052
+ ]
1053
+ ],
1054
+ [
1055
+ "cellColor",
1056
+ [
1057
+ "if",
1058
+ [
1059
+ ">",
1060
+ "@v",
1061
+ 0.66
1062
+ ],
1063
+ "@config.onColor",
1064
+ [
1065
+ "if",
1066
+ [
1067
+ ">",
1068
+ "@v",
1069
+ 0.33
1070
+ ],
1071
+ "@config.midColor",
1072
+ [
1073
+ "if",
1074
+ [
1075
+ ">",
1076
+ "@v",
1077
+ 0.05
1078
+ ],
1079
+ "@config.lowColor",
1080
+ "@config.offColor"
1081
+ ]
1082
+ ]
1083
+ ]
1084
+ ]
1085
+ ],
1086
+ {
1087
+ "color": "@cellColor",
1088
+ "fill": "@cellColor",
1089
+ "height": [
1090
+ "-",
1091
+ "@config.cellSize",
1092
+ 2.0
1093
+ ],
1094
+ "id": [
1095
+ "str/concat",
1096
+ "cell-",
1097
+ "@i"
1098
+ ],
1099
+ "type": "rect",
1100
+ "width": [
1101
+ "-",
1102
+ "@config.cellSize",
1103
+ 2.0
1104
+ ],
1105
+ "x": [
1106
+ "+",
1107
+ 10.0,
1108
+ [
1109
+ "*",
1110
+ "@c",
1111
+ "@config.cellSize"
1112
+ ]
1113
+ ],
1114
+ "y": [
1115
+ "+",
1116
+ 10.0,
1117
+ [
1118
+ "*",
1119
+ "@r",
1120
+ "@config.cellSize"
1121
+ ]
1122
+ ]
1123
+ }
1124
+ ]
1125
+ ]
1126
+ ]
1127
+ ],
1128
+ [
1129
+ "render-ui",
1130
+ "main",
1131
+ {
1132
+ "children": [
1133
+ {
1134
+ "children": [
1135
+ {
1136
+ "content": "@entity.title",
1137
+ "type": "typography",
1138
+ "variant": "h4"
1139
+ },
1140
+ {
1141
+ "content": "@config.taskText",
1142
+ "type": "typography",
1143
+ "variant": "body"
1144
+ },
1145
+ {
1146
+ "children": [
1147
+ {
1148
+ "action": "RUN",
1149
+ "disabled": [
1150
+ "if",
1151
+ "@entity.running",
1152
+ true,
1153
+ false
1154
+ ],
1155
+ "label": "Run",
1156
+ "type": "button",
1157
+ "variant": "primary"
1158
+ },
1159
+ {
1160
+ "action": "PAUSE",
1161
+ "disabled": [
1162
+ "if",
1163
+ "@entity.running",
1164
+ false,
1165
+ true
1166
+ ],
1167
+ "label": "Pause",
1168
+ "type": "button",
1169
+ "variant": "secondary"
1170
+ },
1171
+ {
1172
+ "action": "STEP",
1173
+ "disabled": [
1174
+ "if",
1175
+ "@entity.running",
1176
+ true,
1177
+ false
1178
+ ],
1179
+ "label": "@config.stepLabel",
1180
+ "type": "button",
1181
+ "variant": "secondary"
1182
+ },
1183
+ {
1184
+ "action": "RESET",
1185
+ "label": "Reset",
1186
+ "type": "button",
1187
+ "variant": "ghost"
1188
+ }
1189
+ ],
1190
+ "direction": "horizontal",
1191
+ "gap": "sm",
1192
+ "type": "stack"
1193
+ },
1194
+ {
1195
+ "animate": false,
1196
+ "backgroundColor": "@config.backgroundColor",
1197
+ "height": "@config.height",
1198
+ "interactive": true,
1199
+ "onShapeClick": "TAP_CELL",
1200
+ "shapes": "@entity.cellShapes",
1201
+ "type": "learning-canvas",
1202
+ "width": "@config.width"
1203
+ },
1204
+ {
1205
+ "content": [
1206
+ "str/concat",
1207
+ "Generation ",
1208
+ [
1209
+ "str/concat",
1210
+ "",
1211
+ "@entity.generation"
1212
+ ],
1213
+ " · active cells: ",
1214
+ [
1215
+ "str/concat",
1216
+ "",
1217
+ "@entity.aliveCount"
1218
+ ]
1219
+ ],
1220
+ "type": "typography",
1221
+ "variant": "body"
1222
+ }
1223
+ ],
1224
+ "direction": "vertical",
1225
+ "gap": "md",
1226
+ "type": "stack"
1227
+ }
1228
+ ],
1229
+ "padding": "md",
1230
+ "type": "box"
1231
+ }
1232
+ ]
1233
+ ],
1234
+ "event": "MODE_SELECTED",
1235
+ "eventId": "evt_01M07580Z4ZBCV8MXBRY5824Z6",
1236
+ "from": "idle",
1237
+ "guard": [
1238
+ "==",
1239
+ "@payload.mode",
1240
+ "@config.matchMode"
1241
+ ],
1242
+ "to": "idle"
1243
+ },
1244
+ {
1245
+ "effects": [
1246
+ [
1247
+ "set",
1248
+ "@entity.running",
1249
+ true
1250
+ ],
1251
+ [
1252
+ "render-ui",
1253
+ "main",
1254
+ {
1255
+ "children": [
1256
+ {
1257
+ "children": [
1258
+ {
1259
+ "content": "@entity.title",
1260
+ "type": "typography",
1261
+ "variant": "h4"
1262
+ },
1263
+ {
1264
+ "content": "@config.taskText",
1265
+ "type": "typography",
1266
+ "variant": "body"
1267
+ },
1268
+ {
1269
+ "children": [
1270
+ {
1271
+ "action": "RUN",
1272
+ "disabled": [
1273
+ "if",
1274
+ "@entity.running",
1275
+ true,
1276
+ false
1277
+ ],
1278
+ "label": "Run",
1279
+ "type": "button",
1280
+ "variant": "primary"
1281
+ },
1282
+ {
1283
+ "action": "PAUSE",
1284
+ "disabled": [
1285
+ "if",
1286
+ "@entity.running",
1287
+ false,
1288
+ true
1289
+ ],
1290
+ "label": "Pause",
1291
+ "type": "button",
1292
+ "variant": "secondary"
1293
+ },
1294
+ {
1295
+ "action": "STEP",
1296
+ "disabled": [
1297
+ "if",
1298
+ "@entity.running",
1299
+ true,
1300
+ false
1301
+ ],
1302
+ "label": "@config.stepLabel",
1303
+ "type": "button",
1304
+ "variant": "secondary"
1305
+ },
1306
+ {
1307
+ "action": "RESET",
1308
+ "label": "Reset",
1309
+ "type": "button",
1310
+ "variant": "ghost"
1311
+ }
1312
+ ],
1313
+ "direction": "horizontal",
1314
+ "gap": "sm",
1315
+ "type": "stack"
1316
+ },
1317
+ {
1318
+ "animate": false,
1319
+ "backgroundColor": "@config.backgroundColor",
1320
+ "height": "@config.height",
1321
+ "interactive": true,
1322
+ "onShapeClick": "TAP_CELL",
1323
+ "shapes": "@entity.cellShapes",
1324
+ "type": "learning-canvas",
1325
+ "width": "@config.width"
1326
+ },
1327
+ {
1328
+ "content": [
1329
+ "str/concat",
1330
+ "Generation ",
1331
+ [
1332
+ "str/concat",
1333
+ "",
1334
+ "@entity.generation"
1335
+ ],
1336
+ " · active cells: ",
1337
+ [
1338
+ "str/concat",
1339
+ "",
1340
+ "@entity.aliveCount"
1341
+ ]
1342
+ ],
1343
+ "type": "typography",
1344
+ "variant": "body"
1345
+ }
1346
+ ],
1347
+ "direction": "vertical",
1348
+ "gap": "md",
1349
+ "type": "stack"
1350
+ }
1351
+ ],
1352
+ "padding": "md",
1353
+ "type": "box"
1354
+ }
1355
+ ],
1356
+ [
1357
+ "emit",
1358
+ "RUN_TOGGLED",
1359
+ {
1360
+ "running": "@entity.running"
1361
+ }
1362
+ ]
1363
+ ],
1364
+ "event": "RUN",
1365
+ "eventId": "evt_01M07580Z4AKJB3934MXE7S8SQ",
1366
+ "from": "idle",
1367
+ "guard": [
1368
+ "and",
1369
+ [
1370
+ "==",
1371
+ "@entity.active",
1372
+ true
1373
+ ],
1374
+ [
1375
+ "==",
1376
+ "@entity.running",
1377
+ false
1378
+ ]
1379
+ ],
1380
+ "to": "idle"
1381
+ },
1382
+ {
1383
+ "effects": [
1384
+ [
1385
+ "set",
1386
+ "@entity.running",
1387
+ false
1388
+ ],
1389
+ [
1390
+ "render-ui",
1391
+ "main",
1392
+ {
1393
+ "children": [
1394
+ {
1395
+ "children": [
1396
+ {
1397
+ "content": "@entity.title",
1398
+ "type": "typography",
1399
+ "variant": "h4"
1400
+ },
1401
+ {
1402
+ "content": "@config.taskText",
1403
+ "type": "typography",
1404
+ "variant": "body"
1405
+ },
1406
+ {
1407
+ "children": [
1408
+ {
1409
+ "action": "RUN",
1410
+ "disabled": [
1411
+ "if",
1412
+ "@entity.running",
1413
+ true,
1414
+ false
1415
+ ],
1416
+ "label": "Run",
1417
+ "type": "button",
1418
+ "variant": "primary"
1419
+ },
1420
+ {
1421
+ "action": "PAUSE",
1422
+ "disabled": [
1423
+ "if",
1424
+ "@entity.running",
1425
+ false,
1426
+ true
1427
+ ],
1428
+ "label": "Pause",
1429
+ "type": "button",
1430
+ "variant": "secondary"
1431
+ },
1432
+ {
1433
+ "action": "STEP",
1434
+ "disabled": [
1435
+ "if",
1436
+ "@entity.running",
1437
+ true,
1438
+ false
1439
+ ],
1440
+ "label": "@config.stepLabel",
1441
+ "type": "button",
1442
+ "variant": "secondary"
1443
+ },
1444
+ {
1445
+ "action": "RESET",
1446
+ "label": "Reset",
1447
+ "type": "button",
1448
+ "variant": "ghost"
1449
+ }
1450
+ ],
1451
+ "direction": "horizontal",
1452
+ "gap": "sm",
1453
+ "type": "stack"
1454
+ },
1455
+ {
1456
+ "animate": false,
1457
+ "backgroundColor": "@config.backgroundColor",
1458
+ "height": "@config.height",
1459
+ "interactive": true,
1460
+ "onShapeClick": "TAP_CELL",
1461
+ "shapes": "@entity.cellShapes",
1462
+ "type": "learning-canvas",
1463
+ "width": "@config.width"
1464
+ },
1465
+ {
1466
+ "content": [
1467
+ "str/concat",
1468
+ "Generation ",
1469
+ [
1470
+ "str/concat",
1471
+ "",
1472
+ "@entity.generation"
1473
+ ],
1474
+ " · active cells: ",
1475
+ [
1476
+ "str/concat",
1477
+ "",
1478
+ "@entity.aliveCount"
1479
+ ]
1480
+ ],
1481
+ "type": "typography",
1482
+ "variant": "body"
1483
+ }
1484
+ ],
1485
+ "direction": "vertical",
1486
+ "gap": "md",
1487
+ "type": "stack"
1488
+ }
1489
+ ],
1490
+ "padding": "md",
1491
+ "type": "box"
1492
+ }
1493
+ ],
1494
+ [
1495
+ "emit",
1496
+ "RUN_TOGGLED",
1497
+ {
1498
+ "running": "@entity.running"
1499
+ }
1500
+ ]
1501
+ ],
1502
+ "event": "PAUSE",
1503
+ "eventId": "evt_01M07580Z4SY527GW89VRZRM77",
1504
+ "from": "idle",
1505
+ "guard": [
1506
+ "and",
1507
+ [
1508
+ "==",
1509
+ "@entity.active",
1510
+ true
1511
+ ],
1512
+ [
1513
+ "==",
1514
+ "@entity.running",
1515
+ true
1516
+ ]
1517
+ ],
1518
+ "to": "idle"
1519
+ },
1520
+ {
1521
+ "effects": [
1522
+ [
1523
+ "set",
1524
+ "@entity.cells",
1525
+ [
1526
+ "array/map",
1527
+ [
1528
+ "array/range",
1529
+ 0.0,
1530
+ [
1531
+ "*",
1532
+ "@config.rows",
1533
+ "@config.cols"
1534
+ ]
1535
+ ],
1536
+ [
1537
+ "fn",
1538
+ [
1539
+ "i"
1540
+ ],
1541
+ [
1542
+ "let",
1543
+ [
1544
+ [
1545
+ "r",
1546
+ [
1547
+ "math/floor",
1548
+ [
1549
+ "/",
1550
+ "@i",
1551
+ "@config.cols"
1552
+ ]
1553
+ ]
1554
+ ],
1555
+ [
1556
+ "c",
1557
+ [
1558
+ "math/mod",
1559
+ "@i",
1560
+ "@config.cols"
1561
+ ]
1562
+ ],
1563
+ [
1564
+ "v",
1565
+ [
1566
+ "array/nth",
1567
+ "@entity.cells",
1568
+ "@i"
1569
+ ]
1570
+ ],
1571
+ [
1572
+ "up",
1573
+ [
1574
+ "if",
1575
+ [
1576
+ ">",
1577
+ "@r",
1578
+ 0.0
1579
+ ],
1580
+ [
1581
+ "array/nth",
1582
+ "@entity.cells",
1583
+ [
1584
+ "-",
1585
+ "@i",
1586
+ "@config.cols"
1587
+ ]
1588
+ ],
1589
+ 0.0
1590
+ ]
1591
+ ],
1592
+ [
1593
+ "down",
1594
+ [
1595
+ "if",
1596
+ [
1597
+ "<",
1598
+ "@r",
1599
+ [
1600
+ "-",
1601
+ "@config.rows",
1602
+ 1.0
1603
+ ]
1604
+ ],
1605
+ [
1606
+ "array/nth",
1607
+ "@entity.cells",
1608
+ [
1609
+ "+",
1610
+ "@i",
1611
+ "@config.cols"
1612
+ ]
1613
+ ],
1614
+ 0.0
1615
+ ]
1616
+ ],
1617
+ [
1618
+ "left",
1619
+ [
1620
+ "if",
1621
+ [
1622
+ ">",
1623
+ "@c",
1624
+ 0.0
1625
+ ],
1626
+ [
1627
+ "array/nth",
1628
+ "@entity.cells",
1629
+ [
1630
+ "-",
1631
+ "@i",
1632
+ 1.0
1633
+ ]
1634
+ ],
1635
+ 0.0
1636
+ ]
1637
+ ],
1638
+ [
1639
+ "right",
1640
+ [
1641
+ "if",
1642
+ [
1643
+ "<",
1644
+ "@c",
1645
+ [
1646
+ "-",
1647
+ "@config.cols",
1648
+ 1.0
1649
+ ]
1650
+ ],
1651
+ [
1652
+ "array/nth",
1653
+ "@entity.cells",
1654
+ [
1655
+ "+",
1656
+ "@i",
1657
+ 1.0
1658
+ ]
1659
+ ],
1660
+ 0.0
1661
+ ]
1662
+ ],
1663
+ [
1664
+ "ul",
1665
+ [
1666
+ "if",
1667
+ [
1668
+ "and",
1669
+ [
1670
+ ">",
1671
+ "@r",
1672
+ 0.0
1673
+ ],
1674
+ [
1675
+ ">",
1676
+ "@c",
1677
+ 0.0
1678
+ ]
1679
+ ],
1680
+ [
1681
+ "array/nth",
1682
+ "@entity.cells",
1683
+ [
1684
+ "-",
1685
+ [
1686
+ "-",
1687
+ "@i",
1688
+ "@config.cols"
1689
+ ],
1690
+ 1.0
1691
+ ]
1692
+ ],
1693
+ 0.0
1694
+ ]
1695
+ ],
1696
+ [
1697
+ "ur",
1698
+ [
1699
+ "if",
1700
+ [
1701
+ "and",
1702
+ [
1703
+ ">",
1704
+ "@r",
1705
+ 0.0
1706
+ ],
1707
+ [
1708
+ "<",
1709
+ "@c",
1710
+ [
1711
+ "-",
1712
+ "@config.cols",
1713
+ 1.0
1714
+ ]
1715
+ ]
1716
+ ],
1717
+ [
1718
+ "array/nth",
1719
+ "@entity.cells",
1720
+ [
1721
+ "+",
1722
+ [
1723
+ "-",
1724
+ "@i",
1725
+ "@config.cols"
1726
+ ],
1727
+ 1.0
1728
+ ]
1729
+ ],
1730
+ 0.0
1731
+ ]
1732
+ ],
1733
+ [
1734
+ "dl",
1735
+ [
1736
+ "if",
1737
+ [
1738
+ "and",
1739
+ [
1740
+ "<",
1741
+ "@r",
1742
+ [
1743
+ "-",
1744
+ "@config.rows",
1745
+ 1.0
1746
+ ]
1747
+ ],
1748
+ [
1749
+ ">",
1750
+ "@c",
1751
+ 0.0
1752
+ ]
1753
+ ],
1754
+ [
1755
+ "array/nth",
1756
+ "@entity.cells",
1757
+ [
1758
+ "-",
1759
+ [
1760
+ "+",
1761
+ "@i",
1762
+ "@config.cols"
1763
+ ],
1764
+ 1.0
1765
+ ]
1766
+ ],
1767
+ 0.0
1768
+ ]
1769
+ ],
1770
+ [
1771
+ "dr",
1772
+ [
1773
+ "if",
1774
+ [
1775
+ "and",
1776
+ [
1777
+ "<",
1778
+ "@r",
1779
+ [
1780
+ "-",
1781
+ "@config.rows",
1782
+ 1.0
1783
+ ]
1784
+ ],
1785
+ [
1786
+ "<",
1787
+ "@c",
1788
+ [
1789
+ "-",
1790
+ "@config.cols",
1791
+ 1.0
1792
+ ]
1793
+ ]
1794
+ ],
1795
+ [
1796
+ "array/nth",
1797
+ "@entity.cells",
1798
+ [
1799
+ "+",
1800
+ "@i",
1801
+ "@config.cols",
1802
+ 1.0
1803
+ ]
1804
+ ],
1805
+ 0.0
1806
+ ]
1807
+ ],
1808
+ [
1809
+ "n4",
1810
+ [
1811
+ "+",
1812
+ "@up",
1813
+ "@down",
1814
+ "@left",
1815
+ "@right"
1816
+ ]
1817
+ ],
1818
+ [
1819
+ "n8",
1820
+ [
1821
+ "+",
1822
+ "@n4",
1823
+ "@ul",
1824
+ "@ur",
1825
+ "@dl",
1826
+ "@dr"
1827
+ ]
1828
+ ]
1829
+ ],
1830
+ [
1831
+ "if",
1832
+ [
1833
+ "==",
1834
+ "@config.rule",
1835
+ "life"
1836
+ ],
1837
+ [
1838
+ "if",
1839
+ [
1840
+ "if",
1841
+ [
1842
+ ">",
1843
+ "@v",
1844
+ 0.5
1845
+ ],
1846
+ [
1847
+ "if",
1848
+ [
1849
+ "==",
1850
+ [
1851
+ "math/round",
1852
+ "@n8",
1853
+ 0.0
1854
+ ],
1855
+ 2.0
1856
+ ],
1857
+ true,
1858
+ [
1859
+ "==",
1860
+ [
1861
+ "math/round",
1862
+ "@n8",
1863
+ 0.0
1864
+ ],
1865
+ 3.0
1866
+ ]
1867
+ ],
1868
+ [
1869
+ "==",
1870
+ [
1871
+ "math/round",
1872
+ "@n8",
1873
+ 0.0
1874
+ ],
1875
+ 3.0
1876
+ ]
1877
+ ],
1878
+ 1.0,
1879
+ 0.0
1880
+ ],
1881
+ [
1882
+ "if",
1883
+ [
1884
+ "==",
1885
+ "@config.rule",
1886
+ "spread"
1887
+ ],
1888
+ [
1889
+ "if",
1890
+ [
1891
+ "if",
1892
+ [
1893
+ ">",
1894
+ "@v",
1895
+ 0.5
1896
+ ],
1897
+ true,
1898
+ [
1899
+ ">",
1900
+ "@n4",
1901
+ 0.5
1902
+ ]
1903
+ ],
1904
+ 1.0,
1905
+ 0.0
1906
+ ],
1907
+ [
1908
+ "math/max",
1909
+ 0.0,
1910
+ [
1911
+ "*",
1912
+ "@config.decay",
1913
+ [
1914
+ "+",
1915
+ "@v",
1916
+ [
1917
+ "*",
1918
+ "@config.diffuseRate",
1919
+ [
1920
+ "-",
1921
+ [
1922
+ "/",
1923
+ "@n4",
1924
+ 4.0
1925
+ ],
1926
+ "@v"
1927
+ ]
1928
+ ]
1929
+ ]
1930
+ ]
1931
+ ]
1932
+ ]
1933
+ ]
1934
+ ]
1935
+ ]
1936
+ ]
1937
+ ],
1938
+ [
1939
+ "set",
1940
+ "@entity.generation",
1941
+ [
1942
+ "+",
1943
+ "@entity.generation",
1944
+ 1.0
1945
+ ]
1946
+ ],
1947
+ [
1948
+ "set",
1949
+ "@entity.aliveCount",
1950
+ [
1951
+ "array/len",
1952
+ [
1953
+ "array/filter",
1954
+ "@entity.cells",
1955
+ [
1956
+ "fn",
1957
+ "v",
1958
+ [
1959
+ ">",
1960
+ "@v",
1961
+ 0.05
1962
+ ]
1963
+ ]
1964
+ ]
1965
+ ]
1966
+ ],
1967
+ [
1968
+ "set",
1969
+ "@entity.cellShapes",
1970
+ [
1971
+ "array/map",
1972
+ [
1973
+ "array/range",
1974
+ 0.0,
1975
+ [
1976
+ "*",
1977
+ "@config.rows",
1978
+ "@config.cols"
1979
+ ]
1980
+ ],
1981
+ [
1982
+ "fn",
1983
+ [
1984
+ "i"
1985
+ ],
1986
+ [
1987
+ "let",
1988
+ [
1989
+ [
1990
+ "r",
1991
+ [
1992
+ "math/floor",
1993
+ [
1994
+ "/",
1995
+ "@i",
1996
+ "@config.cols"
1997
+ ]
1998
+ ]
1999
+ ],
2000
+ [
2001
+ "c",
2002
+ [
2003
+ "math/mod",
2004
+ "@i",
2005
+ "@config.cols"
2006
+ ]
2007
+ ],
2008
+ [
2009
+ "v",
2010
+ [
2011
+ "array/nth",
2012
+ "@entity.cells",
2013
+ "@i"
2014
+ ]
2015
+ ],
2016
+ [
2017
+ "cellColor",
2018
+ [
2019
+ "if",
2020
+ [
2021
+ ">",
2022
+ "@v",
2023
+ 0.66
2024
+ ],
2025
+ "@config.onColor",
2026
+ [
2027
+ "if",
2028
+ [
2029
+ ">",
2030
+ "@v",
2031
+ 0.33
2032
+ ],
2033
+ "@config.midColor",
2034
+ [
2035
+ "if",
2036
+ [
2037
+ ">",
2038
+ "@v",
2039
+ 0.05
2040
+ ],
2041
+ "@config.lowColor",
2042
+ "@config.offColor"
2043
+ ]
2044
+ ]
2045
+ ]
2046
+ ]
2047
+ ],
2048
+ {
2049
+ "color": "@cellColor",
2050
+ "fill": "@cellColor",
2051
+ "height": [
2052
+ "-",
2053
+ "@config.cellSize",
2054
+ 2.0
2055
+ ],
2056
+ "id": [
2057
+ "str/concat",
2058
+ "cell-",
2059
+ "@i"
2060
+ ],
2061
+ "type": "rect",
2062
+ "width": [
2063
+ "-",
2064
+ "@config.cellSize",
2065
+ 2.0
2066
+ ],
2067
+ "x": [
2068
+ "+",
2069
+ 10.0,
2070
+ [
2071
+ "*",
2072
+ "@c",
2073
+ "@config.cellSize"
2074
+ ]
2075
+ ],
2076
+ "y": [
2077
+ "+",
2078
+ 10.0,
2079
+ [
2080
+ "*",
2081
+ "@r",
2082
+ "@config.cellSize"
2083
+ ]
2084
+ ]
2085
+ }
2086
+ ]
2087
+ ]
2088
+ ]
2089
+ ],
2090
+ [
2091
+ "render-ui",
2092
+ "main",
2093
+ {
2094
+ "children": [
2095
+ {
2096
+ "children": [
2097
+ {
2098
+ "content": "@entity.title",
2099
+ "type": "typography",
2100
+ "variant": "h4"
2101
+ },
2102
+ {
2103
+ "content": "@config.taskText",
2104
+ "type": "typography",
2105
+ "variant": "body"
2106
+ },
2107
+ {
2108
+ "children": [
2109
+ {
2110
+ "action": "RUN",
2111
+ "disabled": [
2112
+ "if",
2113
+ "@entity.running",
2114
+ true,
2115
+ false
2116
+ ],
2117
+ "label": "Run",
2118
+ "type": "button",
2119
+ "variant": "primary"
2120
+ },
2121
+ {
2122
+ "action": "PAUSE",
2123
+ "disabled": [
2124
+ "if",
2125
+ "@entity.running",
2126
+ false,
2127
+ true
2128
+ ],
2129
+ "label": "Pause",
2130
+ "type": "button",
2131
+ "variant": "secondary"
2132
+ },
2133
+ {
2134
+ "action": "STEP",
2135
+ "disabled": [
2136
+ "if",
2137
+ "@entity.running",
2138
+ true,
2139
+ false
2140
+ ],
2141
+ "label": "@config.stepLabel",
2142
+ "type": "button",
2143
+ "variant": "secondary"
2144
+ },
2145
+ {
2146
+ "action": "RESET",
2147
+ "label": "Reset",
2148
+ "type": "button",
2149
+ "variant": "ghost"
2150
+ }
2151
+ ],
2152
+ "direction": "horizontal",
2153
+ "gap": "sm",
2154
+ "type": "stack"
2155
+ },
2156
+ {
2157
+ "animate": false,
2158
+ "backgroundColor": "@config.backgroundColor",
2159
+ "height": "@config.height",
2160
+ "interactive": true,
2161
+ "onShapeClick": "TAP_CELL",
2162
+ "shapes": "@entity.cellShapes",
2163
+ "type": "learning-canvas",
2164
+ "width": "@config.width"
2165
+ },
2166
+ {
2167
+ "content": [
2168
+ "str/concat",
2169
+ "Generation ",
2170
+ [
2171
+ "str/concat",
2172
+ "",
2173
+ "@entity.generation"
2174
+ ],
2175
+ " · active cells: ",
2176
+ [
2177
+ "str/concat",
2178
+ "",
2179
+ "@entity.aliveCount"
2180
+ ]
2181
+ ],
2182
+ "type": "typography",
2183
+ "variant": "body"
2184
+ }
2185
+ ],
2186
+ "direction": "vertical",
2187
+ "gap": "md",
2188
+ "type": "stack"
2189
+ }
2190
+ ],
2191
+ "padding": "md",
2192
+ "type": "box"
2193
+ }
2194
+ ],
2195
+ [
2196
+ "emit",
2197
+ "GRID_STEPPED",
2198
+ {
2199
+ "aliveCount": "@entity.aliveCount",
2200
+ "generation": "@entity.generation"
2201
+ }
2202
+ ]
2203
+ ],
2204
+ "event": "STEP",
2205
+ "eventId": "evt_01M07580Z46A409AK5X875SRW8",
2206
+ "from": "idle",
2207
+ "guard": [
2208
+ "and",
2209
+ [
2210
+ "==",
2211
+ "@entity.active",
2212
+ true
2213
+ ],
2214
+ [
2215
+ "==",
2216
+ "@entity.running",
2217
+ false
2218
+ ]
2219
+ ],
2220
+ "to": "idle"
2221
+ },
2222
+ {
2223
+ "effects": [
2224
+ [
2225
+ "set",
2226
+ "@entity.cells",
2227
+ [
2228
+ "array/map",
2229
+ [
2230
+ "array/range",
2231
+ 0.0,
2232
+ [
2233
+ "*",
2234
+ "@config.rows",
2235
+ "@config.cols"
2236
+ ]
2237
+ ],
2238
+ [
2239
+ "fn",
2240
+ [
2241
+ "j"
2242
+ ],
2243
+ [
2244
+ "if",
2245
+ [
2246
+ "==",
2247
+ "@j",
2248
+ [
2249
+ "object/get",
2250
+ "@payload.payload",
2251
+ "index"
2252
+ ]
2253
+ ],
2254
+ [
2255
+ "if",
2256
+ [
2257
+ ">",
2258
+ [
2259
+ "array/nth",
2260
+ "@entity.cells",
2261
+ "@j"
2262
+ ],
2263
+ 0.5
2264
+ ],
2265
+ 0.0,
2266
+ 1.0
2267
+ ],
2268
+ [
2269
+ "array/nth",
2270
+ "@entity.cells",
2271
+ "@j"
2272
+ ]
2273
+ ]
2274
+ ]
2275
+ ]
2276
+ ],
2277
+ [
2278
+ "set",
2279
+ "@entity.aliveCount",
2280
+ [
2281
+ "array/len",
2282
+ [
2283
+ "array/filter",
2284
+ "@entity.cells",
2285
+ [
2286
+ "fn",
2287
+ "v",
2288
+ [
2289
+ ">",
2290
+ "@v",
2291
+ 0.05
2292
+ ]
2293
+ ]
2294
+ ]
2295
+ ]
2296
+ ],
2297
+ [
2298
+ "set",
2299
+ "@entity.cellShapes",
2300
+ [
2301
+ "array/map",
2302
+ [
2303
+ "array/range",
2304
+ 0.0,
2305
+ [
2306
+ "*",
2307
+ "@config.rows",
2308
+ "@config.cols"
2309
+ ]
2310
+ ],
2311
+ [
2312
+ "fn",
2313
+ [
2314
+ "i"
2315
+ ],
2316
+ [
2317
+ "let",
2318
+ [
2319
+ [
2320
+ "r",
2321
+ [
2322
+ "math/floor",
2323
+ [
2324
+ "/",
2325
+ "@i",
2326
+ "@config.cols"
2327
+ ]
2328
+ ]
2329
+ ],
2330
+ [
2331
+ "c",
2332
+ [
2333
+ "math/mod",
2334
+ "@i",
2335
+ "@config.cols"
2336
+ ]
2337
+ ],
2338
+ [
2339
+ "v",
2340
+ [
2341
+ "array/nth",
2342
+ "@entity.cells",
2343
+ "@i"
2344
+ ]
2345
+ ],
2346
+ [
2347
+ "cellColor",
2348
+ [
2349
+ "if",
2350
+ [
2351
+ ">",
2352
+ "@v",
2353
+ 0.66
2354
+ ],
2355
+ "@config.onColor",
2356
+ [
2357
+ "if",
2358
+ [
2359
+ ">",
2360
+ "@v",
2361
+ 0.33
2362
+ ],
2363
+ "@config.midColor",
2364
+ [
2365
+ "if",
2366
+ [
2367
+ ">",
2368
+ "@v",
2369
+ 0.05
2370
+ ],
2371
+ "@config.lowColor",
2372
+ "@config.offColor"
2373
+ ]
2374
+ ]
2375
+ ]
2376
+ ]
2377
+ ],
2378
+ {
2379
+ "color": "@cellColor",
2380
+ "fill": "@cellColor",
2381
+ "height": [
2382
+ "-",
2383
+ "@config.cellSize",
2384
+ 2.0
2385
+ ],
2386
+ "id": [
2387
+ "str/concat",
2388
+ "cell-",
2389
+ "@i"
2390
+ ],
2391
+ "type": "rect",
2392
+ "width": [
2393
+ "-",
2394
+ "@config.cellSize",
2395
+ 2.0
2396
+ ],
2397
+ "x": [
2398
+ "+",
2399
+ 10.0,
2400
+ [
2401
+ "*",
2402
+ "@c",
2403
+ "@config.cellSize"
2404
+ ]
2405
+ ],
2406
+ "y": [
2407
+ "+",
2408
+ 10.0,
2409
+ [
2410
+ "*",
2411
+ "@r",
2412
+ "@config.cellSize"
2413
+ ]
2414
+ ]
2415
+ }
2416
+ ]
2417
+ ]
2418
+ ]
2419
+ ],
2420
+ [
2421
+ "render-ui",
2422
+ "main",
2423
+ {
2424
+ "children": [
2425
+ {
2426
+ "children": [
2427
+ {
2428
+ "content": "@entity.title",
2429
+ "type": "typography",
2430
+ "variant": "h4"
2431
+ },
2432
+ {
2433
+ "content": "@config.taskText",
2434
+ "type": "typography",
2435
+ "variant": "body"
2436
+ },
2437
+ {
2438
+ "children": [
2439
+ {
2440
+ "action": "RUN",
2441
+ "disabled": [
2442
+ "if",
2443
+ "@entity.running",
2444
+ true,
2445
+ false
2446
+ ],
2447
+ "label": "Run",
2448
+ "type": "button",
2449
+ "variant": "primary"
2450
+ },
2451
+ {
2452
+ "action": "PAUSE",
2453
+ "disabled": [
2454
+ "if",
2455
+ "@entity.running",
2456
+ false,
2457
+ true
2458
+ ],
2459
+ "label": "Pause",
2460
+ "type": "button",
2461
+ "variant": "secondary"
2462
+ },
2463
+ {
2464
+ "action": "STEP",
2465
+ "disabled": [
2466
+ "if",
2467
+ "@entity.running",
2468
+ true,
2469
+ false
2470
+ ],
2471
+ "label": "@config.stepLabel",
2472
+ "type": "button",
2473
+ "variant": "secondary"
2474
+ },
2475
+ {
2476
+ "action": "RESET",
2477
+ "label": "Reset",
2478
+ "type": "button",
2479
+ "variant": "ghost"
2480
+ }
2481
+ ],
2482
+ "direction": "horizontal",
2483
+ "gap": "sm",
2484
+ "type": "stack"
2485
+ },
2486
+ {
2487
+ "animate": false,
2488
+ "backgroundColor": "@config.backgroundColor",
2489
+ "height": "@config.height",
2490
+ "interactive": true,
2491
+ "onShapeClick": "TAP_CELL",
2492
+ "shapes": "@entity.cellShapes",
2493
+ "type": "learning-canvas",
2494
+ "width": "@config.width"
2495
+ },
2496
+ {
2497
+ "content": [
2498
+ "str/concat",
2499
+ "Generation ",
2500
+ [
2501
+ "str/concat",
2502
+ "",
2503
+ "@entity.generation"
2504
+ ],
2505
+ " · active cells: ",
2506
+ [
2507
+ "str/concat",
2508
+ "",
2509
+ "@entity.aliveCount"
2510
+ ]
2511
+ ],
2512
+ "type": "typography",
2513
+ "variant": "body"
2514
+ }
2515
+ ],
2516
+ "direction": "vertical",
2517
+ "gap": "md",
2518
+ "type": "stack"
2519
+ }
2520
+ ],
2521
+ "padding": "md",
2522
+ "type": "box"
2523
+ }
2524
+ ],
2525
+ [
2526
+ "emit",
2527
+ "CELL_TOGGLED",
2528
+ {
2529
+ "aliveCount": "@entity.aliveCount",
2530
+ "index": [
2531
+ "object/get",
2532
+ "@payload.payload",
2533
+ "index"
2534
+ ]
2535
+ }
2536
+ ]
2537
+ ],
2538
+ "event": "TAP_CELL",
2539
+ "eventId": "evt_01M07580Z41VWS89NNN7YDX34F",
2540
+ "from": "idle",
2541
+ "guard": [
2542
+ "==",
2543
+ "@entity.active",
2544
+ true
2545
+ ],
2546
+ "to": "idle"
2547
+ },
2548
+ {
2549
+ "effects": [
2550
+ [
2551
+ "set",
2552
+ "@entity.generation",
2553
+ 0.0
2554
+ ],
2555
+ [
2556
+ "set",
2557
+ "@entity.running",
2558
+ false
2559
+ ],
2560
+ [
2561
+ "set",
2562
+ "@entity.cells",
2563
+ [
2564
+ "array/map",
2565
+ [
2566
+ "array/range",
2567
+ 0.0,
2568
+ [
2569
+ "*",
2570
+ "@config.rows",
2571
+ "@config.cols"
2572
+ ]
2573
+ ],
2574
+ [
2575
+ "fn",
2576
+ [
2577
+ "i"
2578
+ ],
2579
+ [
2580
+ "if",
2581
+ [
2582
+ "array/includes",
2583
+ "@config.seeds",
2584
+ "@i"
2585
+ ],
2586
+ 1.0,
2587
+ 0.0
2588
+ ]
2589
+ ]
2590
+ ]
2591
+ ],
2592
+ [
2593
+ "set",
2594
+ "@entity.aliveCount",
2595
+ [
2596
+ "array/len",
2597
+ [
2598
+ "array/filter",
2599
+ "@entity.cells",
2600
+ [
2601
+ "fn",
2602
+ "v",
2603
+ [
2604
+ ">",
2605
+ "@v",
2606
+ 0.05
2607
+ ]
2608
+ ]
2609
+ ]
2610
+ ]
2611
+ ],
2612
+ [
2613
+ "set",
2614
+ "@entity.cellShapes",
2615
+ [
2616
+ "array/map",
2617
+ [
2618
+ "array/range",
2619
+ 0.0,
2620
+ [
2621
+ "*",
2622
+ "@config.rows",
2623
+ "@config.cols"
2624
+ ]
2625
+ ],
2626
+ [
2627
+ "fn",
2628
+ [
2629
+ "i"
2630
+ ],
2631
+ [
2632
+ "let",
2633
+ [
2634
+ [
2635
+ "r",
2636
+ [
2637
+ "math/floor",
2638
+ [
2639
+ "/",
2640
+ "@i",
2641
+ "@config.cols"
2642
+ ]
2643
+ ]
2644
+ ],
2645
+ [
2646
+ "c",
2647
+ [
2648
+ "math/mod",
2649
+ "@i",
2650
+ "@config.cols"
2651
+ ]
2652
+ ],
2653
+ [
2654
+ "v",
2655
+ [
2656
+ "array/nth",
2657
+ "@entity.cells",
2658
+ "@i"
2659
+ ]
2660
+ ],
2661
+ [
2662
+ "cellColor",
2663
+ [
2664
+ "if",
2665
+ [
2666
+ ">",
2667
+ "@v",
2668
+ 0.66
2669
+ ],
2670
+ "@config.onColor",
2671
+ [
2672
+ "if",
2673
+ [
2674
+ ">",
2675
+ "@v",
2676
+ 0.33
2677
+ ],
2678
+ "@config.midColor",
2679
+ [
2680
+ "if",
2681
+ [
2682
+ ">",
2683
+ "@v",
2684
+ 0.05
2685
+ ],
2686
+ "@config.lowColor",
2687
+ "@config.offColor"
2688
+ ]
2689
+ ]
2690
+ ]
2691
+ ]
2692
+ ],
2693
+ {
2694
+ "color": "@cellColor",
2695
+ "fill": "@cellColor",
2696
+ "height": [
2697
+ "-",
2698
+ "@config.cellSize",
2699
+ 2.0
2700
+ ],
2701
+ "id": [
2702
+ "str/concat",
2703
+ "cell-",
2704
+ "@i"
2705
+ ],
2706
+ "type": "rect",
2707
+ "width": [
2708
+ "-",
2709
+ "@config.cellSize",
2710
+ 2.0
2711
+ ],
2712
+ "x": [
2713
+ "+",
2714
+ 10.0,
2715
+ [
2716
+ "*",
2717
+ "@c",
2718
+ "@config.cellSize"
2719
+ ]
2720
+ ],
2721
+ "y": [
2722
+ "+",
2723
+ 10.0,
2724
+ [
2725
+ "*",
2726
+ "@r",
2727
+ "@config.cellSize"
2728
+ ]
2729
+ ]
2730
+ }
2731
+ ]
2732
+ ]
2733
+ ]
2734
+ ],
2735
+ [
2736
+ "render-ui",
2737
+ "main",
2738
+ {
2739
+ "children": [
2740
+ {
2741
+ "children": [
2742
+ {
2743
+ "content": "@entity.title",
2744
+ "type": "typography",
2745
+ "variant": "h4"
2746
+ },
2747
+ {
2748
+ "content": "@config.taskText",
2749
+ "type": "typography",
2750
+ "variant": "body"
2751
+ },
2752
+ {
2753
+ "children": [
2754
+ {
2755
+ "action": "RUN",
2756
+ "disabled": [
2757
+ "if",
2758
+ "@entity.running",
2759
+ true,
2760
+ false
2761
+ ],
2762
+ "label": "Run",
2763
+ "type": "button",
2764
+ "variant": "primary"
2765
+ },
2766
+ {
2767
+ "action": "PAUSE",
2768
+ "disabled": [
2769
+ "if",
2770
+ "@entity.running",
2771
+ false,
2772
+ true
2773
+ ],
2774
+ "label": "Pause",
2775
+ "type": "button",
2776
+ "variant": "secondary"
2777
+ },
2778
+ {
2779
+ "action": "STEP",
2780
+ "disabled": [
2781
+ "if",
2782
+ "@entity.running",
2783
+ true,
2784
+ false
2785
+ ],
2786
+ "label": "@config.stepLabel",
2787
+ "type": "button",
2788
+ "variant": "secondary"
2789
+ },
2790
+ {
2791
+ "action": "RESET",
2792
+ "label": "Reset",
2793
+ "type": "button",
2794
+ "variant": "ghost"
2795
+ }
2796
+ ],
2797
+ "direction": "horizontal",
2798
+ "gap": "sm",
2799
+ "type": "stack"
2800
+ },
2801
+ {
2802
+ "animate": false,
2803
+ "backgroundColor": "@config.backgroundColor",
2804
+ "height": "@config.height",
2805
+ "interactive": true,
2806
+ "onShapeClick": "TAP_CELL",
2807
+ "shapes": "@entity.cellShapes",
2808
+ "type": "learning-canvas",
2809
+ "width": "@config.width"
2810
+ },
2811
+ {
2812
+ "content": [
2813
+ "str/concat",
2814
+ "Generation ",
2815
+ [
2816
+ "str/concat",
2817
+ "",
2818
+ "@entity.generation"
2819
+ ],
2820
+ " · active cells: ",
2821
+ [
2822
+ "str/concat",
2823
+ "",
2824
+ "@entity.aliveCount"
2825
+ ]
2826
+ ],
2827
+ "type": "typography",
2828
+ "variant": "body"
2829
+ }
2830
+ ],
2831
+ "direction": "vertical",
2832
+ "gap": "md",
2833
+ "type": "stack"
2834
+ }
2835
+ ],
2836
+ "padding": "md",
2837
+ "type": "box"
2838
+ }
2839
+ ],
2840
+ [
2841
+ "emit",
2842
+ "GRID_RESET",
2843
+ {
2844
+ "seedCount": [
2845
+ "array/len",
2846
+ "@config.seeds"
2847
+ ]
2848
+ }
2849
+ ]
2850
+ ],
2851
+ "event": "RESET",
2852
+ "eventId": "evt_01M07580Z46NBJ8DSFXVB2KQM6",
2853
+ "from": "idle",
2854
+ "guard": [
2855
+ "==",
2856
+ "@entity.active",
2857
+ true
2858
+ ],
2859
+ "to": "idle"
2860
+ }
2861
+ ]
2862
+ },
2863
+ "ticks": [
2864
+ {
2865
+ "effects": [
2866
+ [
2867
+ "set",
2868
+ "@entity.cells",
2869
+ [
2870
+ "array/map",
2871
+ [
2872
+ "array/range",
2873
+ 0.0,
2874
+ [
2875
+ "*",
2876
+ "@config.rows",
2877
+ "@config.cols"
2878
+ ]
2879
+ ],
2880
+ [
2881
+ "fn",
2882
+ [
2883
+ "i"
2884
+ ],
2885
+ [
2886
+ "let",
2887
+ [
2888
+ [
2889
+ "r",
2890
+ [
2891
+ "math/floor",
2892
+ [
2893
+ "/",
2894
+ "@i",
2895
+ "@config.cols"
2896
+ ]
2897
+ ]
2898
+ ],
2899
+ [
2900
+ "c",
2901
+ [
2902
+ "math/mod",
2903
+ "@i",
2904
+ "@config.cols"
2905
+ ]
2906
+ ],
2907
+ [
2908
+ "v",
2909
+ [
2910
+ "array/nth",
2911
+ "@entity.cells",
2912
+ "@i"
2913
+ ]
2914
+ ],
2915
+ [
2916
+ "up",
2917
+ [
2918
+ "if",
2919
+ [
2920
+ ">",
2921
+ "@r",
2922
+ 0.0
2923
+ ],
2924
+ [
2925
+ "array/nth",
2926
+ "@entity.cells",
2927
+ [
2928
+ "-",
2929
+ "@i",
2930
+ "@config.cols"
2931
+ ]
2932
+ ],
2933
+ 0.0
2934
+ ]
2935
+ ],
2936
+ [
2937
+ "down",
2938
+ [
2939
+ "if",
2940
+ [
2941
+ "<",
2942
+ "@r",
2943
+ [
2944
+ "-",
2945
+ "@config.rows",
2946
+ 1.0
2947
+ ]
2948
+ ],
2949
+ [
2950
+ "array/nth",
2951
+ "@entity.cells",
2952
+ [
2953
+ "+",
2954
+ "@i",
2955
+ "@config.cols"
2956
+ ]
2957
+ ],
2958
+ 0.0
2959
+ ]
2960
+ ],
2961
+ [
2962
+ "left",
2963
+ [
2964
+ "if",
2965
+ [
2966
+ ">",
2967
+ "@c",
2968
+ 0.0
2969
+ ],
2970
+ [
2971
+ "array/nth",
2972
+ "@entity.cells",
2973
+ [
2974
+ "-",
2975
+ "@i",
2976
+ 1.0
2977
+ ]
2978
+ ],
2979
+ 0.0
2980
+ ]
2981
+ ],
2982
+ [
2983
+ "right",
2984
+ [
2985
+ "if",
2986
+ [
2987
+ "<",
2988
+ "@c",
2989
+ [
2990
+ "-",
2991
+ "@config.cols",
2992
+ 1.0
2993
+ ]
2994
+ ],
2995
+ [
2996
+ "array/nth",
2997
+ "@entity.cells",
2998
+ [
2999
+ "+",
3000
+ "@i",
3001
+ 1.0
3002
+ ]
3003
+ ],
3004
+ 0.0
3005
+ ]
3006
+ ],
3007
+ [
3008
+ "ul",
3009
+ [
3010
+ "if",
3011
+ [
3012
+ "and",
3013
+ [
3014
+ ">",
3015
+ "@r",
3016
+ 0.0
3017
+ ],
3018
+ [
3019
+ ">",
3020
+ "@c",
3021
+ 0.0
3022
+ ]
3023
+ ],
3024
+ [
3025
+ "array/nth",
3026
+ "@entity.cells",
3027
+ [
3028
+ "-",
3029
+ [
3030
+ "-",
3031
+ "@i",
3032
+ "@config.cols"
3033
+ ],
3034
+ 1.0
3035
+ ]
3036
+ ],
3037
+ 0.0
3038
+ ]
3039
+ ],
3040
+ [
3041
+ "ur",
3042
+ [
3043
+ "if",
3044
+ [
3045
+ "and",
3046
+ [
3047
+ ">",
3048
+ "@r",
3049
+ 0.0
3050
+ ],
3051
+ [
3052
+ "<",
3053
+ "@c",
3054
+ [
3055
+ "-",
3056
+ "@config.cols",
3057
+ 1.0
3058
+ ]
3059
+ ]
3060
+ ],
3061
+ [
3062
+ "array/nth",
3063
+ "@entity.cells",
3064
+ [
3065
+ "+",
3066
+ [
3067
+ "-",
3068
+ "@i",
3069
+ "@config.cols"
3070
+ ],
3071
+ 1.0
3072
+ ]
3073
+ ],
3074
+ 0.0
3075
+ ]
3076
+ ],
3077
+ [
3078
+ "dl",
3079
+ [
3080
+ "if",
3081
+ [
3082
+ "and",
3083
+ [
3084
+ "<",
3085
+ "@r",
3086
+ [
3087
+ "-",
3088
+ "@config.rows",
3089
+ 1.0
3090
+ ]
3091
+ ],
3092
+ [
3093
+ ">",
3094
+ "@c",
3095
+ 0.0
3096
+ ]
3097
+ ],
3098
+ [
3099
+ "array/nth",
3100
+ "@entity.cells",
3101
+ [
3102
+ "-",
3103
+ [
3104
+ "+",
3105
+ "@i",
3106
+ "@config.cols"
3107
+ ],
3108
+ 1.0
3109
+ ]
3110
+ ],
3111
+ 0.0
3112
+ ]
3113
+ ],
3114
+ [
3115
+ "dr",
3116
+ [
3117
+ "if",
3118
+ [
3119
+ "and",
3120
+ [
3121
+ "<",
3122
+ "@r",
3123
+ [
3124
+ "-",
3125
+ "@config.rows",
3126
+ 1.0
3127
+ ]
3128
+ ],
3129
+ [
3130
+ "<",
3131
+ "@c",
3132
+ [
3133
+ "-",
3134
+ "@config.cols",
3135
+ 1.0
3136
+ ]
3137
+ ]
3138
+ ],
3139
+ [
3140
+ "array/nth",
3141
+ "@entity.cells",
3142
+ [
3143
+ "+",
3144
+ "@i",
3145
+ "@config.cols",
3146
+ 1.0
3147
+ ]
3148
+ ],
3149
+ 0.0
3150
+ ]
3151
+ ],
3152
+ [
3153
+ "n4",
3154
+ [
3155
+ "+",
3156
+ "@up",
3157
+ "@down",
3158
+ "@left",
3159
+ "@right"
3160
+ ]
3161
+ ],
3162
+ [
3163
+ "n8",
3164
+ [
3165
+ "+",
3166
+ "@n4",
3167
+ "@ul",
3168
+ "@ur",
3169
+ "@dl",
3170
+ "@dr"
3171
+ ]
3172
+ ]
3173
+ ],
3174
+ [
3175
+ "if",
3176
+ [
3177
+ "==",
3178
+ "@config.rule",
3179
+ "life"
3180
+ ],
3181
+ [
3182
+ "if",
3183
+ [
3184
+ "if",
3185
+ [
3186
+ ">",
3187
+ "@v",
3188
+ 0.5
3189
+ ],
3190
+ [
3191
+ "if",
3192
+ [
3193
+ "==",
3194
+ [
3195
+ "math/round",
3196
+ "@n8",
3197
+ 0.0
3198
+ ],
3199
+ 2.0
3200
+ ],
3201
+ true,
3202
+ [
3203
+ "==",
3204
+ [
3205
+ "math/round",
3206
+ "@n8",
3207
+ 0.0
3208
+ ],
3209
+ 3.0
3210
+ ]
3211
+ ],
3212
+ [
3213
+ "==",
3214
+ [
3215
+ "math/round",
3216
+ "@n8",
3217
+ 0.0
3218
+ ],
3219
+ 3.0
3220
+ ]
3221
+ ],
3222
+ 1.0,
3223
+ 0.0
3224
+ ],
3225
+ [
3226
+ "if",
3227
+ [
3228
+ "==",
3229
+ "@config.rule",
3230
+ "spread"
3231
+ ],
3232
+ [
3233
+ "if",
3234
+ [
3235
+ "if",
3236
+ [
3237
+ ">",
3238
+ "@v",
3239
+ 0.5
3240
+ ],
3241
+ true,
3242
+ [
3243
+ ">",
3244
+ "@n4",
3245
+ 0.5
3246
+ ]
3247
+ ],
3248
+ 1.0,
3249
+ 0.0
3250
+ ],
3251
+ [
3252
+ "math/max",
3253
+ 0.0,
3254
+ [
3255
+ "*",
3256
+ "@config.decay",
3257
+ [
3258
+ "+",
3259
+ "@v",
3260
+ [
3261
+ "*",
3262
+ "@config.diffuseRate",
3263
+ [
3264
+ "-",
3265
+ [
3266
+ "/",
3267
+ "@n4",
3268
+ 4.0
3269
+ ],
3270
+ "@v"
3271
+ ]
3272
+ ]
3273
+ ]
3274
+ ]
3275
+ ]
3276
+ ]
3277
+ ]
3278
+ ]
3279
+ ]
3280
+ ]
3281
+ ],
3282
+ [
3283
+ "set",
3284
+ "@entity.generation",
3285
+ [
3286
+ "+",
3287
+ "@entity.generation",
3288
+ 1.0
3289
+ ]
3290
+ ],
3291
+ [
3292
+ "set",
3293
+ "@entity.aliveCount",
3294
+ [
3295
+ "array/len",
3296
+ [
3297
+ "array/filter",
3298
+ "@entity.cells",
3299
+ [
3300
+ "fn",
3301
+ "v",
3302
+ [
3303
+ ">",
3304
+ "@v",
3305
+ 0.05
3306
+ ]
3307
+ ]
3308
+ ]
3309
+ ]
3310
+ ],
3311
+ [
3312
+ "set",
3313
+ "@entity.cellShapes",
3314
+ [
3315
+ "array/map",
3316
+ [
3317
+ "array/range",
3318
+ 0.0,
3319
+ [
3320
+ "*",
3321
+ "@config.rows",
3322
+ "@config.cols"
3323
+ ]
3324
+ ],
3325
+ [
3326
+ "fn",
3327
+ [
3328
+ "i"
3329
+ ],
3330
+ [
3331
+ "let",
3332
+ [
3333
+ [
3334
+ "r",
3335
+ [
3336
+ "math/floor",
3337
+ [
3338
+ "/",
3339
+ "@i",
3340
+ "@config.cols"
3341
+ ]
3342
+ ]
3343
+ ],
3344
+ [
3345
+ "c",
3346
+ [
3347
+ "math/mod",
3348
+ "@i",
3349
+ "@config.cols"
3350
+ ]
3351
+ ],
3352
+ [
3353
+ "v",
3354
+ [
3355
+ "array/nth",
3356
+ "@entity.cells",
3357
+ "@i"
3358
+ ]
3359
+ ],
3360
+ [
3361
+ "cellColor",
3362
+ [
3363
+ "if",
3364
+ [
3365
+ ">",
3366
+ "@v",
3367
+ 0.66
3368
+ ],
3369
+ "@config.onColor",
3370
+ [
3371
+ "if",
3372
+ [
3373
+ ">",
3374
+ "@v",
3375
+ 0.33
3376
+ ],
3377
+ "@config.midColor",
3378
+ [
3379
+ "if",
3380
+ [
3381
+ ">",
3382
+ "@v",
3383
+ 0.05
3384
+ ],
3385
+ "@config.lowColor",
3386
+ "@config.offColor"
3387
+ ]
3388
+ ]
3389
+ ]
3390
+ ]
3391
+ ],
3392
+ {
3393
+ "color": "@cellColor",
3394
+ "fill": "@cellColor",
3395
+ "height": [
3396
+ "-",
3397
+ "@config.cellSize",
3398
+ 2.0
3399
+ ],
3400
+ "id": [
3401
+ "str/concat",
3402
+ "cell-",
3403
+ "@i"
3404
+ ],
3405
+ "type": "rect",
3406
+ "width": [
3407
+ "-",
3408
+ "@config.cellSize",
3409
+ 2.0
3410
+ ],
3411
+ "x": [
3412
+ "+",
3413
+ 10.0,
3414
+ [
3415
+ "*",
3416
+ "@c",
3417
+ "@config.cellSize"
3418
+ ]
3419
+ ],
3420
+ "y": [
3421
+ "+",
3422
+ 10.0,
3423
+ [
3424
+ "*",
3425
+ "@r",
3426
+ "@config.cellSize"
3427
+ ]
3428
+ ]
3429
+ }
3430
+ ]
3431
+ ]
3432
+ ]
3433
+ ]
3434
+ ],
3435
+ "guard": [
3436
+ "and",
3437
+ [
3438
+ "==",
3439
+ "@entity.active",
3440
+ true
3441
+ ],
3442
+ [
3443
+ "==",
3444
+ "@entity.running",
3445
+ true
3446
+ ]
3447
+ ],
3448
+ "interval": 300.0,
3449
+ "name": "gridTick"
3450
+ }
3451
+ ]
3452
+ }
3453
+ ]
3454
+ }
3455
+ ],
3456
+ "schemaVersion": 1,
3457
+ "version": "1.0.0"
3458
+ }