Skip to content

Instantly share code, notes, and snippets.

@dadecoza
Last active April 4, 2025 11:45
Show Gist options
  • Save dadecoza/52e714f2491ec9bc404eaa391fe2bba4 to your computer and use it in GitHub Desktop.
Save dadecoza/52e714f2491ec9bc404eaa391fe2bba4 to your computer and use it in GitHub Desktop.
<!doctype html>
<html lang="en">
<head>
<!-- Program to draw a Mandebrot set -->
<!-- https://github.com/koce017/plhtml -->
<title>`Fractals`</title>
</head>
<body>
<main>
<var class="integer">w</var>
<var class="integer">h</var>
<var class="integer">a</var>
<var class="integer">b</var>
<var class="integer">c</var>
<var class="integer">d</var>
<var class="integer">m</var>
<var class="integer">x</var>
<var class="integer">y</var>
<var class="integer">g</var>
<var class="integer">s</var>
<var class="integer">r</var>
<var class="integer">zr</var>
<var class="integer">zi</var>
<var class="integer">i</var>
<var class="integer">t</var>
<var class="string">k</var>
<data value="80">w</data>
<data value="24">h</data>
<data value="-2000">a</data>
<data value="1000">b</data>
<data value="-1000">c</data>
<data value="1000">d</data>
<data value="30">m</data>
<data value="1000">s</data>
<data value="0">y</data>
<div data-while="y &lt; h">
<data value="c + y * (d-c) / h">g</data>
<data value="0">x</data>
<div data-while="x &lt; w">
<data value="a + x * (b - a) / w">r</data>
<data value="0">zr</data>
<data value="0">zi</data>
<data value="0">i</data>
<div data-while="(zr * zr + zi * zi) / s &leq; 4000 &and; i &lt; m">
<data value="(zr * zr - zi * zi) / s + r">t</data>
<data value="(2 * zr * zi) / s + g">zi</data>
<data value="t">zr</data>
<data value="i + 1">i</data>
</div>
<data value="` `">k</data>
<div data-if="i &equals; m"><data value="`@`">k</data></div>
<div data-if="i &lt; m &and; i &gt; 25"><data value="`%`">k</data></div>
<div data-if="i &leq; 25 &and; i &gt; 20"><data value="`#`">k</data></div>
<div data-if="i &leq; 20 &and; i &gt; 15"><data value="`*`">k</data></div>
<div data-if="i &leq; 15 &and; i &gt; 10"><data value="`+`">k</data></div>
<div data-if="i &leq; 10 &and; i &gt; 5"><data value="`-`">k</data></div>
<div data-if="i &leq; 5 &and; i &gt; 5"><data value="`.`">k</data></div>
<div data-if="i &leq; 2"><data value="` `">k</data></div>
<output>k</output>
<data value="x + 1">x</data>
</div>
<output>`\n`</output>
<data value="y + 1">y</data>
</div>
</main>
</body>
</html>
@dadecoza
Copy link
Author

dadecoza commented Apr 4, 2025

Fractals

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment