aboutsummaryrefslogtreecommitdiffhomepage
path: root/bruijn/Experiments.bruijn
diff options
context:
space:
mode:
authorMarvin Borner2024-04-07 02:12:53 +0200
committerMarvin Borner2024-04-07 02:12:53 +0200
commita1f6a09fa186de278ef947977c546c5c7870b8da (patch)
tree72e91919c8c63f8738bc731a0de180d7c69e95a1 /bruijn/Experiments.bruijn
parentaec647f9b76ada22b809c97bc7ee669fcb6e6d73 (diff)
Add experiments to git
Diffstat (limited to 'bruijn/Experiments.bruijn')
-rw-r--r--bruijn/Experiments.bruijn63
1 files changed, 63 insertions, 0 deletions
diff --git a/bruijn/Experiments.bruijn b/bruijn/Experiments.bruijn
new file mode 100644
index 0000000..2e2173d
--- /dev/null
+++ b/bruijn/Experiments.bruijn
@@ -0,0 +1,63 @@
+:import std/Combinator .
+:import Screen .
+
+# stable
+s w
+
+a-sierpinski0 [build w w w w]
+
+a-sierpinski1 [build tl tr bl br]
+ tl build w w w (build w s s b)
+ tr build w w (build s w b s) w
+ bl build w (build s b w s) w w
+ br build (build b s s w) w w w
+
+a-sierpinski2 [build tl tr bl br]
+ tl build tl tr bl br
+ tl build w w w (build w s s b)
+ tr build w w (build s w b s) w
+ bl build w (build s b w s) w w
+ br build (build b s s w) s s b
+ tr build tl tr bl br
+ tl build w w w (build w s s b)
+ tr build w w (build s w b s) w
+ bl build s (build s b w s) b s
+ br build (build b s s w) w w w
+ bl build tl tr bl br
+ tl build w w w (build w s s b)
+ tr build s b (build s w b s) s
+ bl build w (build s b w s) w w
+ br build (build b s s w) w w w
+ br build tl tr bl br
+ tl build b s s (build w s s b)
+ tr build w w (build s w b s) w
+ bl build w (build s b w s) w w
+ br build (build b s s w) w w w
+
+b-sierpinski0 y [gen]
+ gen qsplit → color
+ color &[[[[[0 (5 (tl 4)) (5 (tr 3)) (5 (bl 2)) (5 (br 1))]]]]]
+ tl &[[[[[0 4 3 2 b]]]]]
+ tr &[[[[[0 4 3 b 1]]]]]
+ bl &[[[[[0 4 b 2 1]]]]]
+ br &[[[[[0 b 3 2 1]]]]]
+
+:import std/List .
+
+b-sierpinski1 color
+ color [[build tl tr bl br] mut]
+ mut y* ([[[[build 3 2 1 b]]]] : ([[[[build 3 2 b 0]]]] : ([[[[build 3 b 1 0]]]] : {}[[[[build b 2 1 0]]]])))
+ tl ^0
+ tr ^(~0)
+ bl ^(~(~0))
+ br ^(~(~(~0)))
+
+:import std/Number .
+
+b-sierpinskin y [[[=?1 0 (gen 0)]]] (+7)
+ gen qsplit → color
+ color &[[[[[0 (7 --6 (tl 4)) (7 --6 (tr 3)) (7 --6 (bl 2)) (7 --6 (br 1))]]]]]
+ tl &[[[[[0 4 3 2 b]]]]]
+ tr &[[[[[0 4 3 b 1]]]]]
+ bl &[[[[[0 4 b 2 1]]]]]
+ br &[[[[[0 b 3 2 1]]]]]