Professional Documents
Culture Documents
Mad Report1-5-28
Mad Report1-5-28
Mad Report1-5-28
The Dice Roll mobile game is a captivating and entertaining application developed for
both iOS and Android platforms. It offers users a virtual dice-rolling experience, combining luck
and strategy in an addictive gameplay environment. The game features a user-friendly interface,
allowing players to easily navigate and enjoy the virtual dice-rolling experience. The objective is
to accumulate the highest score by strategically rolling the dice and making optimal decisions
based on the rolled numbers. we will be building a Dice Game Project using Java and XML in
Android. The Dice Game is based on a three-player game. The players roll the dice and the player
who gets the highest phase value will win the game. There will be a single activity in this
application. This activity will show the three player’s name and their dice. The result will be
displayed on the top and there will be a roll button at the bottom.
ii
CONTENTS
ACKNOWLEDGEMENT i
ABSTRACT ii
CHAPTER PAGE NO
1. INTRODUCTION 01-02
ABOUT THE MINI PROJECT
.SCOPE AND APPLICATION OF MINI PROJECT
2. HISTORICAL REVIEW 03
3 . REQUIREMENT SPECIFICATION 04-05
SYSTEM REQUIREMENTS
HARDWARE REQUIREMENTS
SOFTWARE REQUIREMENTS
FUNCTIONAL REQUIREMENTS
DEVLOPMENT TASKS
4 . SYSTEM DESIGN 06-08
FLOW CHART
SYSTEM DESIGN
LOGICAL DESIGN
PHYSICAL DESIGN
5. SYSTEM IMPLEMENTATION 09-16
XML CODE
JAVA CODE
6. TESTING 17
7. OUTPUT 18-20
8. CONCLUSION 21
9. REFERENCES 22
Dice Game 2022-23
CHAPTER 1
INTRODUCTION
A dice game is a game that involves the use of one or more dice as the primary element
for gameplay. Dice games have been played for centuries and come in a wide variety of formats,
ranging from simple to complex. The basic premise of a dice game is that players rollone or
more dice and the outcome of the roll determines the outcome of the game. The numberof dice
used, the rules of the game, and the objectives can vary greatly depending on the specificgame
being played. Dice games are often associated with gambling and are commonly found in
casinos, but they can also be played for fun or educational purposes. They can be played with
friends and family or in organized tournaments. One popular dice game is "Craps," where
players bet on the outcome of the roll or a series of rolls of two dice. Another well-known dice
game is "Yahtzee," which involves rolling five dice with the objective of achieving specific
combinations to score points. Dice games can be based purely on chance, where the outcome
is determined solely by the roll of the dice, or they can involve a combination of luck and
strategy, where players make decisions based on the probabilities of certain outcomes. Overall,
dice games provide an entertaining way to engage with probability and chance, and they can
be enjoyed by people of all ages and skill levels.
The dice game is a popular game that involves rolling one or more dice and making decisions
or calculations based on the outcome of the roll. It is commonly played for fun or as a gambling
game.
About Android
Android is the Linux-based open-source operating system for mobile devices like
smartphones & tablets. However, nowadays, many other devices are incorporating android
in them to turn them into smart devices such as Smart TVs, Smart car interface for GPS,
electrical appliances, etc. This software was unveiled in 2007 & the first Android Device was
launched in September 2008. Since then Google, the sponsor of Android has been releasing its
software updates, versions almost every year.
Android offers a unified approach to application development for mobile devices which
means developers need only develop for Android, and their applications should be able
to run on different devices powered by Android.The source code for Android is available
under free and open source software licenses. Google publishes most of the codeunder the
Apache License version 2.0 and the rest, Linux kernel changes, under the GNU General
Public License version 2.
Our Scope is to evolve several Tic-tac-toe strategies which never lose (meaning
a draw or a win by the computer). This makes the problem to have a single objective of
minimizing the number of losses. The evaluation of fitness of any strategy is done by first
allowing it to play all possible games it could play, both as a first player and as a second player.
For example, note from Figure 5 that there are two possible ways a game can move for the first
player from level 1 to level 2, depending on whether the opponent made the left or the right
side move . Our evaluation procedure considers all such intermediate possibilities an opponent
can have and count the total number of possible games resulting in wins, draws and losses. This
is continued for the above strategy to be played as the second player. The total number ofgames
lost in both cases as a first player and a second player is calculated.
CHAPTER 2
HISTORICAL REVIEW
Dice games have a long and rich history that spans across cultures and civilizations.
They have been played for entertainment, gambling, and even religious purposes. Let's explore
a historical review of dice games. Dice games can be traced back to ancient civilizations. The
earliest evidence of dice dates back over 5,000 years to Mesopotamia (modern-day Iraq).
Excavations have uncovered dice-like objects made from various materials such as bone, ivory,
and stone. These early dice were often marked with symbols instead of numbers. The ancient
Egyptians also played dice games. They used dice made from bone, wood, or precious stones.
Dice were commonly found in tombs, indicating their significance in the afterlife. The game
"Senet" was particularly popular, involving a board and dice. It held symbolic meaning and
was believed to represent the journey of the soul through the underworld. The Romans were
enthusiastic dice players. They had a variety of dice games, including "Tesserae" and "Tali."
Tesserae used six-sided dice and was similar to modern-day backgammon. Tali used four-sided
dice with different numbered sides, and players would throw them together to achieve specific
combinations. Dice games continued to evolve during the Middle Ages. Gambling with dice
became prevalent, often associated with taverns and inns. Games like "Hazard" gained
popularity, involving complex betting rules and strategies. Gambling with dice faced
opposition from religious authorities but remained widely enjoyed. Dice games were also
prominent in Asian cultures. Ancient Chinese dice games like "Bian He" and "Siu Fa" date
back to the Han Dynasty (206 BCE - 220 CE). These games were often played for divination
purposes as well. In Japan, "Sugoroku" was a popular dice game played during the Heian period
(794-1185 CE) and influenced the development of backgammon. Dice games continued to
evolve over time, adapting to changing cultural and social contexts. Traditional dice games like
Yahtzee, Farkle, and Liar's Dice gained popularity in the 20th century and remain enjoyed
today. In addition to physical dice games, the digital era has given rise to virtual dice games
played on computers and mobile devices.Dice games have a fascinating history that spans
thousands of years and numerous civilizations. They have served as forms of entertainment,
gambling, divination, and cultural expression. From ancient Mesopotamia to modern-day
gaming, dice games have remained a timeless source of enjoyment and intrigue for people
around the world.
CHAPTER 3
REQUIREMENT SPECIFICATION
SYSTEM REQUIREMENTS
Hardware Requirements
Software Requirements
Functional Requirements
These requirements are implicit to the system and may be so fundamental that
actor/gamer/relevant people does not explicitly state them .Their absence will be a
Development Tasks
1. Android Studio will bring all of the following codes together to create the game.
2. Graphics engine will be responsible for rendering text, 2D images, and 3D models
on screen.
• Drawing models
• Drawing sprite
• Drawing text
• Texturing models
• Animation
3. Sound engine will be responsible for playing music and sound effects.
• Multithreading
• Playing sounds
4. Input engine will be responsible for transferring mouse and keyboard input upon
request
• Retrieving Input
CHAPTER 4
SYSTEM DESIGN
Flowchart
Start
Roll
the
Dice
The result is
determined
after every
Player 1 Player 2
Tie Player 3
wins wins
wins
End
Before getting to implement the game directly we’ll understand the files that we have created
1. Dice Game. Through this, we manage the interface of the Android Application.
2. The next important file is the MainActivity.java file. This file makes the application
The first file that we have created is activity_main.xml, this file has the layout of the
actually work. It has all the methods that make functioning in the app possible.
SYSTEM DESIGN
System Design is the most creative and challenging phase in the system life cycle .Design is
the first step into the development phase for any engineered product or system. Design is a
creative process. A good design is the key to effective system. System design is a solution how
to approach the creation of a new system. System design transforms a logic representation of
what is required to do into the physical specification.
Logical design
The logical flow of a system and define the boundaries of a system. It includes
• Reviews the current physical system – its data flows, file content, volumes, frequencies etc
.• Prepares output specifications – that is, determines the format, content and Frequency of
reports.
• Prepares input specifications – format, content and most of the input functions.
• Prepares a logical design walk through of the information flow, output, input,
Physical design
Physical system produces the working systems by define the design specifications that tell the
programmers exactly what the candidate system must do. It includes the following steps.
• Design physical information flow through the system and a physical design Walk through.
• Devise a test and implementation plan and specify any new hardware/software
CHAPTER 5
SYSTEM IMPLEMENTATION
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<TextView
android:id="@+id/tvVar2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginBottom="40dp"
android:fontFamily="sans-serif-black"
android:gravity="center"
android:text="Dice Game"
android:textSize="40dp"
android:textStyle="bold" />
<TextView
android:id="@+id/tvVar1"
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_below="@+id/tvVar2"
android:fontFamily="sans-serif-smallcaps"
android:gravity="center"
android:textAlignment="center"
android:textColor="@color/gradStop"
android:textSize="35dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/tvVar1"
android:layout_marginTop="40dp"
android:orientation="vertical">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="50dp"
android:layout_gravity="center"
android:layout_marginBottom="40dp"
android:orientation="horizontal">
<TextView
android:layout_width="140dp"
android:layout_height="50dp"
android:layout_gravity="center"
android:gravity="center"
android:padding="10dp"
android:text="Player 1"
android:textAlignment="center"
android:textColor="#000000"
android:textSize="25dp" />
<TextView
android:layout_width="140dp"
android:layout_height="50dp"
android:layout_gravity="center"
android:gravity="center"
android:padding="10dp"
android:text="Player 2"
android:textAlignment="center"
android:textColor="#000000"
android:textSize="25dp" />
<TextView
android:layout_width="140dp"
android:layout_height="50dp"
android:layout_gravity="center"
android:gravity="center"
android:padding="10dp"
android:text="Player 3"
android:textAlignment="center"
android:textColor="#000000"
android:textSize="25dp" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="horizontal">
<ImageView
android:id="@+id/ivVar1"
android:layout_width="140dp"
android:layout_height="140dp"
android:padding="10dp"
android:src="@drawable/dice6" />
<ImageView
android:id="@+id/ivVar2"
android:layout_width="140dp"
android:layout_height="140dp"
android:padding="10dp"
android:src="@drawable/dice6" />
<ImageView
android:id="@+id/ivVar3"
android:layout_width="140dp"
android:layout_height="140dp"
android:padding="10dp"
android:src="@drawable/dice6"
tools:ignore="ContentDescription" />
</LinearLayout>
<Button
android:id="@+id/btVar1"
android:layout_width="wrap_content"
android:layout_height="65dp"
android:layout_gravity="center"
android:layout_marginTop="60dp"
android:background="@drawable/btn_bg"
android:gravity="center"
android:padding="12dp"
android:textAlignment="center"
android:textColor="#ffffff"
android:textSize="30dp" />
</LinearLayout>
</RelativeLayout>
package com.example.dicegame;
import androidx.appcompat.app.AppCompatActivity;
import android.annotation.SuppressLint;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import java.util.Random;
@SuppressLint("MissingInflatedId")
@Override
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
button = findViewById(R.id.btVar1);
textView = findViewById(R.id.tvVar1);
img1 = findViewById(R.id.ivVar1);
img2 = findViewById(R.id.ivVar2);
img3 = findViewById(R.id.ivVar3);
View.OnClickListener() {
@Override
} else {
textView.setText("RESULT : Draw");
img1.setImageResource(dice[num1]);
img2.setImageResource(dice[num2]);
img3.setImageResource(dice[num3]);
});
CHAPTER 6
TESTING
Testing is a process of executing a program with the intent of finding an error.esting is a crucial
element of software quality assurance and presents ultimatereview of specification, design and
coding. System Testing is an important phase.Testing represents an interesting anomaly for the
software. A good test case is one that has a high probability of finding an as undiscovered error.
Test levels
The test approach is divided into three main phases: Module testing, integration testing and
system testing. In addition, the system testing includes two sub-phases:functional and usability
testing. These planned tests are explained briefly below.
1. Module testing will perform during coding by using debug messages to check that the
written code produces wanted results. An important requirement is that the code will compile
with zerobugs.
2. Integration testing will perform after finish module testing in order to validate if each
module can work fine with each other. Integration Test proves that system works as integrated
unit when all the fixes are complete.
3. System testing includes two phases: functional testing and usability testing. These will
perform after the product reaches its final version. During functional test phase,the tester will
test if the product meets the equirements.
4. Acceptance testing is a software testing technique used to determine whether a system meets
its specified requirements and is ready for deployment. It is the final phase of testing before a
software product is delivered to the end-users or stakeholders.
The purpose of acceptance testing is to evaluate the system's compliance with business
requirements and ensure that it functions as intended. It is typically performed by the end-users
or client representatives in a real-world environment, simulating real-world scenarios and
usage.
CHAPTER 7
OUTPUT
CHAPTER 8
CONCLUSION
The outcome of a dice game heavily relies on chance and randomness. Each roll of the
dice is independent of the previous rolls, meaning that there is no way to predict or manipulate
the result. This aspect adds excitement and unpredictability to the game. The probability of
rolling a specific number or combination of numbers can be calculated based on the number of
sides on the dice and the total number of possible outcomes. This knowledge can be used to
develop strategies or make informed decisions during the game. While dice games are
predominantly governed by luck, certain strategies can be employed to maximize the chances
of winning. These strategies often involve analyzing the probabilities, managing risks, and
making optimal decisions based on the current game state. In summary, dice games provide a
balance between luck and strategy, offering an enjoyable and entertaining experience for
players. The element of randomness ensures that each game is unique and unpredictable, while
knowledge of probabilities and strategic decision-making can enhance the chances of success.
Ultimately, dice games continue to be a timeless and engaging form of entertainment for players
worldwide.
CHAPTER 9
REFERENCES
Book References
[2] Erik Hellman, “Android Programming – Pushing the Limits”, 1st Edition, Wiley India Pvt
Ltd, 2014. ISBN-13: 978-8126547197.
[3] Dawn Griffiths and David Griffiths, “Head First Android Development”, 1st Edition,
O’Reilly
[5] Bill Phillips, Chris Stewart and Kristin Marsicano, “Android Programming: The Big Nerd
Ranch Guide”, 3rd Edition, Big Nerd Ranch Guides, 2017. ISBN-13: 978-0134706054.
Web References