Skip to content

Latest commit

 

History

History
27 lines (19 loc) · 1.62 KB

README.md

File metadata and controls

27 lines (19 loc) · 1.62 KB

GitHub Contributions Snake 🐍🍎

Please note that this script is not finished & requires more work. It was just a quick little project cuz I was bored. However, it is usable & fully functional, it just isn't at it's best. (yet) :)

This repository contains a JavaScript implementation of a Snake game that can be played on the GitHub contributions grid. The script automatically sets up the game, and the snake can be controlled using the arrow keys. The snake aims to eat the food that appears on the grid, growing in length with each piece of food consumed.

Features

  • Snake Movement: Control the snake using the arrow keys.
  • Food Generation: Randomly places food on the grid that the snake aims to eat.
  • Collision Handling: Prevents the snake from running into itself.

How It Works

The script continuously executes the following steps:

  1. Initialize Game: Sets up the grid, snake, and food.
  2. Handle Input: Listens for arrow key presses to control the snake's direction.
  3. Move Snake: Moves the snake in the specified direction, handles food consumption, and grows the snake.

Installation

To use this script with Tampermonkey:

  1. Install Tampermonkey: Install the Tampermonkey extension for your browser.
  2. Create a New Script: Open Tampermonkey, create a new script, and paste the code below into it.
  3. Save and Enable: Save the script and ensure it is enabled.
  4. Play the Game: Open GitHub and navigate to your contributions grid. Use the arrow keys to control the snake.