# Checkers AI Algorithm

I am making an AI for my checkers game and I'm trying to make it as hard as possible. Here is the current criteria for a move on the hardest difficulty:

1: Look For A Block: This is when a piece is being threatened and another piece can be moved in behind it to protect it. Here is an example:

Black Moves
`|W| |W| |W| |W| |`
`| |W| |W| |W| |W|`
`|W| | | |W| |W| |`
`| | | |W| | | | |`
`| | | | |B| | | |`
`| |B| | | |B| |B|`
`|B| |B| |B| |B| |`
`| |B| |B| |B| |B|`

White Blocks
`|W| |W| |W| |W| |`
`| |W| | | |W| |W|`
`|W| |W| |W| |W| |`
`| | | |W| | | | |`
`| | | | |B| | | |`
`| |B| | | |B| |B|`
`|B| |B| |B| |B| |`
`| |B| |B| |B| |B|`

2: Move pieces out of danger: if any piece is being threatened, and a piece cannot block for that piece, then it will attempt to move out of the way. If the piece cannot move out of the way without still being in danger, the computer ignores the piece.

3: If the computer player owns any kings, it will attempt to 'hunt down' enemy pieces on the board, if no moves can be made that won't in danger the king or any other pieces, the computer ignores this rule.

4: Any piece that is owned by the computer that is in column 1 or 6 will attempt to go to a side. When a piece is in column 0 or 7, it is in a very strategic position because it cannot get captured while it is in either of these columns

5: It makes an educated random move, the move will not indanger the piece that is moving or any piece that is on the board.

6: If none of the above are possible it makes a random move.

This question is not really specific to any language but if all examples could be in Java that would be great, considering this app is written in android. Does anyone see any room for improvement in this algorithm? Anything that would make it better at playing checkers?

-
(On a Checkers-specific note, IIRC being on the edge isn't necessarily the advantage you make it out to be; such pieces have no mobility, since they only have one move available, and are easier to trap and capture.) – Steven Stadnicki Jun 3 '12 at 19:11
Just in case you weren't aware checkers is a solved game, and if played perfectly the result is always a draw. chessbase.com/newsdetail.asp?newsid=3997 – Adam Jun 4 '12 at 12:01