Package

Source Code of HangmanMain

import java.util.Scanner;
import edu.villanova.csc8540.novahangman.HangManDrawer;
import edu.villanova.csc8540.novahangman.HangmanInstance;

/**
* This class contains our main method, and acts as a wrapper for our class
* HangmanInstance that contains most of the game logic.
*
* */
public class HangmanMain
{
  public static void main(String args[]) {
    String choice;
   
    // Create and show user menu
    while (true) {
      Scanner s = new Scanner(System.in);
      HangManDrawer.createAndShowMenu ();
      choice = s.next ();
      if (choice.contentEquals("1")) {
        HangmanInstance hangmanInstance = new HangmanInstance ();
        hangmanInstance.playGame ();
      }
      else {
        if (choice.contentEquals("2")) {
          break;
        }
        else {
          System.out.println ("CHOOSE 1 OR 2");
          continue;
        }
       } 
     }
  }
}
TOP

Related Classes of HangmanMain

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.