This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Slot Machine Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Slot Machine" Watch "Slot Machine" New topic
Author

Slot Machine

ant williams
Greenhorn

Joined: Mar 20, 2007
Posts: 4
I have been given a piece of coursework to do using random numbers. I have decided to do a slot machine for it. I am having trouble and would like help so that the result either adds 2 pound on to there money if they win or takes one off if they lose. I also would like a loop so that when they have no money left they can not play.


Any help you could give would be greatly appreciated

EDIT by mw: Added Code Tags.
[ March 20, 2007: Message edited by: marc weber ]
marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

Originally posted by ant williams:
...would like help so that the result either adds 2 pound on to there money if they win or takes one off if they lose...

Welcome to JavaRanch!

You already have a field called "money," and you have an if/else condition for determining whether the player wins or loses. So what would make sense here? Do you have any ideas about how to approach this?


"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
 
GeeCON Prague 2014
 
subject: Slot Machine