Skip to content
This repository was archived by the owner on Feb 29, 2024. It is now read-only.

Commit 31463a9

Browse files
authored
Add files via upload
1 parent 4208dc4 commit 31463a9

File tree

5 files changed

+8
-6
lines changed

5 files changed

+8
-6
lines changed

Java/bin/Position.class

0 Bytes
Binary file not shown.

Java/bin/Structure.class

0 Bytes
Binary file not shown.

Java/bin/perimeter.class

-4 Bytes
Binary file not shown.

Java/perimeter.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
16 27
1+
13 37

Java/src/perimeter.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public static Structure flood(int x,int y, int i) {
2525
int y1 = p.y;
2626
try {
2727

28-
System.out.println("FILL ("+x1+","+y1+")");
28+
//System.out.println("FILL ("+x1+","+y1+")");
2929
if(grid[x1][y1]) {
3030
if(x1 < N && grid[x1 + 1][y1]) {
3131
q.add(new Position(x1 + 1,y1));
@@ -39,12 +39,14 @@ public static Structure flood(int x,int y, int i) {
3939
if(1 < y1 && grid[x1][y1 - 1]) {
4040
q.add(new Position(x1,y1 - 1));
4141
}
42+
}else {
43+
continue;
4244
}
4345
}catch(Exception ex) {
4446
continue;
4547
}
4648
st.addStruct(p);
47-
grid[p.x][p.y] = false;
49+
grid[p.x][p.y] = false; // TODO remove to prevent intefering with addStruct
4850

4951
}
5052
return st;
@@ -75,7 +77,7 @@ public static void main(String[] args) throws IOException{
7577
//st.toggleAll();
7678
//st.perimeterList.removeAll(st.posList);
7779

78-
st.perimeterList.removeAll(st.posList);
80+
//st.perimeterList.removeAll(st.posList);
7981
structs.add(st);
8082
}
8183
}
@@ -86,8 +88,8 @@ public static void main(String[] args) throws IOException{
8688
//struct.toggleAll();
8789
//struct.perimeterList.removeAll(struct.posList);
8890
int area = struct.posList.size();
89-
//System.out.println("1:"+struct.posList);
90-
//System.out.println("2:"+struct.perimeterList);
91+
System.out.println("1:"+struct.posList);
92+
System.out.println("2:"+struct.perimeterList);
9193
if(area > largestArea) {
9294
largestArea = area;
9395
perimOfLarge = struct.perimeterList.size();

0 commit comments

Comments
 (0)