Skip to main content

CS222 Project 1 The Game of Korona és Horgony - Dice Rolling Game

Project Description:

For this project, you will be creating a program to play a dice game known in Hungary as Korona és Horgony. The rules are fairly simple. Three dice, each containing six different symbols on each face are used. A mat, also containing the same six symbols is on the table. The player makes bets by placing wagers on one or more of the six symbols. The dice are then thrown. If any of the dice show the symbol on which a bet has been placed, the banker pays the player the amount of his stake for each die  showing that symbol.


In other words, if only one of the dice shows the symbol, the player is paid even money (1:1). The player is paid 2:1 if two dice show the symbol, and 3:1 if all three dice show the symbol. If the symbol does not show up, the player loses any bets placed on that symbol. Although the symbols on the dice can be figures such as a bear, a cat, a gypsy wagon and so on, you will use the numbers 1-6, found on a typical die, for your program.

Your program should give the player an initial bankroll of $100.00. The minimum bet to place on a symbol is $5.00. For purposes of this game, there is no maximum bet, other than the amount of money available. You may assume that only integer values (dollar amounts) will be used for bets.

Specifications:

At the start of the program you will give an introductory message and then prompt the player to enter a random number seed.

You will need to design and implement several functions (explained below) in order to complete this game.

You will need to decide on appropriate variables in which to store the player's bankroll (in order to keep track of how much money the player has) and how much s/he won or lost in the most recent game. This bankroll should be kept up to date on the player's current status, which means that wins should be added and losses should be subtracted from the bankroll as the user plays the game. After each game, theprogram must report the result of the dice throw, the amount of money won or lost, and the current value of the bankroll. After each game, the program should allow the player to continue playing until she chooses to quit, or until the player runs out of money. This central program control may be done within main().

"Rolling" the dice:

A separate function will be used to "roll" the dice. This function will contain three die variables. For a roll, you will set each variable separately using a random number generator. The possible values are one through six, corresponding to the six sides of a regular die. The function will print the value of each die after it is rolled. This function will return void.

For help on using random() to generate random numbers, click here.

"Playing" the game:

A second function will be used to play a single game of Korona és Horgony. This function should be passed the current $ amount of the player's bankroll and should return the amount of money won or lost for that particular game. Within the main program, the player is asked whether s/he would like to place a bet. If so, the function is called.

Within the function, the player must choose which symbols to place bets on, and the amount of each bet (see game rules above). The player then "rolls the dice" (simulated by a call to the dice-rolling function). This should be done interactively (via a key press from the player), rather than simply having the program roll the dice immediately after the bets are placed. After the roll, this function should report the values of each of the dice (after receiving the values from the dice-rolling function). The player is then notified whether s/he won or lost money in that game overall, and the amount won or lost. The amount won or lost is used as the return value of the function. You will have to create variables to keep track of the bets placed on each of the symbols, and decide how to check to see if any symbols had winning bets. (Hint: Although it is not necessary to use arrays, you may find the project easier to program if you do. If not, it still should not be difficult to use six separate variables, one for each symbol.)

After the function returns, the bankroll is updated accordingly. The player is then asked if s/he would like to play again, and if so, the function is called again. The amount returned should be used to update the player's bankroll.

Screenshots of Working Program




What are you waiting for? Get your solution now!


Buy now

CONTACT DETAILS

For any other questions or other tasks please feel free to contact me
via email: mhassnainjamil@gmail.com
via WhatsApp: +92-324-7042178
via skype: hassnainjamil1

Comments

Popular posts from this blog

The Zoo Management System - entity relationship diagram & MS Access Database

Zoo Management System - Project Details: You are the employee of a big, worldwide working Zoo Management Company. Your company is responsible for the Zoo management. Your boss thinks it would be a great idea to store all data for each Zoo in a brand new self-developed ZOO Management System. Up to now, the ZOO management company has maps of each ZOO available. Your boss knows that you took a course in introduction on an ERP system, so he asks you if you could help designing such a system. Each ZOO must have the same organizational structure, which should look like this: Each Zoo has a Zoo-Address. Each Zoo has many visitors (Visitor Ticket Process (VTP). Many Zoo-Attractions belong to a Zoo. Module 1: Entity Relationship Diagram Design a ER (entity-relationship) diagram for your ZOO Management System. Use the information provided below with the entities and its attributes. Put the entities in the correct relationship to each other (organizational structure). Module 2: DB Implem...

EIT Knowledge and Innovative Community Scholarships has been announced

Admission Criteria To qualify for our programmes, applicants need to fulfill the admission requirements based on previous studies, English proficiency and relevant documentation. Previous Studies: A Completed Bachelor’s Degree In order to be admitted into a KIC InnoEnergy MSc programme, you must have completed a Bachelor’s degree encompassing a minimum of 180 ECTS credits or equivalent academic qualifications from an internationally recognized university. Please note that admissions depend on the specific BSc degree you hold for entry into the MSc programme you are interested in. Conditional Acceptance – Undergraduate Students in Final Year Students in their final year of undergraduate education may also apply and if expected to qualify, receive a conditional offer. If you have not completed your studies, please include a written statement from your university’s administration office (or equivalent department), confirming that you are enrolled in the final year of your study programme ...

Human Physiology by Stuart Ira Fox [PDF] (12th edition) free download