Advertisement
Guest User

Untitled

a guest
Mar 29th, 2015
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.80 KB | None | 0 0
  1. public static void showBoard(){
  2.         for(int i = 0; i < brojRedova; i++){
  3.             for(int j = 0; j < brojKolona; j++){
  4.                 if (hIvice[i][j] < 1){
  5.                     System.out.print("·     " + i + "," + j + "     ");   
  6.                 }else
  7.                 {
  8.                     if (hVlasnici[i][j] == 1){
  9.                         System.out.print("·------I------");   
  10.                     }else if (hVlasnici[i][j] == 2){
  11.                         System.out.print("·------B------");
  12.                     }
  13.                 }
  14.             }
  15.             System.out.println("·");
  16.             for (int k = 0; k < 2; k++){   
  17.                 for(int j = 0; j < brojKolona; j++){
  18.                     if(vVlasnici[i][j] != 0){
  19.                         System.out.print("|             ");
  20.                     }else{
  21.                         System.out.print("              ");
  22.                     }
  23.                 }
  24.                 if(vVlasnici[i][brojKolona] != 0){
  25.                     System.out.println("|");
  26.                 }else{
  27.                     System.out.println(" ");
  28.                 }
  29.             }
  30.             for(int j = 0; j <= brojKolona; j++){
  31.                 if (vIvice[i][j] < 1){
  32.                     System.out.print(i + "," + j + "           ");
  33.                 }else
  34.                 {
  35.                     String vlasnik = "     ";
  36.                     if(kvadrati[i][j] == 1){
  37.                         if (kVlasnici[i][j] == 1){
  38.                             vlasnik = "  I    ";
  39.                         }else{
  40.                             vlasnik = "  B    ";
  41.                         }
  42.                     }
  43.                     if (vVlasnici[i][j] == 1){
  44.                         System.out.print("I" + "      " + vlasnik + "  "); 
  45.                     }else if (vVlasnici[i][j] == 2){
  46.                         System.out.print("B" + "    " + vlasnik + "  ");
  47.                     }
  48.                 }
  49.             }
  50.             System.out.println();
  51.             for (int k = 0; k < 2; k++){   
  52.                 for(int j = 0; j < brojKolona; j++){
  53.                     if(vVlasnici[i][j] != 0){
  54.                         System.out.print("|             ");
  55.                     }else{
  56.                         System.out.print("              ");
  57.                     }
  58.                 }
  59.                 if(vVlasnici[i][brojKolona] != 0){
  60.                     System.out.println("|");
  61.                 }else
  62.                 {
  63.                     System.out.println(" ");
  64.                 }
  65.             }
  66.         }
  67.         for(int j = 0; j < brojKolona; j++){
  68.             System.out.print("·     " + brojRedova + "," + j + "     ");
  69.         }
  70.         System.out.println("·");
  71.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement