public static void draw(Percolation perc, int N) {

		perc.init();// this is A* init(), source and target could be passed in
					// future
		perc.AStar();

		StdDraw.clear();
		StdDraw.setPenColor(StdDraw.BLACK);
		StdDraw.setXscale(0, N);
		StdDraw.setYscale(0, N);
		StdDraw.filledSquare(N / 2.0, N / 2.0, N / 2.0);

		// draw N-by-N grid
		for (int row = 0; row < N; row++) {
			for (int col = 0; col < N; col++) {
				if (perc.isClosed(row, col)) { // blocked
					StdDraw.setPenColor(StdDraw.LIGHT_GRAY);
				} else if (perc.isOnPath(row, col)) // open and on path
				{
					StdDraw.setPenColor(StdDraw.ORANGE);
				} else { // open and not on path
					StdDraw.setPenColor(StdDraw.WHITE);
				}

				if (perc.isSource(row, col)) {
					StdDraw.setPenColor(StdDraw.BLUE);
				} else if (perc.isTarget(row, col)) {
					StdDraw.setPenColor(StdDraw.RED);
				}

				StdDraw.filledSquare(col + 0.5, N - row - 0.5, 0.45);
			}
		}
	}