jotto

Untitled

May 11th, 2015
242
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.46 KB | None | 0 0
  1. public class ATile
  2. {
  3.     public double g; // from start to this tile
  4.     public double h; // heuristic to finish
  5.     public double f = g + h;
  6.     public ATile(){}
  7. }
  8.  
  9. //to w innej klasie
  10. private ATile aTiles[][];
  11. aTiles = new ATile[dimension][dimension];  
  12.    
  13. for (int i = 0; i < dimension; i++)
  14. {
  15.     for (int j = 0; j < dimension; j++)
  16.     {
  17.         aTiles[i][j].g = (double)Math.round(countDistance(3, 3, i, j)*100)/100; // NullPointerException tutaj
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment