Skip to content

Latest commit

 

History

History
114 lines (85 loc) · 3.34 KB

README.md

File metadata and controls

114 lines (85 loc) · 3.34 KB

🎮 Terminal TicTacToe

A developer-friendly TicTacToe game that runs in your terminal. Take a break from coding and enjoy a quick game without leaving your development environment! ⌨️

 _______    ______        ______
/_  __(_)__/_  __/__  ___/_  __/__  ___
 / / / / __// / / _ `/ __// / / _ \/ -_)
/_/ /_/\__//_/  \_,_/\__//_/  \___/\__/

Go Version Version License PRs Welcome

✨ Features

  • 🎯 Play TicTacToe directly in your terminal
  • 🤖 Challenge the unbeatable AI opponent
  • ⌨️ Vim-style navigation (h,j,k,l) or arrow keys
  • 🎨 Colorful interface with intuitive controls
  • 👥 Multiple game modes (vs Human, vs Computer)
  • 🎭 Simple and clean UI with borders and highlighting
  • 🔄 Play again feature after game completion

🚀 Installation

  1. Make sure you have Go installed (version 1.21.7 or higher)
  2. Install the game using:
go install github.com/abdullahnettoor/[email protected]

🎮 How to Play

  1. Start a new game:
tictactoe new
  1. Select game mode:

    • 👥 Local Multiplayer (2 Players)
    • 🤖 Local Computer (vs AI)
    • 🌐 Online Multiplayer (Coming soon!)
  2. Controls:

    • 🕹️ Move: Arrow keys or Vim keys (h,j,k,l)
    • ✅ Place mark: Enter
    • 🔄 Play again: P
    • ❌ Quit game: Q or Ctrl+C
  3. Game Rules:

    • Players take turns placing their marks (X and O)
    • First player to get three in a row wins!
    • In Computer mode, try to beat the AI (if you can! 😉)

💻 Development

Prerequisites

🛠️ Building from Source

  1. Clone the repository:
git clone https://github.com/abdullahnettoor/tictactoe.git
  1. Navigate to the project directory:
cd tictactoe
  1. Build and run:
make run

📁 Project Structure

.
├── 📄 main.go              # Entry point of the application
├── 📂 cmd/
│   ├── 📄 root.go         # Root command configuration
│   ├── 📄 new.go          # New game command handler
│   └── 📂 view/
│       ├── 📂 board/      # Game board implementation
│       │   ├── 📄 board.go # Core game logic and UI
│       │   ├── 📄 ai.go   # AI player implementation
│       │   └── 📄 utils.go # Helper functions and styling
│       └── 📂 menu/       # Game mode selection menu
└── 📄 go.mod              # Go module file

📝 License

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

👤 Author

Made with ❤️ by Abdullah Nettoor