OSDN Git Service

players who never win or lose are not rated
authorbeatles <beatles@b8c68f68-1e22-0410-b08e-880e1f8202b4>
Mon, 2 Oct 2006 04:09:30 +0000 (04:09 +0000)
committerbeatles <beatles@b8c68f68-1e22-0410-b08e-880e1f8202b4>
Mon, 2 Oct 2006 04:09:30 +0000 (04:09 +0000)
changelog
mk_rate

index 12a6e7c..d1b1a7a 100644 (file)
--- a/changelog
+++ b/changelog
@@ -1,3 +1,8 @@
+2006-10-02  Daigo Moriwaki <daigo at debian dot org>
+
+       * [mk_rate] players who never win or lose are not rated in order
+         the calculation to complete.
+
 2006-09-30  Daigo Moriwaki <daigo at debian dot org>
 
        * [shogi-server] The CSA mode supports the trip in a password.
@@ -28,7 +33,7 @@
 
        * [shogi-server]
          - Re-design: trip is now a suffix of the password, not name.
-         - Sipmlyfiled the output of %%RATING.
+         - Simplified the output of %%RATING.
        * [mk_rate]
          - Support "@" indentificaton in a name; players with same
            before-@-names are mapped to one.
diff --git a/mk_rate b/mk_rate
index bc6186d..8fc498a 100755 (executable)
--- a/mk_rate
+++ b/mk_rate
@@ -346,7 +346,9 @@ end
 
 def mk_win_loss_matrix(players)
   keys = players.keys.sort.reject do |k|
-    players[k].values.inject(0) {|sum, v| sum + v[0] + v[1]} < $GAMES_LIMIT
+    players[k].values.inject(0) {|sum, v| sum + v[0] + v[1]} < $GAMES_LIMIT ||
+    players[k].values.inject(0) {|sum, v| sum + v[0]} < 1 || # Never win
+    players[k].values.inject(0) {|sum, v| sum + v[1]} < 1    # Never lose
   end
 
   size = keys.size