byurudur / craps-game

Craps game with dices, win, lose or tie.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Craps Dice Game

Introduction

This Java application simulates a simplified version of the Craps dice game. Players roll two dice and win or lose based on the outcome of the dice rolls according to specific rules.

Rules

  • Rolling a sum of 7 results in an immediate loss.
  • To win, the player must roll:
    • Doubles of 6-6
    • Doubles of 5-5
    • Doubles of 3-3
  • The player loses if they roll:
    • Doubles of 4-4
    • Doubles of 2-2
    • Doubles of 1-1
  • If both the computer and the player roll the same sum or both roll a sum of 7, it is a tie.

How to Play

  1. Run the program.
  2. The computer rolls two dice.
  3. The player rolls two dice.
  4. The outcome is displayed, indicating whether the player or the computer wins, or if it’s a tie.

Technologies Used

  • Java: Programming language used for the application.
  • Random: Used for generating random dice rolls.

Running the Program

  1. Copy the code into Main.java.
  2. Compile the program with:
    javac Main.java
    
  3. Run the program with:
    java Main
    

Enjoy playing the Craps game!

About

Craps game with dices, win, lose or tie.


Languages

Language:Java 100.0%