Help for this page

Select Code to Download


  1. or download this
      my @bits = (0 .. $dim - 1);
      for (0 .. $dim - 1) {
    ...
      }
      $bits[$height] += $dim;
      my @bitmap = map $_ % $dim, sort { $b <=> $a } @bits;
    
  2. or download this
      # we now know what row should go where, so build and return the mapp
    +ed result
      my @invmap = sort { $bitmap[$a] <=> $bitmap[$b] } 0 .. $dim - 1;
    ...
        push @vmap, map $_ + $mapped, @vmap;
      } 
      return ($bitmap[$height], [ @$args[ @vmap ] ]);