snake

command module
v0.0.0-...-0b403f8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 25, 2024 License: MIT Imports: 6 Imported by: 0

README

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.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL