Maseera Java Microproject

Download as pdf or txt
Download as pdf or txt
You are on page 1of 16

Micro Project report on

Tic Tac Toe

Code:0563
Academic Year: 2024–2025

Program: Information Engineering Semester: Fourth


Course: JavaProgramming CourseCode:22412
Group no: 02

Maharashtra State Board of Technical Education, Mumbai


(Autonomous)(ISO-9001-2008) (ISO/IEC 27001:20013)
Maharashtra State Board of Technical Education,
Mumbai

CERTIFICATE
This is to certify that,

Roll No Student Name Seat No Enroll No.


04 Maseera Sameer Saldulkar 2205630190

05 Disha Shyamal Mondal 2205630191

06 Abhishek Satish Mishra 2205630192

Of Foutrth Semester of Diploma in Information Technology Engineering of


Institute Pravin Patil College of Diploma Engineering and Technology,
Bhayandar(E) (Code: 0563) has completed the Micro Project satisfactorily in
subject : Java Programming(22412) for the academic year 2024–2025 as
prescribed in the curriculum.

Place: Bhayandar (E)


Date:

Ms.Samiksha
Chaturvedi Mr.Nilesh Vispute Mrs. R.BPatil
Subject Teacher Head of Department Principal
PART A- Plan

1.0 Rationale
Tic Tac Toe is traditionally played on a 3 × 3 grid. Players take turns placing a mark in one of the
cells of the grid. The goal of the game is for players to position their marks so that they make a
continuous line of three cells vertically, horizontally, or diagonally. Tic-tac-toe is a game in which
two players take turns in drawing either an`O' or an`X' in one square of a grid consisting of nine
squares. The winner is the first player to get three of the same symbols in a row.
2.0 Literature Review
variety of methods. Traditionally, the Tic-tac-toe game is a pencil and paper game played by two
people taking turns placing their pieces on the 3rd grid with the intention of becoming the first player
to complete a horizontal, vertical, or diagonal line. Row with their pieces Many versions of the Tic
Tac game software have been recorded, and have recently been made available on smart phones,
including the Apple iPhone [7] and the Android environment.
3.0 Proposed Methodology

Creating a report on Tic Tac Toe by using Java application”.

4.0 Action Plan

S.No Details of Activity Planned Planned Name of


Start Date Finish Responsible
Date Members

1 Gathering Information
2 Understand the logic
3 Importing required module in
application
4 Implementation the logic
5 Applying condition
6 Solving the errors
7 Getting the correct output
8 Creating the report

5.0 Resources Required


Sr.No Name of Resource Specification Qty Remarks
1 Java Applivation 1 Available
2 Jdk 1 Available
PART B
Tic Tac Toe

1.0 Rationale
Tic Tac Toe is traditionally played on a 3 × 3 grid. Players take turns placing a mark in one of
the cells of the grid. The goal of the game is for players to position their marks so that they make
a continuous line of three cells vertically, horizontally, or diagonally. Tic-tac-toe is a game in
which two players take turns in drawing either an ` O' or an ` X' in one square of a grid
consisting of nine squares. The winner is the first player to get three of the same symbols in a
row.

2.0 Course Outcomes Integrated


a) Develop rich user interface by using layouts and controls.

b) Use user interface components for android applications development.

c) Create android application using database.

d) Publish android application.

3.0 Literature Review


Tic-Tac-Toe is a straightforward but fun board game. The Tic-Tac-Toe game is learned using a
variety of methods. Traditionally, the Tic-tac-toe game is a pencil and paper game played by two
people taking turns placing their pieces on the 3rd grid with the intention of becoming the first
player to complete a horizontal, vertical, or diagonal line. Row with their pieces Many versions
of the Tic Tac game software have been recorded, and have recently been made available on
smart phones, including the Apple iPhone [7] and the Android environment.

4.0 Actual Procedure Followed


1. Firstly, we need to gather all information related to Tic Tac Toe.
2. Installing the jdk.
3. Creating a new activity.
4. Implementing java in java compiler.
5. Run the program of the java.

5.0 Actual Resources Used


S.No Name of Resource Specification Qty Remarks
1 Java compiler 3.28 1 Available
2 Microsoft Word 2016 1 Available
6. 0 Outputs of the Micro-project

CODE:

import java.util.Scanner;

