Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 10

A

PROJECT REPORT
ON

“Dice Clash”

DIPLOMA IN COMPUTER ENGINEERING

BY

MR.CHUDIWAL SHREAYSH RAJENRA (19)

Under the guidance of


MR.S.A.PATIL

DEPARTMENT OF COMPUTER ENGINEERING SANJIVANI RURAL


EDUCATION SOCIETY’S SANJIVANI K.B.P. POLYTECHNIC,
KOPARGAON-423603
2023-2024

MR.S.A.PATIL MR.G.N.JORVEKAR
(Subject Teacher) (H.O.D)
Sanjivani Rural Education Society’s
SANJIVANI K. B. P. POLYTECHNIC
DEPARTMENT OF COMPUTER TECHNOLOGY

CERTIFICATE
This is to certify that the Project report entitled

“Dice Clash”
Submitted By
MR.Chudiwal Shreaysh Rajendra (2100340159)

Under our supervision and guidance for partial fulfillment of the requirement for
Diploma in Computer Technology affiliated to
Maharashtra State Board of Technical Education, Mumbai
For academic year
2023- 2024

MR.S.A.PATIL MR.G.N.JORVEKAR
(Subject Teacher) (H.O.D)
INDEX
SR.NO. TITLE PAGE NO.
1 Acknowledgement 4
2 Introduction 5
3 Program Code 6
4 Output 9
5 Conclusion 10
6 Reference 10
Acknowledgement

I am deeply grateful and excited to express my appreciation to all those who have
contributed to the successful development of the micro project "Dice Clash." This project,
designed to provide an engaging and fun dice game experience, would not have been
possible without the support, guidance, and inspiration of various individuals and resources.

First and foremost, I would like to thank the OpenAI community and its extensive
documentation. The knowledge and guidance provided by this community played a pivotal
role in helping me understand and implement the core concepts of JavaScript, HTML, and
CSS, which are at the heart of "Dice Clash." It is through this community's extensive
resources that I was able to embark on this project and bring it to life.

I would also like to extend my gratitude to my peers and friends who enthusiastically
supported me throughout the development process. Their encouragement, feedback, and
constructive criticism helped refine the project and make it more enjoyable for the end-users.
"Dice Clash" truly became a collaborative effort, thanks to their valuable insights.

Additionally, I want to acknowledge the contributions of various online resources and


tutorials that aided me in creating a professional and visually appealing interface for "Dice
Clash." These resources played a significant role in elevating the project's visual appeal and
overall user experience.

In conclusion, the completion of the micro project "Dice Clash" marks a significant
milestone in my journey of learning and applying web development skills. It is with
profound appreciation that I thank the OpenAI community, my friends, and online resources
for their unwavering support, which has enabled me to create a project that I am proud to
share with others. This project stands as a testament to the collaborative and educational
spirit of the development community, and I look forward to further enhancing and expanding
my skills in the future.
INTRODUCTION

"Dice Clash" is an exciting web-based dice game designed for two players. In this engaging
and suspenseful showdown, each player takes turns rolling a six-sided dice, and the outcome
of the game depends on the numbers rolled. The project's name, "Dice Clash," captures the
competitive spirit of the game as players aim to secure victory and claim the title of the
ultimate dice master.

Players are presented with a beautifully designed interface that features two dice, each
representing one player. A simple click of the "Refresh" button initiates the dice roll, and the
results are displayed on the screen. The game uses randomization to ensure fairness, making
it a game of chance and strategy. When the dice have spoken, the player with the higher
number is declared the winner, and in the case of a tie, players will experience a good-
natured "Tiee ;)" result.

"Dice Clash" serves as an entertaining way to test your luck and challenge a friend to a
thrilling dice duel. Whether you're looking to settle a friendly bet, make a quick decision, or
simply enjoy some casual gaming fun, this micro project offers an interactive and visually
appealing experience. So, roll the virtual dice, feel the excitement of the "Dice Clash," and
may the best roller win!
PROGRAM CODE

HTML:-

<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title>Dicee</title>
<link rel="stylesheet" href="styles.css">
<link href="https://fonts.googleapis.com/css?family=Indie+Flower|Lobster"
rel="stylesheet">
<script src="dicee.js"></script>
</head>
<body onload="game()">

<div class="container">
<h1 id="result">Refresh Me</h1>

<div class="dice">
<p>Player 1</p>
<img class="img1" id="img1" src="">
</div>

<div class="dice">
<p>Player 2</p>
<img class="img2" id="img2" src="">
</div>
</div>
</body>
<footer>
www 🎲 < -- Shreaysh -- > 🎲 com
</footer>
</html>
CSS:-

.container {
width: 70%;
margin: 0 auto;
text-align: center;
}

.dice {
text-align: center;
display: inline-block;

body {
background-color: #393E46;

h1 {
margin: 10px;
font-family: 'Lobster', cursive;
text-shadow: 5px 0 #232931;
font-size: 5rem;
color: #4ECCA3;
}

p{
font-size: 2rem;
color: #4ECCA3;
font-family: 'Indie Flower', cursive;
}

img {
margin-top: 0;
width: 40%;
}

footer {
margin-top: 1%;
color: #EEEEEE;
text-align: center;
font-family: 'Indie Flower', cursive;

JavaScript:-

function game(){
var ran1 = Math.floor(Math.random()*6);
var ran2 = Math.floor(Math.random()*6);

var arr=["images/dice1.png","images/dice2.png","images/dice3.png","images/
dice4.png","images/dice5.png","images/dice6.png"];
change(ran1,ran2);

function change(ran1,ran2){
document.getElementById("img1").src=arr[ran1];
document.getElementById("img2").src=arr[ran2];
}

if(ran1 == ran2){
document.getElementById("result").innerHTML="Result : Tiee ;)";
}else if(ran1 > ran2){
document.getElementById("result").innerHTML="Result : player1 wins!";
}else{
document.getElementById("result").innerHTML="Result : player2 wins!";
}
}

OUTPUT
CONCLUSION

In conclusion, "Dice Clash" is a fun and interactive web-based dice game that provides an
entertaining way for two players to engage in a friendly showdown. With its beautifully
designed interface and the element of chance, it offers a quick and engaging gaming
experience that can be enjoyed by friends and family alike. The game's simplicity and
randomization make it accessible to players of all ages, whether you're settling a bet, making
a decision, or simply looking for a casual and enjoyable pastime.

"Dice Clash" not only showcases the use of JavaScript for creating interactive web
applications but also demonstrates how a simple concept, like a dice game, can be turned
into an entertaining and visually appealing project. So, the next time you're in need of a
quick and fun game to enjoy with a friend, remember "Dice Clash" – the perfect choice for
some lighthearted competition and decision-making entertainment. Roll the dice, embrace
the excitement, and revel in the world of "Dice Clash."

REFERENCE

Sites:-
https://www.w3schools.com/js/
https://www.javascript.com/
https://www.geeksforgeeks.org/javascript/

You might also like