I'm making a hangman game and I wanted to know how do I make it so if the user inputs 4, it will show the rules text file(rules.txt)
import java.util.Scanner;
class Hangman
{
public static void main(String[] args)
{
Scanner guess = new Scanner(System.in);
System.out.println("Hello, and welcome to Hangman!");
System.out.println("Choose (1)easy (2)medium (3)hard (4)rules: ");
int diff = guess.nextInt();
if(diff==1)
{
Play obj = new Play();
obj.Start(diff);
}
if(diff==2)
{
Play obj = new Play();
obj.Start(diff);
}
if(diff==3)
{
Play obj = new Play();
obj.Start(3);
}
else{
System.out.print("enter a valid number, please try again");
}
}
}