https://github.com/tiuphun/dice
Another *burdensome* homework from OOP Theory class.
https://github.com/tiuphun/dice
oops-in-java
Last synced: 8 months ago
JSON representation
Another *burdensome* homework from OOP Theory class.
- Host: GitHub
- URL: https://github.com/tiuphun/dice
- Owner: tiuphun
- Created: 2023-06-29T04:13:15.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-07-03T07:36:06.000Z (almost 3 years ago)
- Last Synced: 2025-03-04T04:44:47.954Z (over 1 year ago)
- Topics: oops-in-java
- Language: Java
- Homepage:
- Size: 358 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 21 Dice Game 🎲
Another *burdensome* homework from OOP Theory class (the sigh is real). Hopefully I'll learn something useful.
## 📄 Description
Design a game as following:
* Number of players: 4 (always). If < 4 players are playing, the program will automatically added a number of players so that there are 4 of them.
* There are 4 dices. Each dice has the probability of a face of 20%, and the remaining outcomes are 16%: For dice number 1-4, the face with 1-4 dots is the one with 20% possibility.
* Each player has:
* Name
* Total accumulated points
* *For virtual players*: Have different ways of expressing game over (say something nice, leave game, silently do something bad...)
* There is 1 game master who:
* Decide who will go next;
* Calculate the points for players:
* If `previous turn's accumulated point` + `this turn's point` = 21: Winner. End game.
* If `previous turn's accumulated point` + `this turn's point` > 21: Point = 0;
* Otherwise: add points as normal
* Announce the winner. Virtual players express their disappointment differently.
* At each player's turn, they will receive at random a dice and roll it.