That's correct!
If you want to poke around the source code, here's the puzzlescript hack link. If you're not familiar with puzzlescript, some of the code may seem a little (or quite) silly, but it's a more efficient way to do it with this system.
After posting this game, I decided to try a different algorithm I had been thinking about, but it was less elegant to get working, and I like the results a lot less. The source code for that is here, if you're interested.
Thanks for asking!