迷宫实现算法:
package algrithm;
import java.util.Scanner;
public class maze {
public static void main(String[] args)
{
int a[][]={
{1,1,1,1,1,1,1,1,1,1,1,1},
{1,0,0,0,0,0,0,0,0,0,0,1},
{1,1,0,1,1,1,1,1,1,1,1,1},
{1,0,0,0,0,0,0,0,0,1,0,1},
{1,1,0,1,0,0,1,1,0,0,0,1},
{1,1,1,1,1,1,1,1,1,0,1,1},
{1,0,0,0,0,0,0,0,1,0,0,1},
{1,1,1,1,1,1,1,1,0,0,1,1},
{1,1,0,0,1,0,1,0,0,1,0,1},
{1,0,1,0,0,1,0,1,0,1,0,1},
{1,0,0,1,0,0,1,1,0,0,0,1},
{1,1,1,1,1,1,1,1,1,1,1,1}};
System.out.println("the maze is:");
print(a);
Scanner sc=new Scanner(System.in);
System.out.println("please input enter coordinate:");
int xstart=sc.nextInt();
int ystart=sc.nextInt();
System.out.println("please input exit coordinate:");
int xend=sc.nextInt();
int yend=sc.nextInt();
System.out.