For details see my blog Shehshagiri Hegde - A simple demo on reinforcement learning
If you cannot wait hit the button below to see how the agent behaves once properly trained