using System; class IgraPogadjanjaReci { static void Main() { Console.Write("Unesi rec -> "); string rec = Console.ReadLine(); Console.Clear(); // brise ekran int L = rec.Length; char[] skrivenaRec = new char[L]; for(int i = 0; i < L; i++) { skrivenaRec[i] = '*'; } int brZvezdica = L; int negPoena = 0; int pokusaj = 0; while(brZvezdica > 0) { pokusaj++; Console.Write("{0}. Pokusaj -> ", pokusaj); foreach(char c in skrivenaRec) { Console.Write(c); } Console.WriteLine(" Negativnih poena: {0}", negPoena); Console.Write("-> "); char slovo = (char)Console.Read(); Console.ReadLine(); if(rec.IndexOf(slovo) == -1) { negPoena++; } else { for(int i = 0; i < L; i++) { if(rec[i] == slovo) { skrivenaRec[i] = slovo; brZvezdica--; } } } } Console.WriteLine("BRAVO! Zamisljena rec je -> {0}", rec); } }