鄙人有一个程序要马上编出来,用c编,要在linux下运行的
希望高手帮帮忙,对我非常重要的...
我会想尽一切办法报答各位的!!!!!!!
Problem Descriptions
o The problem is based on a plane flight game in a
3D environment. You are asked to design your
algorithm with the implementation of queues,
stacks and array to find the shortest path for the
plane to fly safely from the start point to the end
point.
o The 3D game environment is divided into n*m*o
blocks. Each block has its own value to represent
the geographical character of the block. To
simplify the problem, there are only two values
adopted: v=0 means the block is accessible; v=1
means the block is not accessible. The plane is
allowed to visit each block no more than once.
o In the 3D game environment, the plane could
move only in five directions (upward, download,
left, right and forward). For each movement, we assigned a corresponding
movement ID value, as shown below:
Movement ID Value
Forward 1
Left 2
Right 3
Downward 4
Upward 5
The standard output of your program should observe these values.
o At the start point, the plane has a given amount of fuel s. During the flight, each
movement will deduct the amount of fuel by one (s = s - 1). If the plane is out of oilbefore it reaches the end point, the mission fails. There are a few fuel backup
packs distributed over the environment. When the plane reaches the location of
the pack pi, it gets re-fuel with a specified amount wi (s = s + wi). The pack is
eliminated from the environment after the refuel.
o The input data will be in the format of text file. The schema is designed as
following:
o The output solution should be in the format of text file. The schema should be in
accord as following:
Submission Procedures
Please follow the submission procedures, so that we could ensure your assignment is
received probably.
o Create a folder named with your student Id, in the following steps we will use the
id “03012345” as an example.
o Put all the source codes into the folder, including:
the source files;
the header files;
and the makefile.
o Please do not include the executable file.
Output.txt
t //the number of steps for the shortest path
d1 d2 d3 d4 … dt //the directions taken on each step
f //the amount of fuel left when reaching the end point
//end of output file
Input.txt
n+1 m+1 o+1 //the num of blocks in each dimension.
s //the amount of fuel at the starting point
xs ys zs //the start point position (Range from [0,n] [0,m],[0,o])
xe ye ze //the end point position
//the detailed map information using 0-1 representation
map(0,0,0) map(0,0,1) map(0,0,2) … map(0,0,o)
map(0,1,0) map(0,1,1) map(0,1,2) … map(0,0,o)
… …
map(0,m,0) map(0,m,1) map(0,m,2) … map(0,m,o)
map(1,0,0) map(1,0,1) map (1,0,2) … map(1,0,o)
… …
map(n,m,0) map(n,m,1) map(n,m,2) … map(n,m,o)
//end of map information
Fn // the number of fuel backup packs
xa ya za qa // the position(x,y,z) and the refuel amount (q) of fuel pack a
… …
xFn yFn zFn qFn
//end of input file
[求助]程序设计,与数据结构有关的