Example #1
0
 public void run()
 {
     Mapple              = new village();
     Toronto             = new village();
     Ajax                = new village();
     Ajax.villagename    = "Ajax";
     Ajax.isAstrilde     = true;
     Mapple.villagename  = "Mapple";
     Mapple.nextvillage  = Toronto;
     Toronto.nextvillage = Ajax;
     Toronto.villagename = "Toronto";
     Ajax.nextvillage    = null;
 }
Example #2
0
        public void run()
        {
            village Toronto;

            Toronto = new village();
            village a, b, c;

            Toronto.villagename = "Version A";
            a                   = Toronto;
            Toronto             = new village();
            Toronto.villagename = "Version B";
            b                   = Toronto;
            Toronto             = new village();
            Toronto.villagename = "Version C";
            c                   = Toronto;
            Console.WriteLine(a.villagename);
        }
Example #3
0
        public void travel()
        {
            currentvillage = Toronto;

            while (true)


            {
                if (currentvillage.isAstrilde)
                {
                    Console.WriteLine(" Astrilde is in: " + currentvillage.villagename);
                    Console.ReadLine();
                }

                else
                {
                    currentvillage = currentvillage.nextvillage;
                }
            }
        }