Professional Documents
Culture Documents
ABSTRACT:
TIC-TAC-TOE is a very simple two-player game. So only two players can play at a time. This game is also
known as Noughts and Crosses or Xs and Os game. One player plays with X and the other player plays with
O. In this game, actually there is a board of nxn squares. But, in our game we have a board consisting of a
3x3 grid.
The game will toggle between the players by giving the chance for each player to mark their move.
When one of the players make a combination of 3 same markers in a horizontal, vertical or diagonal line
then we will display which player has won, whether X or O based on their arrangement. In this project, we
implement a 3x3 tic-tac-toe game on the bread board using number pallet. We use number pallet for entering
the players choice to place their object.
The game is designed so that two players can play tic-tac-toe by entering the number in which block
they want to place their object. As the player enters the number, the object gets displayed on the board by
the given instructions. If the place is already filled, it gives an instruction to fill in another place. After
completion of a player’s turn the chance will be moved to another player. If all the places in the board have
been filled, then the game ends with a tie.
1
CONTENTS
S.No TOPIC PAGE.No
2. THEORITICAL ANALYSIS 3
2.1 Existing System 3
2.2 Proposing System 3
2.3 Theory of the Game 3
2.3.1 Core Logic 4
2.3.1.1.First move 4
2.3.1.2.Second move 4
2.3.1.3.Third and Fourth move 6
4. IMPLEMENTATION 9
4.1.Source code 9
4.2.Methods used 15
7. REFERENCES. 17
2
1.INTRODUCTION OF TIC – TAC – TOE GAME :
1.1. INTRODUCTION :
→Tic-tac-toe is a simple, two-player game that, if played optimally by both players, will always result
in a tie. The game is also called noughts and crosses or Xs and Os.
→Tic-tac-toe is a game that is traditionally played by being drawn on paper, and it can be played on a
computer or on a variety of media.
→In this game, there is a game board with nxn squares. But, in our project it is 3x3 squares. The goal of
Tic-Tac-Toe is to be one of the players to get three same symbols in a row- horizontally, vertically or
diagonally- on 3x3 grid.
1.2.AIM :
The aim of the project is to develop a Tic – Tac – Toe game for mobile device. The game is
supposed to consists of two parts, one a single player game (a player against the system), and the
other a multi-player game (two players on the device against each other).
1.3.OBJECTIVE :
2. THEORETICAL ANALYSIS :
2.1.EXISTING SYSTEM :
Tic-Tac-Toe (or Noughts and crosses, Xs and Os) is a pencil-and-paper game for two players, O and X, who
take turns marking the spaces in a 3 x 3 grid. The player who succeeds in placing three respective marks in a
horizontal, vertical or diagonal row wins the game.
2.2.PROPOSED SYSTEM :
In this project, we create a 3x3 tic-tac-toe game in LabVIEW. The system is designed so that two players
can play a game of tic-tac-toe using LabVIEW software. The program will contain a display function and a
select function to place the symbol as well as toggle between the symbols allowing each player a turn to play
the game. The program will update after each player makes their move and will check for the conditions of
the game as it goes on.
In case logically no one can create a straight line with his own symbol, the game results a tie. Hence there
are only three possible results – a player wins, his opponent (human or computer) wins or it’s a tie.
If any player is able to draw three Xs or three Os in the following combinations then that player wins. The
combinations are:
a) 1, 2, 3 b) 4, 5, 6
c) 7, 8, 9 d) 1, 4, 7
e) 2, 5, 8 f) 3, 6, 9
h) 1, 5, 9 i) 3, 5, 7
2.3.1.Core Logic –
2.3.1.1.First move:
a) If the center is free, get the center.
b) Otherwise, get any of the corners.
2.3.1.2.Second move:
a) Block the opponent from winning.
b) Option for winning by applying the following logic: If the center is occupied by player-1, get any of the
corners.
4
Otherwise, the following cases happen:
Case 1:
If any situation arises like the above diagram, then the player-2 sets its symbol any one of the position
among 2, 4, 6 and 8.
Case 2:
If any situation arises like the above diagrams, then the player-2 sets its symbol at any position among 4 and
6.
Case 3:
5
If any situation arises like the above diagrams, then the player-2 sets its symbol at any position among 2 and
8.
Case 4:
If any situation arises like the above diagrams, then the player-2 sets its symbol at any position among 1, 3,
7 and 9.
6
3.ANALYSIS & DESIGN OF TIC-TAC-TOE :
3.1.SYSTEM REQUIRMENTS:
3.1.1.Hardware Requirements:
3.1.2.Software Requirements:
3.2.DESIGN:
Implementation of the Tic-Tac-Toe game is done using GUI. This is done using tkinter. A landing page
containing selection buttons is created. Selection buttons include single player or multiplayer. The user
should select whether single player or multiplayer. A game board containing nine tiles to play the game
along with other details (i.e. playing with a system or another player , whose turn etc.) should be created.
The player is allowed to press the tile and check the status of the game (i.e. Tie game, anyone of the players
won the match or the game is still running). At last a message is displayed showing who won the match.
7
3.3.DATA FLOW DIAGRAM :
8
4.IMPLEMENTATION :
4.1.SOURCE CODE :
9
10
11
12
13
14
4.2.METHODS USED:
→Tkinter is the standard GUI library for python. It provides a good object-oriented interface to Tk GUI
toolkit. We import tkinter module.
→gameboard_pc() and gameboard_pl() will create the another geometry to play the game. It will add 9
buttons on 3×3 board of the game (Three rows of buttons containing three buttons each).
→get_text_pc() and get_text() functions will put the text on buttons as it pressed.
→winner() function will check whether the player won the match or not.
→isfree() function will check whether the player can put it’s a coin or not.
5.1.RESULT :
15
For Multi-Player : (Player1 v/s Player2)
16
6.CONCLUSION & FUTURE ENHANCEMENT :
6.1.CONCLUSION:
6.2.FUTURE ENHANCEMENT:
• By next project, in android development we would like to learn the OpenGI 2D graphics which can
be implements in the application which will improve the working and presentation of the application.
• Also we would like to implement a 4x4 board game.
• We would to make the game to play from two different computers at a time in multi-player option.
6.3.LIMITATIONS:
7.REFERENCES :
17
→ Stephen Mann and Matthew Netsch, "A parallelEmbedded Neural Network for an Intelligent
Turn-Based Engine", http://www.samduffysinger.pwp.blueyonder.co.uk/
Project%20Outline%20TicTacToe.pdf
→ Shahzeb Siddiqui , Francis Mutuc and Nicholas Schmidt, "Designing a 5x5x5 Tic-Tac-Toe Game
using a Neural Network with Backpropagation with a Twist”,
http://www.personal.psu.edu/fcm5007/eportfolio/AINeural Networks.pdf
→ Pinaki Chakraborty, Artificial Intelligence Based Strategies to Play the Tic -Tac-Toe Game,
Journal of Technology and Engineering Sciences, Vol 1, No. 1 January –June 2009
→ J N Leaw and S A Cheong, Strategic insights from playing quantum tic-tac-toe, Journal of
Physics A: Mathematicaland Theoretical Volume 43 Number 45, 2010
→ Soedarmadji, Decentralized Decision Making in the Game of Tic-tac-toe, IEEE Symposium on
Computational Intelligence and Games, May 2006
→ Edward P. Vogel, Tic tac toe game using an optically routed gate array, Proc. SPIE 2863, Current
Developments in Optical Design and Engineering VI, 407, Nov 1, 1996
→ Alauddin Al-Omary, Machine- Human Tic-Tac game based on Microcontroller Technology,
International Journal of Computer and Information Technology (ISSN:2279 – 0764) Volume 02–
Issue 05, September 2013
18