How to build a self-learning game character using deep reinforcement learning, first in 200 lines of vanilla JavaScript, then again in PyTorch, and watch it go