Friday, October 26, 2007

While the Cat's away..

Ethel was out of town last week, so I had some time to kick back, relax, and write a bit of arguably meaningless code. It started out simple enough - Ethel likes horses, so I wanted to try to draw one in a web page. Turns out that's not too hard:
But a single horse was lonely, so I changed the code to draw a bunch of horses - a coral if you will, or maybe wild Mustangs.

Then I thought "well, they're horses, maybe they should race." And I added lots of code and a couple of buttons so that the horses could race across the screen. And that was cool for a while.

But then I thought "that's kind of stupid - the just run at random speeds. And I thought "wait, what if I gave the horses names, and then looked up each "name" on the Yahoo! to see how popular it was, and the more popular a horse was, the faster it ran, etc.

And lo and behold, my cheesy horse racing application was done.

Don't get me wrong, it's by no means perfect. The graphics are a little rough - Halo 3 is certainly better (but I think they spent more money on their game than I did), and the code is a bit iffy in places, but it's sort of neat in a Magic 8-ball sort of predict things way.

And it does have this neat side effect - when run in Internet Explorer (6 and 7), the first race works fine, but then the second race causes the browser to crash. Oopsie..

Labels: , ,

1 Comments:

At 6:58 AM, Blogger CJH / esper said...

Equine contenders: foobar, fubar, baz, bletch, phred, quux, fnord
(trying to recall the starting lineup, think I spaced one).

What, I must ask, makes "baz" so bloody popular on EITHER search engine? Is there a grey market in ambazic needlepoint, or rotary baz adapters, or secondhand Roombaz? I mean, WHAAAAAT?

BTW, the horses aren't that bad. Ever seen Horse Racing for Mattel ["it's swell!"] Intellivision?
I have. For months, whilst writing that game. The only defense I can offer is that they sucked less than the animations created by a team of high-falutin' designers.

 

Post a Comment

<< Home