Exemple #1
0
 public static Magic8 GetInstance()
 {
     if (_uniqueInstance == null)
     {
         _uniqueInstance = new Magic8();
     }
     return(_uniqueInstance);
 }
Exemple #2
0
        static void Main(string[] args)
        {
            var    eightBall = Magic8.GetInstance();
            string vraag;

            do
            {
                Console.WriteLine("Stel jouw vraag:");
                vraag = Console.ReadLine();
                Console.WriteLine(eightBall.GetRandomAnwser());
                Console.WriteLine();
            }while (vraag != "stop");
        }