联系方式

  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-23:00
  • 微信:codinghelp

您当前位置:首页 >> Java编程Java编程

日期:2020-01-03 10:19

CS101 Assignment#3 Maze Problem

Due date: Thursday, Jan.2, 2020(until20:30)

Problem description:

Amaze is represented by a two dimensional array “maze[10][10]”:

maze[10][10]={{2,3,2,2,2,2,2,2,2,2}, {2,0,0,0,0,0,2,0,0,2}, {2,0,2,0,2,0,0,0,0,2}, {2,0,0,2,0,2,0,0,0,2}, {2,2,0,2,0,2,0,2,0,2}, {2,0,0,0,0,0,0,0,0,2}, {2,2,2,0,2,2,0,2,0,2}

{2,2,2,0,2,2,0,0,0,2}

{2,2,0,2,2,2,0,0,0,2}

{2,2,2,2,2,2,2,2,4,2}};

In “maze[10][10]”,the first“10” denotes the height of the array and the second

denotes the width of the array. As the result, this array has 10 rows and 10 columns that

we can call it 10*10 array. If we want to access the element within this array we only need

to change the coordinate of “maze[10][10]”, for example “maze[3][4]” is the number “0” in

row4 and column5. Note that, when you access the array, it goes from maze[0][0] to

maze[9][9]. Within this array:

1)The number“2” means the wall that you cannot go through;

2) “3” means the entrance and “4” means the exit;

3)Only the number “0” can be passed.


版权所有:编程辅导网 2018 All Rights Reserved 联系方式:QQ:99515681 电子信箱:99515681@qq.com
免责声明:本站部分内容从网络整理而来,只供参考!如有版权问题可联系本站删除。