problem 10 11 12

This commit is contained in:
Xevion
2019-09-19 07:35:53 -05:00
parent a34a4bacb7
commit d3d823f6c3
26 changed files with 402 additions and 10 deletions

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<projectDescription>
<name>12</name>
<comment/>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

View File

@@ -0,0 +1,7 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.8

11
uil/october-2013/12/.vscode/launch.json vendored Normal file
View File

@@ -0,0 +1,11 @@
{
"configurations": [
{
"type": "java",
"name": "CodeLens (Launch) - problem12",
"request": "launch",
"mainClass": "problem12",
"projectName": "12"
}
]
}

View File

Binary file not shown.

View File

Binary file not shown.

View File

Binary file not shown.

View File

@@ -0,0 +1,9 @@
1
B B
B B B
B B B
B B
B B R
R R R R
R R R R
R R R

View File

@@ -0,0 +1,52 @@
import static java.lang.System.*;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Arrays;
import java.util.Scanner;
class Point {
int x;
int y;
Point(int x, int y) {
this.x = x;
this.y = y;
}
}
class CheckerBoard {
Point[] offsets = {Point(1, 1), Point(-1, -1), Point(-1, 1), Point(1, -1)};
CheckerBoard(String[][] matrix) {
}
int[][] getPossible(int x, int y) {
return getPossible(x, y, new int[0][0]);
}
int[][] getPossible(int x, int y, List<Point> blacklist) {}
}
class problem12 {
public static void main(String[] args) throws FileNotFoundException {
// Constants
File input = new File("input.dat");
Scanner read = new Scanner(input);
int lines = Integer.parseInt(read.nextLine());
// Start reading and processing the matrix into
for(int i = 0; i < lines; i++) {
String[][] rawMatrix = new String[8][8];
for(int x = 0; x < 8; x++) {
String line = read.nextLine();
for(int y = 0; y < 8; y++)
rawMatrix[x][y] = line.substring(y, y+1);
}
out.println(Arrays.deepToString(rawMatrix));
CheckerBoard cb = new CheckerBoard(rawMatrix);
out.println(cb.scan());
}
read.close();
}
}