Write a function readMap(n). When n==0, it
reads a map from the file "map000.txt".
The digits "000" may be replaced by other sequence number between 1 and
150.
The format of the map is a plain-text file.
Each line shows a row in the map.
A character 'H' indicates a solid wall.
A character ' ' indicates an empty location.
A character 'B' indicates a box.
A character 'D' indicates the destination where you should move a box to.
A character 'C' indicates this location is a destination of
some box, but it is also occupied by a box at the beginning.
At first you may think this case is redundant, because
a box is already at its destination. However, there are
some levels (e.g. Level 91) which require you to move the
box to another destination if you want to solve the puzzle.
A character 'W' indicates the initial position of the worker.
Design a function
showMap(m),
which draws the map on your screen using the
curses library.
The following is a sample input, and the map your program is expected
to display.
HHHHHH
H BD H
HWC HH
H BD H
HHHHHH
You may want to define the following
color pairs
to control the profile when you draw the map. For example, you may easily
change your program to display the destination as a space with background color
green or cyan: