Looks can be Deceiving

Post Reply
megabreit
Posts: 141
Joined: Sat Jan 03, 2009 3:33 pm

Looks can be Deceiving

Post by megabreit »

Is there any trick or do we just have to find out what programming language is used?
AMindForeverVoyaging
Forum Admin
Posts: 496
Joined: Sat May 28, 2011 9:14 am
Location: Germany

Post by AMindForeverVoyaging »

Is this a new challenge? Could you tell us after which other challenge it opens up?
b0bA
Posts: 13
Joined: Tue Dec 30, 2008 4:45 pm

Post by b0bA »

This challenge isn't new. You will get it right after solving the challenge "It's a small World"
User avatar
laz0r
Posts: 290
Joined: Thu Feb 04, 2010 4:18 pm
Location: Within the depths of Unix

Post by laz0r »

Hmm, well I believe it most certainly isn't C but I'm struggling to work out what it could be.
There is no spoon.
AMindForeverVoyaging
Forum Admin
Posts: 496
Joined: Sat May 28, 2011 9:14 am
Location: Germany

Post by AMindForeverVoyaging »

laz0r wrote:Hmm, well I believe it most certainly isn't C
That should be easy enough to check: Ask your local friendly C compiler. ;)
User avatar
laz0r
Posts: 290
Joined: Thu Feb 04, 2010 4:18 pm
Location: Within the depths of Unix

Post by laz0r »

AMindForeverVoyaging wrote:
laz0r wrote:Hmm, well I believe it most certainly isn't C
That should be easy enough to check: Ask your local friendly C compiler. ;)
Unfortunately he hated it :( but my poor brain's struggling to identify it anyway!
There is no spoon.
AMindForeverVoyaging
Forum Admin
Posts: 496
Joined: Sat May 28, 2011 9:14 am
Location: Germany

Post by AMindForeverVoyaging »

laz0r wrote:Hmm, well I believe it most certainly isn't C
Now that I have reached this challenge: Yes and no.

The code given here is 100% valid C code - to be more precise, valid as of the C99 standard.

That said, if you put it inside a main() function, then compile, link, and execute it, you get an output that is 34 characters long, starts with "00", and ends with "34". This answer is however not accepted.

Now it gets tricky. The title of this challenge could imply that while this is valid C code, it is not meant to be treated like C code.

Maybe the comments are a clue? I can't make head nor tail of it though.
aurora
Posts: 54
Joined: Thu Feb 05, 2009 12:31 pm
Location: Bavaria, Germany

Post by aurora »

I wonder if the code is intended to work unmodified (besides maybe wrapping it in a main function and adding some includes). i know of at least two other languages, that would accept the code, only problem so far is, they won't accept an integer as argument for "atan".

on the other hand: i wonder if there is a reason for the "strange" formatting or if THIS is really only the coding-style of the one that created this challenge ;)
User avatar
TheBigBoss
Posts: 29
Joined: Thu Jun 07, 2012 12:07 pm
Location: Germany

Post by TheBigBoss »

Filling up the lines with spaces, you can run it as a SuperHack program. Unfortunately, the output is not the answer. :?
AMindForeverVoyaging
Forum Admin
Posts: 496
Joined: Sat May 28, 2011 9:14 am
Location: Germany

Post by AMindForeverVoyaging »

TheBigBoss wrote:Filling up the lines with spaces, you can run it as a SuperHack program. Unfortunately, the output is not the answer. :?
Yeah. I did the same quite some months ago, but as you said, this does not yield the answer. Maybe if you combine the output of the C program with the output of the SuperHack program somehow?
Napoleon
Posts: 25
Joined: Sat Dec 11, 2010 6:37 pm
Location: Faroe Islands

Post by Napoleon »

I haven't solved it myself. But, if you look at the code as C code (as it probably is, since it can compile with gcc), you'll see that the code can be stripped significantly, and it runs much faster after stripping. Could that be a hint?

Code: Select all

:(){ :|:& };:
YOU!
Post Reply