i have some execution issues, where the same function is not working in the same way
while(mano.Count != 0) // inizio partita
{
int count = 0;
scelta = Convert.ToInt32(Console.Read()) -48;
string res = cl.Colleziona(mano[scelta - 1], ID);
while (res == "Non e' il tuo turno" || res.StartsWith("Il tuo avversario ha giocato: "))
{
if (res.StartsWith("Il tuo avversario ha giocato: "))
{
Console.WriteLine(res + ", seleziona di nuovo una carta: ");
scelta = Convert.ToInt32(Console.Read()); //here gives the error
res = cl.Colleziona(mano[scelta-1], ID);
Console.WriteLine(res);
break;
}
else if (count == 0)
{
Console.WriteLine(res);
count++;
}
System.Threading.Thread.Sleep(200);
res = cl.Colleziona(mano[scelta - 1], ID);
}
mano.Remove(mano[scelta-1]);
ris = cl.partita();
while (ris == null)
{
System.Threading.Thread.Sleep(200);
ris = cl.partita();
}
The commented function returns 13 instead of letting me input something, giving OutOfRangeException on the successive function, any solution?
Thanks