Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class SlotMachine
- {
- private String face1;
- private String face2;
- private String face3;
- private String face4;
- private String face5;
- private String face6;
- private boolean winner;
- //contructs a 3 reel, 6 icon slot machine with String descriptions of the 6 visual elements (in the runner class)
- public SlotMachine(String one, String two, String three, String four, String five, String six)
- {
- }
- //simulates a pull of the slot machine handle by calling faceImage() to randomly generate
- //a resulting face for each of the 3 slot machine reels. The method returns a String that shows
- //the spin results (e.g., "Spin x: apple apple grape"). "x" represents the number of times the slot machine has been pulled.
- public String spin()
- {
- int an = faceImage();
- int tn = faceImage();
- int on = faceImage();
- }
- public void setWinner(boolean b)
- {
- }
- public boolean getWinner()
- {
- }
- //returns a random face from the six icons passed in the constructor and saved in
- //face1 to face6. Uses 1 + (int)(Math.random() * 6) to generate a random number between
- //1 and 6 that can be used to decide which image to return.
- public String faceImage()
- {
- int x = 1 + (int)(Math.random() * 6); //returns 1 thru 6
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement