Skip to content

Commit

Permalink
all file added
Browse files Browse the repository at this point in the history
  • Loading branch information
ehsansajadi committed Feb 24, 2021
0 parents commit 2d5e77f
Show file tree
Hide file tree
Showing 15 changed files with 3,665 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.class
.idea
out
32 changes: 32 additions & 0 deletions List.txt
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
32 changes: 32 additions & 0 deletions List2.txt
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
12 changes: 12 additions & 0 deletions Quoridor.iml
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>

Binary file added src/Resource/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
817 changes: 817 additions & 0 deletions src/sample/AI2P.java

Large diffs are not rendered by default.

1,085 changes: 1,085 additions & 0 deletions src/sample/AI4P.java

Large diffs are not rendered by default.

75 changes: 75 additions & 0 deletions src/sample/Brick.java
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;
}
}
}

Loading

0 comments on commit 2d5e77f

Please sign in to comment.