Edit: pull request here if anyone wants to see the code:
https://github.com/grant/hnplays2048/pull/13