Dan Stowell on Nostr: My first algorithm in #uxn: the one-dimensional distance between two values. It might ...
My first algorithm in #uxn: the one-dimensional distance between two values. It might not look like much but I'm pleased to have worked it out:
%MIN { LTHk #01 JCN SWP POP } ( b c -- retval )
%dist1d { SUBk SWP ROT SUB MIN } ( b c -- dist )
Published at
2024-11-17 15:18:00 UTCEvent JSON
{
"id": "8dca66ed1d6ddf1010263c7b405e48a2e979964bd9940bfecbb84033d6b79722",
"pubkey": "5e81cb787c50baaf3339f09b96cac9afc817e61a093085cea140e2061714daa3",
"created_at": 1731856680,
"kind": 1,
"tags": [
[
"t",
"uxn"
],
[
"proxy",
"https://mastodon.social/@danstowell/113498959386967628",
"web"
],
[
"proxy",
"https://mastodon.social/users/danstowell/statuses/113498959386967628",
"activitypub"
],
[
"L",
"pink.momostr"
],
[
"l",
"pink.momostr.activitypub:https://mastodon.social/users/danstowell/statuses/113498959386967628",
"pink.momostr"
],
[
"-"
]
],
"content": "My first algorithm in #uxn: the one-dimensional distance between two values. It might not look like much but I'm pleased to have worked it out:\n%MIN { LTHk #01 JCN SWP POP } ( b c -- retval )\n%dist1d { SUBk SWP ROT SUB MIN } ( b c -- dist )",
"sig": "61be75fe8629765e35001adcb39f4fb706deb6dff7cb7b3e18ee07a515a3590f309b24035e998f0e4e777a28bce4922f99d20529cdaf9ee4a4cb577d37fbcfff"
}