chiark / gitweb /
seems to work
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 2 Feb 2014 22:09:39 +0000 (22:09 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 2 Feb 2014 22:09:39 +0000 (22:09 +0000)
parse

diff --git a/parse b/parse
index 53771ce8896e81710192587a8f21ff8507556219..222c40f721734c22a72f91aec21474466bb81f0a 100755 (executable)
--- a/parse
+++ b/parse
@@ -214,22 +214,19 @@ foreach my $ia (chremain()) {
 
 sub chvab ($$) {
     my ($ca,$cb) = @_;
 
 sub chvab ($$) {
     my ($ca,$cb) = @_;
-print " [chvab($ca,$cb)=";
     my $v = $vab[ $choices{$ca}{Index} ][ $choices{$cb}{Index} ];
     my $v = $vab[ $choices{$ca}{Index} ][ $choices{$cb}{Index} ];
-printf "%d]", scalar @$v;
     return scalar @$v;
 }
 
 sub weaker ($$) {
     # A.6(7)(1)
     my ($def1,$def2) = @_;
     return scalar @$v;
 }
 
 sub weaker ($$) {
     # A.6(7)(1)
     my ($def1,$def2) = @_;
-print "@$def1 <=WEAKER?=> @$def2  ";
     my ($ca,$cx) = @$def1;
     my ($cb,$cy) = @$def2;
     my ($ca,$cx) = @$def1;
     my ($cb,$cy) = @$def2;
-    ((print "Y1\n"), return 1) if chvab($ca, $cx) < chvab($cb, $cy);
-    ((print "Y2\n"), return 1) if chvab($ca, $cx) == chvab($cb, $cy)
-                             && chvab($cx, $ca) > chvab($cy, $cb);
-    ((print "N\n"), return 0);
+    return 1 if chvab($ca, $cx) < chvab($cb, $cy);
+    return 1 if chvab($ca, $cx) == chvab($cb, $cy)
+              && chvab($cx, $ca) > chvab($cy, $cb);
+    return 0;
 }
 
 our $schwartz;
 }
 
 our $schwartz;
@@ -284,16 +281,16 @@ for (;;) {
     last unless @weakest;
 
     my $w = $weakest[0];
     last unless @weakest;
 
     my $w = $weakest[0];
-    printf "weakest defeats %d > %d\n", 
+    printf "weakest defeats are %d > %d\n", 
         chvab($w->[0], $w->[1]),
        chvab($w->[1], $w->[0]);
     foreach my $weakest (@weakest) {
        my ($ca,$cb) = @$weakest;
         chvab($w->[0], $w->[1]),
        chvab($w->[1], $w->[0]);
     foreach my $weakest (@weakest) {
        my ($ca,$cb) = @$weakest;
-       print "weakest defeat $ca > $cb\n";
+       print "a weakest defeat is $ca > $cb\n";
        $defeats->delete_edge($ca,$cb);
     }
 
        $defeats->delete_edge($ca,$cb);
     }
 
-    print "defeats within the Schwartz set, round again\n";
+    print "\nDefeats within the Schwartz set, go round again\n";
 }
 
 print "no defeats within the Schwartz set\n";
 }
 
 print "no defeats within the Schwartz set\n";