Can you balance this cartpole?

Here is a pole sitting on top of a cart. How long can you balance the pole?

Use the left and right arrow keys (or h/l) to push the cart.
Use the Start button (or spacebar) to pause, resume, and restart.

High Score: 0.0

Your browser doesn't support the HTML5 canvas :(


This is the classic inverted pendulum problem of control theory—also known as the cartpole problem of reinforcement learning (or "AI"). With a proper strategy, you can stabilize the cart indefinitely. The strategy can either come from mathematical principles (control theory) or from experience (reinforcement learning).

Jeffrey Chang
Icons made by Roundicons from Last updated on Dec 19, 2019.