Maseera Java Microproject
Maseera Java Microproject
Maseera Java Microproject
Code:0563
Academic Year: 2024–2025
CERTIFICATE
This is to certify that,
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
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
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.
CODE:
import java.util.Scanner;
class Main {
int n = 3;
board[i][j] = '-';
for play!\n");
player 1: ");
String p1 = in.nextLine();
player 2:");
String p2 = in.nextLine();
while(!gameEnded) {
drawBoard(board);
System.out.println(p1 + "'s Turn (x):");
} else {
char c = '-';
if(player1) {
c = 'x';
} else {
c = 'o';
int row = 0;
int col = 0;
while(true) {
row = in.nextInt();
System.out.print("Enter a column
number: ");
col = in.nextInt();
again.");
again.");
} else {
break;
board[row][col] = c;
if(playerHasWon(board) == 'x') {
gameEnded = true;
gameEnded = true;
} else {
if(boardIsFull(board)) {
System.out.println("It's a tie!");
gameEnded = true;
} else {
player1 = !player1;
drawBoard(board);
board) {
System.out.println("Board:");
System.out.print(board[i][j]);
System.out.println();
board) {
if(value == '-') {
in A Row = false;
} else {
if(board[i][j] != value)
inARow = false;
break;
if(inARow) {
return value;
}
if(value == '-') {
inACol = false;
} else {
if (board[i][j] != value) {
break;
If (inACol) {
return value;
inADiag1 = false;
} else {
If (board[i][i] != value1) {
inADiag1 = false;
break;
If (inADiag1) {
return value1;
if(value2 == '-') {
inADiag2 = false;
} else {
if(board[i][board.length-1-i] != value2) {
inADiag2 = false;
break;
}
}
if(inADiag2) {
return value2;
boardIsFull(char[][] board) {
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.
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]
5 Quality of Prototype/Model
6 Report Preparation
(B) Individual Presentation / Viva (Convert above total marks out of 4 Marks)
7 Presentation
8 Defense
(A) Process and Product Assessment (B) Individual Presentation / Viva Total Marks
(6 Marks) (4 marks) (10 Marks)
………………………………………………………………………………………………………………………
…………………….
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
5 Quality of Prototype/Model
6 Report Preparation
(B) Individual Presentation / Viva (Convert above total marks out of 4 Marks)
7 Presentation
8 Defense
(A) Process and Product Assessment (B) Individual Presentation / Viva Total Marks
(6 Marks) (4 marks) (10 Marks)
………………………………………………………………………………………………………………………
…………………….
5 Quality of Prototype/Model
6 Report Preparation
(B) Individual Presentation / Viva (Convert above total marks out of 4 Marks)
7 Presentation
8 Defense
(A) Process and Product Assessment (B) Individual Presentation / Viva Total Marks
(6 Marks) (4 marks) (10 Marks)
………………………………………………………………………………………………………………………
…………………….