Help for this page

Select Code to Download


  1. or download this
    sub up
      {
    ...
        ($row * $col > 0 && up( ~-$row . '-' . ~-$col, @_ ) ) .
          ($row > $col && up( ~-$row . '-' . $col, @_ ) );
      }
    
  2. or download this
    sub up{
            # indent to evidentiate the recursive function level
    ...
                ($row > $col && up( ~-$row . '-' . $col, @_ ) );
            } 
    }
    
  3. or download this
    @_ = [3-1]
    3 * 1 > 0 && up(2-0, 3-1) # decremented both row and column are passed
    + plus original @_
    ...
                RETURNING: @_ is a valid path [0-0 1-1 2-1 3-1]
            1 > 1 is FALSE...
    "0-0 1-0 2-0 3-1\n0-0 1-0 2-1 3-1\n0-0 1-1 2-1 3-1\n"
    
  4. or download this
    # receives and returns aoa
     sub up_modified{
    ...
            );
        }    
    }
    
  5. or download this
    @_ is [[3, 1]]
    receiving row 3 col 1
    ...
                @_ is [[0, 0], [1, 1], [2, 1], [3, 1]]
                receiving row 0 col 0
                RETURNING: [[0, 0], [1, 1], [2, 1], [3, 1]]
    
  6. or download this
     sub up_modified_bis{
        my $ind = ' ' x $#_ x 4;
    ...
                @_ is ([0, 0], [1, 1], [2, 1], [3, 1])
                receiving row 0 col 0
                RETURNING: ([0, 0], [1, 1], [2, 1], [3, 1])