Using JS for this feels like cheating... I wonder if similar things would be possible with PostScript?
And OFC there's a chess engine in PS, a tic tac toe, and with patience you could even play NES games, but you might need to play with the stack a lot.