A simple Java console-based dice game for two players.
Demonstrates Object-Oriented Programming (OOP), packages, and input handling.
- Two players roll the dice until there is a winner.
- Random dice values with customizable number of faces.
- Safe input handling using a custom
Keyboardclass. - Simple console interface.
-
Practice Java syntax and project structure.
-
Understand classes, objects, and methods.
-
Learn basic OOP concepts (encapsulation, packages).
-
Handle user input safely.
What is the name of player 1? Alice What is the name of player 2? Bob How many faces will the dice have (minimum 2)? 6
Dice Alice: 4 Dice Bob: 2 Player Alice won!!!
- Clone this repository:
git clone https://github.com/yourusername/java-dice-game.git
2.Navigate to the folder:
bash Copiar código cd java-dice-game/src
3.Compile and run:
bash Copiar código javac App.java java App