Below is the **same single‑file Pong** but with the left paddle now controlled by a simple AI instead of the `W/S` keys.
Copy the code into a file (e.g., `pong-ai.html`) and open it in a browser.
```html
Pong – AI Left Paddle
```
### What changed?
- **AI function (`aiMove`)**:
*Tracks the ball’s vertical position when the ball is moving toward the left paddle.*
*Moves the paddle up or down at a constant speed (`paddleSpeed`).*
*Keeps the paddle inside the canvas bounds.*
- **Input handling**:
*Only the right paddle (Arrow keys) is controlled by the player.*
*The left paddle no longer listens to `W`/`S`.*
- **All other logic (ball physics, scoring, win condition) remains the same.**
You can tweak the AI’s reaction speed or add a delay to make the game more or less challenging. Enjoy!