|
-
January 16th, 2011, 02:23 AM
#4
Re: Slot Machine Help
I'm not sure what you mean by "the methods" to do what you want to do. Are you talking about a general algorithm for doing it or do you mean specifically the method calls that will give you random numbers in a block that checks for X in a row?
In the first case check the Java API (follow link above and search for Random) for Random numbers and read up on storing values in arrays and multi-dimensional arrays. The check for X in a row will be a method that you need to write yourself.
If you are asking for the correct combination of method calls to get you a slot machine then there is no such "combination". That would be programming.
But generally speaking you need random numbers, some place to store them, and something to check to see if X in a row has happened. I don't think you will find a series of pre-made methods to call that will complete your assignment. Otherwise you could call:
public SlotMachine my_machine = new SlotMachine();
Somehow I doubt that would be the assignment though. 
Plus you don't want to use any code that someone on a forum gave you. If you can get it from the web then your instructor can find it as well. Instructors are like Santa Clause... They know... they just do...
Good luck
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|