Function practice 6 (Village of the Sorcerer 2)


Submit solution

Points: 2
Time limit: 1.0s
Memory limit: 64M

Author:
Problem type
Allowed languages
C, C++, Python3

Mr Cleese's chef programmer is sick, and since he is so pleased with your work on csci125p014, he has decided to involve you in the further development of his RPG game: a knock-off version of the famous RPG title Tower of the Sorcerer.

Hint: please make sure you have completed csci125p014 before attempting this task.

Mr Cleese's RPG game will have more than one level, each with their individual maps. Aside from what you've done in csci125p014, you will be provided with \(K\) different maps, and upon request you will need to output the correct map.

It is recommended that you use a 3-dimensional array maps[k][n][m] to store the maps, and a single function printMap(maps, n, m) to actually print it.

Alas, Mr Cleese doesn't know much about programming, which is why he hired you. His assistant will test your programme with \(Q\) queries of levels, each time you will need to print out the correct map.

Input Specification

The first line will contain 3 integers \(K,N,M\) (\(3 < N,M < 30\), \(2 < K \ge 50\)), where \(N,M\) indicate the dimension size, and \(K\) indicates the number of levels you will need to store.

For the next \(K \times N\) lines, each line will contain \(M\) integers, each the item at that coordinate.

The following line will contain 1 integer \(Q\), which indicates the number of queries. This is followed by another \(Q\) lines, each a number \(q\), which is the level number that Mr Cleese's assistant wants you to print.

Output Specification

The output should contain \(Q\) maps, separated by an empty line. Each map is represented by a bitmap of \(N\) lines, \(M\) characters.

Sample Input

2 8 12
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 0 0 0 0 0 0 0 0 0 0 1
1 0 0 0 0 3 0 0 0 0 0 1
1 0 0 0 0 0 0 0 0 0 0 1
1 0 0 0 0 0 2 0 0 0 0 1
1 0 0 0 0 0 0 0 0 0 0 1
1 1 1 1 1 1 1 1 1 1 1 1
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 0 0 0 0 0 0 0 0 0 0 1
1 0 0 0 0 0 0 0 0 0 0 1
1 0 0 0 0 2 0 0 0 0 0 1
1 0 0 0 0 0 3 0 0 0 0 1
1 0 0 0 0 0 0 0 0 0 0 1
1 1 1 1 1 1 1 1 1 1 1 1
4
0
1
1
0

Sample Output

############
#    _     #
#   /_*    #
#   |***   #
#   *****  #
#     |    #
#          #
############

############
#    *     #
#   ***    #
#  ***_*   #
#    /_\   #
#    |_|   #
#          #
############

############
#    *     #
#   ***    #
#  ***_*   #
#    /_\   #
#    |_|   #
#          #
############

############
#    _     #
#   /_*    #
#   |***   #
#   *****  #
#     |    #
#          #
############

Comments

There are no comments at the moment.