The earliest memory I have of ‘programming’ is in the early/mid 90s when my father brought home a computer from work. We could play games on it … so of course I took the spreadsheet program he used (LOTUS 123, did I date myself with that?) and tried to modify it to print out a helpful message for him. It … halfway worked? At least I could undo it so he could get back to work…

After that, I picked up programming for real in QBASIC (I still have a few of those programs lying around), got my own (junky) Linux desktop from my cousin, tried to learn VBasic (without a Windows machine), and eventually made it to high school… In college, I studied computer science and mathematics, mostly programming in Java/.NET, although with a bit of everything in the mix. A few of my oldest programming posts on this blog are from that time.

After that, on to grad school! Originally, I was going to study computational linguistics, but that fell through. Then programming languages (the school’s specialty). And finally I ended up studying censorship and computer security. That’s about where I am today!

But really, I still have a habit of doing a little bit of everything. Whatever seems interesting at the time!

Posts

Neural Network Cellular Automata

Okay. A random post on the /r/cellular_automata subreddit inspired me.

Let’s generate a cellular automata where each pixel updates based on a neural network given as input:

  • The x/y coordinates (scaled to the range 0-1)
  • An optional random value (to make it more dynamic)
  • A variety of neighboring data, such as:
    • The number of neighbors that are ‘active’ (> 50% white), ranges 0-8 scaled to 0-1. This should allow Conway's Game of Life
    • The RGB values of all neighbors (allows a superset of the above)
    • Gradients, subtract color value of the left from the right so that you get edges and side to side movement

Let’s do it!

read more...


Solving Snakebird

Snakebird!

A cute little puzzle game, where you move around snake(birds). Move any number of snakes around the level, eating fruit, and getting to the exit. The main gotchas are that you have gravity to content with–your snake will easily fall off the edge of the world–and each time you eat a fruit, your snake gets bigger. This can help get longer to get into hard to reach places or it can cause trouble when you trap yourself in corners.

Let’s use the new immutable.js solver to solve these problems!

read more...


Immutable.js Solvers

A bit ago I wrote about writing a generic brute force solver (wow, was that really two months ago?). It got … complicate. Mostly, because every time I wrote a step function, I had to be careful to undo the same. Wouldn’t it be nice if we could just write a step function and get backtracking for ‘free’?

Well, with immutability you can!

read more...


Splitting Images

I recently came across a problem where I had a single image with a transparent background containing multiple images that I wanted to split into their component parts. For example, split this:

Into these:

read more...


Crosslinks by Title in Hugo

Another quick Hugo post. One thing I miss about my previous blogging platform(s) was the ability to generate quick links between posts just by using the title of the post. So rather than this:

a cool post
This is [a cool post]({{< ref "2021-07-15-crosslinks-by-title-in-hugo" >}}), go read it.

You could do this:

This is {{< crosslink title="Crosslinks by Title in Hugo" text="a cool post" >}}.

Or shorter: {{< crosslink "Crosslinks by Title in Hugo" >}}.

And it should just work.

read more...


Ordering Board Game Geek GeekLists by Rank

A quick script.

I play a lot of board games. With the whole COVID-19 mess, I’ve been playing a lot on Board Game Arena, which is a wonderful site. But one thing that’s a bit lacking is having ratings / metadata about games to great games I’ve just not heard about before. Where can you get lots of that data? Board Game Geek!

The problem though, is merging the two. So, how do we do it? Well, this time around, I’m going to start with this GeekList that someone else maintains of BGA games on BGG. Which has the games, but no ranks. And apparently there are no ways to rank those by BGG (for some reason). But that’s easy when you know a bit of scripting!

read more...


Generating a Book Bingo Chart in Hugo

Another r/Fantasy 2021 Book Bingo post! How in the world am I generating this (updating) chart in Hugo?

2021 Book Bingo

SFF anthology or collection

Attack on Titan, Vol. 1

Set in Asia (Hard: by an Asian author)

r/Fantasy A to Z Genre Guide (Hard: by a BIPOC author)

Found Family (Hard: featuring an LGBTQ+ character)

