@@mutex = Mutex.new
@@time = 0
- # Decide turns of players according to their turn preferences.
+ # Decide an actual turn of each player according to their turn preferences.
# p2 is a rival player of the p1 player.
# p1_sente_string must be "*", "+" or "-".
+ # After this call, the sente value of each player is always true or false, not
+ # nil.
#
def Game.decide_turns(p1, p1_sente_string, p2)
if ((p1_sente_string == "*") && (p2.sente == nil))
now = Time.now.strftime("%Y/%m/%d %H:%M:%S")
@fh.puts("$START_TIME:#{now}")
- @fh.print <<EOM
-P1-KY-KE-GI-KI-OU-KI-GI-KE-KY
-P2 * -HI * * * * * -KA *
-P3-FU-FU-FU-FU-FU-FU-FU-FU-FU
-P4 * * * * * * * * *
-P5 * * * * * * * * *
-P6 * * * * * * * * *
-P7+FU+FU+FU+FU+FU+FU+FU+FU+FU
-P8 * +KA * * * * * +HI *
-P9+KY+KE+GI+KI+OU+KI+GI+KE+KY
-+
-EOM
+ @fh.print(@board.initial_string)
if rated?
black_name = @sente.rated? ? @sente.player_id : @sente.name
white_name = @gote.rated? ? @gote.player_id : @gote.name
Least_Time_Per_Move:#{Least_Time_Per_Move}
END Time
BEGIN Position
-#{Board::INITIAL_POSITION}
+#{@board.initial_string.chomp}
#{@board.initial_moves.collect {|m| m + ",T1"}.join("\n")}
END Position
END Game_Summary