OSDN Git Service

Corrected namespace of GSL::Vector. This line is not reached, though.
[shogi-server/shogi-server.git] / shogi_server / board.rb
index be22ef1..d2b304b 100644 (file)
@@ -28,7 +28,7 @@ class Board
   # Initial board setup. 
   # The string ends with '+', not a line break.
   #
-  INITIAL_POSITION = (<<-EOF).chomp
+  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
@@ -675,6 +675,8 @@ EOF
     return :normal
   end
 
+  # Return a CSA-styled string notation of the current position.
+  #
   def to_s
     a = Array::new
     y = 1
@@ -711,6 +713,14 @@ EOF
     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