class Main {

public static void main(String[] args)

int n = 3;

char[][] board = new char[n][n];

for(int i = 0; i < n; i++) {

for(int j = 0; j < n; j++) {

board[i][j] = '-';

Scanner in = new Scanner(System.in);

System.out.println("Tic Tac Toe is ready

for play!\n");

System.out.print("What is your name?,

player 1: ");

String p1 = in.nextLine();

System.out.print(" What is your name?,

player 2:");

String p2 = in.nextLine();

boolean player1 = true

boolean gameEnded = false;

while(!gameEnded) {

drawBoard(board);
System.out.println(p1 + "'s Turn (x):");

} else {

System.out.println(p2 + "'s Turn (o):");

char c = '-';

if(player1) {

c = 'x';

} else {

c = 'o';

int row = 0;

int col = 0;

while(true) {

System.out.print("Enter a row number: ");

row = in.nextInt();

System.out.print("Enter a column

number: ");

col = in.nextInt();

if(row < 0 || col < 0 || row >= n || col >n)

System.out.println("This position is off

the bounds of the board! Try

again.");

} else if(board[row][col] != '-') {

System.out.println("Someone has already

made a move at this position! Try

again.");
} else {

break;

board[row][col] = c;

if(playerHasWon(board) == 'x') {

System.out.println(p1 + " has won!");

gameEnded = true;

} else if(playerHasWon(board) == 'o') {

System.out.println(p2 + " has won!");

gameEnded = true;

} else {

if(boardIsFull(board)) {

System.out.println("It's a tie!");

gameEnded = true;

} else {

player1 = !player1;

drawBoard(board);

public static void drawBoard(char[][]

board) {

System.out.println("Board:");

for(int i = 0; i < board.length; i++) {


for(int j = 0; j < board[i].length; j++) {

System.out.print(board[i][j]);

System.out.println();

public static char playerHasWon(char[][]

board) {

for(int i = 0; i < board.length; i++) {

boolean in a Row = true;

char value = board[i][0];

if(value == '-') {

in A Row = false;

} else {

for(int j = 1; j < board[i].length; j++) {

if(board[i][j] != value)

inARow = false;

break;

if(inARow) {

return value;
}

for(int j = 0; j < board[0].length; j++) {

boolean in a Col = true;

char value = board[0][j];

if(value == '-') {

inACol = false;

} else {

For (int i = 1; i < board.length; i++) {

if (board[i][j] != value) {

int A Col = false;

break;

If (inACol) {

return value;

boolean inA Diag1 = true;

char value1 = board[0][0];


if(value1 == '-') {

inADiag1 = false;

} else {

For (int i = 1; i < board.length; i++) {

If (board[i][i] != value1) {

inADiag1 = false;

break;

If (inADiag1) {

return value1;

boolean inADiag2 = true;

char value2 = board[0][board.length-1];

if(value2 == '-') {

inADiag2 = false;

} else {

for(int i = 1; i < board.length; i++) {

if(board[i][board.length-1-i] != value2) {

inADiag2 = false;

break;

}
}

if(inADiag2) {

return value2;

return ' ';

public static boolean

boardIsFull(char[][] board) {

for(int i = 0; i < board.length; i++) {

for(int j = 0; j < board[i].length; j++) {

if(board[i][j] == '-') {

return false;

return true;

}
OUTPUT:
7.0 Skill Developed/learning out of this Micro-project
Learned what is
 User interface design
 Using the Java Compiler
 Debugging and testing
 App publishing and distribution.

8.0 Application of this Micro-project

Because of the simplicity of tic-tac-toe, it is often used as a pedagogical tool for teaching the
concepts of good sportsmanship and the branch of artificial intelligence that deals with the searching
of game trees. It is straightforward to write a computer program to play tic-tac-toe perfectly or to
enumerate the 765 essentially different positions (the state space complexity) or the 26,830 possible
games up to rotations and reflections (the game tree complexity) on this space.[3] If played optimally
by both players, the game always ends in a draw, making tic-tac-toe a futile game.[4]

Incidence structure for tic-tac-toe


The game can be generalized to an m,n,k-game, in which two players alternate placing stones of their
own color on an m-by-n board with the goal of getting k of their own color in a row. Tic-tac-toe is the
3,3,3- game. Harary's generalized tic-tac-toe is an even broader generalization of tic-tac-toe. It can
also be generalized as an nd game, specifically one in which n equals 3 and d equals 2.[6] It can be
generalised even further by playing on an arbitrary incidence structure, where rows are lines and cells
are points. Tic-tac-toe's incidence structure consists of nine points, three horizontal lines, three
vertical lines, and two diagonal lines, with each line consisting of at least three points.

9.0 Area of Future Improvement


 Future improvements could include adding players photos of fingerprints to the game.
 Collaboration features for sharing conversion results and custom settings with others.
 Accessibility enhancements to ensure usability for users with disabilities, promoting inclusivity.
Teacher Evaluation Sheet

Name of Student: Maseera Sameer Saldulkar Enrollment No: 2105630190


Name of Program: INFORMATION TECHNOLOGY Semester: Fourth
ENGINEERING
Course Title: Tic Tac Toe Code: 22412

Course Outcomes Achieved:


a) Develop rich user interfaces by using layouts and controls.
b) Use user interfaces components for android application development.
c) Create android application using database.
d) Publish android application.
Evaluation as per Suggested Rubric for Assessment of Micro-Project

Sr. Characteristic to be Assessed Poor Average Good Excellent Sub


No (Marks 1-3) (Marks 4-5) (Marks 6- (Marks 9- Total
8) 10)
(A) Process and Product Assessment (Covert above total marks out of 6 Marks)
1 Relevance to the course
Literature Survey/ Information
2
Collection
Completion of the Target as per
3
project proposal
Analysis of Data and
4
Representation

5 Quality of Prototype/Model

6 Report Preparation

(B) Individual Presentation / Viva (Convert above total marks out of 4 Marks)
7 Presentation
8 Defense

Micro-Project Evaluation Sheet

(A) Process and Product Assessment (B) Individual Presentation / Viva Total Marks
(6 Marks) (4 marks) (10 Marks)

Comments / Suggestions about teamwork / leadership / interpersonal communication:

………………………………………………………………………………………………………………………
…………………….
Name & Designation of the Teacher: Ms.Samiksha Chaturvedi
Dated Signature: ………………………..
Teacher Evaluation Sheet
Name of Student: Disha Shyamal Mondal Enrollment No: 2105630191
Name of Program: INFORMATION TECHNOLOGY Semester: Fourth
ENGINEERING
Course Title: Tic Tac Toe Code: 22412

Course Outcomes Achieved:


a) Develop rich user interfaces by using layouts and controls.
b) Use user interfaces components for android application development.
c) Create android application using database.
d) Publish android application.

Evaluation as per Suggested Rubric for Assessment of Micro-Project

Sr. Characteristic to be Assessed Poor Average Good Excellent Sub


No (Marks 1-3) (Marks 4-5) (Marks 6- (Marks 9- Total
8) 10)
(A) Process and Product Assessment (Covert above total marks out of 6 Marks)
1 Relevance to the course
Literature Survey/ Information
2
Collection
Completion of the Target as per
3
project proposal
Analysis of Data and
4
Representation

5 Quality of Prototype/Model

6 Report Preparation

(B) Individual Presentation / Viva (Convert above total marks out of 4 Marks)
7 Presentation
8 Defense

Micro-Project Evaluation Sheet

(A) Process and Product Assessment (B) Individual Presentation / Viva Total Marks
(6 Marks) (4 marks) (10 Marks)

Comments / Suggestions about teamwork / leadership / interpersonal communication:

………………………………………………………………………………………………………………………
…………………….

Name & Designation of the Teacher: Ms.Samiksha Chaturvedi


Dated Signature: ………………………..
Teacher Evaluation Sheet
Name of Student: Abhishek Satish Mishra Enrollment No: 2105630192
Name of Program: INFORMATION TECHNOLOGY Semester: Fourth
ENGINEERING
Course Title: Tic Tac Toe Code: 22412

Course Outcomes Achieved:


a) Develop rich user interfaces by using layouts and controls.
b) Use user interfaces components for android application development.
c) Create android application using database.
d) Publish android application.

Evaluation as per Suggested Rubric for Assessment of Micro-Project

Sr. Characteristic to be Assessed Poor Average Good Excellent Sub


No (Marks 1-3) (Marks 4-5) (Marks 6- (Marks 9- Total
8) 10)
(A) Process and Product Assessment (Covert above total marks out of 6 Marks)
1 Relevance to the course
Literature Survey/ Information
2
Collection
Completion of the Target as per
3
project proposal
Analysis of Data and
4
Representation

5 Quality of Prototype/Model

6 Report Preparation

(B) Individual Presentation / Viva (Convert above total marks out of 4 Marks)
7 Presentation
8 Defense

Micro-Project Evaluation Sheet

(A) Process and Product Assessment (B) Individual Presentation / Viva Total Marks
(6 Marks) (4 marks) (10 Marks)

Comments / Suggestions about teamwork / leadership / interpersonal communication:

………………………………………………………………………………………………………………………
…………………….

Name & Designation of the Teacher: Ms.Samiksha Chaturvedi


Dated Signature: ………………………..

You might also like