12 next unless ($_[0] > 0 and $_[0] < 31);
14 $spread = $_[1] - $_[2];
15 unless (defined $min_spread)
18 $min_spread = $spread;
20 if ($spread <= $min_spread)
23 $min_spread = $spread;
26 print $spread_day, "\n";
38 next unless ($_[0] > 0 and $_[0] < 21);
40 $spread = abs($_[6] - $_[8]);
41 unless (defined $min_spread)
44 $min_spread = $spread;
46 if ($spread <= $min_spread)
49 $min_spread = $spread;
52 print $spread_team, "\n";
64 my $label_col = shift;
65 my $alpha_col = shift;
68 my ($spread_label, $min_spread) = ("", 100000);
74 next unless ($_[$alpha_col] =~ /^[0-9]+/);
75 next unless ($_[$beta_col] =~ /^[0-9]+/);
76 my $label = $_[$label_col];
77 my $spread = abs($_[$alpha_col] - $_[$beta_col]);
78 unless (defined $min_spread)
81 $spread_label = $label;
82 $min_spread = $spread;
84 if ($spread <= $min_spread)
86 $spread_label = $label;
87 $min_spread = $spread;
94 print "part1: ", dm("../K4Weather.txt", 0, 1, 2), "\n";
95 print "part2: ", dm("../K4Soccer.txt", 1, 6, 8), "\n";
99 [[!tag CategoryCodeSnippets]]