Sei sulla pagina 1di 18

CHAPTER 1

INTRODUCTION

Introduction to Tic Tac Toe

Our project name is Tic-Tac-Toe game. This game is very popular and is fairly simple by itself. It is
actually a two player game. In this game, there is a board with n x n squares. In our game, it is 3
x 3 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 a 3 x 3 grid.

1.1 Aim and Objective of the project


AIM:
The game is developed for full-time entertainment and enthusiasms. It teaches the Gamer to bealert at
every situation he/she faces, because if the Gamer is not fully alert and notice the saucerfire he/she
must be hit by the saucer-bombs.

Though the proposed game is an action game, it doesn’t involve direct violence. No zombie killing,
animal killing, or human killing is performed in the game. So it can also be viewed as a non-violence
game.Kids can also play this game, because the design of the game is very simple, controlling the
gameis very easy.

OBJECTIVES OF THE PROJECT:

Our objective is to evolve several Tic-tac-toe strategies which never lose (meaning a draw or a win by
the computer). This makes the problem to have a single objective of minimizing the number of losses.
The evaluation of fitness of any strategy is done by first allowing it to play all possible games it could
play, both as a first player and as a second player. For example, note from Figure 5 that there are two
possible ways a game can move for the first player from level 1 to level 2, depending on whether the
opponent made the left or the right side move .

1
CHAPTER 2
PROJECT BACKGROUND

The program is in not played optimally by both sides because the moves are chosen randomly. The
program can be easily modified so that both players play optimally (which will fall under the category
of Artificial Intelligence). Also the program can be modified such that the user himself gives the input
(using scanf() or cin).

A player can choose between two symbols with his opponent, usual gamesuse “X”and “O”. If first
player choose “X” then the second player have to play with “O” and vice versa.A player marks any of
the 3x3 squares with his symbol (may be “X” or “O”)and his aim is to create a straight line
horizontally or vertically or diagonallywith two intensions:a) Create a straight line before his
opponent to win the game. b) Restrict his opponent from creating a straight line first.In case logically
no one can create a straight line with his own symbol, thegame results a tie.Hence there are only three
possible results – a player wins, his opponent(human or computer) wins or it’s a tie.

2
CHAPTER 3
CURRENT SYSTEM

The first player, whom we shall designate "X", has 3 possible positions to mark during the first
turn. Superficially, it might seem that there are 9 possible positions, corresponding to the 9
squares in the grid. However, by rotating the board, we will find that in the first turn, every
corner mark is strategically equivalent to every other corner mark. The same is true of every edge
mark. For strategy purposes, there are therefore only three possible first marks: corner, edge, or
center. Player X can win or force a draw from any of these starting marks; however, playing the
corner gives the opponent the smallest choice of squares which must be played to avoid losing.
The second player, whom we shall designate "O", must respond to X's opening mark in such a
way as to avoid the forced win. Player O must always respond to a corner opening with a center
mark, and to a center opening with a corner mark. An edge opening must be answered either with
a center mark, a corner mark next to the X, or an edge mark opposite the X. Any other responses
will allow X to force the win. Once the opening is completed, O's task is to follow the above list
of priorities in order to force the draw, or else to gain a win if X makes a weak play

The first player, whom we shall designate "X", has 3 possible positions to mark during the firstturn.
Superficially, it might seem that there are 9 possible positions, corresponding to the 9squares in the
grid. However, by rotating the board, we will find that in the first turn, everycorner mark is
strategically equivalent to every other corner mark. The same is true of every edgemark. For strategy
purposes, there are therefore only three possible first marks: corner, edge, orcenter. Player X can win
or force a draw from any of these starting marks; however, playing thecorner gives the opponent the
smallest choice of squares which must be played to avoid losing.The second player, whom we shall
designate "O", must respond to X's opening mark in such away as to avoid the forced win. Player O
must always respond to a corner opening with a centermark, and to a center opening with a corner
mark. An edge opening must be answered either witha center mark, a corner mark next to the X, or an
edge mark opposite the X. Any other responseswill allow X to force the win. Once the opening is
completed, O's task is to follow the above listof priorities in order to force the draw, or else to gain a
win if X makes a weak play.

3
CHAPTER 4
WORKING OF PROJECT
The highest-priority and the lowest-priority rules seemed obvious to me right away.The highest-
priority are these:
1. If I can win on this move,do it.
2. If the other player can win on the next move,block that winning square.
Here are the lowest-priority rules,used only if there is nothing suggested more strongly by the board
position:
n-2. Take the center square if it’s free.
n-1. Take a corner square if one is free.
n. Take whatever is available.
The highest priority rules are the ones dealing with the most urgent situations:either I or my opponent
can win on the next move.The lowest priority ones deal with the least urgent situations,in which there
is nothing special about the moves already made to guide me.
What was harder was to find the rules in between.I knew that the goal of my own tic-tac-toe strategy
was to set up a fork, a board position in which I have two winning moves,
 so my opponent can only block one of them.
 Here is an example:
x o
x
x o

X can win by playing in square 3 or square 4.It’s O’s turn,


but poor O can only block one of those squares at a time. Whichever O picks, X will then win by
picking the other one. Given this concept of forking, I decided to use it as the next highest priority
rule:
3. If I can make a move that will set up a fork for myself, do it.That was the end of the easy part. My
first attempt at writing the program used only these six rules.
Unfortunately, it lost in many different situations. I needed to add something, but I had trouble finding
a good rule to add. My first idea was that rule 4 should be the defensive equivalent of rule 3, just as
rule 2 is the defensive equivalent of rule 1:
4
LIBRARIES
In this project different following libraries are imported for specific tasks. They are:
 java.lang is always implicitly being imported as it contains everything you basically cannot
program without String, Double, Enum, Math, etc.
 In java.util you can find all the collections and data structures available in Java
 Next, we have java.io for reading files, working with pipes, streams and similar.
 Also we have java.nio, which actually is the alternative to java.io and stands for non-blocking I/O.
It allows intensive use of the input/output operations as you might guess.
 java.math provides functionality for working with arbitrary-precision decimal (BigDecimal) and
integer (BigInteger) values.
 java.net is being used for working with sockets, creating connections or in short – creating
networking applications.
 In Java we also have libraries for working with GUI : javax.swing (extension of the older java.awt).
 We even can play music and create midi files with java.sound.

5
CHAPTER 5

DESIGNING PART
The hardware and software requirements for the project are:-

Hardware configuration
Processor: Pentium 200 MHz

computer RAM: 64 MB

Free Space required on hard disk: 128 MB


Software requirement
1. Window xp/7/8 operating system.
2. Netbeans java.
3. Advance java
4. My Sql

Technology Used

JAVA

Java is a programming language and computing platform first released by Sun Microsystems in
1995. Java is a programming language built for the age of the Internet. There are lots of applications
and websites that will not work unless you have Java installed, and more are created every day. Java
is fast, secure, and reliable. From laptops to datacenters, game consoles to scientific supercomputers.
Java is a high level, robust, secured and object-oriented programming language. And any hardware or
software environment in which a program runs, is known as a platform. Since Java has its own
runtime.

6
FEATURES OF JAVA

 Simple

 Easy to learn

 Free and Open source

 High-level language

 Interpreted

 Object oriented

 Extensive libraries

NETBEANS

NetBeans IDE is the official IDE for Java 8. With its editors, code analyzers, and converters, you can
quickly and smoothly upgrade your applications to use new Java 8 language constructs, such as
lambdas, functional operations, and method references.

Batch analyzers and converters are provided to search through multiple applications at the same time,
matching patterns for conversion to new Java 8 language constructs.

With its constantly improving Java Editor, many rich features and an extensive range of tools,
templates and samples, NetBeans IDE sets the standard for developing with cutting edge technologies
out of the box.

7
CHAPTER 6

SCREENSHOTS



Figure 6.1: This figure dispay Welcome Window of Login and registered.

8






















Figure 6.2: This figures display the imges of credentials.

9
Figure 6.3: This figure display the Login Successful.

10


Figure 6.4: This figure displays the Dashboard.

11







Figure 6.5: This figure displays the 1st game Tic tac Toe.

12

Figure 6.6: This figure displays the 2nd Word game.

13

Figure 6.7: This figure displays the Guide of the games.

14



Figure 6.8: This figure displays the time over of the game.

15
CHAPTER 7
FUTURE SCOPE

Our project will be able to implement in future after making some changes and modifications as we
make our project at a very low level. So the modifications that can be done in our project are:

In future one change can be done by adding the fingerprints of the persons of which the address is
entered.And one more major change which can be done in this project is that to add the snaps of the
person of which the address is entered.We can also add or subtract details of the individual.

More number of winning strategies.

Implementation of MINMAX algorithm into other games such as

checker, Go and even chess.

Use of other Algorithms like Heuristic Search(BFS and DFS)

16
CHAPTER 8
CONCLUSION

The result of our project is Game World working perfectly fine. It has the speed that we targeted for
that is screen does not flicker, stick moves correctly and movements of images are pretty smooth.
The game theory is also accurate.
Our game is quite safe as it does not include any RF signals and noise in it. The best part of our game
is that it’s very user friendly. Anyone can play it and gets addicted. We have documented the design
of our game in such a way that anybody can alter it by reading our documentation.

have done my best to make the complicated process of “TIC TAC TOE GAME” as simple as
possible using Structured & Modular technique & Menu oriented interface. I have tried to design the
software in such a way that user may not have any difficulty in using this package & further
expansion is possible without much effort. Even though I cannot claim that this work to be entirely
exhaustive. As every game has some limitations so my project is not exceptional, but I will try to
short out them very shortly and deliver a defective less product to client.
I am confident that this software package can be readily used by non-programming personal avoiding
human handled chance of error.

17
REFERENCES
1. https://en.wikipedia.org/wiki/Tic-tac-toe
2. https://playtictactoe.org/
3. https://www.exploratorium.edu/brain_explorer/tictactoe.html

18

Potrebbero piacerti anche