dr inż. Maciej Kraszewski

inżynier

menedżer R&D

nauczyciel akademicki

dr inż. Maciej Kraszewski

inżynier

menedżer R&D

nauczyciel akademicki

Method of programming. Path finding problems

Assignment

Your assignment is to write program that will find a path through a labirynth.

The labirynth structure should be read from the text file that contain matrix of characters. Meaning of this characters is the following:

‘*’ (asterisk): wall,

‘ ‘ (space): empty space,

‘o’ – entrace,

‘e’ – exit.

The program should create new file that will mark with dots (‘.’) the path from entrace to exit.

Sample labirynth file can be downloaded using this link.

Sample solution can be downloaded using this link.

Your program should be a console application called pathfinder.exe that will accept the name of the input file as a first argument and name of the output file as a second argument. E.g. calling the program in the following way:

pathfinder.exe input.txt output.txt

should read the labirynth from input.txt and save the solution in the output.txt.

Sample console app in C# that read file names from arguments:

using System;

namespace pathfinder
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Name of the input file: " + args[0]);
            Console.WriteLine("Name of the output file: " + args[1]);
        }
    }
}

Details:

  • Send your solution to address: maciej.kraszewski[at]apsl.edu.pl.
  • E-mail should have the title in the following form: “<your name> methods of programming assignment 5”.
  • Send source code only (e.g. do not send Visual Studio project files).

Deadlines:

  • Solution sent before 22.05.2020: extra 50% points.
  • Deadline: 29.05.2020 (no points will be given for solutions sent after this date).