Skip to content

SVENTRIPIKAL/Tic-Tac-Toe

Repository files navigation

Tic-Tac-Toe

A short terminal version of the famous game of Tic-Tac-Toe. Game rules
are the same: X-player goes first, followed by O-player, etc., and obtaining
3-in-a-row (Horizontally, Vertically, or Diagonally) is the goal to winning
the game. User input must be two numbers between 1 & 3 (inclusive) and
separated by a space, which indicates the point where the player's icon
will be placed along the 3x3 grid.

Example

---------
| O X O |
| X X _ |
| O _ X |
---------
>> 2 3
---------
| O X O |
| X X O |
| O _ X |
---------
>> 3 2
---------
| O X O |
| X X O |
| O X X |
---------
>> X wins

Highlights

  • While Loops
  • Java Scanner
  • Enum Classes
  • Inner Classes
  • When Expressions
  • Exception Handling
  • Regular Expressions
  • Try-Catch-Finally Statements

Inspiration

Simple Tic-Tac-Toe (Kotlin)
Part of the JetBrains Academy: Hyperskill - Kotlin Developer Course

About

A short terminal version of the famous game of Tic-Tac-Toe

Resources

Stars

Watchers

Forks

Languages