class Board
+ # Initial board setup.
+ # The string ends with '+', not a line break.
+ #
+ INITIAL_HIRATE_POSITION = (<<-EOF).chomp
+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
++
+EOF
+
# Split a moves line into an array of a move string.
# If it fails to parse the moves, it raises WrongMoves.
# @param moves a moves line. Ex. "+776FU-3334Fu"
return ret
end
+
def initialize(move_count=0)
@sente_hands = Array::new
@gote_hands = Array::new
return :normal
end
+ # Return a CSA-styled string notation of the current position.
+ #
def to_s
a = Array::new
y = 1
a.push("%s\n" % [@teban ? "+" : "-"])
return a.join
end
+
+ # Return a CSA-styled string notation of the initial position.
+ #
+ def initial_string
+ tmp_board = self.class.new
+ tmp_board.initial
+ return tmp_board.to_s
+ end
end
end # ShogiServer