-Sat Apr 8 15:42:33 JST 2006 Daigo Moriwaki <daigo@debian.org>
+2006-04-28 Daigo Moriwaki <daigo at debian dot org>
- * Support CSA Protocal Version 1.1.
+ * Jishogi kachi declaration did not work. This bug has been fixed.
+ Add debug lines to show a jishogi state.
+
+2006-04-08 Daigo Moriwaki <daigo at debian dot org>
+
+ * Support CSA Protocol Version 1.1.
* Change the declaration of Jishogi 1.1.
-Fri Mar 10 23:09:43 JST 2006 Daigo Moriwaki <daigo@debian.org>
+2006-03-10 Daigo Moriwaki <daigo at debian dot org>
* Kifu logs are always written in separate files.
* Add a test case, test/TC_functional.rb
end
def good_kachi?(sente)
- return false if (checkmated?(sente))
+ if (checkmated?(sente))
+ puts "'NG: Checkmating." if $DEBUG
+ return false
+ end
+
ou = look_for_ou(sente)
- return false if (sente && (ou.y >= 4))
- return false if (! sente && (ou.y <= 6))
-
+ if (sente && (ou.y >= 4))
+ puts "'NG: Black's OU does not enter yet." if $DEBUG
+ return false
+ end
+ if (! sente && (ou.y <= 6))
+ puts "'NG: White's OU does not enter yet." if $DEBUG
+ return false
+ end
+
number = 0
point = 0
point = point + piece.point
end
- return false if (number < 10)
+ if (number < 10)
+ puts "'NG: Piece#[%d] is too small." % [number] if $DEBUG
+ return false
+ end
if (sente)
- return false if (point < 28)
+ if (point < 28)
+ puts "'NG: Black's point#[%d] is too small." % [point] if $DEBUG
+ return false
+ end
else
- return false if (point < 27)
+ if (point < 27)
+ puts "'NG: White's point#[%d] is too small." % [point] if $DEBUG
+ return false
+ end
end
+
+ puts "'Good: Piece#[%d], Point[%d]." % [number, point] if $DEBUG
return true
end
- def handle_one_move(str)
+ def handle_one_move(str, sente)
if (str =~ /^([\+\-])(\d)(\d)(\d)(\d)([A-Z]{2})/)
sg = $1
x0 = $2.to_i
y1 = $5.to_i
name = $6
elsif (str =~ /^%KACHI/)
- if (@sente == @current_player)
- sente = true
- else
- sente = false
- end
if (good_kachi?(sente))
return :kachi_win
else
end
# begin
- move_status = @board.handle_one_move(str)
+ move_status = @board.handle_one_move(str, @sente == @current_player)
# rescue
# log_error("handle_one_move raise exception for #{str}")
# move_status = :illegal