1 / 15

TIC TAC TOE TERM PROJECT BY: SALIK AZIZ KHAN RAMSHA KAUSAR USHNA SHAIKH (

DATA STRUCTURES AND ALGORITHMS. TIC TAC TOE TERM PROJECT BY: SALIK AZIZ KHAN RAMSHA KAUSAR USHNA SHAIKH (. INTRODUCTION. The project that we worked on is a well known game called “Tic Tac Toe”.

Download Presentation

TIC TAC TOE TERM PROJECT BY: SALIK AZIZ KHAN RAMSHA KAUSAR USHNA SHAIKH (

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. DATA STRUCTURES AND ALGORITHMS TIC TAC TOETERM PROJECT BY:SALIK AZIZ KHANRAMSHA KAUSARUSHNA SHAIKH (

  2. INTRODUCTION • The project that we worked on is a well known game called “Tic Tac Toe”. • We implemented this game using a binary tree which is a very flexible data structure along with some other data structures namely link lists & multi dimensional arrays.

  3. What is Tic Tac Toe? • Tic-tac-toe, also spelled tick tack toe, or noughts and crosses is a pencil paper game for two players, X and O, who take turns marking the spaces in a 3×3 grid. • The player who succeeds in placing three respective marks in a horizontal, vertical, or diagonal row wins the game.

  4. How is it played? • Choose which player will be represented by X and which by O. • Let player X go firstto put an X in any of the nine sections of the grid. • The players take turns putting their symbol on the table. • The first player to have 3 of their symbols in a row, whether it is horizontally, vertically, or diagonally, is the winner.

  5. EXAMPLE

  6. Binary tree • A binary tree is a tree data structure in which each node has at most two child nodes, usually distinguished as "left" and "right". • Nodes with children are parent nodes, and child nodes may contain references to their parents. • Any node in the data structure can be reached by starting at root node and repeatedly following references to either the left or right child.

  7. Java Applet • JButton • JLabel • File streaming

  8. ALGORITHM

  9. CLASSES • Following classes were used in our program: • tttapp • Node • AI

  10. IMPORTED FILES • java.util.* • java.io.* • java.awt.* • javax.swing.* • java.awt.event.* • Firstedge(text file) • Firstcorner(text file)

  11. METHODS • AI() • setstate() • match() • load() • searchstate() • nextmove() • display() • compwin() • compwins() • userwins() • chktie() • getc() • actionperformed() • init()

  12. FIRST CORNER

  13. FIRST EDGE

  14. LIMITATIONS • Only two strategies i.e. first-corner and first-edge are taken into consideration while developing the program’s logic. • The computer always goes first.

More Related