Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            Tamagotchi tamagotchi = new Tamagotchi();

            NameTamagotchi(tamagotchi);

            GameLogic(tamagotchi);
        }
Ejemplo n.º 2
0
        static void GameLogic(Tamagotchi tamagotchi)
        {
            bool loop = tamagotchi.GetAlive();

            while (loop == true)
            {
                tamagotchi.PrintStats();
                System.Console.WriteLine("\nteach - teaches a new word\nhi - greet " + tamagotchi.name +
                                         "\nfeed - feed tamagotchi\nskip - do nothing");
                GetAnswer(tamagotchi);

                System.Console.WriteLine("\n\n\npress 'enter' to continue");
                Console.ReadLine();
                Console.Clear();
            }
        }
Ejemplo n.º 3
0
        static void GetAnswer(Tamagotchi tamagotchi)
        {
            bool loop = true;

            while (loop == true)
            {
                string input = Console.ReadLine();

                if (input == "teach")
                {
                    System.Console.Write("write word: ");
                    input = Console.ReadLine();
                    tamagotchi.Teach(input);
                    loop = false;
                }
                else if (input == "hi")
                {
                    tamagotchi.Hi();
                    loop = false;
                }
                else if (input == "feed")
                {
                    tamagotchi.Feed();
                    loop = false;
                }
                else if (input == "skip")
                {
                    tamagotchi.Tick();
                    loop = false;
                }
                else
                {
                    System.Console.WriteLine(input + " does not exist");
                }
            }
        }
Ejemplo n.º 4
0
 static void NameTamagotchi(Tamagotchi tamagotchi)
 {
     System.Console.Write("enter tamagotchis name: ");
     tamagotchi.name = Console.ReadLine();
     Console.Clear();
 }