-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 2d5e77f
Showing
15 changed files
with
3,665 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
*.class | ||
.idea | ||
out |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
-90 | ||
-15 | ||
20 | ||
203 | ||
-47 | ||
-39 | ||
22 | ||
70 | ||
-183 | ||
-35 | ||
22 | ||
99 | ||
-73 | ||
-13 | ||
9 | ||
71 | ||
-88 | ||
-31 | ||
14 | ||
112 | ||
-91 | ||
-76 | ||
22 | ||
79 | ||
-171 | ||
-58 | ||
11 | ||
107 | ||
-149 | ||
-18 | ||
24 | ||
76 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
-90 | ||
-11 | ||
20 | ||
203 | ||
-89 | ||
-23 | ||
17 | ||
139 | ||
-78 | ||
-29 | ||
17 | ||
124 | ||
-78 | ||
-25 | ||
19 | ||
146 | ||
-89 | ||
-19 | ||
18 | ||
180 | ||
-89 | ||
-23 | ||
17 | ||
157 | ||
-79 | ||
-25 | ||
20 | ||
169 | ||
-88 | ||
-27 | ||
15 | ||
134 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<module type="JAVA_MODULE" version="4"> | ||
<component name="NewModuleRootManager" inherit-compiler-output="true"> | ||
<exclude-output /> | ||
<content url="file://$MODULE_DIR$"> | ||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" /> | ||
</content> | ||
<orderEntry type="inheritedJdk" /> | ||
<orderEntry type="sourceFolder" forTests="false" /> | ||
</component> | ||
</module> | ||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
package sample; | ||
import javafx.scene.paint.Color; | ||
import javafx.scene.shape.Rectangle; | ||
|
||
|
||
class Wall extends Rectangle { | ||
|
||
Wall(Coordinates c, int width, int height, Color color) { | ||
super(width, height, color); | ||
setTranslateX(c.x); | ||
setTranslateY(c.y); | ||
} | ||
} | ||
|
||
public class Brick extends Rectangle { | ||
boolean isHorizontal; | ||
boolean isSolid = false; | ||
Coordinates coordinates; | ||
int row, column; | ||
|
||
Brick(Coordinates c, int width, int height, boolean isHorizontal, int row, int column) { | ||
super(width, height, Color.DARKGRAY); | ||
this.isHorizontal = isHorizontal; | ||
coordinates = c; | ||
this.row = row; | ||
this.column = column; | ||
setTranslateX(c.x); | ||
setTranslateY(c.y); | ||
} | ||
|
||
/*Brick(boolean isHorizontal, int row, int column){ | ||
this.isHorizontal = isHorizontal; | ||
this.row = row; | ||
this.column = column; | ||
}*/ | ||
|
||
Brick(Brick brick){ | ||
this.isHorizontal = brick.isHorizontal; | ||
this.row = brick.row; | ||
this.column = brick.column; | ||
this.isSolid = brick.isSolid; | ||
} | ||
|
||
Brick() { | ||
} | ||
|
||
boolean isValidWall(Brick brick) { | ||
if (this.isSolid || brick.isSolid) | ||
return false; | ||
if (this.isHorizontal) { | ||
return this.row == brick.row && (this.column == (brick.column + 1) || (this.column + 1) == brick.column); | ||
} else { | ||
return this.column == brick.column && (this.row == (brick.row + 1) || (this.row + 1) == brick.row); | ||
} | ||
} | ||
|
||
boolean isValidJoint(Brick brick, boolean[][] emptyJoints) { | ||
if (this.isHorizontal) { | ||
if (this.column == brick.column + 1) | ||
return emptyJoints[this.row][brick.column]; | ||
else if (this.column + 1 == brick.column) | ||
return emptyJoints[this.row][this.column]; | ||
else | ||
return false; | ||
} else { | ||
if (this.row == brick.row + 1) | ||
return emptyJoints[brick.row][this.column]; | ||
else if (this.row + 1 == brick.row) | ||
return emptyJoints[this.row][this.column]; | ||
else | ||
return false; | ||
} | ||
} | ||
} | ||
|
Oops, something went wrong.