Skip to content

About

A robust, crash-proof console Tic-Tac-Toe game in Java.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

Robust Console Tic-Tac-Toe (Java)

A bulletproof, console-based Tic-Tac-Toe game built in Java. The project showcases solid programming practices, focusing on Clean Code, Modularity, and Defensive Programming.


🚀 Key Features & Architectural Highlights

  • Defensive Input Validation: Utilizes Regular Expressions ([1-9]) coupled with short-circuit evaluation (||) to prevent system crashes (NumberFormatException) regardless of malicious or accidental user inputs (e.g., characters, symbols, out-of-bounds numbers).
  • DRY Principle (Don't Repeat Yourself): Avoided redundant logic for Player 1 and Player 2 by implementing a dynamic, loop-driven turn mechanism using ternary operators.
  • High Modularity: Code is decoupled into single-responsibility methods (checkInput, can, win, display) making it highly maintainable and readable.
  • Resource Management: Explicitly handles Scanner leaks by ensuring proper closure upon game termination.

🛠️ How to Run

Prerequisites

  • Java Development Kit (JDK) 8 or higher installed.

Execution Steps

  1. Clone the repository:
    git clone https://github.com/Banda-11/Console-Tic-Tac-Toe-Java.git

About

A robust, crash-proof console Tic-Tac-Toe game in Java.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages