Showing posts with label Programming. Show all posts
Showing posts with label Programming. Show all posts

Monday, March 10, 2008

Ticky Tacky Dough--and how many men could a Pacman pack if a Pacman could pack?

I found an old CD with some of my old home projects, written in Visual Basic.

First is a shoddy version of Pacman. If you're wondering why it looks so much like the arcade version--I screenprinted the real thing and used the bitmap as a background. (Hopefully this snapshot is not violating copyright--if it is, tell me and I'll take it down.)

To the right is a behind the scenes look at how the program works. Basically, Pacman, Blinky, Pinky, Inky, and Clyde ran on "rails".

Unfortunately, the backup wasn't up-to-date. It only encompassed Pacman running the maze, while moving his mouth. Later versions had his enemies, working power pellets(that is the ghosts turned blue when they were eaten), dots, and I had the ghosts regenerating in the ghost box. What I had not perfected was how the ghosts hunted or fled Pacman--and even the disembodied eyes had a time getting back to the ghost box.

As with many home projects, I got to the point where I saw I could do the window dressing. But then, what? The mountain was basically climbed at that point. I moved on.

In the bottom righthand corner is a screenprint of the obligatory Tic Tac Toe program. If memory serves me correct, it was just a matter of a few sittings to code. If you're interested in the code, navigate over to my Livejournal.

Friday, December 7, 2007

Shallow Red


This is my chess program in action.

You've heard of Deep Blue, the terror of Chess Champions everywhere? Well, this it ain't. I never promised that it was pretty. Like Frankenstein, I never bothered making my creation look good. It was only a personal project. If & when I'd the chess engine well tuned, then I intended on going back and give it a slick front end.

Is it alive? Barely. It can be set to Human vs Human, Human vs Computer, Computer vs Computer.

It never allows the human to make an illegal move. On computer mode it tries to calculate the best possible move, reiteratively adding and subtracting different possibilities based on pieces that are in jeopardy on both sides, depending on the value of the piece. Unfortunately, such exponential processing can get out of hand. Thus, I can't calculate too many moves ahead. Even so, it takes, at least, half a minute. And even then, it makes some boneheaded moves sometimes.

Obviously, it was a work in progress. But I haven't touched it in over 4 years other than, importing the code into Excel and making a type of spreadsheet chess. And why would anyone do that? Because I could. To satisfy my inner mad scientist.