Source code - slot.cpp

Find C and C++ source code to help you learn to program. You can submit your own code, or you can simply browse and download the code of others.

Finally, you might want to check out Code Cogs - An Open Source Scientific Library / Database in C++ for more code.

Index :: Games / slot.cpp
slot.cpp
resource information
Title slot.cpp
URL http://www.cprogramming.com/source/slot.cpp
Category 2
Description A slot machine game.
Contact Joe Tchamitchian
Added 08-10-2002 at 01:55 p.m.
Last Updated 08-10-2002 at 01:55 p.m.
rating
Current Rating 3.92592592592593
Rate Resource
 
reviews
Number of Reviews 13
Review this Resource
Reviews:
  • Thanks for the reply Bob!Opps sorry, I ment keep each character on there own cuotsm sprite sheet (as in .h and dot m file) sorry sometimes these things are easier to communicate with the actual project! (im a terrible typer!)I have heard of people referring to keeping all the characters on an array and using getChild method (but if using separate cuotsm files works just as well, I'll keep with that until i get a bit better at coding to understand how to achieve this.)Your neat macro trick to control z depth and playback speed and a myriad of other options, will probably ease the manageability side of keeping my cuotsm sprites separate in any case I Couldn't recommend the Galaxy fighter course enough alone for these little tricks and tips, which certainly make life a lot lot easier! P.s Thanks! (its my first try at making animation, although I worked in an animation studio I was more of a 3d texture artist and illustrator/digi artist, so its nice to be able to try something new)now i just have to keep working on learning to code then ill be able to combine all things i like into one project!anyway thanks again!Kind regardsNatalie
    posted at 06:58 a.m. on 12-04-2015
  • I modified the source code and instead of 4 tokens I edited it to 400. I was playing for some time and finally i got three same numbers (9 9 9) and it doesn't show that I win.
    posted at 04:58 a.m. on 09-03-2015
  • /* Slot Machine Program by Joe Tchamitchian*/ #include <iostream.h> #include <stdlib.h> #include <time.h> int main() { int x,a, b, c, token=4; srand(time(0)); cout<<"\t********************************************************\n" <<"\t* Welcome to slot machine. *\n" <<"\t* Would you like to play? (1 to play, 2 not to play) *\n" <<"\t********************************************************\n\n"; cin>>x; while(token!=0) {cout<<"You have "<<token<< " tokens\n\n" <<"Pull? (1 to pull, 2 not to pull)\n\n"; cin>>x; if(x==1) { a = 1+rand() %10; b = 1+rand() %10; c = 1+rand() %10; cout<<"\t\t"<<a<<" "<<b<<" "<<c<<"\n\n"; } else cout<<"OK\n"; { if(a==b==c) { token+=4; cout<<"You win\n\n"; } if(a==b || b==c || a==c) { token+=1; cout<<"You got two out of three\n\n"; } else { token-=1; cout<<"You loose\n\n"; } } } return 0; }
    posted at 06:48 a.m. on 01-07-2015
  • makes for a smooth ride and pulls well. Reviewers are of the opinion that the Beetle is built for cruising and being noticed in but this version has more to offer.The Beetle has a reputation for its distinct appearance. You can further enhance the looks of your car by using Beetle body kits. A body kit is a collection of exterior modifications to the car. By this you can make changes such as add bumpers Nike Air Foamposite One http://www.avus-revival.com/nike-air-foamposite-one-c-17.html
    posted at 09:34 p.m. on 10-13-2014
  • vXc9Eo <a href="http://cprewkwhjhhr.com/">cprewkwhjhhr</a>, [url=http://oermzljwsvmy.com/]oermzljwsvmy[/url], [link=http://allzelovqtpz.com/]allzelovqtpz[/link], http://akdgwwcigtxp.com/
    posted at 06:05 a.m. on 05-26-2013
  • vqH7od , [url=http://ercrvixtgmca.com/]ercrvixtgmca[/url], [link=http://jwvdpvkqfzif.com/]jwvdpvkqfzif[/link], http://qtvmvrcdrigg.com/
    posted at 12:28 p.m. on 01-06-2012
  • oboqI6 <a href="http://azvnwuvtztia.com/">azvnwuvtztia</a>
    posted at 07:24 a.m. on 01-06-2012
  • 1WDftU , [url=http://cbzsredmaxcu.com/]cbzsredmaxcu[/url], [link=http://mraiqnosummf.com/]mraiqnosummf[/link], http://dndqymchfaxl.com/
    posted at 08:21 a.m. on 01-04-2012
  • cQInUQ <a href="http://yoqchtflwxrb.com/">yoqchtflwxrb</a>
    posted at 04:03 a.m. on 01-04-2012
  • You've got to be kidding me-it's so tnrasparently clear now!
    posted at 08:36 a.m. on 01-03-2012
  • Yea i also found another problem. at the beginning where it asked to push 1 to play or 2 not to play.. if you pushed any other number.. it would give you a token..so you could just keep pushing a diff number then enter and gain tokens
    posted at 05:13 p.m. on 04-24-2009
  • Program has major error in it. It never lets you win a Jackpot LOL. It was not tested properly
    posted at 05:37 p.m. on 07-03-2004
  • um...a decent begining needs a bit of work though the way the choices are used is very awkward no to mention there seems to be a logic error enter 1 a couple of times then enter 2, to see what I mean
    posted at 07:22 a.m. on 07-02-2003