Skip to content

Thomas-trinh/Snake-Game-with-TS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🐍 Snake Game (Terminal Edition)

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!


🎮 Features

  • 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)

🧰 Requirements

  • Node.js installed
  • ts-node for running TypeScript directly (or transpile to JS)

Install ts-node (if not already):

npm install -g ts-node

How to run

ts-node snake.ts

Expected outcome

!Screen Shot 2025-05-18 at 15 39 32

Press A,S,W,D for moving the snake

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published