-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMain.java
26 lines (23 loc) · 934 Bytes
/
Main.java
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
import java.util.Scanner;
import graph.*;
public class Main{
public static void main(String[] args) {
String[] colors = {"Purple", "Green", "Red", //"Green",
"Green", "Green", "Cyan", //"Green",
"Green", "Green", "Green"//, "Green",
// "Green", "Green", "Green", "Green",
};
Graph graph = new Graph(3, colors);
graph.draw();
System.out.print("Apakah anda ingin mencari siklus yang mungkin dipapan permainan? = ");
Scanner scan = new Scanner(System.in);
String input = scan.next();
if (input.equalsIgnoreCase("ya")){
System.out.println();
if (graph.isCyclic())
System.out.println("Papan permainan punya siklus dengan dot berwarna sama");
else
System.out.println("Papan permainan tidak punya siklus dengan dot berwarna sama");
}
}
}