All Projects
Personal Project · July 2025

Terminal Snake Game in Go

A high-performance, terminal-based Snake game implementation written in Go, showcasing advanced concurrency patterns, data structures, and clean architecture principles.

Technologies
GoGoroutinesChannelsConcurrencyTerminal UIANSI Escape SequencesLinked ListsCLI
Terminal Preview
snake — Terminal Snake Game
┌────────────────────────────────────────┐ │ TERMINAL SNAKE │ │ │ │ ████████████████████████████████████ │ │ █ █ │ │ █ █ │ │ █ ●●●●●●● █ │ │ █ ● █ │ │ █ ● █ │ │ █ ● █ │ │ █ ♦ █ │ │ █ █ │ │ █ █ │ │ █ █ │ │ ████████████████████████████████████ │ │ │ │ Score: 7 Speed: Medium ↑ │ │ High: 23 Board: 20x15 ← → │ │ ↓ │ │ │ │ Controls: WASD / hjkl / Arrow Keys │ │ [P]ause [Q]uit [R]estart │ └────────────────────────────────────────┘
Overview

Overview

This Terminal Snake Game is a sophisticated implementation written in Go that demonstrates mastery of concurrent programming, efficient data structures, and clean architecture principles.

Built with performance and maintainability in mind, the project showcases advanced Go concepts including goroutines for concurrent input processing, channels for safe communication, and efficient data structures like linked lists for optimal snake body management.

The game supports multiple difficulty levels with configurable board sizes and speeds, responsive controls, and cross-platform compatibility across macOS, Linux, and Windows terminals.

Features

Features

Performance & Concurrency

  • Goroutines & Channels: Non-blocking input handling with safe concurrent communication
  • Efficient Data Structures: Linked list implementation for O(1) head/tail operations
  • Real-time Processing: Game loop with precise timing and input processing
  • Memory Optimization: ~2MB baseline memory footprint with minimal allocations

Gameplay & UI

  • Multiple Difficulty Levels: Three board sizes (Small, Medium, Large) and configurable speeds
  • Responsive Controls: Vim-style (hjkl) and WASD movement with direction locking
  • Terminal Programming: Raw terminal manipulation and ANSI escape sequences
  • Cross-platform: Works seamlessly on macOS, Linux, and Windows
Back to All Projects