예제 #1
0
        private static int pokemonChoice()
        {
            Console.WriteLine("A present, choisis parmi ces 3 Pokemons! Prends-en bien soin.");
            Console.WriteLine("Veux-tu le Pokemon type Plante: Bulbizarre? Tape 1");
            Console.WriteLine("Veux-tu le Pokemon type Feu: Salameche? Tape 2");
            Console.WriteLine("Veux-tu le Pokemon type Eau: Carapuce? Tape 3");
            Console.WriteLine("Tu ne sais pas qui tu veux? Tape 4 pour en obtenir un aleatoirement");
            i_result = Int16.Parse(Console.ReadLine());
            Random rnd = new Random();

retry:
            switch (i_result)
            {
            case 1:
                starter = new Bulbizarre();
                break;

            case 2:
                starter = new Salamèche();
                break;

            case 3:
                starter = new Carapuce();
                break;

            case 4:
                //Dans le cas aléatoire, on utilise le point retry pour utiliser un cas aléatoire
                i_result = rnd.Next(1, 3);
                goto retry;

            default:
                break;
            }

            return(i_result);
        }