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...

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

Sudoku Game Project in Java with full source code including GUI task

Introduction The purpose of the project is to try in practice the use of recursion and object-oriented program design. Please make sure to read this entire note before starting your work. Pay close attention to the sections on deadlines, deliverables, and exam rules. The problem Your task in this part of the project is to write a solver for Sudoku puzzles. Sudoku puzzles are a kind of crossword puzzles with numbers where the following two conditions have to be met: In each row or column, the nine numbers have to be from the set [1,2,3,4,5,6,7,8,9] and they must all be different.  For each of the nine non-overlapping 3x3 blocks, the nine numbers have to be from the set [1,2,3,4,5,6,7,8,9] and they ust all be different. The following two figures show a Sudoku puzzle and its solution. The input The input of your program, the Sudoku puzzles, is given in text files. More specifically, they are represented as nine lines of nine characters separated by spaces. The characters can be of two...