You're absolutely right! The chess AI is intentionally very simple (or "dumb" as you put it 😄). I'm not using any external chess library in this implementation - it's all custom code with a very basic AI.
The current AI simply:
This is about as basic as a chess AI can get - no evaluation function, no look-ahead, no opening book, and no endgame strategy. It's designed to be beatable as a captcha verification rather than a challenging opponent.
If you wanted a smarter chess AI, I could:
Would you like me to enhance the AI to make it a bit smarter while still keeping it beatable for captcha purposes? Or would you prefer to keep it simple but add other features to the chess captcha?
Yes, there are several great chess libraries on npm! The most popular one is chess.js which handles all the chess rules, move validation, and game state management. Let me update the implementation to use it with a smarter (but still beatable) AI:
Now the chess captcha uses chess.js library which provides:
The AI now:
The AI is now much smarter than the random-move version, but still designed to be beatable by humans for captcha verification!