Commits

Shlomi Fish  committed 14ea2b7

Add more.

  • Participants
  • Parent commits e3f60a3

Comments (0)

Files changed (2)

File project-euler/466/euler-466-experimental-with-modulo-bit-vec.pl

                     vec($lookup_vec, 0, 1) = 1;
                 }
 
-                print "prev_rows_and_step_lcm == $prev_rows_and_step_lcm\n";
+                # print "prev_rows_and_step_lcm == $prev_rows_and_step_lcm\n";
 
                 foreach my $prev_row (@prev_rows)
                 {
                         $step_i += $step;
                     }
                 }
-                # push @counts, $counts[-1];
-                #
 
                 my $_calc_num_mods_loop = sub {
                     my ($s, $e) = @_;
 my_test(18, 100, 824);
 }
 
-if (1)
+if (1 and !$DEBUG)
+{
+my_test(32, (('1'.('0'x15))+0), 13826382602124302);
+}
+
+if (0)
 {
 my_test(64, 64, 1263);
 }
 
-if (0 and !$DEBUG)
-{
-my_test(32, (('1'.('0'x15))+0), 13826382602124302);
-}

File project-euler/466/euler-466-v2.pl

 use List::Util qw(first sum min);
 use List::MoreUtils qw(none);
 
-my $DEBUG = 1;
+my $DEBUG = 0;
 
 sub calc_P
 {
     my $got = calc_P($MIN, $MAJ);
 
     print "P($MIN, $MAJ) = $got (should be $expected)\n";
+
+    if ($got != $expected)
+    {
+        die "Got: $got ; Expected: $expected.";
+    }
+
+    return 1;
 }
 
 my_test(3, 4, 8);