Advertisement
Guest User

Untitled

a guest
Jun 25th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.43 KB | None | 0 0
  1.     public static int[][][] generateFrom(int[][] brett){
  2.         int[][][] res = new int[9][9][9];
  3.         for (int i = 0; i < res.length; i++) {
  4.             for (int j = 0; j < res.length; j++) {
  5.                 int[] alt;
  6.                 if(brett[i][j]==0){
  7.                     alt = new int[]{1,2,3,4,5,6,7,8,9};    
  8.                 }
  9.                 else{
  10.                     alt = new int[9];
  11.                     for(int k=1; k<=9; k++){
  12.                         if(brett[i][j]== k) alt[k-1]=k;
  13.                     }
  14.                 }
  15.                 res[i][j]= alt;
  16.             }
  17.         }
  18.         return res;
  19.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement