How did I defeat myself vs. Stockfish engine today?
By blocking pieces from developing. This is kind of a bad habit with me, and it’s usually how my game starts to fall apart. For example, my move 2) … Bd6

Computer programming for chess, improving my game, and chess education.
How did I defeat myself vs. Stockfish engine today?
By blocking pieces from developing. This is kind of a bad habit with me, and it’s usually how my game starts to fall apart. For example, my move 2) … Bd6
Last year I “wondered if MVC was even the best design for a chess game,” but if I had taken the time to read about the Universal Chess Interface (UCI) I would have seen that MVC is a common design for online chess. If I had built to UCI specs and selected a full-stack framework instead of trying to write backend from the ground up in Node, I might not have given up and resorted to just writing frontend for a platform service.
Sure, online chess is a solved problem, but I was reinventing the wheel for learning’s sake.
This single-page app chess game is live on Netlify. It’s logo is an image of IC 434, the Horsehead Nebula, that I took using iTelescope.net.
Building this app with a Next.js template was an opportunity for me to learn to write pure functions. It was a major milestone in my learning journey, as someone who has been dependent on the use of for
loops and array mutations since college! It’s amazing to see how much you can get done with only const
and once I got used to Array.prototype
‘s map
and filter
I think I actually prefer them to for
loops. Last but definitely not least with pure functions,
was learning to write recursion. Taking out pencil and paper and planning out the function composition necessary to get me from point A to point B was what enabled me to finally write a working recursive function.
Making a chess game has been the pet project nearest and dearest to my heart. Through making a chess game, I built up my HTML, CSS, and JavaScript skills, tried out several styling aids such as Bootstrap, Sass, and Bulma, learned about MVC architecture, and did a deep dive into writing elegant/efficient solutions in the problem domain. MDN Web Docs were my JavaScript and Web API reference of choice, and I was appreciative of hints into the problem domain offered by sites like Chess Programming Wiki without giving away specific “code spoilers,” speaking of which, I know there are existing, proven solutions out there for chess engines and frontends: Stockfish, GNU Chess, Lichess, etc., and reinventing the wheel was just my way of teaching myself to code with something that interested me.
I first attempted MVC with the UI and the data-generating backend modules both coded in vanilla JS, with a NodeJS simple server. It was a challenge to avoid antipatterns and ensure SoC without writing within a framework, and sometimes I wondered if MVC was even the best design for a chess game, so I was pleased to
finally refactor the code into the React framework, creating a working UI in much less time than it took for me to code vanilla MVC View objects!