Slashdot is powered by your submissions, so send in your scoop

 



Forgot your password?
typodupeerror

Comment Time Out! (Score 3, Interesting) 345

I'm either missing something or the boys at the MIT lab are thinking too hard.
Years ago I wrote a program to play tetris and it did just fine! I know because it played directly against the tetris I had on my computer.
I'll explain how it worked:
In 1989 I lived in England and had lots of spare time to tinker with my computer (it was an old PC running at 4.77Mhz).
I thought DOS Tetris was the coolest thing since mini skirts and was also dabbling with TSR programs at the time (TSR = Terminate and Stay Resident). These would let you run one program in the background while another program runs.
So, naturally, I wrote a TSR program to play Tetris.
I would start the TSR and then start the game. The TSR would look in the video buffer and analyze tetris as it ran. It would look at the layout of the board and look at the next piece. With some relatively simple logic and a series of rules it weighed the merits of various positions for the piece. To make the move it would stuff keystrokes in the keyboard buffer, such as Rotate, Rotate, Left, Left, Left, Drop. Then it simply waited till the keyboard buffer was empty (the piece had been moved) and look for the next piece.
I could just sit back and watch...
At first it wasn't very good but with some tweaking of rules it improved drastically.
It would do much better than I could do manually, with pieces spinning, moving and dropping like crazy until the game really sped up. Then, with the limitations of a slow computer it couldn't analyze the best move and get the keystrokes in the buffer in time. Once it hit this threshold the pieces would start to stack up and it would be 'game over'.
I think at the time and the version I had I personally could get a score of around 8000. The TSR could get scores up to around 15000.

Just something to think about.....
--
Geoff

Slashdot Top Deals

Once it hits the fan, the only rational choice is to sweep it up, package it, and sell it as fertilizer.

Working...