forked from hummel/4Gewinnt-WS23
Compare commits
2 Commits
Author | SHA1 | Date |
---|---|---|
Oliver Hummel | 3b5015caee | |
Oliver Hummel | 026d592730 |
|
@ -125,6 +125,19 @@ public class VierGewinnt {
|
|||
return true;
|
||||
}
|
||||
|
||||
// diagonale Prüfung 1: "Plusplus-Fall"
|
||||
for (int z = 0; z < 3; z++) {
|
||||
for (int s = 0; s < 4; s++) {
|
||||
if (spielfeld[z][s] == spielfeld[z+1][s+1]
|
||||
&& spielfeld[z][s] == spielfeld[z+2][s+2]
|
||||
&& spielfeld[z][s] == spielfeld[z+3][s+3]
|
||||
&& spielfeld[z][s] != '_')
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// diagonale Prüfung 2: "Plusminus-Fall"
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue