> ## Documentation Index
> Fetch the complete documentation index at: https://aegean.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Dynamic programming on a gridworld (interactive)

> Interactive browser demo by Andrej Karpathy showing policy evaluation, policy iteration, and value iteration on a configurable gridworld.

Andrej Karpathy's ReinforceJS demo runs policy evaluation, policy iteration, and value iteration on a gridworld MDP directly in your browser. Use it as a companion to the algorithm pages above: watch state values propagate with each sweep, see the greedy policy refine, and toggle between evaluation-only and full iteration to feel the difference.

<iframe src="https://cs.stanford.edu/people/karpathy/reinforcejs/gridworld_dp.html" width="100%" height="900" style={{ border: '1px solid #e0e0e0', borderRadius: '6px' }} title="Karpathy ReinforceJS: Gridworld DP demo" loading="lazy" />

Source: [`cs.stanford.edu/people/karpathy/reinforcejs/gridworld_dp.html`](https://cs.stanford.edu/people/karpathy/reinforcejs/gridworld_dp.html). If the embedded frame above is blocked by your browser or network, open the link in a new tab.

***

<Callout icon="pen-to-square" iconType="regular">
  [Edit this page on GitHub](https://github.com/aegean-ai/eaia/edit/main/src/book/mdps/dp-gridworld-demo.mdx) or [file an issue](https://github.com/aegean-ai/eaia/issues/new/choose).
</Callout>
