Sure! Here's an example of an endless game where a pig is chased by a farmer, implemented as a single HTML file using JavaScript and enclosed in script tags:
This game continuously moves the pig pictogram to the right, and every time it reaches the end, the score increases by one. The game ends when the player clicks on the game container, showing their final score. They can then click again to restart the game. The pig and farmer pictograms are displayed using emojis.