To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.off-topic.geekOpen lugnet.off-topic.geek in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Off-Topic / Geek / 1998
1997  |  1999
Subject: 
Re: Programming Brain Teaser
Newsgroups: 
lugnet.off-topic.geek
Date: 
Thu, 7 Sep 2000 07:06:39 GMT
Viewed: 
126 times
  
In lugnet.off-topic.geek, Richard Marchetti writes:
Hey Y'all:

Someone posed the following teaser to me, and I admit that it has stumped me
completely.  It has even stumped my programmer buddies (which creates doubt in
my mind that there IS actually a solution to the puzzle).

The question was posed thusly:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
What line of code written either in C, C++, or Perl will compile written
forward as well as backwards?  The following was submitted as an example of
the FORM of the answer, while not itself being the answer:

#include <stdio.h>
#include <stdlib.h>
#include <time.h>

void rof(void) {};

void main(){
int C;

C = 0
// line below
; for (C;C;C) rof;
// Ok so its lame
}
// Should be valid in perl too, but I am not sure.
Just an off the cuff answer.
DaveG



Message has 1 Reply:
  Re: Programming Brain Teaser
 
(...) And a good one. Thanks for the replies. I think I am beginning to see some ways into it that I hadn't thought of. The way I was understanding the puzzle (and you know that people have a tendency to explain things quite poorly AND I tried to (...) (24 years ago, 7-Sep-00, to lugnet.off-topic.geek)

Message is in Reply To:
  Programming Brain Teaser
 
Hey Y'all: Someone posed the following teaser to me, and I admit that it has stumped me completely. It has even stumped my programmer buddies (which creates doubt in my mind that there IS actually a solution to the puzzle). The question was posed (...) (24 years ago, 7-Sep-00, to lugnet.off-topic.geek)

19 Messages in This Thread:







Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR