Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class WheelOFortuneFinal {
- public static void main(String[] args) {
- new WheelOFortuneFinal().run();
- }
- public void run() {
- int maxPlayers = 3;
- int playerNumber = 1;
- int[] playerMoney = new int[maxPlayers];
- System.out.println("\nWelcome to Wheel of fortune...\n" +
- "------------------------------");
- String secretString = enterSolution();
- printPlayerMoney(playerMoney);
- printSolutionSoFar(secretString);
- menuOptions(playerNumber);
- }
- public String enterSolution() {
- Scanner myScanner = new Scanner(System.in);
- System.out.println("Quizmaster please provide a sentence the contestants need to guess:");
- String secret = myScanner.nextLine();
- System.out.println("\nLet the game begin!\n" +
- "---------------------------------");
- return secret;
- }
- public void printPlayerMoney(int[] playerMoney) {
- for (int i = 0; i < playerMoney.length; i++) {
- System.out.println("-- Money earned by player " + (i + 1) + ": " + playerMoney[i] + "$");
- }
- }
- public void printSolutionSoFar(String secretString) {
- System.out.println("\n-- The solution so far... \n");
- for (int i = 0; i < secretString.length(); i++) {
- if (secretString.charAt(i) == ' ') {
- System.out.print(' ');
- } else {
- System.out.print('-');
- }
- }
- System.out.println();
- }
- public void menuOptions(int playerNumber){
- System.out.println
- ("-- " + playerNumber + " Turn.\n" +
- "1) Turn the wheel and guess a letter\n" +
- "2) Guess the solution\n" +
- "What would you like to do?");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement