Sure, here's a simple implementation of Pac-Man as a single HTML file using JavaScript:
To run this game, save the code in an HTML file (e.g., `pacman.html`) and open it in a web browser. You can control Pac-Man's movements by swiping on the game board using a smartphone. The goal is to collect all the yellow dots. Once you collect all the dots, an alert will be shown with a congratulatory message and the game will restart. Enjoy playing Pac-Man!