OSDN Git Service

コミットテスト master
authorunknown <Kimoto@Beep_PC.(none)>
Mon, 7 May 2012 06:07:47 +0000 (15:07 +0900)
committerunknown <Kimoto@Beep_PC.(none)>
Mon, 7 May 2012 06:07:47 +0000 (15:07 +0900)
16 files changed:
.classpath [new file with mode: 0644]
.project [new file with mode: 0644]
.settings/org.eclipse.jdt.core.prefs [new file with mode: 0644]
bin/CheckSolver.class [new file with mode: 0644]
bin/Filler.class [new file with mode: 0644]
bin/Grid.class [new file with mode: 0644]
bin/HRemainSolver.class [new file with mode: 0644]
bin/Matrixmaker.class [new file with mode: 0644]
bin/MilkyWaySolver.class [new file with mode: 0644]
file.txt [new file with mode: 0644]
src/CheckSolver.java [new file with mode: 0644]
src/Filler.java [new file with mode: 0644]
src/Grid.java [new file with mode: 0644]
src/HRemainSolver.java [new file with mode: 0644]
src/Matrixmaker.java [new file with mode: 0644]
src/MilkyWaySolver.java [new file with mode: 0644]

diff --git a/.classpath b/.classpath
new file mode 100644 (file)
index 0000000..18d70f0
--- /dev/null
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="src" path="src"/>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+       <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/.project b/.project
new file mode 100644 (file)
index 0000000..98917b9
--- /dev/null
+++ b/.project
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>MilkyWaySolver</name>
+       <comment></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>
diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs
new file mode 100644 (file)
index 0000000..8000cd6
--- /dev/null
@@ -0,0 +1,11 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
diff --git a/bin/CheckSolver.class b/bin/CheckSolver.class
new file mode 100644 (file)
index 0000000..f5994a4
Binary files /dev/null and b/bin/CheckSolver.class differ
diff --git a/bin/Filler.class b/bin/Filler.class
new file mode 100644 (file)
index 0000000..59cd97f
Binary files /dev/null and b/bin/Filler.class differ
diff --git a/bin/Grid.class b/bin/Grid.class
new file mode 100644 (file)
index 0000000..cb5db65
Binary files /dev/null and b/bin/Grid.class differ
diff --git a/bin/HRemainSolver.class b/bin/HRemainSolver.class
new file mode 100644 (file)
index 0000000..6ccb64f
Binary files /dev/null and b/bin/HRemainSolver.class differ
diff --git a/bin/Matrixmaker.class b/bin/Matrixmaker.class
new file mode 100644 (file)
index 0000000..bb8b3ee
Binary files /dev/null and b/bin/Matrixmaker.class differ
diff --git a/bin/MilkyWaySolver.class b/bin/MilkyWaySolver.class
new file mode 100644 (file)
index 0000000..c589f27
Binary files /dev/null and b/bin/MilkyWaySolver.class differ
diff --git a/file.txt b/file.txt
new file mode 100644 (file)
index 0000000..fbef8f2
--- /dev/null
+++ b/file.txt
@@ -0,0 +1,9 @@
+040005000
+001002000
+300600700
+706800000
+000000000
+000000045
+020094000
+000000000
+800000600
\ No newline at end of file
diff --git a/src/CheckSolver.java b/src/CheckSolver.java
new file mode 100644 (file)
index 0000000..dd1bdd9
--- /dev/null
@@ -0,0 +1,7 @@
+
+public class CheckSolver {
+    //check each grid remains 1 possibility
+    void Solver(Grid Base[][]){
+       
+    }
+}
\ No newline at end of file
diff --git a/src/Filler.java b/src/Filler.java
new file mode 100644 (file)
index 0000000..e1538c5
--- /dev/null
@@ -0,0 +1,21 @@
+
+public class Filler {
+       void filler(Grid Base[][], int x, int y, int a){
+               int blockx = x/3;
+               int blocky = y/3;
+               int i,j;
+               
+               for(i=0;i<9;i++){
+                       //vertical & horizontal filler
+                       Base[x][i].checker[a]=1;
+                       Base[i][y].checker[a]=1;
+               }
+               
+               for(i=0;i<3;i++){
+                       for(j=0;j<3;j++){
+                               //area filler
+                               Base[blockx*3+i][blocky*3+j].checker[a]=1;
+                       }
+               }
+       }
+}
diff --git a/src/Grid.java b/src/Grid.java
new file mode 100644 (file)
index 0000000..cec36f3
--- /dev/null
@@ -0,0 +1,5 @@
+
+public class Grid {
+       int result;
+       int[] checker = new int[9];
+}
diff --git a/src/HRemainSolver.java b/src/HRemainSolver.java
new file mode 100644 (file)
index 0000000..f1a3497
--- /dev/null
@@ -0,0 +1,4 @@
+
+public class HRemainSolver {
+
+}
diff --git a/src/Matrixmaker.java b/src/Matrixmaker.java
new file mode 100644 (file)
index 0000000..f4e6e1f
--- /dev/null
@@ -0,0 +1,36 @@
+import java.io.BufferedReader;
+import java.io.FileReader;
+import java.io.IOException;
+import java.util.Arrays;
+
+public class Matrixmaker {
+       char [][] TempArray = new char [9][9];
+       int x,y;
+       
+       
+       void Initialize(Grid[][] Array){
+               for(int t1=0; t1<9; t1++){
+                       for(int t2=0; t2<9; t2++){
+                               Array[t1][t2] = new Grid(); 
+                               Arrays.fill(Array[t1][t2].checker, 0);
+                               Array[t1][t2].result=0;
+                       }
+               }
+        try {
+            FileReader in = new FileReader("file.txt");
+            BufferedReader br = new BufferedReader(in);
+            String line;
+            while ((line = br.readLine()) != null) {
+               for(y=0; y<9; y++){
+                       TempArray[x][y] = line.charAt(y);
+                       Array[x][y].result = Integer.parseInt(""+TempArray[x][y]);
+                       Filler fill = new Filler();
+                       fill.filler(Array,x,y,Array[x][y].result);
+               }
+               x++;
+            }
+        } catch (IOException e) {
+            System.out.println(e);
+        }
+       }
+}
diff --git a/src/MilkyWaySolver.java b/src/MilkyWaySolver.java
new file mode 100644 (file)
index 0000000..8a0c57e
--- /dev/null
@@ -0,0 +1,24 @@
+
+public class MilkyWaySolver {
+       public static void main(String[] args) {
+               Grid [][] Base = new Grid[9][9];
+               int x = 0;
+               int y = 0;
+               
+               Matrixmaker mm = new Matrixmaker();
+               mm.Initialize(Base);
+               CheckSolver sl = new CheckSolver();
+               
+               for(int loop=0; loop<5; loop++){
+               sl.Solver(Base);
+               System.out.println("End loop "+loop+".");
+               }
+               
+               for(x=0; x<9; x++){
+               for(y=0; y<9; y++){
+                       System.out.print(Base[x][y].result);
+               }
+               System.out.println("");
+           }
+       }
+}