Starting from:
$30

$24

JdeRobot- Universidad Rey Juan Carlos Solution




C++ Challenge




You will need to accomplish this challenge as part of your GSoC application.




Labyrinth




Let's imagine you are outside a labyrinth described as walls (#) and holes (.) where you can not pass through the walls and you can only move to adjacent holes. Diagonal adjacencies will not be taken into account, only vertical and horizontal.




Your applications should find the largest pathway moving only between holes, reading the labyrinth schema from a txt file, using only standard libraries of c++11. All the lines in the input file will have the same number of elements. Your application should save the schema of the largest detected pathway, overwriting the holes (.) with the order in which the hole has been visited.




Example 1​:




input:




##.##.#




#..##.#




#.#####




#..####




#######







output:




6




##0##.#




#21##.#




#3#####




#45####




#######

Example 2​:




input:




##.##.#




##.#..#




####..#




##....#




#######







output:




9




##.##0#




##.#21#




####34#




##8765#




#######







Requirements​:

Your application should compile with the gcc compiler 4.8






Results​:

Make or CMakeLists to compile the application.



The source code of the application.

More products