Chess AI in JavaScript