Feed fabulous-adventures-in-coding Fabulous adventures in coding

Favorite IconFabulous adventures in coding

Link https://ericlippert.com/
Feed http://ericlippert.com/feed
Updated 2024-11-21 11:30
Reservoir
You are on what used to be a large lake, but which is now a large mud pile. There are “shores” to the north and south. Half-buried in the mud is an old trunk, bulging with jewels. A suspicious-looking individual … Continue reading →
Maintenance room
This was the maintenance room for Flood Control Dam #3. Apparently, the room has been ransacked, for most of the valuable equipment is gone. On one wall is a group of buttons colored yellow, brown and red. The only doorway … Continue reading →
Dam
You are atop Flood Control Dam #3, which was once quite a tourist attraction. There are exits to the northeast and west, and a scramble down. The sluice gates on the dam are closed. Behind the dam is a wide … Continue reading →
Reservoir south
You are south of a large lake, far too deep and wide to be crossed. Paths lead east, south and southwest. > go north You would drown. > swim in the lake Swimming isn’t allowed in the lake. > go … Continue reading →
Studio
This was once an artist’s studio. The walls are splattered with paints of 69 different colors. To the west is a doorway (also covered with paint). A dark and narrow chimney leads up from a fireplace; although you might be … Continue reading →
Sandy cave
This is a sand-filled cave whose exit is to the southwest. > dig in the sand with the shovel You seem to be digging a hole here. > again The hole is getting deeper, but that’s about it. > again … Continue reading →
Aragain falls
You are near the top of Aragain Falls. The only path leads north. A solid rainbow spans the falls to the west. > go north Sandy beach You are on a large beach on the east shore of the river, … Continue reading →
End of rainbow
You are on a small, rocky beach by the Frigid River, below the falls. A rainbow crosses over the falls to the east and a narrow path continues to the southwest. > go east Can you walk on water vapor? … Continue reading →
Canyon view
You are atop the west wall of a great canyon, offering a marvelous view of the mighty Frigid River below. Across the canyon, the walls of the White Cliffs join the mighty ramparts of the Flathead Mountains. To the north, … Continue reading →
Another troll room
I am spending the week at FB headquarters in Menlo Park: (That’s me looking out for the thief. He’s around here somewhere.) I assume that the axe-wielding troll had already been killed and turned into mist, since the room was … Continue reading →
Forest edge
Paths lead into the forest to the west and northwest. Also, a well-marked path extends east. > go west Forest This is a dimly lit forest, with large trees all around. > go west Behind House > enter the white … Continue reading →
Altar
Standing by the temple’s altar, you can see a small hole in the floor which leads into darkness. The rest of the temple is north of here. On the two ends of the altar are burning candles. On the altar … Continue reading →
Egyptian room
This looks like an Egyptian tomb. A stair ascends to the west. The solid-gold coffin used for the burial of Ramses II is here. > take the coffin Your load is too heavy. > drop the sword Dropped. > take … Continue reading →
Temple
This is a large domed temple. A piece of rope descends from the railing of the dome, about 20 feet above, ending some five feet above your head. On the east wall is an ancient inscription, probably a prayer in … Continue reading →
Dome room
You are at the periphery of a large dome, which forms the ceiling of another room below. A wooden railing protects you from a precipitous drop. > tie the rope to the railing The rope drops over the side and … Continue reading →
Round room
This is a circular room with passages in all directions. Several have unfortunately been blocked by cave-ins. > go southeast Last time we implemented the state transition function; it takes in a zchar and a state, and produces a string … Continue reading →
Troll room
This is a small room with passages to the east, northeast and south, and a forbidding hole leading west. Bloodstains and deep scratches (perhaps made by an axe) mar the walls. A troll, brandishing a bloody axe, blocks all passages … Continue reading →
Cellar
You are in a dark, damp cellar with narrow passageways to the north and east. On the west is the bottom of a steep metal ramp which is unclimbable. > go north We are very close to being able to … Continue reading →
Attic
You have moved into a dark place. It is pitch black. You are likely to be eaten by a grue. > what is a grue The grue is a sinister, lurking presence in the dark places of the earth. Its … Continue reading →
Living room
The living room opens to the east. To the west is a wooden door, above which is strange gothic lettering. The door is nailed shut. There is a trophy case here, and a large oriental rug in the center of … Continue reading →
Kitchen
You are in the kitchen of the white house. A table has recently been used for the preparation of food. A passage leads west and a dark staircase leads upward. A chimney leads down and to the east is a … Continue reading →
Behind house
You are behind the white house. Paths lead into the forest to the east and northeast. In one corner of the house is a small window which is slightly ajar. > examine the window The window is slightly ajar, but … Continue reading →
Up a tree
You are ten feet above the ground, nestled among large branches. Beside you on the branch is a small bird’s nest. In the bird’s nest is a large egg encrusted with precious jewels, apparently scavenged by a childless songbird. > … Continue reading →
Like me, on Facebook
Well here’s something I never thought I’d write in Fabulous Adventures in Coding when I started this blog more than ten years ago: Today is my first day at Facebook. It still feels weird to say it. But as it … Continue reading →
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. … Continue reading →
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 Let’s start with some … Continue reading →
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 … Continue reading →
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 … 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 … 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 … Continue reading →
The dedoublifier, part four
I said last time that binary-searching the rationals (WOLOG between zero and one) for a particular fraction that is very close to a given double does not really work, because we end up with only fractions that have powers of … Continue reading →
The dedoublifier, part three
All right, we have an arbitrary-precision rational arithmetic type now, so we can do arithmetic on fractions with confidence. Remember the problem I set out to explore here was: a double is actually a fraction whose denominator is a large … Continue reading →
The dedoublifier, part two
A couple of years ago I developed my own arbitrary precision natural number and integer mathematics types, just for fun and to illustrate how it could be done. I’m going to do the same for rational numbers here, but rather … Continue reading →
The dedoublifier, part one
Good Monday morning everyone; I hope my American readers had a lovely Thanksgiving. I sure did! Well enough chit-chat, here’s a problem I was pondering the other day. We know that doubles introduce some “representation error” when trying to represent … Continue reading →
Monitor madness, part two
In the previous exciting episode I ended on a cliffhanger; why did I put a loop around each wait? In the consumer, for example, I said: while (myQueue.IsEmpty) Monitor.Wait(myLock); It seems like I could replace that “while” with an “if”. … Continue reading →
Monitor madness, part one
Locks are tricky; I thought today I’d talk a bit about some of the pitfalls of locking that you might not have seen before. As you probably know, the lock statement in C# is a syntactic sugar for the use … Continue reading →
Logical implication
One of the early stumbling blocks people run into when learning traditional Aristotelian logic is the idea that “a false proposition implies any proposition”. Let’s briefly review material implication, and then I’ll talk about what the implications of material implication … Continue reading →
When would you use & on a bool?
UPDATE: A commenter points out that today is the 200th anniversary of the birth of George Boole; I had no idea when I scheduled this article that it would be so apropos. Happy birthday George Boole! Here’s a little-known and … Continue reading →
Optimizing associative operations
A question I occasionally get is, suppose I have code like this: const double x = 200.0; const double y = 0.5; ... void M(double z) { double r = z * x * y; ... Does the compiler generate … Continue reading →
Inferring from “is”, part two
In part one I gave a bunch of reasons to reject the proposed feature where the compiler infers additional type information about a local variable when inside the consequence of a conditional statement: if (animal is Dog) { animal.Bark(); // … Continue reading →
It’s still essential
I am excited to announce that Essential C# 6.0 is now available in stores! As always, Mark did the vast majority of the work. And as always, I was delighted to be asked once again to contribute to one of … Continue reading →
Inferring from “is”, part one
In last week’s episode of FAIC I was discussing code of the form: if (animal is Dog) ((Dog)animal).Bark(); Specifically, why the cast was illegal if the variable tested was of generic parameter type. Today I want to take a bit … Continue reading →
Casts and type parameters do not mix
Here’s a question I’m asked occasionally: void M<T>(T t) where T : Animal { // This gives a compile-time error: if (t is Dog) ((Dog)t).Bark(); // But this does not: if (t is Dog) (t as Dog).Bark(); } What’s going … Continue reading →
Nullable comparisons are weird
One of the C# oddities I noted in my recent article was that I find it odd that creating a numeric type with less-than, greater-than, and similar operators requires implementing a lot of redundant methods, methods whose values could be … Continue reading →
Nature photography
I got a lot of great responses to my recent piece on features of C# I somewhat regret; thanks all for those. As promised, today on fun-for-Friday-FAIC I’ve posted some fabulous adventures in nature photography from my recent trip to … Continue reading →
Bottom ten list
Hey everyone, I am finally back from my many travels this summer and looking forward to doing some blogging this autumn. I’ll post some vacation photos when I have them sorted out. Until then, here’s an article that the nice … Continue reading →
One from the road
I have begun my travels but I have one more from the road. Literally! The nice people at radar asked me to write them a short article on static analysis for beginners; I was happy to oblige. (There seem to … Continue reading →
Interviewing candidates
A quick note: I’m going to be traveling for much of the rest of June and I haven’t got articles queued up, so the blog will go dark for a bit; see you in July! In the last two episodes … Continue reading →
It’s not magic
Last time on FAIC I reran my 2004 article on tips for coding on whiteboards for interviews. This time, a rerun from 2009 article on a similar topic. Next time, some more thoughts on this subject. Interviewing job-seeking candidates is … Continue reading →
Writing code on whiteboards is hard
I got an email from a reader in India recently asking me to talk a bit about thoughts on technical interviews. Here’s a rerun of my 2004 article on that subject. (Note that this was before I was on the … Continue reading →
123456