Sure! Below is an example of a simple Snake game implemented as a single HTML file:
This code implements a basic Snake game using JavaScript and HTML canvas. The player controls the snake using the arrow keys, and the objective is to eat the apple. Each time the snake eats an apple, it grows longer. The game ends if the snake collides with the walls or itself.
Note: This is a simplified example for demonstration purposes. You can enhance the game by adding more features like scoring, levels, and additional game mechanics.