Next | Program Repair Shop | 171 |
Glancing over the program, this looks like a nice fat target
Two big blocks like this one:
360 foreach $x (0..2) { 361 if ( 362 ($squares->[$x][0] eq $squares->[$x][1]) and 363 ($squares->[$x][1] eq $squares->[$x][2]) 364 ) { 365 $winner = $squares->[$x][0]; 366 return $winner; 367 } 368 } ...
Also a special case for the diagonals
There are only 8 ways to win in Tic-Tac-Toe
How can an analysis of 8 items require 21 lines?
Next | Copyright © 2002 M. J. Dominus |