4-Bot uses the Python Imaging library to process the image of the game board. The image is down-sampled to 16 colours to enhance readability and then divided into a grid. Each of the 42 spaces on the board is identified as red, yellow or empty by reading the RGB value of each space in the grid and this data is then saved as an array which represents the board state and then passed to the AI. Even on a small 6 x 7 Connect 4 board there are 4,531,985,219,092 possible game positions – yes, that’s TRILLIONS! So getting the Pi to play the game effectively was quite a challenge. It becomes a trade off between absolute perfect play, and reasonable time for each move. The robot part is built from a recycled top assembly from a 3D printer and the claw from a MeArm robot arm. Motion and LCD screen controlled by the PiXi controller board.