However, once I got into the code of the article, I noticed it wasn’t very cleanly separated. For example, jQuery calls to animate tiles were performed in the same function as checking for the validity of a move. So, I thought about writing my own game engine before tackling the AI part. After all, it would be nice to swap out different input devices (Adafruit Trello, Wii Nunchuck, computer vision-instructued robots (what?)) and have a separated output, so that a game could be played with a arbitrary photo.
After I started separating the code, I ended up with a browser app which separated presentation (using jQuery) and logic (using a knockout viewmodel). Not quite sufficient: handling input from hardware devices would remain difficult. Off to node! This would allow me to make games persistent, handle multiple games, etc. However, this could make the simple functionality slow, so caching is needed. In the end, I try to learn about: