-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
38 lines (28 loc) · 976 Bytes
/
Copy pathMain.java
File metadata and controls
38 lines (28 loc) · 976 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
38
//Sluzi za pokretanje igre
import java.util.InputMismatchException;
import java.util.Scanner;
import java.util.InputMismatchException;
public class Main {
static Scanner input = new Scanner(System.in);
public static void main(String[] args) {
int BrojIgre =0;
try{
System.out.println("Upiši broj igre koju zeliš da igras: 1)Skočko 2)Lavirint 3)Vešala");
BrojIgre = input.nextInt();
} catch(InputMismatchException e){
System.out.println("Pokušaj ponovo " + e + ".");
}
if(BrojIgre<1 || BrojIgre > 3){
throw new InputMismatchException("Pokušaj ponovo.");
} else if(BrojIgre == 1){
//Skocko
Skocko.main(args);
} else if(BrojIgre==2){
//Lavirint
PobegniIzLavirinta.main(args);
} else if(BrojIgre==3){
//Vesala
Vesala.main(args);
}
}
}