Course:INFO1214 Winter 2023 Coding ProjectProfessor:Bill Pulling for Section 01 Project:Casino Fanshawe: Craps! Service Pack #:If we find an error in the assignment we’ll issue a...

This is a Project to make a CRAPS game. We UseEclipse IDE for Java Developers - 2022-12 for our coding class. If you have any questions please feel free to email me!


Course: INFO1214 Winter 2023 Coding Project Professor: Bill Pulling for Section 01 Project: Casino Fanshawe: Craps! Service Pack #: If we find an error in the assignment we’ll issue a service pack notice to everyone by email. Due Date: Code in FOL drop box by Friday April 7 by 2359 EST Description: The gambling game known as “Craps” had its origins in ancient Roman times. Soldiers would take pig knuckle bones and carve them into cube shapes to resemble dice. They would then wager on the outcomes of rolls made. This is where the slang phrase “rolling the bones” originated. The modern casino game of craps evolved from a similar dice game called “Hazard” attributed to English knight Sir William of Tyre around 1125. It was a game played by his knights to pass the time as they laid siege to a castle name ‘Hazarth”, during the Crusades. One player would be the “caster”. That player would roll the dice, and other players would lay bets as to whether the caster would win or lose. The game evolved and in the early 1700’s it reached France, where the name had morphed to “Crabs”, which was the slang term used to describe the worst possible role total of 2 (today we call this roll “snake-eyes”). A few decades later it followed French settlers to the new world colony of Acadia, in present day Atlantic Canada. When the Acadians were expelled from Acadia by the English around 1755, the game followed the “Cajuns” into what is now the southern United States, where its name morphed into “Crebs” or “Creps”. By the middle 1800’s it was a popular game in the gambling establishments throughout the southern states and on the riverboats travelling the length of the Mississippi river. The name hade morphed again into its present day version of “Craps”. The rules for the modern casino version of the game are attributed to a dice maker named John H. Winn, who proposed a standardized set of rules for the game in 1907 (“Winn’s Rules”) and a standardized table top layout. To see an example of a casino craps table layout and a brief explanation of the casino rules, take a look at this site: https://www.bestuscasinos.org/blog/how-the-craps-table-works-for-beginners/. These rules and table layout were quickly adopted by casinos and remain the standards for the game today. For a more complete story on the origin and modernization of the game, take a look at this site: https://www.pinnacle.com/en/betting-articles/casino/the-history-of-craps/ALR2XUH7E5FK48DM The Project Your project assignment is to code a simplified version of Craps, which is sometimes called “Alley Craps”, because it was often played in dark alleys to avoid the police, who were always on the lookout for illegal gambling games. In Alley Craps the only bet is on whether the shooter will win or lose on their “pass”. Here is description of the basic flow of the game: 1) The game can be played by a minimum of two players and a maximum of six players. The computer will ask for the number of players and will validate that you enter a number from 2 to 6 players. 2) The computer will then ask each player to enter their name. Each player’s name will be stored in an array of type String called playerArray that is sized to the number of players in the game. 3) The computer will create another array of type int called the bankRollArray which will have the same number of elements as the playerArray. Each player will have a total of $100 deposited in this array in the same element index number at which their name is stored in the playerArray. 4) The computer will then create another array called betAmountArray which has the same number of elements as the playerArray. 5) After the players have all entered their names, the computer will welcome them to the casino and will ask if they want to see the rules of the game. The first player can either enter a ‘Y’ to see the rules, or an ‘N’ to skip the rules display and go right to the game. 6) The first player in the playerArray becomes “the shooter” and will be invited to place a wager. The rules for the shooter are that the MINIMUM BET amount must be at least $10, the maximum bet is whatever amount the player has in their bank account in the bankRollArray, AND, the bet CAN ONLY BE AN EXACT MULTIPLE OF $10. So, a bet such as $10, $20, $30, etc is valid, but a bet of $35 or $53, or $87 would be rejected, and the player would be told to enter another bet. 7) The computer will then invite the other players (“the opponents”), in turn according to their position in the playerArray, to “take a piece of the action”, or place a bet against the shooter’s wager amount. The rule here is that the opponent must make at least the minimum bet of $10, but they can take a larger “piece of the action” if they desire, up to the entire amount of the shooter’s bet if they desire to do so. Again the BET AMOUNTS MUST BE EXACT MULTIPLES OF 10. For example, suppose we have a game with 4 players. Player 1 is the shooter and lays down a bet of $60 and invites the other players to “fade him”, or bet against him/her. Player 2 decides to take $20 of the action, which leaves $40 of the shooter’s bet “uncovered”. Player 3 decides to bet $40 and take the rest of the action, which “covers” the remaining action. At this time the computer will announce “The action is covered, NO MORE BETS”. So, in this example, Player 4 did not get to make a bet because all of the action ($60) was covered by Player 2’s bet of $20 and Player 3’s bet of $40. But don’t worry, player 4 will have lots more opportunities to get a piece of the action. 8) The roll of the dice: the computer will then simulate the shooter’s “come-out roll” by randomly generating two numbers from 1 to 6 inclusive to simulate a roll of the dice.. It will then add these two values to produce a number ranging from 2 to 12 inclusive. Here are the rules to decide who wins the pass. SCENARIO ONE: shooter wins on the come out roll. IF the shooter rolls a 7 or an 11 (a “natural”), then the shooter WINS immediately, and the opponents’ bets are added to the shooter’s bank balance. The opponents’ bets are subtracted from their respective bank balances. In the example above, Player 1 gets $60 added to their account, and Player 2 has $20 subtracted from their account, and Player 3 has $40 subtracted from their account. SCENARIO TWO: the shooter “craps out” and loses: NOW, IF the shooter rolls a 2 (“snake-eyes”), a 3(“ace-deuce”), or a 12(“box-cars”), then the shooter is said to have “crapped out”, and he/she LOSES immediately. Their bank balance is reduced BY THE AMOUNT OF THE BET THAT WAS COVERED. In the example above, the shooter’s bet of $60 was COMPLETELY COVERED, so their bank balance is reduced by $60. HOWEVER, if the bet is not completely covered by the opponents, then the shooter can only loose as much as was bet against him. For example, suppose the shooter bet $100, but each of the three opponents only bet $20 each against him. This means that only $60 of the shooter’s bet was covered, so if the shooter loses the roll, the shooter will have his/her bank balance reduced by $60, not $100. SCENARIO THREE: shooter does not win and does not crap out on the “come out” roll: In this scenario, the shooter has rolled one of the following numbers: 4,5,6,8,9 or 10. Whichever number they roll becomes the shooter’s “point” number. The shooter continues to roll the dice to try to roll their point again before they roll a 7. IF the shooter rolls a 7, then the shooter is said to have “sevened out” and loses. HOWEVER, if they manage to roll their point again before rolling a 7, then they “make their point” and they win the pass. 9) After the pass is completed, the computer will redistribute the money wagered to the appropriate players and then show each player’s current bank balance. The computer will then ask the shooter if they want to roll again or if they want to “pass the bones” to the next player. The shooter can pick either option, to roll again or to pass the dice to the next player. 10) As the game progresses, a player may lose all of their money or be “cleaned out”. Their bank balance will be zero, so they are out of the game. The computer will not ask for a bet from a person whose bank balance is zero. Eventually, one player will wind up with all of the money in the game. When this happens, the computer will announce that the game is over and it will name the winner and state how much money the player has won. On the next few pages are some sample screens from games with differing numbers of players to give you an idea of how the game progresses. In the first example, we’ll do a game with just 2 players, who will ask for a printout of the rules before they start to play. EXAMPLE GAME WITH TWO PLAYERS, Bill and Tony: Welcome to Casino Fanshawe! The game here is craps, so we need to get some information about your party... Enter the number of players for this game (minimum of 2 to maximum of 6):2 Enter first name of player# 1 and press ENTER: Bill Enter first name of player# 2 and press ENTER: Tony We have 2 players with $100 each for total game money of $200 Welcome to the game Bill, and Tony Would you like a brief explanation of the rules of the game? Enter Y for yes, or N for no: Y Here are the basic rules of the game: One round of play with one person shooting the dice is known as 'a pass'. 1)The person with the dice is 'the shooter'. The shooter decides how much they want to bet, which is called 'the action'. 2)The shooter has to make a minimum bet of 10 dollars, and the bet amount must be a multiple of $10, but they can bet up to the maximum amount in their bank roll. 3)The other players are invited to 'take a piece of the action', which means they can bet an amount up to but not greater than the amount of the action. For example, if the 'action amount' bet was $50, then one player could 'take $30 of the action, a second player could 'take $10 of the action, and a third player could take the final $10 of the action.The action of $50 would then be 'covered' and no other players in the game would be able to lay a bet on this round.When all bets are placed, the shooter rolls the dice on the 'come out' roll. Here are the possible outcomes: 1)IF the shooter rolls a seven or eleven, then they have rolled 'a natural' and they win their bet. The bets of the otherplayers will be given to the shooter. 2)IF the shooter rolls a two ('snake-eyes), a three ('ace-deuce'), or a twelve ('box-cars') then the shooter 'craps out' (loses) and the amount of his action is split up and given to the other players according to the amount they bet. 3)IF the shooter rolls any other number besides 2,3,7,11, or 12, then that number becomes the shooter's point'. The shooter now rolls the dice again until they either roll their point again, in which case they have 'come' and won the pass, or they roll a seven,in which case they 'don't come' (lose) because they have 'sevened out'. 4)After a pass is completed, the shooter may choose to continue to roll the dice ('make another pass') or they can pass the dice to the next player ('pass on the bones'). 5)If a player loses all of their money, they are out of the game ('cleaned out').The game ends when one player has won all of the money in the game from the other players ('cleaned house'). Bill, you are the shooter! You have $100 in your bank roll and minimum bet is $10. Enter your bet amount: $100 Tony, Bill has bet $100. How much of the $100 action do you want? Enter your bet, minimum of $10 up to $100, or your bank balance, whichever is less: $100 The shooter's bet has been completely covered. NO MORE BETS!. ***** Rolling the dice...and the result is: 7! ***** Congratulations Bill! You have rolled a natural. You win! ***** AND WE HAVE THE GAME WINNER! Congratulations, Bill!***** You have won the total pot of $200! EXAMPLE TWO: A GAME WITH THREE PLAYERS named Moe, Larry, and Curly Welcome to Casino Fanshawe! The game here is craps, so we need to get some information about your party... Enter the number of players for this game (minimum of 2 to maximum of 6):3 Enter first name of player# 1 and press ENTER: Moe Enter first name of player# 2 and press ENTER: Larry Enter first name of player# 3 and press ENTER: Curly We have 3 players with $100 each for total game money of $300 Welcome to the game Moe, Larry, and Curly Would you like a brief
Mar 27, 2023
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here