Two Dice Pig Game

Overview

This project is a simple dice game called Two Dice Pig. This game is played by Two people using a pair of dice. I wrote this program in my 1st year, in ICS111. This project includes a graphical interface. I like this project because it’s really fun to play and it’s what got me hooked to coding and programming. From this project, I learned how to use if-else statements and learned about using functions in javas library.

How to play

Players Roll dice until the score is reached. Simple and Easy! :)

Rules:

Preview

picture

How it works

The program works by using the math.random function to simulate a dice roll. To create the rules of the game, I used if-else statements. For example, if both dice rolled 1, the users total score variable would be set to 0. Since this was a beginning level computer science course, the graphical interface was given to us from our instructor. This program was very simple but it was a fun introduction to programming.