I would like to know how can i compare a switch case 1 and case 2 in C# is it possible to do that? obs i am a begginer :)

i would like to know how can i compare a switch case 1 and case 2 in C# is it possible to do that? obs i am a begginer :) I tried to do it with search and sort but it did not go well

let me give you an example if you add a word case 1( lagg ord) how can i compare that word with case 2 words ( in case 2  already exist 5 words)
here is the my program 
using System;
namespace ConsoleApplication1
    class Program
        static void Main(string[] args)
            //Meny
            Console.WriteLine("\n HÄNGA GUBBE\n");
            Console.WriteLine(" 1) Lägg till ord");
            Console.WriteLine(" 2) Lista alla ord");
            Console.WriteLine(" 3) Spela");
            Console.WriteLine(" 4) Avsluta");
            bool utgång = false;
            do
                int Valet;
                Console.Write("\n\tVälj 1-4: \n ");
                try
                    Valet = int.Parse(Console.ReadLine());
                catch (Exception)
                    Console.WriteLine("Du skriver fel character!\n" +
                        "\nSkriv bara mellan 1 och 4");
                    continue;
                switch (Valet)
                    case 1:
                        Console.WriteLine("\n lägg ett till ord! ");
                      var input = Console.ReadLine();
                        break;
                    case 2:
                        Console.WriteLine("\n Lista med alla ord :\n");
                        string[] array = { " Lev", " Skratta", " Gledje", " Gråt", " Njut" };
                        Array.Sort<string>(array);
                        foreach (var c in array)
                            Console.WriteLine(c);
                        Console.WriteLine("\n");
                        break;
                    case 3:
                        string guesses, bokstäver;
                        Console.Write("\n Hur många fel får man ha? ");
                        guesses = (Console.ReadLine());
                        Console.WriteLine(" Utmärkt, då spelar vi!\n");
                        Console.WriteLine(" Felgisningar :" + "0/" + guesses);
                        Console.Write(" Gissade bokstäver ");
                        bokstäver = (Console.ReadLine());
                        Console.WriteLine("Aktuellt ord");
                        Console.Write("Gissa bokstav : " + bokstäver + " \n");
                        break;
                    case 4:
                        Console.WriteLine("\n  HEJ DÅ! \n");
                        Console.Beep();
                        utgång = true;
                        break;
                    //avbryter while loopen, avslutar spelet
            } while (!utgång);

Similar Messages

Maybe you are looking for