Category Archives: computing

Bit pumps.

Alchemy

(WARNING: spoilers ahead!)

Alchemy is a fun little grind game for Android. The premise is simple. You start with four elements: earth, air, fire, and water. You can drag any element onto any other, and they might “combine” to make one or more new elements. For example, dragging earth onto air makes dust. You can then drag dust onto water to make mud. Things start getting really funny as elements get more complex (e.g. dragging man onto beer makes an alcoholic, which is useless for further combinations. Lulz.) The combinations are often surprising and amusing… until you realize it’s a grind game, and you’re not finished until you find all 300 combinations. There is some very amusing logic to the game, and some of the combinations are downright hilarious… But this kind of game just can’t keep my attention if all one does is grind.

The killjoys among us could just go to any number of cheat sites and download the recipe for every possible element. But even if you wanted to just blow through every element, it’s not that easy: “Okay, I want to make Twilight Saga, so I need a vampire, which is made of blood, which is made from a beast, wait, how do I make the lizard prerequisite again??!?” Obviously, if you’re going to cheat, you really want a cookbook that reduces each element to its most primal form: some combination of earth, air, fire, and water. But how to generate such a list?

Finally, the game got interesting for me. Here’s a perl script that takes the master list of elements from the above cheat site, and turns it into entries like:

lizard : ( ( earth + water ) + ( earth + ( ( ( ( air + fire ) + ( earth + water ) ) + ( earth + water ) ) + water ) ) ) + ( earth + ( ( ( ( air + fire ) + ( earth + water ) ) + ( earth + water ) ) + water ) )

…or even:

mcdonald’s : ( ( ( ( water + ( ( air + fire ) + ( fire + ( air + ( earth + fire ) ) ) ) ) + ( ( earth + ( ( ( earth + water ) + ( earth + ( ( ( ( air + fire ) + ( earth + water ) ) + ( earth + water ) ) + water ) ) ) + ( earth + ( ( ( ( air + fire ) + ( earth + water ) ) + ( earth + water ) ) + water ) ) ) ) + ( ( air + fire ) + ( earth + water ) ) ) ) + water ) + ( ( ( ( ( ( air + ( earth + fire ) ) + water ) + ( ( air + ( earth + fire ) ) + water ) ) + ( earth + ( ( ( air + fire ) + ( earth + water ) ) + ( ( air + ( earth + fire ) ) + water ) ) ) ) + ( earth + ( earth + ( ( ( ( air + fire ) + ( earth + water ) ) + ( earth + water ) ) + water ) ) ) ) + fire ) ) + ( ( ( earth + ( ( ( earth + water ) + ( earth + ( ( ( ( air + fire ) + ( earth + water ) ) + ( earth + water ) ) + water ) ) ) + ( earth + ( ( ( ( air + fire ) + ( earth + water ) ) + ( earth + water ) ) + water ) ) ) ) + ( ( ( fire + ( air + ( earth + fire ) ) ) + ( ( ( earth + ( ( ( earth + water ) + ( earth + ( ( ( ( air + fire ) + ( earth + water ) ) + ( earth + water ) ) + water ) ) ) + ( earth + ( ( ( ( air + fire ) + ( earth + water ) ) + ( earth + water ) ) + water ) ) ) ) + ( ( air + fire ) + ( earth + water ) ) ) + ( fire + ( air + ( earth + fire ) ) ) ) ) + ( ( earth + ( ( ( earth + water ) + ( earth + ( ( ( ( air + fire ) + ( earth + water ) ) + ( earth + water ) ) + water ) ) ) + ( earth + ( ( ( ( air + fire ) + ( earth + water ) ) + ( earth + water ) ) + water ) ) ) ) + ( ( air + fire ) + ( earth + water ) ) ) ) ) + ( ( ( ( air + ( earth + fire ) ) + ( ( earth + ( ( ( earth + ( ( ( earth + water ) + ( earth + ( ( ( ( air + fire ) + ( earth + water ) ) + ( earth + water ) ) + water ) ) ) + ( earth + ( ( ( ( air + fire ) + ( earth + water ) ) + ( earth + water ) ) + water ) ) ) ) + ( ( air + fire ) + ( earth + water ) ) ) + ( fire + ( air + ( earth + fire ) ) ) ) ) + ( ( ( air + fire ) + ( earth + water ) ) + ( ( air + ( earth + fire ) ) + water ) ) ) ) + water ) + fire ) )

See? Simple. The perl code is actually simpler than the resulting recipe, thanks to the power of recursion!

Since I don’t want to spoil the game for everybody, I won’t post all of the recipes here. 😉

#!/usr/bin/perl -w
sub lookup {
  my $s = shift;

  if($element{$s}[1]) {
    return "( " . lookup($element{$s}[0]) . " + " . lookup($element{$s}[1]) . " )";
  }
  return $s;
}

while(<>) {
  /(.*) = (.*) + (.*)$/;
  $element{$1} = [$2, $3];
}

for my $el (sort(keys(%element))) {
  $simplified{$el} = lookup($element{$el}[0]) . " + " . lookup($element{$el}[1]);
}

for(sort(keys(%simplified))) {
  print "$_ : $simplified{$_}n";
}

Tune in next week for my exciting python script that solves Super Mario 3

The road to the Metaverse

It has been a while since I checked in on the Metaverse scene. Tonight I downloaded Snowglobe (the open source viewer from Second Life, remember them?) and OpenSimulator (the still-alpha but apparently working mono-based server simulator). In about five minutes, I had my very own grid-ready simulator running on my local network. I became a god in my very own isolated box.

Now the real question: If I invite over some friends, and we make models in this world, can we click “print” and have the results come out of the Makerbot?

UPDATE: My mistake. The viewer you’re looking for is Meerkat. It lets you export all of your old juicy Second Life data, and re-import it into your new simulator. Virtual Sushi 2.0!

My First Computer

pwn3dI got my first home computer for Christmas, 1982 (about a month before my 8th birthday). It was a TI 99/4A with a speech synthesizer, built-in BASIC interpreter, and audio tape storage device. I had a chance to play with the Apple II in elementary school, but this one was ours!

I played my first video games on it. I remember my two favorite games were Henhouse and Ambulance. I even got an introduction to text-based adventure games with Adventure.

But twitch-games can only entertain you for a while. It wasn’t long before I started fooling with the BASIC interpreter to make my own sounds and graphics. My crowning achievement was a program that would tell you how many marbles were in a jar by estimating.

I remember when it dawned on me that since the storage device used regular audio tapes, it might be possible to copy them using another tape recorder (and it was!) Too bad I only knew one other person with a TI.

The only thing missing was a modem. In retrospect, it was probably all for the best that I didn’t have access to a modem for another few years.