Eric Maino

System.Brain.CoreDump();

Proposal in C#

public bool Propose(Mate sigOther)
{

bool answer = false;

Conversation convo = CellPhone.Call(PhoneBook.SearchFor("Florist", "Greenville")[0]);
convo.Recieve("Hello, some florist in Greenville");
convo.Send("Could you please send a single rose...");
convo.SendThanks();
convo.End();

Car vehicle = new Car("Eric's Car");
vehicle.GetIn(me);
vehicle.DriveTo(new Location("Chicago"));
vehicle.ValletPark();

Hotel hotel = new Hotel("Renaissance Hotel");
hotel.CheckIn();
hotel.FindRoom();

me.Change();
me.PutOn(typeof(Shirt), "Microsoft Student Ambassador");
me.PutOn(typeof(Suit), "Ralph Lauren Polo");

me.Locate(typeof(TabletPC));

while (!me.IsReady()) 
         me.PracticeProposal();

convo = me.WaitForCall();
convo.Recieve("Hello, Mr. Maino you limo is here.");
convo.Send("Thanks, I will be down in a few moments...");
convo.End();

me.PickUp(typeof(Flower), "Rose petals");
me.PickUp(typeof(CD), "Monster Ballads Vol. 1");

Car limo = new Car("White Limousine");
limo.GetIn(me);
limo.GiveDriverInstructions("Drive to the airport and pretend I am not in here");
limo.ExplainToStupidDriver("No, it's not her birthday. I am going to propose. See this ring");

me.PrepareLimo();

limo.GiveDriverInstructions("There she is... Remember I am not in here");
limo.GetIn(sigOther);

if
(me.PopsTheQuestion(sigOther) == BigQuestionAnswer.Yes)
       answer = true;

return
answer;

}

CORRECTION: Thanks to Jeff for pointing out the error. There is no type TablePC, but yet it's of type TabletPC.

UPDATE: I noticed a few more bugs in this code, just minor spelling typo's when creating the HumanInteractionAPI this evening.

Comments

Bill Gates said:

Congratulations. See, women love geeks too.
# November 15, 2004 8:42 AM

Douglas Reilly said:

Such a geek<g>. Congratulations!
# November 16, 2004 1:49 PM

Alex said:

Dude that is aweosme...in both senses!!
# November 17, 2004 10:35 AM

Damon said:

Nice job! So how does code resuse apply to this? *grin*
# November 17, 2004 6:40 PM

Fabrice said:

I noticed you did not made sigOther a singleton, but instead a parameter you can change...
What that in case the return value was false, or do you still plan to reuse this method with other Mate objects? Maybe you created a class library after all?
# November 19, 2004 6:22 AM

Srinivas Ivaturi said:

Nice one to see in C#. I coame accross such things quite often but this makes more sense.

# December 7, 2004 1:31 AM

Kaisa M. Lindahl said:

Congratulations.
Best code I ever read!

Kaisa
# December 7, 2004 3:15 AM

Adi Oltean said:

public void Post(Person me, Blog blog)
{

BlogComment comment = blog.GetNewComment();

comment.Title = BlogComment.DefaultTitle;
comment.Name = me.Name;
comment.Url = me.MyBlog.Url;
comment.Text = "Absolutely cool!";

comment.Submit();

}

# December 7, 2004 3:21 AM

Brian said:

This is my favorite line:

me.PickUp(typeof(CD), "Monster Ballads Vol. 1");

Awesome.
# December 7, 2004 3:03 PM

Jota said:

damn...

doesnt compile here... whats your .net version?

nice code ;)
# December 7, 2004 6:14 PM

Anand said:

Nice Stuff.. Enjoy
# December 8, 2004 1:21 AM

Joel Martinez said:

Nice ... so what was the return value?
# December 9, 2004 11:36 AM

Chua Wen Ching said:

Wow... that is unique. Congrats :)
# December 10, 2004 3:37 AM

Jens C said:

...you forgot the interesting part: the finally block??? ;-)

Congratulations!!! For both, your marriage and the code!
# December 10, 2004 5:23 AM

kamran khan said:

mail id :k4kami@msn.com

good Excelllent keeep it up child!
:p
# December 11, 2004 4:54 AM