This repository was archived by the owner on Feb 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBugApp.java
More file actions
67 lines (62 loc) · 1.64 KB
/
BugApp.java
File metadata and controls
67 lines (62 loc) · 1.64 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/*
* Notes
*
*
*
*/
import java.io.*;
import java.util.*;
public class BugApp {
public static PrintWriter debug;
public static HashMap<Integer,List> db=new HashMap<Integer,List>();
public static ArrayList<int[]> resolver=new ArrayList<int[]>();
public static int info;
public static void setup() {
try {
debug=new PrintWriter(new BufferedWriter(new FileWriter("programdebug.info")));
}catch(Exception e) {
e.printStackTrace();
System.out.println("WARNING:Log file cannot be initliazed, redirecting to stdout! This may be a restrcited system!");
debug=new PrintWriter(System.out);
}
debug.println("Setup completed");
info=0;
db.put(0, new ArrayList<Integer>());
}
public static void session() {
int[] resolved;
debug.println("Session started");
System.out.println("Debug 1.0 Session\nPress enter to stop\nWarning timing this program will be messed up!");
String text=">";
Scanner sc=new Scanner(System.in);
while(!(text.equals(""))) {
System.out.print(">");
text=sc.nextLine();
try {
resolved=resolver.get(Integer.parseInt(text));
show(db.get(resolved[0]).get(resolved[1]));
}catch(Exception e) {
System.out.println("Failed to find "+text);
}
}
}
public static void show(int x) {
System.out.println(x);
}
public static int add(int x) {
db.get("int").add(x);
info++;
return info-1;
}
public static void main(String[] args) {
setup();
String x="test";
Var a=new Var("Testing");
add(a,x);
session();
a.set("sync test");
Var a2=new Var(new ArrayList<Integer>());
add(a2,"arr");
session();
}
}