It looks like you're new here. If you want to get involved, click one of these buttons!
Please assist in giving a code that will enable me to create this game as per below instructions. Thanks. You have been asked by a local board-game shop to create a flexible card-stack application that can calculate the distribution of any given combination of dice, and keep a card-stack of that combination stored in memory. Whenever the user asks for a number of dice from a previously generated combination, a result should be dealt off of the stack and that number should be placed on a list of numbers which have previously been ‘drawn’. When all numbers in the stack have been exhausted, the stack is reshuffled. When creating a card-stack, the user should also be able to specify how many cards should be ‘removed’ from the stack to eliminate the possibility of card-counting. These cards should simply be dealt off of the top of a randomly shuffled stack before numbers are generated. A user will request a dice roll by providing dice notation in the form of d Asking for one eight sided dice will be represented by the string 1d8. Four twelve sided dice minus two cards would be 4d12-2. Eight twenty sided dice minus six would be 8d20-6. Four four sided dice would be 4d4. Upon requesting a dice-roll, the application will check to see if it has previously generated a card-stack for that dice combination. If it has, it will provide the next card on that stack. If it has not, it will go through a four step process: 1. Calculate the correct distribution of results from that dice combination by ‘rolling’ them TEN THOUSAND (10, 000) times, and storing the results of how many times each combination was encountered. 2. Reducing those values down to the percentage chance of encountering each individual number. 3. Generating a card stack large enough to give the correct number of each result, to the accuracy of a tenth of a percentage point. 4. Shuffling that card stack and then removing the correct number of cards as per the user request. A stack then is defined as its dice combination plus the number of cards initially removed from the stack. 3d6-2 should be a different stack to 3d6-4, and should be generated and dealt independently. The application should also allow the player to ‘peek’ at a particular stack at any time to see what numbers will be generated in the future, and in which order, to ensure that the stack is being correctly generated and retained. Peeking should also show which cards have been removed, and which cards have already been ‘dealt’. If desired, the player should also be able to ‘shuffle’ the stack at any time. The application too should maintain a graph for each stack, showing how often each number has been drawn from the stack and how many are left to be generated from each possible number. This should be regenerated every time a number is dealt, and should be displayed when the user peeks at a stack.