Skip to main content

Posts

Tic Tac Toe in JAVA

Course Project Title: TIC TAC TOE in JAVA Description: Tic Tac Toe is developed as a desktop application in Java using SWING for the Graphical User Interface(GUI) part. The game is developed for both, one user mode and two user mode. Topic 1: Introduction and advantages of JAVA Presenter's information: Name:  Pooja Jadhav Div:  TY-L Roll no: 29 Gr. no: 1711028 Video link:  Introduction & Use of JAVA Topic 2: GUI in JAVA SWING Presenter's information: Name:  Pradnya Ghadge Div:  TY-L Roll no: 22 Gr. no: 1710418 Video link:  GUI Topic 3: Two User Mode Logic Presenter's information: Name: Gayatrai Bhagwat Div:  TY-L Roll no: 06 Gr. no:  1710540 Video link:  Two User Mode Topic 4: One User Mode Logic Presenter's information: Name: Rutuja Badbe Div:  TY-L Roll no: 04 Gr. no:  1710624 Video link:  One User Mode Topic 5: Win condition & Future Scope  Presenter's informat...
Recent posts

The Learning Experience & Challenges Faced

T he overall learning experience from the project was exceptionally good. A great percentage of increment in the knowledge as well as in the logic development process. We really experienced how the project based learning is knowledgible and fun. The Learning and challenges faced: The literature survey maked us acquainted with the various GUI and Coding platforms (or the combination of both). The object oriented progamming language JAVA was learnt so as to implement the various tasks. As it was a group project, code needed to be developed and updation should be feasible to all at every instance . So the GITHUB platform was used. As every other coder would think which part should we start first whether to skeletonize the GUI or development of the algorithm .So it was counter by distributuing the work among the contributers of these blog. The sailent learning features that must be metioned like finding the correct version of the software,JDK’s and merging it to the folder of Tic...

Sneak peek in the Code!

                             In our previous blogs we have discussed about our approach and logic of the code. You must be wondering what do we see in the output window and what are the actual codes! Here you go, in this blog we will take a peek at the code and the output they result into.                When we run our code, this is the first window that pops up. The User can choose the number of players.   Java SWING has a function named actionPerformed, we have used Button actionPerfmoded in our project extensively. When the user clicks the onscreen button, the button fires action event and executes the piece of code written in that function. Thus, further in the blog, we’ve mentioned the actions and the functions. When one clicks the Two Users Button, a new window pops up and the following code is written in the functio...

You don't always need a partner to play!

In the last blog, we saw about the basic and common logic which is used in both one user and two user modes. In this blog, we will see the logic used for both the modes with the help of flowchart. In one user mode, user will always get ‘X’ for playing the game and computer will always get ’O’ symbol, this can be swapped as well. When user plays ‘X’, computer will make the nearest empty button zero. It is the main logic behind one user mode.                 In two users mode, let us assume that user one will use ‘X’ and by default, second user will use ‘O’. If it is win condition then Winner will be displayed in those three winning boxes and it will appear in the above text box as well. When any button is clicked, the win condition is checked. Once, a user puts either a ‘X’ or ‘O’, that button should be locked. The flow will become more   clear in the flowchart given below.   For One User   mode:   For Two Use...

Logic Behind the Code

Until now, we have seen design of the game. Now, lets discuss about the logic. As you know, our project in divide into basic 3 parts. User setting One user Mode Two User Mode In this blog, we will see about the basic and common logic which is used in both modes. Step by step explanation: ·          The game is basically made for two players as ‘X’ and ‘O’. So, it is necessary to make sure that after the player ‘X’, player ‘O’ gets the chance to play and after player ‘O’ again player ‘X’ gets the chance. i.e. Toggling of the player is important. For this we have used Boolean variable flag. Pseudo code: If (flag==true)          //player ‘X’ will be playing else         //player ‘O’   will be playing flag = !flag              //Toggling the player ·    ...

Basic Design

Any gaming application needs a Graphical User Interface along with the logic to work out well with the user. As you already know, we are using JSWING for GUI. In the last blog we discussed about the components. Let’s see how to use them to design our project. We have designed two frames for the actual game and one frame for user setting.(We will discuss more about it in the up coming blogs.) Two gaming frames have same design, but different logic and the user setting has different design. Design of Gaming Frame: The following can be observed in the inspector window, ·            We have used Border layout for the frame. This divides the frame into 5 sections- east, west, south, north, center. ·          Amongst these 5 sections, East block contains button with name ‘Refresh’.   It clears the previous game and starts new game. ·      ...

About the Components

In last blog, we discussed about selecting a framework. Now, we will discuss about the basic components of Swing. Basically, these basic components are classes itself and we will use their attributes in the GUI implementations. So here are these components: 1. Panel: The panel is nothing but simplest container class as it inherits the container class. It does not contain title bar and menu bar. It can attach any other component. It can be declared as             public class Panel extends Container implements Accessible   2. Text field: Text field inherits TextComponent class. The object of this class is text component that allows the editing of a single line text. It can be declared as             public class TextField extends TextComponent 3. Label: Label is used for displaying a single line of read only text. The object of this class i...