master
Chloe Fontenot 🏳️‍⚧️ 2023-01-17 11:07:01 +07:00
parent 87e04d639d
commit 049b6b9dae
2 changed files with 9 additions and 23 deletions

@ -1 +1 @@
,caleb,caleb-gaming-laptop-archlinux,13.01.2023 10:13,file:///home/caleb/.config/libreoffice/4;
,caleb,caleb-ryzen-archlinux,14.01.2023 14:36,file:///home/caleb/.config/libreoffice/4;

@ -11,8 +11,7 @@ public class MP1_CalebFontenot {
public static void main(String[] args)
{ //2965
/*
int[][] intArray = { // Horizontal
int[][] intArray1 = { // Horizontal
{0, 1, 0, 3, 1, 6, 1},
{0, 1, 6, 8, 6, 0, 1},
{5, 6, 2, 1, 8, 2, 9},
@ -21,7 +20,7 @@ public class MP1_CalebFontenot {
{3, 3, 3, 3, 4, 0, 7}
};
int[][] intArray = { // Vertical
int[][] intArray2 = { // Vertical
{0, 1, 0, 3, 1, 6, 1},
{0, 1, 6, 8, 6, 0, 1},
{5, 5, 2, 1, 8, 2, 9},
@ -29,8 +28,7 @@ public class MP1_CalebFontenot {
{1, 5, 6, 1, 4, 0, 7},
{3, 5, 3, 3, 4, 0, 7}
};
*/
int[][] intArray = { // Diagonal 1
int[][] intArray3 = { // Diagonal 1
{0, 1, 0, 3, 1, 6, 1},
{0, 1, 6, 8, 6, 0, 1},
{9, 6, 2, 1, 8, 2, 9},
@ -38,8 +36,8 @@ public class MP1_CalebFontenot {
{1, 3, 9, 1, 4, 0, 7},
{3, 3, 3, 9, 4, 0, 7}
};
printArray(intArray);
System.out.println(isConsecutiveFour(intArray));
printArray(intArray3);
System.out.println(isConsecutiveFour(intArray3));
}
public static void printArray(int[][] array)
@ -103,22 +101,10 @@ public class MP1_CalebFontenot {
System.out.println("Checking next line...");
}
System.out.println("Checking for Diagonal matches...");
for (int rowIterate = 0; rowIterate < values.length; ++rowIterate) {
y = 0;
for (int x = 0; x < values[0].length - 1; ++x) {
++y;
if (values[rowIterate][x] == values[rowIterate + 1][y + 1]) {
intCounter++;
System.out.println(values[rowIterate][x] + " " + values[rowIterate + 1][y ] + ", intCounter: " + intCounter);
} else {
intCounter = 0;
System.out.println(values[rowIterate][x] + " " + values[rowIterate + 1][y] + ", intCounter: " + intCounter);
for (int rowIterate = 0; rowIterate < (values.length - 4); ++rowIterate) {
for (int x = 0; x < values.length - 1; ++x) {
if (values[x][rowIterate] == values[x][rowIterate + 1])
}
if (intCounter == 3) {
System.out.println("Diagonal match!");
return true;
}
}
System.out.println("Checking next line...");
}
System.out.println("No match found.");