Advertisement
Cassimus

OdgadnijHaslo cz1

Mar 22nd, 2025
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.02 KB | None | 0 0
  1. private static void OdgadujHaslo(string wylosowaneHaslo, string hasloDoWyswietlenia,
  2.             int liczbaNieLiter, string[] rysunkiWisielca)
  3.     {
  4.         int liczbaPomylek = 0; // index z rysunkiWisielca
  5.         int liczbaOdslonietychLiter = 0;
  6.         string uzyteLitery="";
  7.  
  8.         while (liczbaOdslonietychLiter < wylosowaneHaslo.Length - liczbaNieLiter)
  9.         {
  10.             Console.Clear();
  11.             System.Console.WriteLine(wylosowaneHaslo); // do testów, docelowo usunąć
  12.             System.Console.WriteLine(rysunkiWisielca[liczbaPomylek]);
  13.             System.Console.WriteLine();
  14.             System.Console.WriteLine(hasloDoWyswietlenia);
  15.             System.Console.WriteLine($"Uzyte litery: {uzyteLitery}");
  16.             System.Console.Write($"Podaj literę: ");
  17.            
  18.             char wpisanaLitera = Console.ReadLine()[0];
  19.  
  20.             // TODO Dalsza mechanika
  21.         }
  22.         System.Console.WriteLine($"Brawo, wygrałeś!!! Hasłem bylo {wylosowaneHaslo}");
  23.         Console.ReadKey();
  24.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement