-
Notifications
You must be signed in to change notification settings - Fork 0
/
Main.java
55 lines (48 loc) · 1.54 KB
/
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
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
package com.company;
import jdk.nashorn.internal.objects.NativeJSON;
import java.io.*;
import java.util.LinkedList;
/**
* Margus Kevin Sünter
* Ville Maripuu
* Raigo
* Jüri
* Maria
* Rainer
*/
public class Main {
private static int mapSize = 10;
public static void main(String[] args) {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String inputBuffer;
System.out.println("Oled pimedas tunnelis, mis teha?");
System.out.println("1) Sured ära 2) Ei sure");
try
{
inputBuffer = br.readLine();
if (inputBuffer.equals("1")) {
System.out.println("Said surma");
} else {
System.out.println("Ei saanud surma");
}
} catch (IOException error){
System.out.println(error);
}
Room map[][] = new Room[mapSize/2][mapSize/2];
Room map2[][] = new Room[mapSize/2][mapSize/2];
for (int i = 0; i < mapSize/2; i++) {
System.out.println("Sisesta ruumi x");
map[i][i] = new Room();
}
try {
FileOutputStream fos = new FileOutputStream("test.dat");
ObjectOutputStream oos = new ObjectOutputStream(fos);
oos.writeObject(map);
FileInputStream fis = new FileInputStream("test.dat");
ObjectInputStream iis = new ObjectInputStream(fis);
map2 = (Room[][]) iis.readObject();
} catch (Exception e) {
e.printStackTrace();
}
}
}