Welcome to the Virtual Dice Roller! A fun and interactive console-based Java project where you can roll dice with any number of sides, see cool ASCII art, and play as many times as you want! π
This project was created as a study and practice project while learning Java for backend development. The main objectives and skills practiced include:
- π’ Understanding Java basics: classes, methods, loops, conditionals, and input/output.
- π’ Practicing user input validation using
Scanner. - π’ Implementing nested loops for game flow control.
- π’ Learning Collections with
Setfor managing valid user responses. - π’ Working with random numbers using
Random. - π’ Practicing modular code design by separating concerns into methods like
printDiceArtMenu(),printDiceArtFinal(), andreadPositiveInt(). - π’ Exploring object-oriented programming (OOP) with the nested
Diceclass. - π’ Improving code readability with proper naming conventions, constants, and comments.
- π’ Handling edge cases, such as invalid inputs or zero/negative dice sides.
β¨ Outcome: This project was a hands-on way to consolidate Java fundamentals, practice good coding habits, and simulate a small interactive console app, a foundation for more complex backend projects in the future.
- π² Roll a dice with any number of sides.
- π¨ Fun ASCII art before and after rolling the dice.
- β User input validation for dice sides and repeat choices.
- π Supports multiple yes/no responses in different languages:
y,yes,s,sim,n,no,nop,nΓ£o. - π₯οΈ Clean and user-friendly console interface.
- π‘ Reusable Dice class for object-oriented design practice.
- Java 17+ installed on your system.
- A terminal or IDE (IntelliJ IDEA, Eclipse, VS Code, etc.).
- Clone this repository or copy the files locally.
- Compile the project using the terminal:
javac DiceRoller.java
