A classic Snake game playable entirely in the terminal, built using TypeScript and Node.js. Control the snake using your keyboard (WASD) and try to grow as long as possible without hitting the walls or biting yourself!
- Playable directly in the terminal
- Real-time movement using
stdin
- Snake grows each time it eats food
- Game Over on:
- Hitting the wall
- Biting itself
- Displays current score
- Prevents 180-degree turns (e.g. no reversing direction)
Install ts-node (if not already):
npm install -g ts-node
ts-node snake.ts
Press A,S,W,D for moving the snake