Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/sqlite/blob/master/ext/wasm/sql/000-mandelbrot.sql # sqlite [Ported from github.com/sqlite/sqlite] Fix bugs in and improve the interface to the ".check" command of the CLI. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `sqlite / ext / wasm / sql / 000-mandelbrot.sql` 17 lines ยท 612 bytes Raw Blame History 1 WITH RECURSIVE 2 xaxis(x) AS (VALUES(-2.0) UNION ALL SELECT x+0.05 FROM xaxis WHERE x<1.2), 3 yaxis(y) AS (VALUES(-1.0) UNION ALL SELECT y+0.1 FROM yaxis WHERE y<1.0), 4 m(iter, cx, cy, x, y) AS ( 5 SELECT 0, x, y, 0.0, 0.0 FROM xaxis, yaxis 6 UNION ALL 7 SELECT iter+1, cx, cy, x*x-y*y + cx, 2.0*x*y + cy FROM m 8 WHERE (x*x + y*y) < 4.0 AND iter<28 9 ), 10 m2(iter, cx, cy) AS ( 11 SELECT max(iter), cx, cy FROM m GROUP BY cx, cy 12 ), 13 a(t) AS ( 14 SELECT group_concat( substr(' .+*#', 1+min(iter/7,4), 1), '') 15 FROM m2 GROUP BY cy 16 ) 17 SELECT group_concat(rtrim(t),x'0a') as Mandelbrot FROM a;