Schack funkar lite bättre men man fattar inte

This commit is contained in:
k1ntas 2022-04-07 08:48:24 +02:00
parent 29df86030c
commit 70097886d4
3 changed files with 8 additions and 8 deletions

View File

@ -13,7 +13,6 @@ auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.text-limit-width=
auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.text-line-wrap=none auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.text-line-wrap=none
auxiliary.org-netbeans-modules-editor-indent.CodeStyle.usedProfile=project auxiliary.org-netbeans-modules-editor-indent.CodeStyle.usedProfile=project
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.enable-indent=true auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.enable-indent=true
auxiliary.org-netbeans-spi-editor-hints-projects.perProjectHintSettingsFile=nbproject/cfg_hints.xml
build.classes.dir=${build.dir}/classes build.classes.dir=${build.dir}/classes
build.classes.excludes=**/*.java,**/*.form build.classes.excludes=**/*.java,**/*.form
# This directory is removed when the project is cleaned: # This directory is removed when the project is cleaned:
@ -42,17 +41,17 @@ dist.jar=${dist.dir}/Schack.jar
dist.javadoc.dir=${dist.dir}/javadoc dist.javadoc.dir=${dist.dir}/javadoc
endorsed.classpath= endorsed.classpath=
excludes= excludes=
file.reference.flatlaf-2.1.jar=lib\\flatlaf-2.1.jar file.reference.flatlaf-2.1.jar=lib/flatlaf-2.1.jar
file.reference.flatlaf-extras-2.1.jar=lib\\flatlaf-extras-2.1.jar file.reference.flatlaf-extras-2.1.jar=lib/flatlaf-extras-2.1.jar
file.reference.flatlaf-intellij-themes-2.1.jar=lib\\flatlaf-intellij-themes-2.1.jar file.reference.flatlaf-intellij-themes-2.1.jar=lib/flatlaf-intellij-themes-2.1.jar
includes=** includes=**
jar.archive.disabled=${jnlp.enabled} jar.archive.disabled=${jnlp.enabled}
jar.compress=false jar.compress=false
jar.index=${jnlp.enabled} jar.index=${jnlp.enabled}
javac.classpath=\ javac.classpath=\
${file.reference.flatlaf-2.1.jar}:\ ${file.reference.flatlaf-2.1.jar}:\
${file.reference.flatlaf-intellij-themes-2.1.jar}:\ ${file.reference.flatlaf-extras-2.1.jar}:\
${file.reference.flatlaf-extras-2.1.jar} ${file.reference.flatlaf-intellij-themes-2.1.jar}
# Space-separated list of extra javac options # Space-separated list of extra javac options
javac.compilerargs= javac.compilerargs=
javac.deprecation=false javac.deprecation=false

View File

@ -157,8 +157,8 @@ public class Board extends JPanel implements MouseListener {
validMoves.removeAll(turn ? blackAttacks : whiteAttacks); validMoves.removeAll(turn ? blackAttacks : whiteAttacks);
} }
// Funkar inte // Funkar inte
for (Point attack : turn ? whiteAttacks : blackAttacks) { for (Point attack : turn ? blackAttacks : whiteAttacks) {
Piece attacked = pieces[attack.x][attack.x]; Piece attacked = pieces[attack.x][attack.y];
if (attacked == null) { if (attacked == null) {
continue; continue;
} }

View File

@ -18,6 +18,7 @@ public class Queen extends Piece {
// Vänster // Vänster
for (int loopX = this.position.x - 1; loopX >= 0; loopX--) { for (int loopX = this.position.x - 1; loopX >= 0; loopX--) {
boolean shouldBreak = addMovesIfCan(new Point(loopX, this.position.y), movable, pieces); boolean shouldBreak = addMovesIfCan(new Point(loopX, this.position.y), movable, pieces);
if (shouldBreak) { if (shouldBreak) {
break; break;
} }