Next Program Repair Shop 152

Repeated Code

     foreach $x(0..2) {
        if ($squares->[0][$x] eq "") {
           print_cell($squares, $page, $x, "0");
        }else {
           print ("<td>" . $squares->[0][$x] . "</td>\n");
        } 
     }
     for my $row (0..2) {
       for my $column (0..2) {
         if ($squares->[$row][$column] eq "") {
           print_cell($squares, $page, $column, $row);
         } else {
           print ("<td>" . $squares->[$row][$column] . "</td>\n");
         } 
       }
       print ("</tr><tr>\n") unless $row == 2;
     }


Next Copyright © 2002 M. J. Dominus