100% found this document useful (1 vote)
101 views

What Is Tic Tac Toe?

Tic Tac Toe is a two-player game where players take turns marking a 3x3 grid with Xs and Os. The goal is to be the first to mark three of your symbol in a horizontal, vertical, or diagonal row. The document provides rules for playing: X goes first, players alternate placing symbols until someone wins or the board is full, in which case it's a draw. It then describes steps to create a basic Tic Tac Toe program in Java without a GUI, including creating packages and classes for the game model, view, and controller. Potential extensions are adding a GUI interface, introducing artificial intelligence for one player, and tracking player scores over multiple games.

Uploaded by

Rajesh Kumar
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
101 views

What Is Tic Tac Toe?

Tic Tac Toe is a two-player game where players take turns marking a 3x3 grid with Xs and Os. The goal is to be the first to mark three of your symbol in a horizontal, vertical, or diagonal row. The document provides rules for playing: X goes first, players alternate placing symbols until someone wins or the board is full, in which case it's a draw. It then describes steps to create a basic Tic Tac Toe program in Java without a GUI, including creating packages and classes for the game model, view, and controller. Potential extensions are adding a GUI interface, introducing artificial intelligence for one player, and tracking player scores over multiple games.

Uploaded by

Rajesh Kumar
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

What is Tic Tac Toe?

Tic Tac Toe, also popularly known as X and 0’s is a two-player game. Generally, there is a 3 X 3
grid, in which players take turns to mark the spaces with their respective symbol i.e. ‘X’ or ‘0’.
The player that succeeds in placing three of their makes either in horizontal, vertical or in a
diagonal row, wins.

Here are some rules for the game:

 The player with symbol ‘X’ goes first

 Players alternate placing Xs and Os on the board until either

 one player has three in a row, horizontally, vertically or diagonally; or

 all nine squares are filled.

 The player who can draw three Xs or three Os in a row wins.

 If all nine squares are filled and none of the players have three in a row, the game is a draw.

Java Tutorial for creating a Tic Tac Toe

Follow these steps to create a Tic Tac Toe program in java. Today, we will create a simple Tic
Tac Toe program, without any GUI and can be played by two players. Please note that both the
players must be human.

1. Create a new Project

The very first step of creating our Tic Tac Toe game is to make a new project. Open your IDE (I
am using NetBeans) and create a new Java Project by the name TicTacToe. Inside our project, we
will create three Model package Model, View and Controller. It contain classes
GameController.java, Enemy.java, Player.java, Players.java, Screen.java. The Screen.java class
will contain the main() method and will be used to run the code in Screen.java. The other class
which will contain an object that will have the state of the board and methods to manipulate the
game.

1. Adding GUI:
This game will be more interactive if GUI is added to it, the symbols can be added to the by
just clicking on the matrices, which would be buttons if GUI is used.

2. Introduction of Artificial Intelligence


An option of playing against the computer (bot) can be added too. An algorithm can be
implemented for the bot based on actual rules a player uses to fill the Tic-Tac-Toe board.
This can pose a challenge to the user when playing.

3. User scores
Both computer and humann’s score are displyed for multiple time .

You might also like