14 my @before = @nums[0..3];
15 my ($op, $a, $b, $c) = @nums[4..7];
16 my @after = @nums[8..11];
20 $match++ if ($before[$a] + $before[$b] == $after[$c]);
22 $match++ if ($before[$a] + $b == $after[$c]);
24 $match++ if ($before[$a] * $before[$b] == $after[$c]);
26 $match++ if ($before[$a] * $b == $after[$c]);
28 $match++ if (($before[$a] & $before[$b]) == $after[$c]);
30 $match++ if (($before[$a] & $b) == $after[$c]);
32 $match++ if (($before[$a] | $before[$b]) == $after[$c]);
34 $match++ if (($before[$a] | $b) == $after[$c]);
36 $match++ if ($before[$a] == $after[$c]);
38 $match++ if ($a == $after[$c]);
40 $match++ if (($a > $before[$b] ? 1 : 0) == $after[$c]);
42 $match++ if (($before[$a] > $b ? 1 : 0) == $after[$c]);
44 $match++ if (($before[$a] > $before[$b] ? 1 : 0) == $after[$c]);
46 $match++ if (($a == $before[$b] ? 1 : 0) == $after[$c]);
48 $match++ if (($before[$a] == $b ? 1 : 0) == $after[$c]);
50 $match++ if (($before[$a] == $before[$b] ? 1 : 0) == $after[$c]);
52 $total++ if $match >= 3;