CSS Finalmicroproject
CSS Finalmicroproject
MICROPROJECT REPORT ON
“Creating Math Game”
Diploma in Computer Engineering
Submitted By
Name : Roll No:
Revan S Kudalkar - 3025
Tejas S Kadam - 3026
Namrata U Wadekar - 3027
1|Page
Creating Math Game Ashokrao Mane Polytechnic
DECLARATION
I hereby declare that the Micro-Project Report entitled “Client Side Scripting Language ”
with Module “Creating Math Game” is an authentic record on my own work as
requirements of Micro Project during the period from / / 2024 to / / 2024 in partial fulfillment
of Third Year in Computer Engineering, Ashokrao Mane Polytechnic, Vathar under the
guidance of Mrs. P. D. Patil.
Signature of Student
Date: / / 2024
2|Page
Creating Math Game Ashokrao Mane Polytechnic
ACKNOWLEDGMENT
The successful presentation of the Client Side Scripting Language Micro Project would be
incomplete without the mention of the people who made it possible and whose constant
guidance crowned my effort with success.
I would like to extend my gratitude to HOD of Computer Department Dr. S. A. Lakade Sir,
Kolhapur, for providing all the facilities to present this Micro-Project.
I would like to thank our Project Guide, Mrs. P. D. Patil, Department of Computer
Engineering, Ashokrao Mane Polytechnic, Vathar, for their constant guidance and inputs.
Sincerely,
Revan S
Kudalkar Tejas S
Kadam Namrata
U Wadekar
3|Page
Creating Math Game Ashokrao Mane Polytechnic
INDEX
1 Report
1.1 Abstract
1.2 Title
1.3 Introduction
3.1 Output
4 Conclusion
4|Page
Creating Math Game Ashokrao Mane Polytechnic
ABSTRACT
5|Page
Creating Math Game Ashokrao Mane Polytechnic
INTRODUCTION
Educational math games developed using JavaScript offer a highly interactive and
engaging platform for students to improve their problem-solving skills and enjoy learning
math. JavaScript is a widely used programming language due to its compatibility with all
web browsers, ease of use, and ability to support interactive elements such as animations
and real- time feedback. These features make it possible to create games that provide
instant responses to user input, allowing students to learn and correct their mistakes
quickly. Developers can incorporate dynamic question generation, time-based
challenges, and score tracking, all of which are key features in creating an engaging
math game.
Balancing fun and learning is essential for the success of any educational game. If a game
focuses too much on entertainment, it may lose its educational value, while if it is too
focused on learning, it may fail to engage students. Helping students learn and correct
mistakes quickly. Key features include dynamic question generation, time-based
challenges, and score tracking, which make the experience more exciting. Effective math
games achieve this balance by presenting math problems in a fun and interactive way,
ensuring that students are learning while having fun. The role of adaptive learning also
comes into play, where the game adjusts the difficulty level based on the student’s
performance, an individualized learning experience.
6|Page
Creating Math Game Ashokrao Mane Polytechnic
RESOURCES REQUIRED :
2. Operating Windows 11 1 -
System
SKILL DEVELOPED :
Developing a math game project in JavaScript cultivates a diverse set of skills that extend
beyond basic programming. Key skills include advanced proficiency in JavaScript,
encompassing its syntax, functions, and asynchronous programming techniques for smooth
game performance. Developers gain expertise in manipulating the Document Object Model
(DOM) to create interactive game elements and handle user inputs. The project also hones
problem-solving abilities through algorithm design and debugging, ensuring robust and
efficient game logic. Additionally, developers learn to design intuitive user interfaces, manage
game states, and implement features that enhance user experience. Skills in data management
are developed through techniques like local storage for saving progress and data visualization
for displaying game metrics. The project also involves integrating third- party libraries and
multimedia, further enriching the game. Working on such a project often involves
collaboration and version control, fostering teamwork and project management skills. Finally,
applying educational technology principles ensures the game effectively supports learning
objectives.
7|Page
Creating Math Game Ashokrao Mane Polytechnic
PROGRAM CODE:
<!DOCTYPE html>
<html lang="en">
<head>
<title>Math Game</title>
<style>
body {
font-family: 'Arial', sans-
serif;margin:0;
padding: 0;
background-color:
#282c34;display: flex;
justify-content:
center;align- items:
center; height: 100vh;
color: #ffffff; text-
align: center;
}
#container {
background: rgba(50, 50, 50,
0.9);padding:40px;
border-radius: 10px;
box-shadow: 0 4px 20px rgba(0, 0, 0,
0.5);width:400px;
}
h2 {
margin-bottom: 20px;
}
input {
font-size:
20px;padding:
10px;margin: 10px 0;
width: 90%; border:
none;border-radius:
5px; background:
#ffffff;color: #000;
}
button {
font-size: 20px;
padding:12px
20px;margin: 10px;
border-radius: 5px;
8|Page
Creating Math Game Ashokrao Mane Polytechnic
pointer;
border: none; cursor:
background-color:
#4CAF50;color:white;
transition: background-color 0.3s;
}
button:hover {
background-color:
#45a049;
}
#question {
font-size: 36px;
margin:
20px 0; font-weight:
bold;
}
#options { margin:
20px 0;
}
.option-button {
display: block;
font-size: 20px;
padding: 12px;
margin:
10px auto;border-
radius: 5px;border:
none; cursor:
pointer;
background-color:
#007BFF;color: white;
width: 70%;
transition: background-color 0.3s;
}
.option-button:hover {
background-color:
#0056b3;
}
</style>
</head>
<body>
<div id="container">
<!-- Login Section -->
<div id="login-container">
<h2>Math Game</h2>
<input type="text" id="username" placeholder="Enter your username">
<button onclick="login()">Login</button>
</div>
9|Page
Creating Math Game Ashokrao Mane Polytechnic
<script>
let currentAnswer = 0;
let score = 0;
let questionsRemaining = 10;
let username = '';
function login() {
username =
document.getElementById('username').value.trim();if
(username) {
document.getElementById('welcome-user').innerText = username;
document.getElementById('username-display').innerText = username; // Display
username in game
document.getElementById('login-container').style.display = 'none';
document.getElementById('start-container').style.display = 'block';
10 | P a g e
Creating Math Game Ashokrao Mane Polytechnic
} else {
alert('Please enter a username.');
}
function startGame() {
document.getElementById('start-container').style.display =
'none'; document.getElementById('game-
container').style.display = 'block';resetGame();
generateQuestion();
}
function generateQuestion() {
if (questionsRemaining === 0) {
displayFinalScore();
return;
}
const num1 = Math.floor(Math.random() * 10) + 1; const
num2 = Math.floor(Math.random() * 10) + 1;const operators
= ['+', '-', '*', '/'];
const operator = operators[Math.floor(Math.random() * operators.length)];
currentAnswer =calculateAnswer(num1, num2, operator);
document.getElementById('question').innerText =
`${num1} ${operator} ${num2}`;displayOptions(currentAnswer);
}
function calculateAnswer(num1, num2, operator)
{switch(operator) {
case '+':
return num1 + num2;case '-':
return num1 - num2;case '*':
return num1 * num2;case '/':
return (num2 !== 0) ? (num1 / num2).toFixed(2) : 0;default:
return 0;
}
}
function displayOptions(correctAnswer) {
const optionsContainer = document.getElementById('options');
optionsContainer.innerHTML = '';
const incorrectAnswers = [];
while (incorrectAnswers.length < 3) {
const wrongAnswer = (Math.random() * 20).toFixed(2);
if (wrongAnswer != correctAnswer && !incorrectAnswers.includes(wrongAnswer))
{
incorrectAnswers.push(wrongAnswer);
}
}
11 | P a g e
Creating Math Game Ashokrao Mane Polytechnic
} else {
messageContainer.innerText = "Incorrect!";
}
questionsRemaining--; document.getElementById('score').innerText =
`Score: ${score}`;
document.getElementById('questions-remaining').innerText = `Questions Remaining:
${questionsRemaining}`;
12 | P a g e
Creating Math Game Ashokrao Mane Polytechnic
document.getElementById('final-score-container').style.display = 'block';
document.getElementById('final-score-value').innerText = score;
}
function
playAgain() {
resetGame();
document.getElementById('final-score-container').style.display = 'none';
document.getElementById('login-container').style.display = 'block'; // Redirect to
login
}
function
backToGame() {
resetGame();
document.getElementById('final-score-container').style.display = 'none';
document.getElementById('game-container').style.display = 'block'; //
Show newquestions
document.getElementById('username-display').innerText = username; // Display the
same username
generateQuestion();
}
function
exitGame() {
resetGame();
document.getElementById('game-container').style.display =
'none';document.getElementById('login-
container').style.display = 'block';
}
function resetGame()
{score =0;
questionsRemaining = 10; document.getElementById('score').innerText =
`Score: ${score}`;
document.getElementById('questions-remaining').innerText = `Questions Remaining:
$ {questionsRemaining}`; document.getElementById('username').value = '';
}
</script>
</body>
</html>
13 | P a g e
Creating Math Game Ashokrao Mane Polytechnic
OUTPUT:
14 | P a g e
Creating Math Game Ashokrao Mane Polytechnic
CODE :
15 | P a g e
Creating Math Game Ashokrao Mane Polytechnic
CONCLUSION:
In conclusion, this math game micro project demonstrates the power of JavaScript in
creating an interactive learning experience. By integrating various difficulty levels and a
responsive scoring system, we’ve designed a fun way to reinforce mathematical concepts
for users of all ages. The game not only fosters engagement but also encourages users to
enhance their problem-solving skills in a playful environment. Moving forward, potential
improvements could include adding new mathematical topics, implementing multiplayer
functionality, and creating a leaderboard to boost competitiveness. Overall, this project
successfully combines education and entertainment, showcasing the effectiveness of
gamified learning in improving mathematical literacy.
16 | P a g e