A chess game with a slow AI in Javascript