You are on page 1of 11

2021-2022

MINI PROJECT REPORT ENTITLED

“JAVA SIMPLE DICE GAME”

DEPARTMENT OF INFORMATION TECHNOLOGY

Submitted by
SHRIDHAR PATIL (36)
PRAJWAL SARNOBAT(22)
PRAVIN PATIL(16)

Under Guidance of
Prof. Pranoti Tamgave mam.

DR. J.J. MAGDUM COLLEGE OF ENGINEERING,JAYSINGPUR


(Affiliated to SHIVAJI UNIVERSITY, KOLHAPUR)

1
DR. J.J. MAGDUM COLLEGE OF
ENGINEERING,JAYSINGPUR

CERTIFICATE

SHRIDHAR PATIL
PRAJWAL SARNOBAT
PRAVIN PATIL

OF (IT) Department has satisfactorily completed their report work as


Prescribed by Shivaji University during the Academic year 2021-2022 towards
fulfillment of the requirement for T.Y(SEM-5th ) (IT)ENGINEERING

2
ACKNOWLEDGEMENT

We find very happy in submitting project report on “DICE


GAME”. It is mostly impossible to succeed alone. We are
thankful for inspiration and help by our guide prof. Pranoti
Tamgave mam. (information Technology).he provided us
valuable advice and suggestions.

3
INTRODUCTION

Dice game are very much popular in the world and the board
games of dice are also very much popular. So here we created a
simple Dice Game where you and Computer will have the battle
against you. In this program there is no need to put any input
just run every time and get output.

The program is made with “java.util.Randam” for generating


random number or picking up random inputs from the program
. We are using Switch statement and IF statement in the
program.

The result or output is very easy to understand there will be


win, lose and draw. The output will show the Dice value you got
and the Dice value computer get and whose value is higher will
win the game and if equal then draw will be made.

4
SOURCE CODE

import java.util.Random;

public class Program


{
public static void six(){
System.out.print("---------\n| * * |\n| * * |\n| * * |\
n---------");
}

public static void five(){


System.out.print("---------\n| * * |\n| * |\n| * * |\
n---------");
}

public static void four(){


System.out.print("---------\n| * * |\n| |\n| * * |\
n---------");
}

public static void three(){


System.out.print("---------\n| * |\n| * |\n| * |\
n---------");
}

public static void two(){


System.out.print("---------\n| * |\n| |\n| * |\
n---------");
}

5
public static void one(){
System.out.print("---------\n| |\n| * |\n| |\
n---------");
}

public static int random(){


Random r = new Random();
int a = r.nextInt(6)+1;
return a;
}
public static void main(String[] args) {
int you = random();
int computer = random();

System.out.println("you");
switch(you){
case 1: one(); break;
case 2: two(); break;
case 3: three(); break;
case 4: four(); break;
case 5: five(); break;
case 6: six(); break;
}
System.out.println("\n");
System.out.println("computer");
switch(computer){
case 1: one(); break;
case 2: two(); break;
case 3: three(); break;
case 4: four(); break;
case 5: five(); break;
case 6: six(); break;
}

6
if(you>computer){
System.out.println("\nLucky! you won. \ndon't forget
like :)");
}
if(computer>you){
System.out.println("\nYou lost :( \ntap run button till
you win :)");
}
if(you==computer){
System.out.println("\nDraw! click run button again");
}
}
}

7
OUTPUT

8
FUTURE SCOPE

The future scope of these project is that it can be used for


educational purposes and to get a basic idea how java works
because it provides an exciting way to introduce students to
learning techniques and to polish our Special skills.
This game can have varied applications in the context of word
formation and puzzles.
In future modified and updated game will be made from these.

CONCLUSION

The conclusion of these project is that we learn to use the


concept of strings,Switch Statement and if statement.
The Dice game is a luck game so we can run a program without
any input.

9
10
11

You might also like