First person POV (Hard: Multiple)

r/Fantasy Book Club (Hard: with participation)

New to you author (Hard: haven’t heard much about)

Gothic Fantasy (Hard: not in the Book Riot article)

Mexican Gothic

(Hard Mode)

Backlist book (Hard: published before 2000)

Revenge-seeking character (Hard: revenge as the major book plot)

Red Sister

(Hard Mode)

Mystery plot (Hard: not primary world urban fantasy)

Six Wakes

(Hard Mode)

Comfort read (Hard: that isn’t a reread)

Wild Sign

(Hard Mode)

Debut novel (Hard: published in 2021)

Tales of Nezura: Book 1: The Zevolra

(Hard Mode)

Cat squasher (500+ pages; Hard: 800+ pages)

SFF-related nonfiction (Hard: published in the last 5 years)

Latinx or Latin American author (Hard: with fewer than 1000 Goodreads ratings)

Self published (Hard: with fewer than 50 Goodreads ratings)

Tales of Nezura: Book 1: The Zevolra

(Hard Mode)

Forest setting (Hard: for the entire book)

Annihilation

(Hard Mode)

Genre mashup (Hard: of three or more genres)

Gideon the Ninth

(Hard Mode)

Has chapter titles of more than one word (Hard: for every chapter)

The Midnight Library

(Hard Mode)

___ of ___ (Hard: and ___)

First contact (Hard: that doesn’t lead to war)

Project Hail Mary

(Hard Mode)

Trans or Nonbinary (Hard: protagonist)

Debut author (Hard: with an AMA)

Witches (Hard: as the main protagonist)

A Great and Terrible Beauty

(Hard Mode)

read more...


A Generic Brute Force Backtracking Solver

One of the projects I’ve had vaguely in the back of my head is a sort of generic puzzle solver. I really love puzzles, but of the pencil and paper and video game varieties. So I think it would be awesome to write out a definition of a puzzle (say how to play Sudoku), give it input, and have it give me an answer back.

Well, I finally got around to trying it!

read more...


Categorizing r/Fantasy Book Bingo Books

I’ve been working through the r/Fantasy 2021 Book Bingo this year:

2021 Book Bingo

SFF anthology or collection

Attack on Titan, Vol. 1

Set in Asia (Hard: by an Asian author)

r/Fantasy A to Z Genre Guide (Hard: by a BIPOC author)

Found Family (Hard: featuring an LGBTQ+ character)

First person POV (Hard: Multiple)

r/Fantasy Book Club (Hard: with participation)

New to you author (Hard: haven’t heard much about)

Gothic Fantasy (Hard: not in the Book Riot article)

Mexican Gothic

(Hard Mode)

Backlist book (Hard: published before 2000)

Revenge-seeking character (Hard: revenge as the major book plot)

Red Sister

(Hard Mode)

Mystery plot (Hard: not primary world urban fantasy)

Six Wakes

(Hard Mode)

Comfort read (Hard: that isn’t a reread)

Wild Sign

(Hard Mode)

Debut novel (Hard: published in 2021)

Tales of Nezura: Book 1: The Zevolra

(Hard Mode)

Cat squasher (500+ pages; Hard: 800+ pages)

SFF-related nonfiction (Hard: published in the last 5 years)

Latinx or Latin American author (Hard: with fewer than 1000 Goodreads ratings)

Self published (Hard: with fewer than 50 Goodreads ratings)

Tales of Nezura: Book 1: The Zevolra

(Hard Mode)

Forest setting (Hard: for the entire book)

Annihilation

(Hard Mode)

Genre mashup (Hard: of three or more genres)

Gideon the Ninth

(Hard Mode)

Has chapter titles of more than one word (Hard: for every chapter)

The Midnight Library

(Hard Mode)

___ of ___ (Hard: and ___)

First contact (Hard: that doesn’t lead to war)

Project Hail Mary

(Hard Mode)

Trans or Nonbinary (Hard: protagonist)

Debut author (Hard: with an AMA)

Witches (Hard: as the main protagonist)

A Great and Terrible Beauty

(Hard Mode)

read more...