Skip to content

amithrx/TicTacToe-using-Java-OOPs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

## TicTacToe in Java using OOPs

- Operations:
  : 1 for player vs player and 2 for player vs computer
 
- Format of TicTacToe board:
   This is a new game. Board numbers are as follows:
   ---------------
    |1|  |2|  |3|
   ---------------
    |4|  |5|  |6|
   ---------------
    |7|  |8|  |9|
   ---------------

- After this,it will prompt the user to enter between [1,9] to choose the desired locations.
- For player vs computer player is 'X' and computer is '0' and for player vs player player1 is 'X' and player2 is '0'.
- After each move is done by either you or your opponent it will display the modified grid.
- Computer will try its best move, if it has winning moves then it will do that, otherwise, if it can block the opponent move it will do that, otherwise, it will do random moves in available space in grid.
- Every instruction will be prompted on the screen to have an interactive environment.

- To run the program, type the following commands in your terminal:
    : javac TicTacToe.java
    : java TicTacToe

About

The classic TicTacToe game having two versions player vs player or computer vs player

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages