0% found this document useful (0 votes)
26 views22 pages

Mini Project Final

The document is a mini project report for a 'Calculation Challenge' game developed by students Aaron P S and Athul Mohan KP under the guidance of Mrs. Veena Grace Carmel at Krupanidhi Degree College. The project aims to create an interactive math game using C programming to enhance users' arithmetic skills through timed challenges and a scoring system. It includes sections on the project's introduction, history of calculation games, coding, data interpretation, and a conclusion.

Uploaded by

luttapi737
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views22 pages

Mini Project Final

The document is a mini project report for a 'Calculation Challenge' game developed by students Aaron P S and Athul Mohan KP under the guidance of Mrs. Veena Grace Carmel at Krupanidhi Degree College. The project aims to create an interactive math game using C programming to enhance users' arithmetic skills through timed challenges and a scoring system. It includes sections on the project's introduction, history of calculation games, coding, data interpretation, and a conclusion.

Uploaded by

luttapi737
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 22

CALCULATION CHALLENGE

A Mini Project Report Submitted for Formative


Assessment

“BACHELOR OF COMPUTER APPLICATION”

UNDER
BENGALURU NORTH UNIVERSITY, KARNATAKA

FOR THE ACADEMIC YEAR 2024-2025

SUBMITTED BY:

AARON P S ( U19CU24SOO31 )

ATHUL MOHAN KP ( U19CU24SOO32 )

UNDER THE GUIDENCE OF


Mrs.VEENA GRACE CARMEL

Krupanidhi Degree College


Department of Computer Science

Krupanidhi Degree College


12/1, ChikkaBellandur, Carmelaram Post
VarthurHobli,Off Sarjapur Road, Bengaluru, Karnataka 560035
KRUPANIDHI DEGREE COLLEGE
NO: 12/1, CHIKKABELLANDUR, CARMELARAM POST
VARTHUR (H), BENGALURU-35
(RECOGNISED BY THE BENGALURU NORTH
UNIVERSITY)

CERTIFICATE

This is to Certify that, Mr.Aaron PS and Mr.Athul Mohan KP​ bearing


Reg.No U19CU24S0031,U19CU24S0032 has successfully completed the Mini-Project
entitled “CALCULATION CHALLENGE” under the guidance of Mrs. Veena Grace
Carmel, as the part of the formative assessment for the Academic year 2024-2025.

Supervisor/Guide HOD/Coordinator​ ​ ​ Principal


DECLARATION

I hereby declare that “CALCULATION CHALLENGE” is the result of


the mini project work carried out by me under the guidance of Mrs.VEENA
GRACE CARMEL, Assistant Professor in fulfilment for the award of Bachelor of
Computer Applications of Bengaluru North University.
I also declare this project is the outcome of my own efforts and that it has not
been submitted to any other University or Institution for the award of any other
degree or diploma or certificate.

Place: Bengaluru ​ ​ ​ ​ ​ ​ ​ Name:


Date: AARON P S
ATHUL MOHAN KP
​ ​
ACKNOWLEDGEMENT
I would like to thank all those who have guided and encouraged me to do
what has been done thus far. I avail the opportunity to express our deep sense of
gratitude and sincere thanks to our department of Bachelor of Computer
Applications.
I am deeply grateful to Dr. Suresh Nagpal, Chairman of the KRUPANIDHI
GROUP OF INSTITUTIONS. I acknowledge my delightful thanks to Ms.
Geetha Nagpal, Vice Chair Person, KRUPANIDHI GROUP OF
INSTITUTIONS.

I would like to sincerely thank our Dean, Professor P.M. Shyjan, Dr.
Rajendra Prasad, Principal, KRUPANIDHI DEGREE COLLEGE for providing
the facilities.
I sincerely thank Prof. Kavitha H S, Head of the Department, for her
assistance and collaboration during the duration of the mini project.
I express deep gratitude to my guide Mrs.VEENA GRACE CARMEL for
her valuable advice, timely suggestions and assistance in the realization of this
mini project.
My heartfelt thanks to all the staff members and non-teaching staff of the
Computer Science department for providing the necessary facilities and support.
Without the support of any one of them, this mini project would not have been a
reality.
I am also grateful to my friends for their valuable suggestions for the success
of the project.
I also thank my parents for their support in all our activities, without which I
would not have been able to carry out the project.
Place: Bengaluru​ ​ ​ ​ Name: AARON P S
Date: ATHUL MOHAN K P

ABSTRACT

This project culminates in the creation of a dynamic and interactive mathematical calculation
game, meticulously developed using the C programming language. The primary objective of
this endeavor is to provide users with an engaging and effective platform to significantly
enhance their arithmetic proficiency and mental agility. The core functionality revolves
around the procedural generation of randomized mathematical expressions, encompassing the
fundamental operations of addition, subtraction, multiplication, and division, along with the
strategic inclusion of parentheses to increase complexity. These expressions are presented to
the user as time-sensitive challenges, demanding accurate and timely responses within a
predetermined time frame. The game's architecture emphasizes real-time interaction,
necessitating swift mental calculations and precise input, fostering a dynamic learning
environment. A robust scoring mechanism is implemented to meticulously track and evaluate
user performance, providing immediate and comprehensive feedback that serves to motivate
and guide the user's learning process. This system incorporates bonus points for rapid and
accurate responses, while also applying penalties for incorrect answers or exceeding time
limits, thereby incentivizing both speed and accuracy. The design incorporates a dynamic
difficulty adjustment, ensuring that the game adapts to the user's skill level, thereby providing
an optimal learning experience and preventing frustration. The game also includes robust
error handling, to ensure program stability and prevent crashes, and comprehensive input
validation, to guarantee that user input adheres to expected formats. The time limit associated
with each problem adds an element of urgency, pushing users to improve their calculation
speed and accuracy, thereby sharpening their mental reflexes. Furthermore, the game will
save, and load the high scores of the user, adding a competitive element. The project aims to
provide an educational and entertaining experience, seamlessly blending learning with the
thrill of competitive gameplay. The game is designed to run in a standard terminal
environment, ensuring broad compatibility and ease of portability across various operating
systems. The game's modular design allows for future expansion, including the addition of
more complex mathematical concepts and gameplay modes.

CONTENTS

SL NO. C0NTENTS PAGE NO

1 INTRODUCTION 1-2

2 HISTORY 3-4

3 CODING 5-8

4 DATA INTERPRETATION 9-11

5 OUTPUT SCREENSHOT 12

6 CONCLUSION 13-14

7 BIBLIOGRAPHY 15-16
TMS

Introduction
Calculation games serve as invaluable tools for enhancing mathematical proficiency and
bolstering cognitive skills, offering a dynamic and engaging approach to learning and
reinforcing arithmetic concepts. This project is dedicated to the creation of an interactive
math challenge game using the C programming language, providing users with a stimulating
and interactive platform to practice and refine their arithmetic abilities. The game will
dynamically generate random mathematical expressions, encompassing a range of operations
and complexities, allowing users to rigorously test and enhance their calculation speed,
accuracy, and mental agility.

The project will delve into the fundamental concepts of game development in C, exploring
and implementing key functionalities such as robust random number generation, efficient
input/output operations, and the precise execution of basic arithmetic calculations. We will
leverage the rand() function, seeded with time (NULL), to ensure a diverse and unpredictable
set of mathematical challenges. Furthermore, we will implement input validation to ensure
that user input is in the correct format, and handle errors gracefully. The project will
demonstrate how C can be effectively utilized to create interactive and educational
applications, showcasing its versatility and power in developing engaging software.

Beyond the basic arithmetic operations, this project will also explore the potential to
incorporate more advanced features, such as varying difficulty levels, timed challenges, and a
scoring system to track user progress. The dynamic difficulty adjustment will tailor the
game's complexity to the user's performance, ensuring a challenging yet rewarding
experience. The inclusion of timed challenges will add an element of urgency, encouraging
users to improve their calculation speed and accuracy. The scoring system will provide
immediate feedback, motivating users to strive for higher scores and track their progress over
time. The project will also include file I/O, so that high scores can be saved and loaded.

