+2008-03-16 Daigo Moriwaki <daigo at debian dot org>
+
+ * [shogi-server]
+ - Erroneously, Board#to_s's current player was always Black.
+ It caused wrong determination of sennichite since it did not
+ care about the current player of a state. This has been fixed.
+ Thanks Takada-san for reporting this bug.
+
2008-03-10 Daigo Moriwaki <daigo at debian dot org>
* [util/players-graph.rb]
@gote_history = Hash::new(0)
@array = [[], [], [], [], [], [], [], [], [], []]
@move_count = 0
+ @teban = nil # black => true, white => false
end
attr_accessor :array, :sente_hands, :gote_hands, :history, :sente_history, :gote_history
attr_reader :move_count
(1..9).each do |i|
PieceFU::new(self, i, 7, true)
end
+ @teban = true
end
def have_piece?(hands, name)
@array[x0][y0].move_to(x1, y1)
end
@move_count += 1
+ @teban = @teban ? false : true
return true
end
end
move_to(x0, y0, x1, y1, name, sente)
- str = to_s
update_sennichite(sente)
return :normal
end
a.push("\n")
end
- a.push("+\n")
+ a.push("%s\n" % [@teban ? "+" : "-"])
return a.join
end
end