Пример #1
0
        static void Main(string[] args)
        {
            Console.WriteLine("Gra w wisielca");

            Gra g = new Gra(); // zosta³ utworzony obiekt i wylosowane s³owo do odgadniecia

            Console.WriteLine(g.AktualnyWzorzec);
            Console.WriteLine(g.AktualnyWzorzec);
            Console.WriteLine(g.StanGry);
            // czy jest litera k
            Console.WriteLine("Czy jest k?");
            g.CzyJest('k');
            Console.WriteLine(g.StanGry);
            Console.WriteLine(g.AktualnyWzorzec);



            g.CzyJest('m');
            Console.WriteLine("Czy jest m?");
            Console.WriteLine(g.StanGry);
            Console.WriteLine(g.AktualnyWzorzec);

            Console.ReadKey();
            // przygotuj obrazki na jutro 50 x 50 pixeli format jpg
        }
Пример #2
0
        private void buttonWyslij_Click(object sender, EventArgs e)
        {
            if (textBoxLitera.Text == null || textBoxLitera.Text.Length != 1)
            {
                return;
            }
            char c = textBoxLitera.Text[0];

            if (g.CzyJest(c))
            {
            }
            else
            {
                string obrazek = $"Szubienica{ (int)g.StanGry}";
                pictureBoxSzubienica.Image = (Image)Properties.Resources.ResourceManager.GetObject(obrazek);
            };
            textBoxWzorzec.Text = g.AktualnyWzorzec;
            textBoxLitera.Text  = string.Empty;
            textBoxLitera.Focus();
            if (g.StanGry == StanSzubienicy.PrawaNoga)
            {
                Poddaj();
            }
        }