Learning to play chess