Dang, this is hard. I got really close to winning with just 3 squares left. Nice implementation of a classic concept!