www.eamoncaddigan.net

Content and configuration for https://www.eamoncaddigan.net
git clone https://git.eamoncaddigan.net/www.eamoncaddigan.net.git
Log | Files | Refs | Submodules | README

commit e627fca7dc382e721d7e6364fd31c8c221dea494
parent 6bbecb9b6d8e78869530d01cf5489d984a9c42df
Author: Eamon Caddigan <eamon.caddigan@gmail.com>
Date:   Tue, 12 Dec 2023 20:51:00 -0800

December Adventure, day 12

Diffstat:
Acontent/december-adventure/2023-12/index.md | 56++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 56 insertions(+), 0 deletions(-)

diff --git a/content/december-adventure/2023-12/index.md b/content/december-adventure/2023-12/index.md @@ -0,0 +1,56 @@ +--- +title: "2023, Day 12" +date: 2023-12-12T18:55:04-08:00 +draft: false +--- + +[Devine had a sharp critique +today](https://merveilles.town/@neauoire/111568838011217063): + +> Reading the december adventure feed, nearly halfway into the month, you'd +> expect people to have started to play with stuff, but the feed reads like +> most are lost in the weeds of setting their servers or environment and +> whatnot so they can finally begin. For a chillout event, it looks +> exhausting af + +So I _have_ been hacking for the past week, but I've also been grouchy and +whiny enough the past couple days that I _feel_ exhausting af[^jumps]. + +Since Eli's whole vision for December Adventure is that it should be [fun +and playful](https://eli.li/2022/12/9/december-adventure), I decided it +seemed fun to work on a different part of my project: how should I encode +the Morse code representation of each character[^fun]? + +In case anyone is unfamiliar with Morse Code, it's a method of encoding +characters with signal durations (dots and dashes, or as radio folks call +them, dits and dahs), each letter is represented by one to four dits or dahs +(numerals are all represented by five). At first it seems obvious to use one +bit per dit/dah, but it's a little tricky due to the varying length for each +character. + +The solution I landed on was using two bits per dit/dah, with another two +bits to indicate the end of a letter: + +bits | signal +-----|-------------- +`01` | dit +`11` | dah +`00` | end of letter +`10` | (unused) + +This allows each character (including numerals) to fit into a 16-bit short. +Slightly over half of the letters would be able to fit into a byte, but by +using a short for each one, implementing a lookup table will be much easier. +Another shortcut I plan to take is to store the letters' encoding +"backwards", with the first dit/dah in the lowest bits. This should let me +play the tones for a character with a simple sequence of _shift_ and _and_ +operations. + +I haven't actually implemented anything yet, but I had fun thinking this +through, and I look forward to coding this up! + +[^jumps]: In the same thread, they also helped me work through some + questions about addressing that I had [yesterday]({{< ref + "december-adventure/2023-11/index.md" >}}); thanks! + +[^fun]: Look, this kind of thing is _fun_ to me, ok?