+2006-08-14 Daigo Moriwaki <daigo at debian dot org>
+
+ * [mk_rate] Record numbers of win/loss games.
+ * Add mk_html, which genrates html from players.haml
+ * Fix test/test_board.rb. Now it works.
+ * Add test/TC_ALL.rb to run all test cases.
+
2006-08-11 Daigo Moriwaki <daigo at debian dot org>
* Add mk_rate, which calculate rating scores.
rating.integer!
yaml = {}
- keys.each_with_index do |p, i|
+ keys.each_with_index do |p, i| # player_id, index#
+ win_loss = $players[p].values.inject(Vector[0,0]) {|sum, v| sum + v}
+ win = win_loss_matrix
yaml[p] =
{ 'name' => p.split("+")[0],
'rate' => rating.rate[i],
- 'last_modified' => $players_time[p]}
+ 'last_modified' => $players_time[p],
+ 'win' => win_loss[0],
+ 'loss' => win_loss[1]}
end
puts yaml.to_yaml
end
return true
end
- def handle_one_move(str, sente)
+ def handle_one_move(str, sente=nil)
if (str =~ /^([\+\-])(\d)(\d)(\d)(\d)([A-Z]{2})/)
sg = $1
x0 = $2.to_i
y1 = $5.to_i
name = $6
elsif (str =~ /^%KACHI/)
+ raise ArgumentError, "sente is null", callser unless sente
if (good_kachi?(sente))
return :kachi_win
else
end
end
+# TODO This is also checked by good_game_name?().
def good_identifier?(str)
if str =~ /\A[\w\d_@\-\.]{1,#{Max_Identifier_Length}}\z/
return true