class Program
{
static void Main(string[] args)
{
if (args.Length > 0)
{
var v = File.ReadLines("dictionary.txt");
var v1 = args\[2\];
var v2 = args\[3\];
var first = v.Where(w => w == v1).First();
var last = v.Where(w => w == v2).First();
var l = Array.IndexOf(v.ToArray(), first);
var l2 = Array.IndexOf(v.ToArray(), last);
var l3 = l2 - l;
var results = v.Skip(l).Take(l3);
foreach (var result in results)
{
Console.WriteLine(result);
}
}
else
{
Console.ForegroundColor = ConsoleColor.DarkRed;
Console.WriteLine("Arguments invalid");
}
}
}
// Please provide written answers to the questions below.
// 1. What is this code doing?
// 2. Comment on the quality of this code / how could you improve this implementation?
// 3. How could you verify the behaviour is correct?