Skip to content

Amirbhn/SimpleTicTacToe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

Kotlin Tic-Tac-Toe

This is a simple console-based implementation of the Tic-Tac-Toe game written in Kotlin as part of hyperskill project practice.

How to Play

  1. Run the program in a Kotlin environment.
  2. The game initializes with an empty 3x3 grid.
  3. Players take turns entering coordinates (row and column) to make a move.
  4. The grid is updated after each valid move.
  5. The game ends when a player wins or when there is a draw.
  6. The program provides feedback for invalid moves.

Code Structure

  • The printGrid function is used to display the current state of the Tic-Tac-Toe grid.
  • The checkWinner function determines if a player has won based on the current grid.
  • The isGridFull function checks if the grid is completely filled, indicating a draw.
  • The main game loop handles player moves, validates input, and checks for a winner or draw.

How to Run

Compile and run the Kotlin code using your preferred Kotlin environment or command line.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages