|
Ok, we all know the game Tetris, but have you ever seen the
computer play it? I didn't before I started this little project,
reason enough to put it online.
The applet you see here is playing tetris on its own. And it is doing a pretty good job (if I may say so)... No this applet does not play perfectly, but it does play fair. This means it can only look ahead one tetris-shape (as is standard) and as you can see it is playing in a real-time speed (and a lot faster). It is using the standard random generator of JAVA to generate the tetris-shapes and they are choosen uniformly. No cheeting! The applet can handle different widths and heights and the delay can be switched to different values. Here is a list of links to other values: A lot faster (but still delaying) NO delay (this is fast) A bigger board Oh yes, I almost forgot! You can also battle the AI in a direct fight! I just defined three levels, they play with the same algorithm, but at a different pace... You'll see THAT's important! :)... 'easy' 'normal' 'hard' |