Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 24th, 2012  |  syntax: None  |  size: 0.52 KB  |  hits: 8  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. package Sudoku;
  2. public class SudokuTest {
  3.         public static void main(String[] args){
  4.                 int[][] arr = {{1,0,0,7,0,0,4,8,0}, {0,0,7,0,0,0,0,0,9},{6,4,5,0,0,9,7,3,0},{0,0,8,0,0,3,0,9,0},{0,0,4,1,9,7,8,0,0},{0,2,0,4,0,0,5,0,0},{0,7,9,3,0,0,2,5,6},{2,0,0,0,0,0,3,0,0},{0,8,1,0,0,2,0,0,7}};
  5.                 Sudoku obj = new Sudoku(arr);
  6.                 System.out.println(obj.toString());
  7.                 System.out.println(obj.countOccurencesInRow(0, 0));
  8.                 System.out.println(obj.countOccurencesInCol(0, 0));
  9.                 System.out.println(obj.countOccurencesIn3by3(0, 0, 3));
  10.         }
  11. }