readMap()

  1. Write a function int ReadMap(int n).
  2. To obtain all map files from map001.txt to map150.txt, run "/home/solomon/CPP/Sokoban/get_maps.sh". Then "ls map*.txt" will show that you have those map files in our current working directory.
  3. The format of the map is a plain-text file.
  4. The following is a sample input, and the map you are expected to display.
    HHHHHH
    H BD H
    HWC HH
    H BD H
    HHHHHH
    
  5. You may want to define the following global variables 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:
  6. Bonus: Can you detect if the format of a map file is invalid? Please describe what you can detect in the comments at the beginning of your program.
    1. The number of 'B' must be the same as 'D'.
    2. There should be exactly one 'W'.
    3. The only valid characters in the map matrix are 'H', '0', ' ', 'B', 'C', 'D', 'W'.