Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- namespace Wisielec
- {
- class Program
- {
- static bool sprawdzenieWygranej(string haslo, List<char> listaLiter)
- {
- foreach (char litera in haslo)
- {
- if (!listaLiter.Contains(litera) && litera != ' ')
- {
- return false;
- }
- }
- return true;
- }
- static void pokazUzyteLitery(List<char> listaLiter)
- {
- Console.Write("Użyte litery to: ");
- foreach (char litera in listaLiter)
- {
- Console.Write(litera + ", ");
- }
- Console.WriteLine();
- }
- static void pokazHaslo(string haslo, List<char> listaLiter)
- {
- foreach (var litera in haslo)
- {
- if (listaLiter.Contains(litera))
- {
- Console.Write(litera);
- }
- else if (litera == ' ')
- {
- Console.Write(" ");
- }
- else
- {
- Console.Write("_ ");
- }
- }
- }
- static void Main(string[] args)
- {
- List<string> listaHasel = new List<string>();
- listaHasel.Add("hograwts legacy");
- listaHasel.Add("god of war");
- listaHasel.Add("fortnite");
- listaHasel.Add("minecraft");
- listaHasel.Add("animal crossing");
- Random generatorLiczb = new Random();
- int iloscHasel = listaHasel.Count;
- int wylosowanyIndexHasla = generatorLiczb.Next(iloscHasel);
- string haslo = listaHasel[wylosowanyIndexHasla];
- List<char> listaUzytychLiter = new List<char>();
- }
- }
- }
Add Comment
Please, Sign In to add comment