Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Tetris AI

Name: Anonymous 2010-06-08 3:34

Help, I want to implement an AI in my Tetris game but there aren't many good resources about it and I can't figure out what this guy is talking about: http://www.vidarholen.net/contents/junk/tetris/

When a piece drops, it simple goes through all rotations and horizontal movements of these to find the place where it's best to drop, for some definition of best. In this case is the total mass of the board where the weight of each square is the cubed distance from the top, minus a big penalty for each covered hole.
That didn't say much, I suppose. Let me try again: for each non-empty square (x,y), sum up y^3. Subtract the number of empty squares with a filled square over it (ie, they are unreachable by dropping blocks).

Besides the first paragraph being slightly nonsensical, I get lost at "Subtract the number of empty squares with a filled square over it".  Does that mean to take the total number of empty squares that are unreachable, and subtract that number from each y^3 that I calculate?  And then after I've done this for each non-empty square, am I meant to choose the highest value or lowest value to drop onto?

Name: Anonymous 2010-06-08 19:16

TILE() is just a poorly named macro that happens to be defined as
#define TILE(x, y)           ((x) +  (y*GridW))
where GridW is a constant that equals 10.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List