Skip to content

WillianFerreiraDaCosta/java-dice-game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Java Dice Game

A simple Java console-based dice game for two players.
Demonstrates Object-Oriented Programming (OOP), packages, and input handling.


Features

  • Two players roll the dice until there is a winner.
  • Random dice values with customizable number of faces.
  • Safe input handling using a custom Keyboard class.
  • Simple console interface.

Learning Objectives

  • Practice Java syntax and project structure.

  • Understand classes, objects, and methods.

  • Learn basic OOP concepts (encapsulation, packages).

  • Handle user input safely.


Example Run

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!!!


⚙️ How to Run

  1. 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

About

A simple Java console-based dice game for two players. Demonstrates Object-Oriented Programming (OOP), packages, and input handling.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages