<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Akshay's creative-coding posts</title>
    <link>https://ediblemonad.dev/creative-coding</link>
    
    <item>
  <guid>/creative-coding/2026-03-24-desmos.html</guid>
  <title># Desmos is beautiful</title>
  <link>https://ediblemonad.dev/creative-coding/2026-03-24-desmos.html</link>
  <comments>https://ediblemonad.dev/creative-coding/2026-03-24-desmos.html</comments>
  <pubDate>2026-03-24</pubDate>
  <description>
    <![CDATA[<h2 id="desmos-is-beautiful">Desmos is beautiful</h2>
<p>Desmos is a graphing calculator where you can input math equations
and it'll plot it. The normal way to use it would be to throw in an
equation like <span
class="math inline"><em>y</em> = 2<em>x</em><sup>2</sup> + 2</span> and
boom you have a parabola. Even though it might seem simple on the
surface, it is hiding an incredible programming language and rendering
engine that you can use to build pretty much anything you'd like.</p>
<p>Want to draw a box and a circle? <span
class="math display">{−5 &lt; <em>x</em> &lt; 5}{−5 &lt; <em>y</em> &lt; 5} &gt; 0</span>
<span
class="math display"><em>x</em><sup>2</sup> + <em>y</em><sup>2</sup> &lt; 25</span></p>
<p>Here, conditional at the top level means region and conditional
enclosed in curly braves like <span
class="math inline">{−5 &lt; <em>x</em> &lt; 5 &gt; 0}</span> are
expressions that can either return 1 if true or undefined if false. 2 of
these expressions next to each other is the product of both.</p>
<p>Want to conditionally draw either a box or a circle and toggle
between them on the click of a button?
(<a href="https://www.desmos.com/calculator/zom3hguvjv" target="_blank _parent" rel="noopener">on
desmos</a>) <span
class="math display">{<em>V</em><sub><em>i</em><em>s</em><em>c</em><em>i</em><em>r</em><em>c</em><em>l</em><em>e</em></sub> = 1 : −<em>x</em><sup>2</sup> − <em>y</em><sup>2</sup> + 25, {−5 &lt; <em>x</em> &lt; 5 &gt; 0}{−5 &lt; <em>y</em> &lt; 5}} &gt; 0</span>
<span
class="math display"><em>V</em><sub><em>i</em><em>s</em><em>c</em><em>i</em><em>r</em><em>c</em><em>l</em><em>e</em></sub> = 0</span>
<span
class="math display"><em>V</em><sub><em>i</em><em>s</em><em>c</em><em>i</em><em>r</em><em>c</em><em>l</em><em>e</em></sub> → {<em>V</em><sub><em>i</em><em>s</em><em>c</em><em>i</em><em>r</em><em>c</em><em>l</em><em>e</em></sub> = 0 : 1, 0}</span></p>
<p>Here, if you click the arrow button to the left of the last equation,
it will update/toggle <span
class="math inline"><em>V</em><sub><em>i</em><em>s</em><em>c</em><em>i</em><em>r</em><em>c</em><em>l</em><em>e</em></sub></span>.
An expression like <span
class="math inline">{<em>x</em> &gt; 0 : 42, 7}</span> is a conditional
expression but instead of 1/undefined, it will return 42 when true and 7
when false (i.e. if expression). Also, <span
class="math inline"><em>V</em><sub><em>i</em><em>s</em><em>c</em><em>i</em><em>r</em><em>c</em><em>l</em><em>e</em></sub> → {<em>V</em><sub><em>i</em><em>s</em><em>c</em><em>i</em><em>r</em><em>c</em><em>l</em><em>e</em></sub> = 0 : 1, 0}</span>
means when the action is triggered (button is clicked or via timer), it
will update the value which in this case would toggle between 0 and
1.</p>
<p>The action can also be connected to any object drawn on screen by
clicking the cog in the sidebar, clicking on the icon to the left of the
equation for the object and then enabling "Clickable".</p>
<p>You could also have that action be triggered every second (or
whatever interval) using the ticker feature in desmos (+ button in the
sidebar &gt; Ticker).</p>
<p>This post doesn't even begin to cover the incredible features desmos
provides but I think the fun is in exploring so if you find desmos
interesting, it's better to discover those yourself.</p>
<p><a href="https://desmos.ediblemonad.dev/#/graphs/snake-game" target="_blank _parent" rel="noopener">Here's
a snake game implemented in desmos</a>. Press "Play/Pause" to start.</p>
<p>I maintain my collection of desmos experiments
<a href="https://desmos.ediblemonad.dev" target="_blank _parent" rel="noopener">here</a>.</p>
]]>
  </description>
</item>
<item>
  <guid>/creative-coding/2026-03-22-uiua.html</guid>
  <title># Uiua</title>
  <link>https://ediblemonad.dev/creative-coding/2026-03-22-uiua.html</link>
  <comments>https://ediblemonad.dev/creative-coding/2026-03-22-uiua.html</comments>
  <pubDate>2026-03-22</pubDate>
  <description>
    <![CDATA[<h2 id="uiua">Uiua</h2>
<p><a href="https://www.uiua.org" target="_blank _parent" rel="noopener">Uiua</a>
is one of the most fun languages for creative coding. There are a bunch
of really good primitives that generating audio files from samples,
generating an image from an array of pixels, generating a gif from an
array of array of pixels, etc. Messed around with it
<a href="https://github.com/phenax/uiua-playground" target="_blank _parent" rel="noopener">here</a>
some time ago and I've started to miss it. The only other APL-ish
language I've tried is BQN which is also an amazing language but
thinking tacit is hard and it takes time to get used to. There are smart
people in the world. Being a member and representative of the other side
of that spectrum, I need my escape hatches and they need to be pleasant.
I've come to appreciate the stack-based escape hatches a lot more than
the functional escape hatches with blocks using 𝕩 and the other spicy
letters.</p>
]]>
  </description>
</item>

  </channel>
</rss>
