Проблем при една изпитна задача от Tech Module with C#-Tseam Account
Условието може да се види от линка:
https://softuni.bg/trainings/resources/officedocument/32246/exercise-problem-descriptions-group-1-programming-fundamentals-may-2018/1939
При моят опит за решение стигнах до 70/100 и се завъртях в затворен кръг.
Според Judje при някои случаи на команда Ubdate <Name>,командата се изпълнява правилно )Играта с име Name отива на последно место),a в други случаи не се изпълнява?Защо се получава така :
Ето и кода:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Tseam_Account
{
    class Program
    {
        static void Main(string[] args)
        {
            string Pechosaccount = Console.ReadLine();
            List<string> Pechosaccountsplit = Pechosaccount.Split().ToList();
            while(true)
            {
                string command=Console.ReadLine();
                if (command=="Play!")
                {
                    Console.WriteLine(String.Join(" ",Pechosaccountsplit));
                    return;
                }
                List <string> commandsplit = command.Split(' ','-').ToList();
                if (commandsplit[0]=="Install")
                {
                    Pechosaccountsplit.Add(commandsplit[1]);
                }
                if (commandsplit[0]=="Uninstall")
                {
                    for (int i=0;i<Pechosaccountsplit.Count;i++)
                    {
                        if(Pechosaccountsplit[i]==commandsplit[1])
                        {
                           Pechosaccountsplit.Remove(Pechosaccountsplit[i]);                                
                        }
                    }
                }
                if (commandsplit[0] == "Ubdate")
                {
                    for (int i = 0; i < Pechosaccountsplit.Count; i++)
                    {
                        if (Pechosaccountsplit[i] == commandsplit[1])
                        {
                            Pechosaccountsplit.Remove(commandsplit[1]);
                            Pechosaccountsplit.Add(commandsplit[1]);
                        }                     
                    }
                }
                    if (commandsplit[0] == "Expansion")
                    {
                        for (int i = 0; i < Pechosaccountsplit.Count; i++)
                        {
                            if (Pechosaccountsplit[i] == commandsplit[1])
                            {
                            string word = commandsplit[1] + ":" + commandsplit[2];
                                Pechosaccountsplit.Insert(i + 1,word);                                   
                            }
                        }
}
                   
                
            }
            
        }
    }
}
 
Мерси за кода.Естествено,че имам на пред вид Update.
:)