Program that runs when rows and columns are transposed I posted this to The Daily WTF coder challenge forum a few years ago but only got one response. I figure CodeGolf stack exchange might generate more interest!

Description

Write a program that runs when the rows and columns of the source code are transposed. 

In other words, imagine each character on each line is a cell in a matrix (pad out shorter lines as necessary to make the matrix rectangular). Write a functioning program that still functions even if its "matrix" is transposed.

This is just a creative puzzle, not a golf.

Details


The program must execute without error and do something interesting*
The transpose of the program must execute without error and do something interesting, although not necessarily the same thing as the original.
Any language.
No shebang required.
Single row/single column entries disallowed.


*Interesting is the subjective opinion of the CodeGolf community.

Deadline April 15 2011

Trivial Example

Here's a really stupid example, but it illustrates the rules pretty well. Of course, any "symmetric" program will meet this challenge, but I encourage you to try non-symmetric programs.

# #####################
 print "hello,world\n";
#r
#i
#n
#t
#
#"
#h
#e
#l
#l
#o
#,
#w
#o
#r
#l
#d
#\
#n
#"
#;


Transposer Reference Implementation

Here's a perl snippet that does the type of transposing that I am talking about. This is not the objective of the puzzle, it is just a helper tool.

#!/usr/bin/perl
my @matrix;
open('SOURCE', $ARGV[0]);
my $matrixwidth = -1;
my $matrixheight = 0;
foreach (&lt;SOURCE&gt;) {
  chomp;
  if ($matrixwidth &lt; length $_) {$matrixwidth = length $_}
  my @row = split(//, $_);
  push @matrix, \@row;
  $matrixheight++;
}
foreach my $x (0 .. ($matrixwidth-1)) {
  foreach my $y (0 .. ($matrixheight-1)) {
    print(defined $matrix[$y]-&gt;[$x] ? $matrix[$y]-&gt;[$x] : ' ');
  }
  print "\n";
}
Here's one I came up with when I originally wrote the challenge a few years back. It's a perl script that can transpose other scripts. You can run it on itself, save the output as a new script, then run that new script on itself to get the original.

#######       p           $f f   ]'
#      ofm    u        $  ho o   -
#      poy    s        w  +r r  p&gt;'
#      er ####h########=##+ #   r[}
    open   'M' , $ARGV[ 0]  ; # i$p
  for(;   &lt;M&gt;  ; ){         #   nxr
      #((@             $  }( (  t]i
      #';r             #   $ $   ?n
      #M&lt;=    @        r   x y   $t
      #'M     m        +   = =   m
      # &gt;     ,        1   0 0   ["
my @r=   $_ =~ /./g;#  &gt;   ; ;   $\
      #  _ /  \                # yn
push @m,     \@r;              # ]"
      # ;=    r            $ $   -}
      #  ~    ;        $   x y   &gt;
$w=($#r   + 1&gt;        $w)      # [
?$#r+1:     $w ;$h++}# ?   &lt; &lt;   $
for (     $x=0 ;$x&lt;$w;         # x
          $x++ ){              # ]
for (     $y=0 ;$y&lt;$h;
          $y++ ){           #$
  print               #$   $ h  d:
defined                #   w ;  e
      #$)/    #        r   ; $  f
      #A{.             +   $ y  i
      #R#/             1   x +  n
      #G g             :   + +  e
      #V ;                 + )  d
     $m[  $y]-&gt;[$x]
      #0 #                 ) {  $
 ?$m[$y]-&gt;[$x]:' '}          #  m
      #)               $   {    [
      #;               w        $
  print "\n"} #        ;        y