​ 1|Page
TMS

The aim is to develop a game that is not only educational but also entertaining, providing a
stimulating and enjoyable way for users to improve their mathematical skills. The game will
be designed to run in a standard terminal environment, ensuring broad compatibility and ease
of use. The modular design of the game will allow for future expansion, including the
addition of more complex mathematical concepts and gameplay modes, further enhancing its
educational value and entertainment potential.

​ 2|Page
TMS

3. History of Calculation Games

The history of calculation games is a rich tapestry, interwoven with the evolution of
educational tools and the advancement of computational technology. From the earliest forms
of arithmetic practice to the sophisticated digital applications of today, calculation games
have consistently served as a vital means of enhancing mathematical proficiency and
cognitive development.

The origins of calculation games can be traced back to ancient times, with tools like the
abacus representing some of the earliest forms of computational aids. Arithmetic puzzles and
riddles, often passed down through generations, also played a significant role in developing
mathematical reasoning and problem-solving skills. These early tools and puzzles laid the
foundation for the structured learning of mathematics, emphasizing the importance of
practice and mental agility.

The advent of computer technology marked a transformative period in the history of


calculation games. Early computer-based math games, often text-based applications, provided
a new and interactive way to practice arithmetic. These early implementations, though
rudimentary by modern standards, demonstrated the potential of computers to create
engaging educational experiences. As computing power increased and graphical user
interfaces (GUIs) became more prevalent, calculation games underwent a significant
evolution. Enhanced visual appeal and interactivity became key features, making learning
more engaging and accessible. Games began to incorporate animations, sound effects, and
interactive elements, transforming mathematical practice from a mundane task into an
enjoyable activity.

Key milestones in the history of calculation games include:


●​ Early Educational Tools: The abacus, arithmetic puzzles, and mathematical riddles
served as foundational tools for developing arithmetic skills and mathematical reasoning.

​ 3|Page
TMS

These tools emphasized manual calculation and mental agility.


●​ Text-Based Computer Games: Early computer implementations, often developed in languages
like BASIC and C, provided a new and interactive way to practice arithmetic. These games were
typically simple text-based applications, focusing on the core mechanics of calculation.
●​ Graphical User Interface (GUI) Games: Advancements in graphics and user interface design led
to more sophisticated and visually appealing games. These games incorporated animations, sound
effects, and interactive elements, making learning more engaging and accessible.
●​ Mobile and Online Games: The proliferation of mobile devices and the internet has significantly
increased the accessibility and widespread use of calculation games. Mobile apps and online
platforms offer a diverse range of mathematical challenges, catering to various age groups and skill
levels. These platforms often incorporate features like multiplayer modes, leaderboards, and
personalized learning paths, further enhancing the learning experience.
●​ Modern Educational Software: Today, calculation games are often integrated into
comprehensive educational software packages, offering adaptive learning experiences and detailed
performance tracking. These tools leverage artificial intelligence and machine learning to
personalize the learning process, providing targeted feedback and customized challenges.
●​ Gamification of Mathematics: The concept of gamification has deeply impacted the development
of calculation games, utilizing game-design elements and principles in non-game contexts. This
approach aims to make learning more engaging and motivating, transforming mathematical
practice into a fun and rewarding experience.

The evolution of calculation games reflects the ongoing quest to make learning more
effective and enjoyable. As technology continues to advance, we can expect to see even more
innovative and engaging calculation games that will further enhance mathematical
proficiency and cognitive development.

​ 4|Page
TMS

4.Code

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <ctype.h>

#define NUM_WORDS 20 // Number of words in the pool


#define TOTAL_ROUNDS 15 // Total words to type

// ANSI color codes


#define RESET "\033[0m"
#define GREEN "\033[1;32m"
#define RED "\033[1;31m"
#define CYAN "\033[1;36m"
#define YELLOW "\033[1;33m"
#define BLUE_BG "\033[44m"
#define WHITE_TEXT "\033[1;37m"

// Word bank
char words[NUM_WORDS][20] = {
"programming", "computer", "algorithm", "database", "network",
"software", "hardware", "interface", "function", "variable",
"structure", "pointer", "memory", "process", "thread",
"compile", "debug", "syntax", "library", "execute"
};

// Function to generate a random word

​ 5|Page
TMS

char *getRandomWord() {
return words[rand() % NUM_WORDS];
}

// Function to calculate WPM


float calculateWPM(int correctChars, float timeTaken) {
if (timeTaken == 0) return 0;
return (correctChars / 5.0) / (timeTaken / 60.0); // 5 chars per word, 60 seconds per minute
}

int main() {
srand(time(NULL)); // Seed random generator
char input[20]; // User input
char *targetWord;
int correctWords = 0, correctChars = 0;
time_t startTime, endTime;
float timeTaken;

printf(YELLOW "\n========================================\n" RESET);


printf(WHITE_TEXT BLUE_BG " ⌨ WELCOME TO TYPESPRINT! " RESET "\n");
printf(YELLOW "========================================\n\n" RESET);
printf("Type the words as fast and accurately as you can.\n");
printf("Press Enter to start...\n");
getchar(); // Wait for user to press Enter

startTime = time(NULL);

for (int i = 1; i <= TOTAL_ROUNDS; i++) { // 15 rounds


targetWord = getRandomWord();

​ 6|Page
TMS

printf(CYAN "\n 🔢 Round %d of %d\n" RESET, i, TOTAL_ROUNDS);


printf(" 📜 Type: " YELLOW "%s" RESET " (%lu letters)\n", targetWord, strlen(targetWord));
printf("⌨ Your Input: ");
scanf("%s", input);

if (strcmp(input, targetWord) == 0) {
printf(GREEN " ✅ Correct!\n" RESET);
correctWords++;
correctChars += strlen(targetWord);
} else {
printf(RED " ❌ Wrong! The correct word was: %s\n" RESET, targetWord);
}
}

endTime = time(NULL);
timeTaken = difftime(endTime, startTime);
float wpm = calculateWPM(correctChars, timeTaken);

// Display final score


printf(YELLOW "\n========================================\n" RESET);
printf(WHITE_TEXT BLUE_BG " 🏆 FINAL SCORE 🏆 " RESET "\n");
printf(YELLOW "========================================\n\n" RESET);

printf("⏳ Time taken: " CYAN "%.2f seconds\n" RESET, timeTaken);


printf("✅ Correct words: " GREEN "%d/%d\n" RESET, correctWords, TOTAL_ROUNDS);
printf("🔢 Correct characters: " GREEN "%d\n" RESET, correctChars);
printf("⚡ Words per minute (WPM): " YELLOW "%.2f\n\n" RESET, wpm);

​ 7|Page
TMS

// Encouraging message
if (correctWords == TOTAL_ROUNDS) {
printf(GREEN " 🎉 Perfect score! You're a typing master! 🎉\n" RESET);
} else if (correctWords >= TOTAL_ROUNDS / 2) {
printf(YELLOW "👍 Great job! Keep practicing to get even faster!\n" RESET);
} else {
printf(RED "💡 Don't worry! Practice makes perfect!\n" RESET);
}

printf(YELLOW "========================================\n\n" RESET);

return 0;
}

5. Data Interpretation and Analysis

​ 8|Page
TMS

The core functionality of the C-based math calculation game revolves around the generation
of random arithmetic problems and the evaluation of user responses. The
generateRandomNumber function plays a pivotal role in creating the dynamic nature of the
game, producing pseudo-random integers within a user-defined range. This range can be
adjusted to control the difficulty of the generated problems. The performCalculation function
then takes these random integers and applies basic arithmetic operations (addition,
subtraction, multiplication, and division) based on a randomly selected operator.

Key Data Aspects and Interpretations:


●​ Randomness:
o​ The utilization of the srand(time(NULL)) function is crucial for ensuring the generation of
distinct random number sequences during each execution of the program. This dynamic
seeding of the random number generator guarantees that users encounter unique and
unpredictable mathematical challenges, enhancing the replayability and educational value
of the game.
o​ The quality of the randomness directly affects the variability and unpredictability of the
math problems.
●​ Input Handling:
o​ The scanf function is employed to capture user input, specifically the numerical answers
provided to the generated arithmetic problems. Robust input validation is essential to
ensure that the program can gracefully handle unexpected or invalid input, such as
non-numeric characters or out-of-range values.
o​ The games robustness is dependant on how well the input is handled.

●​ Scoring Mechanism:
o​ The game implements a scoring system to track user performance, providing immediate
feedback on the correctness of each answer. This scoring system serves as a motivational
tool, encouraging users to improve their arithmetic skills and strive for higher scores.
o​ The scoring system provides data on the users preformance, which can be used to adjust the
difficulty.
●​ Error Handling:

​ 9|Page
TMS

o​ Basic error handling is implemented to prevent potential program crashes, particularly in


scenarios involving division by zero. This safeguard ensures the stability and reliability of
the game, preventing unexpected termination and preserving the user experience.
o​ Further error handling would greatly improve the quality of the program.

Possible Enhancements and Data-Driven Improvements:


●​ Timer Implementation:
o​ Adding a timer to each problem would introduce an element of time pressure, encouraging
users to improve their calculation speed. The data collected from the timer could be used to
track user response times and provide feedback on their progress.
●​ Dynamic Difficulty Adjustment:
o​ Implementing a dynamic difficulty adjustment mechanism would allow the game to adapt
to the user's skill level. By analyzing user performance data, such as accuracy and response
time, the game could automatically increase or decrease the complexity of the generated
problems.
●​ Expanded Operator Set:
o​ Expanding the set of supported arithmetic operators to include exponents, roots, or modulo
operations would increase the complexity and educational value of the game. This would
require modifications to the performCalculation function and the input validation logic.
●​ Data Logging and Analysis:
o​ Saving user performance data to a file would allow for more in-depth analysis of user
progress. The data could include scores, response times, and accuracy rates, providing
valuable insights into user learning patterns.
o​ The high scores should be saved to a file.

●​ User Profiles:
o​ Implementing user profiles, and saving user data, would allow for personalization of the
game, and would also allow the user to track their own progress.
●​ Graphical User Interface(GUI):
o​ Implementing a GUI would greatly improve the user experience.

●​ Complex Expression Generation:

​ 10 | P a g e
TMS

o​ Adding parenthesis, and more operands to the generated expressions, would greatly
increase the difficulty of the game.

6.Output Screenshots

​ 11 | P a g e
TMS

7. Conclusion
This project has successfully implemented a functional and engaging math calculation game
using the C programming language. The game provides users with a valuable and interactive
platform to practice fundamental arithmetic skills, ultimately enhancing their calculation
speed, accuracy, and mental agility. By generating random mathematical expressions and
requiring timely responses, the game fosters a dynamic learning environment that encourages
users to think critically and react swiftly.

The project effectively demonstrates the application of C programming in the realm of game
development, highlighting the language's versatility and power in creating interactive and
educational applications. The successful implementation of random number generation, using
srand(time(NULL)) and rand(), ensures a diverse and unpredictable set of mathematical
challenges, maintaining user engagement and promoting continuous learning. Robust input
handling, using scanf, ensures that the program can gracefully handle user input, and that the
program is stable. The basic error handling implemented prevents common errors, such as

​ 12 | P a g e
TMS

division by zero.

