Fun_People Archive
18 Jun
Donuts and the Code Challenge


Content-Type: text/plain
Mime-Version: 1.0 (NeXT Mail 3.3 v118.2)
From: Peter Langston <psl>
Date: Tue, 18 Jun 96 14:45:49 -0700
To: Fun_People
Subject: Donuts and the Code Challenge

Forwarded-by: Daniel Steinberg <dss@opcode.com>
Forwarded-by: Mike Muskin <muskin@opcode.com>
Author unknown (who is Mike Kolesnik?).


Heaven's donuts are jelly donuts.  The blend of texture, from the cool,
sweet ooze of the jelly, mined with tiny raspberry seeds, to the firm,
spongy cake, so lightly encrusted in a thin glaze of sugar, that cracks and
flakes as you gingerly tear off small pieces of delight, is certainly the
greatest experience a humble man can afford.

I was eating a jelly donut when He first appeared in my office, smelling
slightly of gunpowder.  He was tall and gaunt, with deep-set eyes and
crooked teeth, long, delicate fingers, and sloped shoulders.  He wore a
black Ozzy Osborne concert t-shirt, frayed black jeans, and dusty black
high-tops, unlaced. He smiled at me in an ugly way.  I put down my donut
and glanced at my watch. 7:00 PM.  "You're Mike Kolesnik."

I nodded.

"You're a programmer for CyberHackers."

I nodded again.  Not only was I a programmer for CyberHackers -- I was the
best damn programmer this group had ever or would ever see.  I suppose I
should introduce myself.  I am Michael Kolesnik, master programmer.  I'm
not just blowing smoke here either.  I'm the best damn programmer to come
out of MIT since code was constructed one bit at a time.  I can do it all:
C, LISP, assembly -- even the languages no self-respecting programmer would
deign to look at.  I can do it all in no time flat, with the most elegant
of style.  Code sprinkled with glistening semicolons and flowing rivers of
indentation.  Lesser programmers avert their eyes when I enter the room.

"They say you're the best, and I'm here to challenge you."  I sized this
guy up again.  He had the right shape.  The pot-belly, the greasy hair,
parted with precision.  The fingers.  And the funny smell.  I told him I
didn't have time.

"I'll make it worth your while," he said.  "I have something you might be
interested in.  Follow me."

I grabbed my box of donuts, and followed him down the hall and into the
elevator.  He pressed a button and the elevator descended into the basement.
I'd never been in the basement before.  For that matter, I didn't even
recall that the building had a basement.  Nonetheless, the elevator chimed,
the doors opened, and we stepped out into a wide room that was entirely
featureless.  That is, except for the fog on the floor and two workstations
that were set up, side by side.  One of the workstations was mine.  The
other was a workstation like none other that I had seen before.  It was
magnificent.

It was matte black.  More than an object, it looked like a hole in space.
The monitor it sported was the biggest I had ever seen, and the keyboard
was a flow of liquid lines, containing a field of keys of different sizes
and shapes, packed in like cobblestones.  The mouse floated above the table,
and had no wire.  Next to the computer was a box with a small chute coming
out of one side, and a large red button on the top.  The monitor was flanked
by two gigantic speakers, and I could see a sub-woofer poking up out of the
fog.  It hummed.  It steamed.  It was the most beautiful computer I had ever
seen.

"You approve," said the stranger.

I swallowed and said, "It is beyond description."

"It's a custom job.  And it's yours.  If," he said, "If you can beat me in
a coding contest."

I looked at him incredulously.  "What's in it for you?"

"I will have defeated the greatest coder in the world, and thus, I can claim
that title.  AND, I get to keep your immortal soul."  He smiled the ugly
smile again.

Here was a dilemma.  I was dealing with the Devil.  There was no doubt about
that.  And he was no doubt very good.  I am somewhat attached to my soul,
but oh, the prizes.  The glory.  I can easily claim to be the best coder in
the company, in the Bay Area, probably on the whole planet, but if I pulled
this off, I will have shown myself to be the best coder in this entire
theology!  Vanity got the better part of me.

"What's the contest?" I asked.

I won't bore you with the details, but it was seriously ugly.  Ugly in a
way that makes the most arrogant of coders cringe and causes managers to
pad development schedules into the next century.  It had to run in any
language, including the nasty chicken-scratch ones.  It had to be backward
compatible, all the way to the ENIAC. And it had to run on Windows...  I
cringed.  But vanity won. I signed the forms, agreed on a deadline of
midnight, and we sat down at our machines and started to code.

      My watch said 8:00 PM, and I started warming up.  Class definitions
flew off my fingertips like throwing stars. Structures and declarations grew
like perfect crystals, and I didn't even break a sweat. True to the task,
I soon lost myself in an endless cycle of postulate, create, instantiate
and verify.  Bits grew to bytes, to K, to Megs, and finally to Gigs.  By
11:00 PM it had come to that crucial point. With an hour to go, I had to
put all the pieces together. It wasn't going to be easy. It was going to
take all the concentration I had.

Then I hit the first bug.

At first, I wasn't sure where it was coming from, but then I spotted it.
It wasn't mine. It was a bug in Windows. Even worse, it was a bug in Windows
that stemmed from a timing problem with the system clock itself. I couldn't
see a workaround. I was stymied. I genuflected and called Microsoft support.
"Hello, and welcome to the Microsoft help line.  Please enter your 64 digit
user identification number, followed by your 32 digit password."

While I frantically typed number after number, trying to navigate through
layer upon layer of phone menu, I heard Him pick up his phone and call a
number.

"Hello, is Bill in? ... I don't care, wake him up ... Tell him it's Mr.
Black ... Hey Bill, what's shakin'?  Listen, I needed to know a workaround
to one of your bugs ... Yes, I know what time it is...  Yes, I know ... Bill
... Bill!  You remember our little deal?...  That's right.  Now be a dear
and give me that workaround ... Mm-hm
... Right ... Thank you, Bill.  I'll be seeing you."

I was shocked.  It was obviously pointless continuing my desperate journey
through Microsoft's Help line. I needed immediate genius! I scarfed down a
grape jelly. Sugar shock engulfed me, and my vision tunneled. I shuddered
once, something clicked, and I determined the answer I needed -- I could
use the clock on the sound chip to get my timings.

I dove back into the code, and was quickly integrating modules when I hit
bug number two. It was even uglier than the first. In fact, it was the
ugliest bug I had ever seen. It was a problem with C. With the language
itself. There's no way fix a broken hammer using the same hammer.

I wracked my brains. I clenched and grunted and sweated and thought and
Thought and THOUGHT, but to no avail. Over my shoulder, I could hear Him
chime in, "Bugger, isn't it?  I remember putting that one in back when I
was working on the Unix kernal. Did you really think there was a Kernighan
and Ritchie?  Rearrange the letters in their names and you'll discover an
interesting anagram."

I ignored him and continued thinking.  My mind went deeper and deeper into
the problem at hand -- my senses dulled, my breathing grew shallow.  My eyes
rolled back and sweat beaded on my forehead.  Clumsily, blindly, my hand
pawed it's way to the box on my desk, containing my last jelly donut.  It
raised slowly to my lips, and I bit.

Pounding waves of sugar induced euphoria washed through my mind.  I felt my
brain hum and crackle.  My hands trembled, my body shuddered, and I began
to type. I was a man possessed. Complex topographical math equations formed
on my screen. Klien bottles and hypercubes locked neatly into place like
pieces of a puzzle. Beyond my control, a complex mathematical world formed
in my computer, with additional dimensions unimaginable.

I felt a small pop, and I came to. I looked at my screen. I had worked
around the bug. My watch read 11:45. Frantically I continued putting all
the modules into place. Glancing for a moment at my rival, I could see I
had him worried.  He was typing furiously. Smoke poured from his ears, and
flames licked around his collar.

Then I hit the third bug.

It was not so much a bug, it was a limit. I only had 4 Gigabytes of memory,
and I had used it all. There wasn't a bit left. I had compressed data to a
point so fine that it was in danger of collapsing into a black hole. I was
storing memory in every conceivable way, including keeping a chain of sound
waves running between the speaker and the microphone. There was no memory
left to be had.

Frantic, I reached into my box of donuts, and my heart sank into my stomach
when I realized that I had eaten the last one.  I glanced at my watch, but
it was too late. I was sunk. I had done the best that I could, and I had
nothing more to give.

The Devil laughed, and grinning cruelly, he reached over to the box with
the chute and the button. Remember the box? Slowly, firmly, his hand pressed
the red button, and a jelly donut slid down the chute and onto the table.

My jaw dropped.  "What...is...that?" I asked.

He languorously chewed as he replied, "The Box of Eternal Donuts."

"The Box of Eternal Donuts!?"

"Yes," he said.

"It never runs out?"

"Never," he said.

"It's mine if I win?!?!"

"If you can win, it is entirely yours," he replied, grinning cockily.

My mind reeled.  The Box of Eternal Donuts.  The Box of Eternal Donuts!  My
eyes darted everywhere, my jaw hung slack, and my throat emitted strange
animal-like noises. Anything. I would do anything to win! I just needed the
smallest amount of memory. But where could I get it from? I glanced at my
watch again, and a plan came into my mind. A beautiful, devious plan.

I went quickly upstairs and retrieved the emergency toolkit that we keep in
the medicine cabinet. I ripped the case off my computer, and quickly scanned
for the right connections. I pulled two wires, and unscrewed the back of my
watch. The Devil's eyes widened and he desperately started coding again,
but it was too late. I got the last of the memory I needed out of my watch,
and pressed the ENTER key seconds before he did.

The watch burst into flames. Sparks flew from the disk drives and the
monitor glowed and throbbed, finally melting into a puddle of glass.  The
computer exploded in a shower of sparks, and then there was absolute
silence.

There was a pause, and both of us turned as the printer started, slowly
emitting a single sheet that wafted gently into the out bin. I nonchalantly
strolled over, and held up to the Devil's scowling face, a sheet imprinted
with two words.  "Hello World".

Nothing more needs to be told, other than, as I write this, I am sitting in
front of my new computer, munching on what is undoubtedly the best jelly
donut I have ever eaten...


prev [=] prev © 1996 Peter Langston []