首页 > > 详细

讲解 Final Project Proposal “Dice Duel” 讲解 R语言

Final Project Proposal

Project Description:
“Dice Duel” is played as a best‑of‑five match: each player aims to win three rounds before their opponent. At the start of every round, both players roll five six‑sided dice and keep their results hidden under a cup so that only they can see their own dice. The first player then makes an opening bid by declaring the total number of dice, from both players combined, showing a certain face (for example, “two 4s”).

Players take turns either raising the bid or calling a challenge.

To raise: a player must either increase the quantity (for instance, move from “two 4s” to “three 4s”) or, if the quantity remains the same, increase the face value (for example, from “two 4s” to “two 5s”).

Challenge: If a player believes the previous bid is simply impossible, they say “Challenge.” Both players then reveal their dice and count how many match the face in question across all ten dice: if the actual number is less than the bid, the challenger wins the round; if it is equal to or greater than the bid, the bidder wins the round.

Each round victory earns one point, and as soon as one player reaches three points, the match is over. If all five rounds are played without either player reaching three points, the one with the higher score wins; in the event of a tie, an extra deciding round is played.

General Description of Implementation:

1. Game Initialization: Define player names or identifiers and set a round counter and initialize scores

2. Make a Main Game Loop: Make a while loop to continue until one player scores 3 points or 5 rounds are played.

3. Dice Rolling: Let each player roll five six-sided dice and store these privately and optionally display only to the corresponding player during testing.

4. Phase Bidding: Start with Player 1 making an initial bid: a quantity and face value

Use a turn-based loop to alternate bidding: On each turn, a player can raise or challenge.

Raise: Increase quantity, or increase face value if quantity is unchanged

Valid input is checked to enforce rules.

5.Challenge Rules: If a player calls “Challenge”, reveal all dice

Compare ‘actualCount’  with ‘bidQuantity’, if actualCount >= bidQuantity, bidder wins, otherwise, challenger wins

Update the score and rounds played

6. End Check: If a player reaches 3 points, they win.

If 5 rounds are completed and neither has 3 points: Higher score wins. If tied, play a tiebreaker round using the same round logic.

7. Other Features: Add graphical display and background music

Reach Goals:
Beyond the core Dice Duel mechanics, our reachable stretch goals include three practical enhancements that can be completed within our existing timeline. First, we will implement an in‑app history log and replay panel that automatically records every bid, raise, challenge, and actual dice count in a scrolling table; players can launch replay mode to step through each reviewing round move‑by‑move, pausing at key moments to compare values, review strategic decisions. Second, we will add a customizable UI themes menu so users can choose between polished light and dark modes, adjust accent colors to their preference, and toggle between pipped‑dot or sleek pipless die‑face styles—ensuring a personalized interface that adapts to any environment. Third, we will develop a single-player AI mode with three difficulty settings - Easy, Normal, and Hard - which can be adjusted by a bluffing threshold parameter; the AI's strategies range from conservative bluffing to high-frequency bluffing, which can be used to provide a good training for players to hone their bluffing skills.



联系我们
  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-21:00
  • 微信:codinghelp
热点标签

联系我们 - QQ: 99515681 微信:codinghelp
程序辅导网!