//package Dasearch; import java.util.*; public class astar { public static final int OPEN = 0; public static final int FOREST = 1; public static final int DESERT = 2; public static final int WATER = 3; public int ROWS, COLS; // size of map in array coords public int M[][]; // the map itself public astar(int r0, int c0) // typically 32x44 { M = new int[r0][c0]; ROWS=r0; COLS=c0; // generate random map (initially all OPEN) int GENS = 12; double NFACTOR = 0.12; double p, r; int generation; int i, j; for(generation=0;generation0 && M[i-1][j]==WATER) p += NFACTOR; if (i0 && M[i][j-1]==WATER) p+=NFACTOR; if (j A, coord c) { for(coord d : A) {if (d.equals(c)) return true;} return false; } /******* THE FOLLOWING IS THE METHOD YOU HAVE TO WRITE *******/ // create path from from source to target, return end of path coord. public coord search(int sy, int sx, int ty, int tx) { return null; // this means there is no path }//search }//astar