http://ericlippert.com

# Forest path

This is a path through a dimly lit forest, curving from south to east. A large tree with low branches stands by the edge of the path. On the ground is a pile of leaves.

> count the leaves

69,105.

> climb the tree

# North of house

> go north

You are facing the north side of a white house. There is no door here, and all the windows are boarded up. A narrow path winds north through the trees.

> go north

# West of house

You are standing in an open field west of a white house, with a boarded front door. You could circle the house to the north or south. There is a small mailbox here.

> open the mailbox

Opening the small mailbox reveals a leaflet.

[Taken]

“WELCOME TO ZORK, a game of adventure, danger, and low cunning. No computer should be without one!”

# Functional style follow-up

Thanks to everyone who came out to my beginner talk on using functional style in C# on Wednesday. I had a great time and we had a capacity crowd. The video will be posted in a couple of weeks; I’ll put up a link when I have it.

A number of people asked questions that we did not have time to get to: Continue reading

# Space oddity

Many years ago I awoke in the dead of night in a cold sweat, with the certain knowledge that a close relative had suddenly died. […] In fact, the relative is alive and well […]. However, suppose the relative had in fact died that night. You would have had a difficult time convincing me that it was merely coincidence. But it is easy to calculate that if each American has such a premonitory experience a few times in his lifetime, the actuarial statistics alone will produce a few apparent precognitive events somewhere in America each year. We can calculate that this must occur fairly frequently, but to the rare person who dreams of disaster, followed rapidly by its realization, it is uncanny and awesome. Such a coincidence must happen to someone every few months, but those who experience a correct precognition understandably resist its explanation by coincidence.

After my experience I did not write a letter to an institute of parapsychology relating a compelling predictive dream which was not borne out by reality. That is not a memorable letter. But had the death I dreamt actually occurred, such a letter would have been marked down as evidence for precognition. The hits are recorded, the misses are not.

Thus Carl Sagan in his 1979 book Broca’s Brain. Continue reading

# Functional programming for beginners

Happy New Year everyone; I hope you had a pleasant and relaxing festive holiday season. I sure did.

I’m starting the new year off by giving a short — an hour long or so — talk on how you can use ideas from functional programming languages in C#. It will broadcast this coming Wednesday, the 13th of January, at 10AM Pacific, 1PM Eastern.

The talk will be aimed straight at beginners who have some experience with OOP style in C# but no experience with functional languages. I’ll cover ways to avoid mutating variables and data structures, passing functions as data, how LINQ is functional, and some speculation on future features for C# 7.

Probably it will be too basic for the majority of readers of this blog, but perhaps you have a friend or colleague interested in this topic.

Thanks once again to the nice people at InformIT who are sponsoring this talk. You can get all the details at their page:

http://www.informit.com/promotions/webcast-a-beginners-guide-to-functional-programming-141067

In related news, I am putting together what will be a very, very long indeed series of blog articles on functional programming, but not in C#. Comme c’est bizarre!