Original Post
I'm trying to make a computer playing Tetris. But I have a little problem to find the best piece location. The variables I have for each possible location for one piece are the following: rows: The number of rows that is destroyed. holes: The number of holes that are created (counts the number of empty blocks to the left, right and bottom for each of the four blocks). drop: The number of blocks the piece have dropped before collision (the Y-axis). walls: The number of blocks the piece have touched when falling down far to the left or right side of the board. edges: The number of blocks that the piece have touched on another piece. For the moment, I have this setup: int bestScore = -100000; score = (rows*100) + (holes*-6) + (drop*10) + (edges*3); if(score >= bestScore) bestScore = score; This works mostly fine when using each of the standard tetris pieces for themselves. But when I use randomly created pieces, I won't even get one row destroyed. :( Could anyone help me find out a good solution to this?