Skip to content

Implementation of the classic video game Snake in low level MIPS Assembly Language 🐍

License

Notifications You must be signed in to change notification settings

mahirahman/Snake

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

10 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Snake in MIPS 🐍

Implementation of the classic video game Snake in low level MIPS Assembly Language πŸ•ΉοΈ

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See below for prerequisite libraries and notes on how to deploy the project on a live system.

git clone https://github.com/mahirahman/Snake.git

To get a feel for this game, try it out in QtSpim:

  1. Open QtSpim (Or your preferred MIPS emulator)
  2. Click 'File' on the top left
  3. Click 'Reinitialize and Load File' from the drop-down menu
  4. Find snake.s on your computer and open it
  5. Click the green play button
  6. Enter command w|a|s|d into the console that pops up
.@.............
...............
...............
...............
...............
...............
...............
....ooo#.......
...............
...............
...............
...............
...............
...............
...............

Image

Notes

The starting state of a game to the right, where you can see all the key parts of the game. Snake is played on a 15Γ—15 grid. The snake is made up of a head (#), and a number of body segments (o), and can move around the grid.

When the user enters one of w, a, s, or d, the snake will move one step on the grid either north, west, south, or east, respectively. The snake won't move if the requested direction is where the first non-head segment is.

Also on the grid: apples! Snakes like apples [citation needed] so, if the snake's head moves over an apple (denoted @), the snake consumes it, and gains three segments over the next three moves. If there's no apple on the grid, a new one is added in a random empty cell.

The game ends only when either the snake falls off one of the edges of the board, or the snake runs into its own body as the snake's length increases, not falling off the board or running into itself become increasingly tricky!

Built With

License

Authors

  • Mahi Rahman

About

Implementation of the classic video game Snake in low level MIPS Assembly Language 🐍

Topics

Resources

License

Stars

Watchers

Forks