The game of Pig is a simple two-player dice game in which the first player to...

90.2K

Verified Solution

Question

Programming

The game of Pig is a simple two-player dice game in which thefirst player to reach 100 or more points wins. How to play: Playerstake turns rolling one six-sided dice and following these rules: Ifthe player rolls 2 through 6, then he/she can either a. “RollAgain” or b. “Hold” At this point, the sum of all rolls is added tothe player’s score, and it becomes the other player’s turn. If theplayer rolls 1 before he/she decides to stop rolling, the playerscores 0 for that round and it's the other player's turn. Write aprogram that plays the game of Pig, where one player is a human andthe other is the computer. Your program should have a GUIinterface. At the beginning or after each game, the player shouldbe able choose either “start a new game” or “look up historyrecords”. If the user selects “Look up History Records”, he/shewill see a list of all games played on that machine so far, withfour columns: Game result: win or lose Date and time Total pointsWho is the player: computer or human The user should be able tosort the list in different ways by clicking on each of the columntitle. in Java

Answer & Explanation Solved by verified expert
4.2 Ratings (551 Votes)
Here i am providing    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students