-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGuess_The_Word
More file actions
37 lines (29 loc) · 885 Bytes
/
Guess_The_Word
File metadata and controls
37 lines (29 loc) · 885 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
public class GuessWord extends GuessLogic{
public static void main(String[] args) {
new GuessLogic();
}
}
//Logic of the GameBASE
import java.util.Random;
import java.util.Scanner;
public class GuessLogic
{
static String []Movies={"PATHAN", "3 IDIOTS", "JHONWICK", "FAMILY MAN", "MIRZAPUR", "MONEYHEIST"};
static String gen_word(){
Random random = new Random();
int index = random.nextInt(Movies.length);
return Movies[index];
}
static void guessword(){
Scanner sc = new Scanner(System.in);
String movie = gen_word();
System.out.println("Guess the movie:"+movie.length()+"Words");
String guess = sc.nextLine();
if(guess.equalsIgnoreCase(movie)){
System.out.println("Congratulation you WON !!");
}
else{
System.out.println("YOU LOOSE");
}
}
}