December 18th, 2007

My wonderful Meg kitty.

(no subject)

I've been doing very little on LJ these days -- apologies. It's not even work, really. It's other stuff killing my time.

Some personal junk -- mostly drama-inducing things I find myself not caring to post on LJ. I barely want to deal with them in real life.

I started playing Tokyo Extreme Racer Drift 2. It's forced me to write two scripts. One to sort car stats (power to weight ratio, mostly) and another one to run a variant of the traveling salesman problem

As you play the game, you can gather sponsors. When you win an organized race, you get money from your sponsors (in addition to prize money) for the stickers on your car. Each sticker is worth a different amount based on where it is on your car.

At the moment, I have 8 sponsors. There are 16 points on the car where a sticker can be applied. This can be treated as a 16 digit number in base 9 (until I get more sponsors anyway). More generally, an m bit number in base-n where m is the number of points on the car and n is the number of sponsors + 1. No digit can appear two or more times (except for 0). It seems like there should be a better algorithm than iterating through all the possibilities. The best optimization (assuming that all possible stickers will be in use) I've made cut down the range from 0-(9^17)-1 to around 6*10^6 to 1*10^15 for my current case.

I don't have an obvious, non-computationally-intensive way of detecting when two stickers from the same sponsor are used or detecting when all possible sponsors are used, so that removes that as a reasonable limit.

Last, but not least -- The Altair 8880 (the first personal computer) went on sale today in 1976. We've come quite a ways since then.