The development process has provided valuable insights into the design and implementation
of interactive applications in C, emphasizing the importance of clear code structure, efficient
algorithm design, and thorough testing. The project has also reinforced the significance of
user-centered design, highlighting the need to create intuitive and engaging interfaces that
facilitate effective learning.
Future Enhancements and Potential Developments:
●​ Timer Implementation:
o​ Integrating a timer mechanism to introduce time constraints for each question would
significantly enhance the game's challenge and promote faster calculation speeds. This
feature would add an element of urgency, encouraging users to improve their mental agility
and quick-thinking abilities.
●​ Dynamic Difficulty Levels:
o​ Implementing dynamic difficulty levels by adjusting the range of numbers and the
complexity of operations would cater to users of varying skill levels. This adaptive feature
would ensure a personalized learning experience, providing appropriate challenges and
preventing frustration.
●​ Graphical User Interface (GUI):
o​ Developing a graphical user interface (GUI) would significantly enhance the game's visual
appeal and user experience. A GUI would allow for more interactive elements, animations,
and visual feedback, making the game more engaging and enjoyable.
●​ Expanded Operator Set:
o​ Expanding the set of supported arithmetic operations to include modulus, exponents, roots,
and other mathematical functions would increase the complexity and educational value of
the game. This would provide users with a broader range of mathematical challenges,
fostering a deeper understanding of mathematical concepts.
●​ High Score Tracking and Persistence:
o​ Implementing a high score tracking system and saving high scores to a file would add a
competitive element to the game, motivating users to strive for higher scores and track their
progress over time.

​ 13 | P a g e
TMS

●​ User Profiles and Progress Tracking:


o​ Implementing user profiles would allow users to save their progress, and allow for personal
customization of the game.
●​ Complex Expression Generation:
o​ Adding parenthesis, and increasing the amount of operands, would greatly increase the
difficulty of the generated questions.
●​ Addition of Fractions and Decimals:
o​ Adding fractions and decimals to the generated problems would increase the games
difficulty and educational value.
●​ Addition of Trigonometric Functions:
o​ Adding trigonometric functions to the generated problems would add a very high difficulty,
and would increase the educational value of the game.
In conclusion, this project has successfully created a solid foundation for an engaging and
educational math calculation game. The implemented functionalities and potential enhancements
provide a clear path for future development, ensuring that the game continues to evolve and provide
a valuable learning experience for users.

​ 14 | P a g e
TMS

8. Bibliography
This project drew upon a variety of resources, encompassing foundational C programming
texts, online tutorials, and the official C Standard Library documentation. The following
bibliography provides a more detailed overview of the materials consulted:
●​ "C Programming: A Modern Approach" by K.N. King:
o​ This comprehensive textbook served as a primary resource for understanding the intricacies
of the C programming language. It provided in-depth explanations of core concepts,
including data types, operators, control flow, functions, and memory management. Its clear
and concise writing style, coupled with numerous examples, facilitated a thorough
understanding of C programming principles. This book was especially useful for
understanding memory management, which is important for optimization.
●​ "Programming in C" by Stephen G. Kochan:
o​ This widely acclaimed book provided a practical and accessible introduction to C
programming. Its step-by-step approach and emphasis on real-world examples made it an
invaluable resource for learning the fundamentals of C. It was very useful for learning
about standard library functions.
●​ Online Resources and Tutorials on C Programming and Game Development:

​ 15 | P a g e
TMS

o​ Numerous online resources and tutorials were consulted to supplement the textbook
learning. Websites such as GeeksforGeeks, TutorialsPoint, and Stack Overflow provided
valuable insights into specific C programming concepts and game development techniques.
These resources offered practical examples, code snippets, and solutions to common
programming challenges.
o​ Websites such as learn-c.org were also utilised.

●​ Documentation of the C Standard Library:


o​ The official documentation of the C Standard Library (e.g., cppreference.com) was an
essential resource for understanding the functionality and usage of standard library
functions. This documentation provided detailed information on functions such as rand(),
srand(), scanf(), printf(), and other essential components of the C programming
environment.
o​ This was extremely important for verifying correct usage of functions.

●​ "Algorithms in C" by Robert Sedgewick:


o​ This book provided information on algorithms, that helped with the creation of the random
number generation, and helped with the creation of the scoring system.
●​ "The C Programming Language" by Brian W. Kernighan and Dennis M. Ritchie:
o​ This is the definitive book on the C programming language, and was used as a reference.

●​ Various Stack Overflow threads:


o​ Stack overflow was used to debug many errors, and to learn about best practices.

​ 16 | P a g e

You might also like