Skip to content

Coding style

hbons edited this page Mar 5, 2012 · 11 revisions
// License text
// and copyright


using System;
using System.Diagnostics;
using System.IO;
using System.NyanCats;
using System.Threading;
using System.Unicorns;

namespace SparkleShare {

    public class CodingStyle {
		
		public string [] NyanCats { get; private set; };
		public NyanCats cats;
		
		private int number_of_unicorns;
		private double rainbow;
		
		public string Text {
			get {
				 return "a" + "b" + "c";
			}
		}


        public CodingStyle ()
        {
			NyanCats                = new NyanCats [3];
			this.number_of_unicorns = 42;
			
			NyanCats [0] = new NyanCat ();
			NyanCats [1] = new NyanCat ();
			NyanCats [2] = new NyanCat ();
			
			Sparkle ();
			Thread.Sleep (5);
			
			cats [0].Meows += delegate {
            	this.number_of_unicorns++;
            };
        }


        private void Sparkle (NyanCat cat, bool repeat)
        {
        	while (repeat) {
				Unicorn pink_unicorn = new Unicorn () {
					HasWings     = false,
					Farts        = true,
					FriendOnBack = cat 
				};
				
				try {
					if (unicorn.)
						unicorn.Fly ();
					else
						unicorn.Fart ();
					
					if (unicorn.HasWings) {
						unicorn.Fart ();
						unicorn.Fly ();
					
					} else {
						unicorn.Fart ();
						Sparkle ()
					}
					
					unicorn.Jump ();
					
				} catch (FriendFellOffException e) {
					Console.WriteLine (e.Friend.Name + " fell off!");
					break;
				}
			}
        }
    }
}