Added CapitalExs mandelbrot

This commit is contained in:
Devine Lu Linvega 2024-05-07 07:55:04 -07:00
parent 1f7e382c92
commit 09dd2a9795
2 changed files with 34 additions and 1 deletions

33
examples/mandelbrot.modal Normal file
View File

@ -0,0 +1,33 @@
<> (iterating ?x ?y (100) ?z ?a ?b) (?((?:) ?:) *\s)
<> (iterating ?x ?y ?n (1) ?a ?b) (?((?:) ?:) \s\s)
<> (iterating (?x) (?y) (?n) (?c) (?a) (?b)) (
iterating (?x) (?y) (?n 1 `+) (?a ?a f* ?b ?b f* `+ 4096 `>)
(?a ?a f* ?b ?b f* `- ?x `+)
(?a ?b 2048 f* f* ?y `+)
)
<> (?0 ?1 f*) (?0 ?1 `* 1024 `/)
<> (?0 ?1 f/) (?0 1024 `* ?1 `/)
<> (?0 ?1 `?:) ?:
<> (mandelbrot (?x) (?y)) (
plot-mandelbrot (0) (0) (2529 ?x `/) (2293 ?y `/) (-2048) (-1146)
)
<> (plot-mandelbrot (40) (36) (?r) (?d) (?x) (?y)) ()
<> (plot-mandelbrot (40) (?j) (?r) (?d) (?x) (?y)) (
?(?: ?:) \n
iterating (?x) (?y) (0) (0) (0) (0)
plot-mandelbrot (0) (?j 1 `+) (?r) (?d) (-2048) (?y ?d `+)
)
<> (plot-mandelbrot (?i) (?j) (?r) (?d) (?x) (?y)) (
iterating (?x) (?y) (0) (0) (0) (0)
plot-mandelbrot (?i 1 `+) (?j) (?r) (?d) (?x ?r `+) (?y)
)
mandelbrot (40) (36)

View File

@ -5,7 +5,7 @@ typedef struct {
char *a, *b; char *a, *b;
} Rule; } Rule;
static int flip, quiet, debug, cycles = 0x10000; static int flip, quiet, debug, cycles = 0x200000;
static Rule rules[0x1000], *rules_ = rules, lambda; static Rule rules[0x1000], *rules_ = rules, lambda;
static char dict[0x8000], *dict_ = dict, empty; static char dict[0x8000], *dict_ = dict, empty;
static char bank_a[0x4000], *src_ = bank_a; static char bank_a[0x4000], *src_ = bank_a;