Exemple #1
0
        public static void Main(string[] args)
        {
            var jarvis = new Jarvis();

            var energy = long.Parse(Console.ReadLine());

            var command = Console.ReadLine().Split();

            while (command[0] != "Assemble!")
            {
                jarvis.Apply(PartFactory.Get(command));
                command = Console.ReadLine().Split();
            }

            switch (jarvis.Assemble(energy))
            {
            case 1:
                Console.WriteLine("We need more parts!");
                break;

            case 2:
                Console.WriteLine("We need more power!");
                break;

            default:
                Console.WriteLine(jarvis);
                break;
            }
        }