Sure, here's an example of a simple text-based game written in JavaScript, enclosed in script tags in a single HTML file:
In this game, the player starts at the "School" location and their goal is to find the "Exit". They can navigate through different locations (currently only "School" and "Hallway") by typing appropriate actions in the prompt. When the player reaches the "Exit" location, a congratulatory message is displayed indicating that the game has been won.
Please note that this is a very basic example to demonstrate the structure and flow of a simple game implemented in JavaScript within an HTML file. You can customize and expand on it according to your specific requirements, such as using pictograms or adding more locations and actions.