Skip to content

Latest commit

 

History

History
41 lines (30 loc) · 1.09 KB

README.md

File metadata and controls

41 lines (30 loc) · 1.09 KB

Snake Game in Go

This is a simple implementation of the classic Snake game in Go. The game is played in the terminal and uses keyboard input to control the snake's direction.

How to Play

  • Use the arrow keys to control the direction of the snake.
  • The snake will continue to move in its current direction even if no key is pressed.
  • Eat the food (represented by 'X') to grow the snake and increase your score.
  • Avoid running into the walls or the snake's own body.

Controls

  • Up Arrow - Move up
  • Down Arrow - Move down
  • Left Arrow - Move left
  • Right Arrow - Move right
  • Esc or q - Quit the game

Installation

  1. Make sure you have Go installed on your machine. You can download it from the official Go website.
  2. Clone this repository or download the source code.
git clone https://github.com/yourusername/snake-game-go.git
cd snake-game-go
  1. Build the game.
go build -o snake
  1. Run the game.
./snake

License

This project is licensed under the MIT License - see the LICENSE file for details.