Description: This C++ program on CASINO GAME is a simple text base game.We have used procedure oriented method to design this game. This program is without grahics to keep program easy for beginners. Player can deposit his money to play. From this amount he can bet on number between 1 to 12. If he win he gets 10 times of money otherwise lost his money. In this project, We have used programming concept like do..while loop, user defined function, library function like randomize(), random() etc. |
#include<iostream.h>#include<conio.h>#include<stdlib.h>#include<stdio.h>#include<time.h>void draw_line(int n,char ch);void rules();void main(){int balanceamt,amt,no,dice;char playername[80],ch;clrscr();draw_line(60,'=');cout<<"\n\n\n\n\t\tCASINO GAME\n\n\n\n";draw_line(60,'=');cout<<"\n\n\nEnter Your Name :";gets(playername);cout<<"\n\n\Enter Deposit amount to play game :";cin>>balanceamt;do{clrscr();rules();cout<<"\n\nYour current balance is Rs."<<balanceamt;do{cout<<"\n\n"<<playername<<" enter money to bet";cin>>amt;if(amt>balanceamt)cout<<"Your betting amount is more than your current balance\n\nRe-enter data\n ";elsebreak;}while(1);do{cout<<"Enter your lucky number to bet between 1 to 12 :";cin>>no;if(no<=0||no>12)cout<<"Please check the number!! should be between 1 to 12\n\nRe-enter data\n ";elsebreak;}while(1);randomize();dice=random(12)+1;if(dice==no){cout<<"\n\nGood Luck!! You won Rs."<<amt*10;balanceamt=balanceamt+amt*10;}else{cout<<"Bad Luck this time !! You lose Rs."<<amt;balanceamt=balanceamt-amt;}cout<<"\n\nThe winning number was : "<<dice;cout<<"\n\n\t"<<playername<<" You have Rs. "<<balanceamt<<endl;cout<<"\n\n-->Do you want to play (y/n)? ";cin>>ch;}while(ch=='Y'|| ch=='y');clrscr();cout<<"\n\n\n";draw_line(70,'+');cout<<"\n\n\t\THANKS FOR COME TO CASINO YOUR BALANCE AMOUNT IS RS."<<balanceamt<<"\n\n";draw_line(70,'+');cout<<"\n\nGame developed by ANIKET RAJPUT\n";draw_line(70,'+');getch();}void draw_line(int n,char ch){for(int i=0;i<n;i++)cout<<ch;}void rules(){clrscr();cout<<"\n\n";draw_line(60,'-');cout<<"\n\t\tRULES OF THE GAME\n";draw_line(60,'-');cout<<"\n\t1. Choose any number between 1 to 12\n\t2. If you win you will get 10 times of money you bet\n\t3. If you bet on wrong number you will lose your betting amount\n\n";draw_line(60,'-');cout<<endl;}
Great post, and great website. Thanks for the information! 188xoso.com
ReplyDeleteYes i am totally agreed with this article and i just want say that this article is very nice and very informative article.I will make sure to be reading your blog more. You made a good point but I can't help but wonder, what about the other side? !!!!!!THANKS!!!!!! k8loto
ReplyDeleteNice information, valuable and excellent design, as share good stuff with good ideas and concepts, lots of great information and inspiration, both of which I need, thanks to offer such a helpful information here. how is there 52 weeks in a year
ReplyDeleteThanks for taking the time to discuss this, I feel strongly about it and love learning more on this topic. If possible, as you gain expertise, would you mind updating your blog with extra information? It is extremely helpful for me. IDN POKER
ReplyDeleteTook me time to read all the comments, but I really enjoyed the article. It proved to be Very helpful to me and I am sure to all the commenters here! It’s always nice when you can not only be informed, but also entertained! sbobet 88
ReplyDeleteReally I enjoy your site with effective and useful information. It is included very nice post with a lot of our resources.thanks for share. i enjoy this post. gamnes
ReplyDeleteThis is my first visit to your web journal! We are a group of volunteers and new activities in the same specialty. Website gave us helpful data to work. https://ufa365liveball.tumblr.com/post/640838085585829888/review-mi-curved-gaming-monitor-34-monitor
ReplyDeleteYes i am totally agreed with this article and i just want say that this article is very nice and very informative article. and Subscribers Views Buy YouTube
ReplyDeleteThis blog very helpful and intersting, thank you so much to good post. buy Instagram followers chapest
ReplyDeleteInteresting post. I Have Been wondering about this issue, so thanks for posting. Pretty cool post.It 's really very nice and Useful post.Thanks download joker gaming
ReplyDeletePersonally, I have found that to get just about the most fascinating topics if this draws a parallel to. 우리카지노
ReplyDeletehello, your website is really good. We do appreciate your give good results Choosing multiplier slots
ReplyDeleteThis is such a great resource that you are providing and you give it away for free. I love seeing blog that understand the value. Im glad to have found this post as its such an interesting one! I am always on the lookout for quality posts and articles so i suppose im lucky to have found this! I hope you will be adding more in the future... download joker123 gaming
ReplyDelete