+ 3

Challenge :: Prison Escape

Description: Pete the Piper was abducted around Christmas by some crazy woman mumbling about 'needing more gifts'. He is trying to escape from the prison he was thrown into. The prison has floor, wall, gem and door tiles. Your job is to help Pete find the shortest path to the exit. Input: The input is the map of the prison, you can find some examples here: https://code.sololearn.com/c10dnx22EsJq/#py Each character represents a tile: ' ': Empty space #: Wall P: The starting position of Pete a-j: Gem 0-9: Door E: The exit Rules: Pete can move North, West, South or East in a step. He automatically picks up gems and opens doors he passes over. Each door needs 1 gem to be opened. Any gem can be used but the gem is lost in the process. Some ideas for the output: - The length of the shortest path (-1 if it's not possible) - The order of the gem and door tiles during the escape - Print the path - Animate the escape ;)

19th Sep 2017, 8:52 AM
László Ozsvárt
László Ozsvárt - avatar
3 ответов
+ 1
thanks for the challenge... i'm not yet ready for the task, but will solve it eventually
23rd Sep 2017, 9:52 AM
Ринат Нургалиев
Ринат Нургалиев - avatar
0
ok bro
19th Sep 2017, 6:08 PM
Menos 0
Menos 0 - avatar
0
No need to hurry :)
23rd Sep 2017, 10:06 AM
László Ozsvárt
László Ozsvárt - avatar