Subject:
|
Re: Programming Brain Teaser
|
Newsgroups:
|
lugnet.off-topic.geek
|
Date:
|
Thu, 7 Sep 2000 01:37:06 GMT
|
Viewed:
|
133 times
|
| |
| |
On Thu, Sep 07, 2000 at 01:00:57AM +0000, richard marchetti wrote:
> 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:
>
> print "abcdefghijklmnopqrstuvwxyz";
>
> ;"zyxwvutsrqponmlkjihgfedcba" tnirp
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> And again, it was asserted that both statements would compile.
it doesn't have to actually produce anything, right?
try this:
perl -e 'print ,"lalal", tnirp' e- lrep
:)
I seem to recall some JAPH's code that would actually do things and would
still qualify... but I can't find it yet...
:)
Dan
|
|
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
|
|
|
|