Feeds:
Posts
Comments

Archive for the ‘Hacker Challenge’ Category

Number Crunch Brunch

We now join our hero, Captain Constructor, at Decidability Deli where he is brunching with his arch-nemesis, Doctor Destructor.  (The thoughts and ideas presented herein by Doctor Destructor are expressed in a shade of red, while those of Captain Constructor are blue.)

 

So you see, my good captain, the number of infinities is itself infinite.

Of course.  And the number of finities is finite.  By the way, are you enjoying that Pi?

Yes, yes!  It’s absolutely irrational!  But back to more serious matters.  I have just discovered a delightful sequence of numbers which is sure to stump you until well after the end of the universe.

On second thought, perhaps inviting you to brunch was a sub-good idea.  Must we talk numbers now?

Usually you are quite game, Captain.  There must be something debilitating in that Turing Tart of yours.

Sadly, I think you’re right.  Yet I cannot resist.

Every Achilles has his heel.  Just like every cowboy sings a sad, sad song.

Every villain likes to hear himself talk.  On with the number sequence!

 

Dr. Destructor clears his throat and begins…

(more…)

Read Full Post »

[When we last visited our intrepid hero, he was engaged in a battle of wits atop the tallest turret of Fallacy Fortress. The fate of the world is again in his hands. We join him now...]

Dr. Destructor: Wait till I get going! Where was I?

Capt. Constructor: Australia. Oh wait. I mean, you were just telling me about spheroids, buckets, and a scale.

Dr. Destructor: Right! I, like many non-virtual Destructors out there, suffer from occasional memory leaks. Don’t tell me you Constructors are immune. Australia? Ha!

(more…)

Read Full Post »

[We join our hero, Captain Constructor, atop the tallest turret of Doctor Destructor's hidden hideout: Fallacy Fortress...]

Dr. Destructor: You’re too late, Constructor! Before the next clock cycle, all of those mortals you call friends will be destroyed! And your little dog, too! [Maniacal laughter...]

Cptn. Constructor: Close your handle, Destructor. Just tell me how to interrupt the detonation kernel … er … process … sequence … thing.

Dr. Destructor: The sequence is perfectly synchronized and it cannot be pre-empted! Unless, of course, you are able to correctly identify the set of slightly-heavier-than-the-rest spheroids. But it is a task that is surely intractable to your puny single-core mind.

Cptn. Constructor: YOUR FACE IS SINGLE-CORE! [Our hero clears his throat, embarrassed. He is not generally given to such base language. Quickly he recovers his composure.] Tell me more about these spheroids.

Dr. Destructor: Over here you will find I have sorted 100 spheroids into 10 buckets labeled 0 through 9. Each bucket holds 10 spheroids, as you can plainly see. 90 of these spheroids all weigh 1 gram each. The other 10 weigh 1.01 grams each and they have been placed all together in the same bucket. You should also have noticed by now that all 100 spheroids are visually indistinguishable from one another. Shall I go on? Your stack is beginning to look overflowed.

Cptn. Constructor: I have stack space you could never even dream of. continue;

Dr. Destructor: Immediately next to the buckets I have placed a scale. The scale has been badly damaged from overuse. I keep telling that furry PHP elephant he’s too big! Never mind that, though. I assure you that the scale is still perfectly accurate. However, it only has one good measurement left in it.

Cptn. Constructor: What does all of this have to do with the spheroids?

Dr. Destructor: It should be quite clear that to interrupt the sequence of destruction, you must identify which bucket contains the heavier spheroids. You may take any combination of spheroids you like from these 10 buckets, place your selection in this empty bucket labelled “this.EmtpyBucket”, and place “this.EmptyBucket” (which at that point will no longer be empty) on the scale. The scale will tell you the weight and you must then tell me which of the 10 buckets contains the heavier spheroids.

Cptn. Constructor: Truly, you have a dizzying intellect.

Dr. Destructor: Wait till I get going! Where was I?

[Join us next time for the exciting conclusion...]

Read Full Post »

OK, this challenge is shamelessly borrowed from a challenge issued by Sasha on the Provo Linux Users Group mailing list, but I remember enjoying it so I figured I’d share. Make a solution in any language. The more, the merrier! Post solutions in the comments.

Input: A string containing an arithmetic expression consisting of times. The times could be in seconds, but they could also be in colon form: 3:12 is 192 seconds, 1:45:03 is 1 hour, 45 minutes, 3 seconds. There also may be fractions of seconds: 2:28.42 is 2 minutes, 28.42 seconds.

Output: Leave the arithmetic expression intact, but convert all times into seconds. So:
1:45.2 + 83 – 2:34 becomes 105.2 + 83 – 154

Enjoy, and good luck!

Guest Submission from The Code Lisperer

Read Full Post »

Follow

Get every new post delivered to your Inbox.