r/dailyprogrammer • u/rya11111 3 1 • Mar 28 '12
[3/28/2012] Challenge #32 [easy]
lets simulate a roulette wheel!
a program that takes as input your bet, and gives as output how much you won, with the appropriate probability
write a program that will take a players bet and output the resulting spin and payout. try using an american roulette wheel (which has the 00 slot) to add a slight twist. and try to incorporate as many complex bets as you can to. a comprehensive list can be found here
- thanks to SleepyTurtle for the challenge at /r/dailyprogrammer_ideas
15
Upvotes
3
u/[deleted] Mar 29 '12
In C++:
The getWagers function is just the link to however the player selects the bet (GUI, console cin etc). The main is a bit weak but it hopefully shows how it would work. Feedback much appreciated, I'm pretty new as a programmer.
2
u/huck_cussler 0 0 Mar 29 '12 edited Mar 29 '12
In Java:
It's still a bit rough around the edges but basic functionality is there:
1
u/playdoepete 0 0 Apr 15 '12
Java; Basic pick a number and bet.... Will reply with updates
-1
u/SleepyTurtle Mar 29 '12
this made my day.