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DD1ZZ Z1DZD1Z1D11Z1111DZ1DD11DZDZ11DDDDD11ZZZ1Z11Z D1ZD11DZDDZ11D1D1D1ZZZ11DZDZDZZD11ZD1DDZZZDD DZZDZ1ZDZDZ1Z1DZDDZ11ZDZ1D1DDD1DD1D1DZDDZ11D 1(|1ACQR|##|#*#####*|#*#*|*#*|**|||*###|**|| C9|CR77#*#||||##||||*#|**#|####|||*|#|#*|||# 09*GRASS||*#|###|#*#*|##**##|###*||***|#*##* ;(*XOUNFAIN|*|##*###*##||###*##***||*#*#|###
encoded_map2:
1DDDDZZ1DDDZZ1DD1ZD11ZD2FFC20BB++0401D11Z1D1 DD11DDZDDDDZ11DD1D1ZZZ224C00;;B;0040ZDDZ1ZZ1 D1ZZZ1ZZ111D111ZD1Z1Z1000222+;;040404Z1DDDZD Z11ZZ11DDD1DDZ1ZDDD1D22C42044++;;0030Z11D1ZD 1DDD1111DZZDZ1D1D11ZZ20202220B;+B40F4ZDD1D1D D1ZD111ZDD1DDZ1Z1ZZD42044044BB+4420F0DZZ1ZZD ZDZDZD1DDD1ZDD11ZD1Z04444440+B;2400441Z11ZZZ ZDDD111ZZZZZZDZDZZZ11Z00200;+;+44040Z1DZ111D 11Z1D1ZDD1ZD1D1Z11ZDZD04220+BB224240DDZ111D1 DZ1ZDDDD1D1ZZ1ZDDDZZ1114442;B240442D1DZ11Z11 ZZZDD1Z1D1Z1ZD1DDZD11D224400;40440D111Z1DDDZ ZZZD11Z1ZD1Z11D111111004242040240D1D11ZDDZ1Z DZZ11ZZD11D1Z1D1D1DD0022F400420ZDZZDZD1Z1Z11 ZD1DD0201Z1ZDDDD11ZDD42C0F02244ZDDZZZZZ11DZZ DD1Z02FCF01ZZZZ1DZD1D400C22440D1D1DDZ1DDDZDZ ZC40442421DD1Z1ZD1D12242021Z1ZD11ZZZ1ZZ1DZ1Z 33F042F242Z11Z111ZDZZ1D111ZDDZ1ZD1DZ1D11D111 D3000440204441ZZ11Z111Z1ZD11DD1DDZDDD1D1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||||***|*||||#***####*##**# 49|GRASS**|||||#|*|###|#|||#|#*#*#|*|#***#*| ;9|!OUNFAIN*|#|#|*#*||##|##**|#*|**||*||#*#|
encoded_map5:
CF33FCF3CC3CFF3FFC33FFC+044B;QQ87B;+C33FC3C3 CF3CFF3CCCC3FF3CCCFCC3;+;2+BQQ87B;;B33CFFC3C 3FCCCC3FCFC3FCFF33CCFCB;++BB8Q7BB;+;;C33C33C C3CC3CFCF333CFCFCCFC3++2;++;BQ78QBB4+CFC3C3F C3C3C3FCFCCFCC33CF3C3;+;+;;++7888;;2;F333FCF F3CFF3CFCCFCC33FF33C+B;+BB++Q7QBBB;4;C3FFCCF 333CFFCFFFC333CCFCFC;;++++BB888B;+++B33C3CFC CC3F3FCFC3FFF3CF3C33CC;+++BQQQ7;B++B3FFC3C3C CCFF33C3CF3FFFC33FF3F3+;;+B888B;+B++3333FCFF F3CCCC333CFFF3CFFFF3F33;+++8QB+++B+C3F33C3FF FFFFFFF33CC3CCFCC33F3FBB;+BBQBB++;FF3333F3CC 33CCCC33FCF3FC33FF3CF;+B;++++;;B+CCCCFFC33FC FF3F3CCCFCCFFCFFCCCC;;+B2;;;++;CCF3F3CCFC3F3 CFFC3B+BFF3FF3FFFCC3C+;2+4BBBB;FC3FCCF33F3F3 FFCC+;004+F3FCCCCC3FF+;;2B+++BC3FCC3FCC3CFCF 3FCCF;+B+;B+3FF3C3FCFCCB;;+;B3CFF3FFF33C3FF3 FFC3FC3C++B0BF3FCFCFFCC3C3F3C3FFCFFFF3CCC3FF 3FFFC3F33;+BBC3C3F3FFCC3FFC3F3C3CCFCFCCC33FF CCFCCF3FCC;4+FCF33F3FCF3F33CCCCFFCFFCCCFCCFF FFF33F33CCFBCFFFC3C3FFB+;B+33CFCFC3FF3333F33 3FF3FC333333C3FCCF3C3B+;+0BBCCCF3FF3C3CCFCFC 3F33CCCCCCC33CCC3FF3C33B444B;FFCC3F33CFCCCFF FCFF3F33C33CCFF3FCFFCCF++4;+3CFF33FFFCC333CF F3C3F3FFFCF3CC33CCC33F+BB333FCCCFC3C3FCC3C3F FCC33CF33CFFCC3FCF3CFF33FFCCC3CC3FFC3F333CFF 3FCCCCCFFC3CCFCFFFF3CCF3CFFFF3C3FCCF33CC3FFF 33CFC33F3CC3CFFFFFCFCFF3F33F3C3CFF333FFF33F3 F*!FA2ZR!!!!!PPX!PPX!PP!P!XX!X!P!XPPPXXP!PXX 2*P2RDZXXX!PXP!!!PPPXPXPPXPPP!!!!X!!!PX!XP!P B*!GRASS!!!!X!PX!XX!!PPPXX!!XPP!XXXP!XP!P!PP Q*X)OUN0AINX!P!P!X!P!X!P!XP!!XXPPPX!!XXXX!X!
decoded_map1:
WWWWWWWWWWWWWWWWWWWWWWW.TTT..^^^^...WWWWWWWW WWWWWWWWWWWWWWWWWWWWWW...T..^^^^....WWWWWWWW WWWWWWWWWWWWWWWWWWWWWW......^^^......WWWWWWW WWWWWWWWWWWWWWWWWWWWW..T.....^^^^..T.WWWWWWW WWWWWWWWWWWWWWWWWWWWW........^^^^..T.WWWWWWW WWWWWWWWWWWWWWWWWWWW........^^^....T.WWWWWWW WWWWWWWWWWWWWWWWWWWW........^^^......WWWWWWW WWWWWWWWWWWWWWWWWWWWWW.....^^^^.....WWWWWWWW WWWWWWWWWWWWWWWWWWWWWW.....^^^......WWWWWWWW WWWWWWWWWWWWWWWWWWWWWWW....^^......WWWWWWWWW WWWWWWWWWWWWWWWWWWWWWW......^.....WWWWWWWWWW WWWWWWWWWWWWWWWWWWWWW............WWWWWWWWWWW WWWWWWWWWWWWWWWWWWWW....T......WWWWWWWWWWWWW WWWWW...WWWWWWWWWWWWW..T.T.....WWWWWWWWWWWWW WWWW..TTT.WWWWWWWWWWW...T.....WWWWWWWWWWWWWW WWWWW.......WWWWWWWWWWW......WWWWWWWWWWWWWWW WWWWWWWW...T.WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW WWWWWWWWW....WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW WWWWWWWWWW.T.WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW WWWWWWWWWWW.WWWWWWWWWW.....WWWWWWWWWWWWWWWWW WWWWWWWWWWWWWWWWWWWWW....T..WWWWWWWWWWWWWWWW WWWWWWWWWWWWWWWWWWWWWWW.TTT..WWWWWWWWWWWWWWW WWWWWWWWWWWWWWWWWWWWWWW..T..WWWWWWWWWWWWWWWW WWWWWWWWWWWWWWWWWWWWWW...WWWWWWWWWWWWWWWWWWW WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW W: WATER T: TREE .: GRASS ^: MOUNTAIN
Do question 1.3, Code in python.
1.2 Decoding a Map [20 marks] After a long and arduous journey, you finally obtain the treasure map. However, much to your disappointment, the treasure map is encrypted as well. ZZ1DDZDDD1DZD1ZZZ17D111223222B;+;44411D211DZ Z1D1ZZD111122111 ZDD1ZDO4CFFOB+BB022021DDZ1ZD Z1Z211DDZZZ1ZZD1DZDZ12400F22+; +2002022111211 1ZD1ZZZ1DD11D2121211224F22222B;BB40F2111DDZD 1DDZZZZZ1DDDZ1DDD1D1120402444+BBB44C2DZD1ZDD You now turn to a different guide dictionary. 1 map-guide = { 2 'D': 'W', '1': 'W', 'Z': 'W', 'c': 'T', '3': 'T', 'F': 'T', 3 O': '.', 2': '.', '4': '.', 'B': '', '+': * 4 'Q': 'E', '7': 'E', 18': 'E', 'X': 'M', 'P': 'M', '!': 'M 5 (':':', '':':' 19': ':', 6 } With the dictionary, you should be able to decipher the above encrypted map into something like this: WWWWWWWWWWWWWWWWWWWWWWW..T... WWWWWWWWWWWWWWWWWWWWWW.TTT. WWWWWWWWWWWWWWWWWWWWWW.. WWWWWWWWWWWWWWWWWWWWW. WWWWWWWWWWWWWWWWWWWWW. WWWWWWWW WWWWWWWW WWWWWWW .T.WWWWWWW T.WWWWWWW You should have gotten the hint on where the treasure is from the last test case in Question 1.1. Your task is to decrypt the map and then find the treasure. continue on the next page... 3 Question You may think that decrypting the map is the same job as Question 1.1 but you are wrong. This time, you need to read the map from a file by yourself and then return a map as a list (list) of string (str). Your task is to write a function decode_map (mapfile, guide) such that mapfile is a file containing the encrypted map and guide is the guide dictionary similar to Question 1.1. The function should read the data from mapfile and use guide to decrypt the map. The function should return a list (list) of string (str) where each line corresponds to each line on the map after being decrypted. You should not include the newline character i.e., " ", note this is treated as a single character in Python and not two characters) in your result. Name Date modified Type Size Da5_91_template.py encoded_map1.txt 02/15/21 5:09 PM 11/20/20 12:48 PM PY File Text Document 3 KB 2 KB Figure 1: A possible directory structure containing a5_91_template.py and encoded_map1.txt. For instance, after decode_map('encoded_map1.txt', map-guide) , you should read the en- coded file encoded_map1.txt and return a map below. Note that the map below is printed using the given print_map function. For your code to work, encoded_map1.txt has to be in the same directory as a5_91_template.py. WWWWWWWWWWWWWWWWWWWWWWW.TTT.. WWWWWWWW WWWWWWWWWWWWWWWWWWWWWW...T. WWWWWWWW WWWWWWWWWWWWWWWWWWWWWW. WWWWWWW WWWWWWWWWWWWWWWWWWWWW. WWWWWWW WWWWWWWWWWWWWWWWWWWWW T.WWWWWWW WWW T.WWWWWWW WWWWWWWWWWWWWWWWWWWW . WWWWWWW WWWWWWWWWWWWWWWWWWWWWW. WWWWWWWW WWWWWWWWWWWWWWWWWWWWWW. WWWWWWWW WWWWWWWWWWWWWWWWWWWWWWW WWWWWWWWW WWWWWWWWWWWWWWWWWWWWWW. WWWWWWWWWW WWWWWWWWWWWWWWWWWWWWW. WWWWWWWWWWW WWWWWWWWWWWWWWWWWWWW. WWWWWWWWWWWWW WWWWW... WWWWWWWWWWWWW.T.T.. WWWWWWWWWWWWW WWWW.TTT. WWWWWWWWWWW...T. WWWWWWWWWWWWWW .WWWWWWWWWWW. WWWWWWWWWWWWWWW WWWWWWWW...T.WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW WWWWW.... WWWWW. WWWWWWWW WWWW.TTT. WWW WWWWW . .WWWWWWWWWWW. WWWWWW WWWW WWWWWWWW. T. WWWWWWWWWWWWWW WWWWWWWWW. .WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW WWWWWWWWWW.T.WWWW WWWW WWWWWWWWWWW.WWWWWWWWWW. WWWWWWWWWWWWWWWWW WWWWWWWWWWWWWWWWWWWWW. .T..WWWWWWWWWWWWWWWW WWWWWWWWWWWWWWWWWWWWWWW.TTT..WWWWWWWWWWWWWWW WWWWWWWWWWWWWWWWWWWWWWW..T. WWWWWWWWWWWWWWWW WWWWWWWWWWWWWWWWWWWWWW. WWWWWWWWWWWWWWWWWWW WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW W: WATER T: TREE . : GRASS If you have problem viewing the map above, you can view the file decoded_map1_ans.txt from Coursemology instead. continue on the next page... 4 Assumptions The keys and values in guide are single characters. Restrictions The dictionary guide should not be modified. 1.3 Find Treasure [20 marks] Once you managed to decipher the map, you are now ready to find the missing treasure! The hint from Question 1.1 tells you that the treasure is in the middle of five (5) trees that are planted in a cross shape like the one highlighted below: WWWWWWWWWWWWWWWWWWWWWW WWWWWWWWWW WWWWWWWWWWWWWWWWWWWWW WWWWWWWWWWW WWWWWWWWWWWWWWWWWWWW. .T WWWWWWWWWWWWW WWWWW... WWWWWWWWWWWWW..T.T.. WWWWWWWWWWWWW WWWW.TTT.WWWWWWWWWWW...T. WWWWWWWWWWWWWW WWWWW . WWWWWWWWWWW. WWWWWWWWWWWWWWW WWWWWWWW. .T.WWWWWWWWWWWW WWWWWWWWW. WWWWWWWWWWWWWW WWWWW WWWWWWWWWW.T.WWWWWWWW WWWWWWWWWWWWWW WWWWWWWWWWW.WWWWWWWWWW. WWWWWWWWWWWWWWWWW WWWWWWWWWWWWWWWWWWWWW. WWWWWWWWWWWW WWWWWWWWWWWWWWWWWWWWWWW.TTT..WWWWWWWWWWWWWWW WWWWWWWWWWWWWWWWWWWWWWW . T WWWWWWWWWWWWWWWW WWWWWWWWWWWWWWWWWWWWWW , WWWWWWWWWWWWWW WWWWWWWWWW WWW WWWWWWWWWW WWWW WWWWW WWWWWWWWWW WWWWWWWWWWWWWW Question Write a function find_treasure (decodedmap) that reads in a list (list) of string (str) called decodedmap that contains the decoded map and returns the coordinate of the treasure as a tuple (tuple). Your function should work for any arbitrary map. Note The indexes for the row and column for the map start from 0. The top left corner of the map has the coordinate (0,0). You may assume that the map will have only one treasure location. Sample Run #1 a cross shape like the one highlighted below: WWWWWWWWWWWWWWWWWWWWWW. WWWWWWWWWW WWWWWWW WWWWWWWWWWWW WWWWWWWWWWW WWWWWWWWWWWWWWWWWWWW. .T. WWWWWWWWWWWWW WWWWW ...WWWWWWWWWWWWW..T.T. WWWWWWWWWWWWW WWWW.TTT.WWWWWWWWWWW. WWWWWWWWWWWWW WWWWW. WWWWWWWWWWW WWWWWWW WWWWWWWW...T.WWWWWWWWWWWWWWWW WWWWWWWWW WWWWW WWWWWWWWWWWWW WWWWWWWWWW.T.WWWWWWWWWW WWWWWWWWWWWWW WWWWWWWWWWWWWWWWWWWWW. WWWWWWWWWWWWW WWWWWWWWWWWWWWWWWWWWW . T WWWWWWWWWWWWWWWW WWWWWWWWWWWWWWWWWWWWWWW.TTT..WWWWWWWWWWWWWWW WWWWWWWWWWWWWWWWWWWWWWW . T WWWWWWWWWWWWWWWW WWW W WWWWWWWWWWWWW WWWWWWWWWWWWWWWWW WWWWWWWW WWWWWWWWWWWWW WWW WWWWWWWWWWWWW WWWWWWWWWWWWWWWW WWWWWWWWWWWWWWWWWW Question Write a function find_treasure (decodedmap) that reads in a list (list) of string (str) called decodedmap that contains the decoded map and returns the coordinate of the treasure as a tuple (tuple). Your function should work for any arbitrary map. Note The indexes for the row and column for the map start from 0. The top left corner of the map has the coordinate (0,0). You may assume that the map will have only one treasure location. Sample Run #1 >>> print(find_treasure('decoded_map1.txt')) (21, 25)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started