Coders Packet

Casino Number Guessing Game Program in C++

By Mukul Kumar

Casino number guessing game in C++. In this game, if the player guessed the number correctly will receive 10 times the amount he bet with else he will lose the amount.

This is a C++ program for a number-guessing game. Where the player who wishes to play initially has to deposit some amount. After that, the player has to enter the betting amount which might be less than or equal to the deposited amount next after the player needs to guess and enter a number between 1 to 10. If the player’s guessed number is matched with the program's randomly generated number, the player will get 10 times the amount he/she bet for. Else the player will lose the betting amount.

The program uses a rand() built-in function to randomly generate a number between 1 and 10. Apart from this, in the program there exist two functions one to draw lines (to make the command-line game interface look good) and another one to display game rules.

The player may continue to play after the result of the current bet. There are only two exit conditions first the player’s wish not to play further, second until the total amount player has become zero.

Download project

Reviews Report

Submitted by Mukul Kumar (mukul102000)

Download packets of source code on Coders Packet