<commit_before>﻿
namespace MarsRoverApp
{
    class Program
    {
        static void Main(string[] args)
        {
        }
    }
}<commit_msg>DESIGN - DEVELOPMENT - Mars Rover - Crude implementation of the mars rover app. Tests are fine.<commit_after>﻿
using System;
using System.Collections.Generic;
using System.Linq;
using MarsRover;

namespace MarsRoverApp
{
    class Program
    {
        static void Main()
        {
            var rovers = new List<Rover>();
            var input = Console.ReadLine();
            if(string.IsNullOrEmpty(input))
                throw new Exception("Input not recieved.");
            var planeTopRightCoordinates = input.Split(' ');
            if (planeTopRightCoordinates.Count() != 2)
            {
                throw new Exception("Bad input");
            }
            var plane = new Plane(int.Parse(planeTopRightCoordinates[0]), int.Parse(planeTopRightCoordinates[1]));

            while (!string.IsNullOrEmpty(input = Console.ReadLine()))
            {
                var locationStrings = input.Split(' ');
                if(locationStrings.Count()!=3)
                    throw new Exception("Bad input");
                var direction = CompassDirection.East;
                switch (locationStrings[2].ToUpper())
                {
                    case "N": direction = CompassDirection.North; 
                        break;
                    case "E": direction = CompassDirection.East;
                        break;
                    case "W" : direction = CompassDirection.West;
                        break;
                    case "S" : direction=CompassDirection.South;
                        break;
                    default: throw new Exception("Bad direction input.");
                }
                var location = new Location(int.Parse(locationStrings[0]),
                    int.Parse(locationStrings[1]), direction);

                var command = Console.ReadLine();
                if(string.IsNullOrEmpty(command)) throw new Exception("Command not received.");

                var rover = new Rover(plane, command, location);
                rovers.Add(rover);
            }

            foreach (var rover in rovers)
            {
                var finalLocation = rover.Operate();
                Console.WriteLine(finalLocation.CurrentX + " " + finalLocation.CurrentY + " " + finalLocation.CurrentDirection.ToString()[0]);
            }
        }
    }
}
{'fraction_non_alphanumeric': 0.09959349593495935, 'fraction_numerical': 0.0032520325203252032, 'mean_word_length': 1.5932560590094837, 'pattern_counts': {'":': 2, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1565679', 'n_tokens_mistral': 616, 'n_tokens_neox': 582, 'n_words': 140}