Check the script below for a simple DOS-style game implemented as a single HTML file with JavaScript:
Cd
Please note that this is just a simple example and you can expand on it to create a more complex and interactive game. Feel free to customize it further to your liking!