Sunday, July 20, 2008

Some more stuff

And now for another exciting (cough) update!

I am currently attempting to get a movie of my Tandy 102 demo online so all of you who don't own the wonderful Tandy 102 can see something other than my code, which, frankly, is kinda boring. And then again, unless you are easily amused by old computers, you'll probably find the demo itself a bit bland. But I'm proud of it anyway, I had so much fun making it.

And I have begun my next project. It's a game, and I plan on calling it "sticks." It's a game you've probably heard of or played. Basically, there is a pile of sticks (or rocks, or whatever) and you can take 1, 2, or 3 of them. You take turns with a second player and try to force him to take the last stick. The person who takes the last stick looses. So far the code has been going well, though I am a bit stumped on how to make the computer generate random numbers correctly. Something tells me I need to seed my random number generator differently, it always wants to pick the same number of sticks... kinda annoying for this kind of game.

Yeah, that and the computer player's AI is pretty crummy right now. It just chooses randomly until the second to last move, when it tries to see if it can beat you. Pretty easy to beat the computer really, except by dumb luck when the computer wins by randomly choosing the right combination.

Well, back to work with the code! Expect a Google video link or something soon.

2 comments:

Equant said...

The first program I ever wrote for the Macintosh was the same match-stick game. It was in some Think Pascal tutorial some where.

Regarding the random numbers... It's been a long time since I wrote a program for the 102, but you can always time how long it takes some one to "Start Game" to seed your random numbers. So instead of just starting the game you have a title screen, and a register that's accumulating while it waits for the player to press a key to start the game. I can't recall how easy that approach would be with the Tandy basic.

Unknown said...

Well, that would work really good if I was working with assembler, but in Basic I can just seed with the TIME$ variable, which contains the current internal clock time. That way, unless you played the game again at the exact same time of day, you'd get different values.