OSDN Git Service

* [shogi-server]
authorbeatles <beatles@b8c68f68-1e22-0410-b08e-880e1f8202b4>
Wed, 8 Oct 2008 13:54:27 +0000 (13:54 +0000)
committerbeatles <beatles@b8c68f68-1e22-0410-b08e-880e1f8202b4>
Wed, 8 Oct 2008 13:54:27 +0000 (13:54 +0000)
  - Ruby 1.8.7 (or later) must be used. Ruby 1.8.6 is not supported.
  - Daemon mode is available.
  - shogi_server/piece_ky.rb is again merged with
    shogi_server/piece.rb, then has been removed.
  - Added a test case, TC_usi.rb.

changelog
shogi_server.rb
shogi_server/piece.rb
shogi_server/piece_ky.rb [deleted file]
shogi_server/pieceky.rb [deleted file]
showgame/controller/main.rb
test/TC_board.rb
test/TC_usi.rb

index 6196aca..72e0bfb 100644 (file)
--- a/changelog
+++ b/changelog
@@ -1,3 +1,12 @@
+2008-10-08 Daigo Moriwaki <daigo at debian dot org>
+
+       * [shogi-server]
+         - Ruby 1.8.7 (or later) must be used. Ruby 1.8.6 is not supported.
+         - Daemon mode is available.
+         - shogi_server/piece_ky.rb is again merged with
+           shogi_server/piece.rb, then has been removed.  
+         - Added a test case, TC_usi.rb.
+
 2008-06-30 Daigo Moriwaki <daigo at debian dot org>
 
        * [shogi-server]
index 4b1b39a..3268222 100644 (file)
@@ -34,7 +34,6 @@ require 'shogi_server/game'
 require 'shogi_server/league'
 require 'shogi_server/login'
 require 'shogi_server/piece'
-require 'shogi_server/pieceky'
 require 'shogi_server/player'
 require 'shogi_server/timeout_queue'
 require 'shogi_server/usi'
index 4275c0b..93d085f 100644 (file)
@@ -203,6 +203,52 @@ class PieceFU < Piece
   end
 end
 
+class PieceKY  < Piece
+  def initialize(*arg)
+    @point = 1
+    @normal_moves = []
+    @promoted_moves = [[0, +1], [+1, +1], [-1, +1], [+1, +0], [-1, +0], [0, -1]]
+    @name = "KY"
+    @promoted_name = "NY"
+    super
+  end
+  def room_of_head?(x, y, name)
+    if (name == "KY")
+      if (@sente)
+        return false if (y == 1)
+      else
+        return false if (y == 9)
+      end
+    end
+    return true
+  end
+  def far_movable_grids
+    grids = Array::new
+    if (@promoted)
+      return []
+    else
+      if (@sente)                 # up
+        cand_x = @x
+        cand_y = @y - 1
+        while (jump_to?(cand_x, cand_y))
+          grids.push([cand_x, cand_y])
+          break if (! put_to?(cand_x, cand_y))
+          cand_y = cand_y - 1
+        end
+      else                        # down
+        cand_x = @x
+        cand_y = @y + 1
+        while (jump_to?(cand_x, cand_y))
+          grids.push([cand_x, cand_y])
+          break if (! put_to?(cand_x, cand_y))
+          cand_y = cand_y + 1
+        end
+      end
+      return grids
+    end
+  end
+end
+
 class PieceKE  < Piece
   def initialize(*arg)
     @point = 1
diff --git a/shogi_server/piece_ky.rb b/shogi_server/piece_ky.rb
deleted file mode 100644 (file)
index f21c671..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-module ShogiServer
-
-class PieceKY  < Piece
-  def initialize(*arg)
-    @point = 1
-    @normal_moves = []
-    @promoted_moves = [[0, +1], [+1, +1], [-1, +1], [+1, +0], [-1, +0], [0, -1]]
-    @name = "KY"
-    @promoted_name = "NY"
-    super
-  end
-  def room_of_head?(x, y, name)
-    if (name == "KY")
-      if (@sente)
-        return false if (y == 1)
-      else
-        return false if (y == 9)
-      end
-    end
-    return true
-  end
-  def far_movable_grids
-    grids = Array::new
-    if (@promoted)
-      return []
-    else
-      if (@sente)                 # up
-        cand_x = @x
-        cand_y = @y - 1
-        while (jump_to?(cand_x, cand_y))
-          grids.push([cand_x, cand_y])
-          break if (! put_to?(cand_x, cand_y))
-          cand_y = cand_y - 1
-        end
-      else                        # down
-        cand_x = @x
-        cand_y = @y + 1
-        while (jump_to?(cand_x, cand_y))
-          grids.push([cand_x, cand_y])
-          break if (! put_to?(cand_x, cand_y))
-          cand_y = cand_y + 1
-        end
-      end
-      return grids
-    end
-  end
-end
-
-end
diff --git a/shogi_server/pieceky.rb b/shogi_server/pieceky.rb
deleted file mode 100644 (file)
index f21c671..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-module ShogiServer
-
-class PieceKY  < Piece
-  def initialize(*arg)
-    @point = 1
-    @normal_moves = []
-    @promoted_moves = [[0, +1], [+1, +1], [-1, +1], [+1, +0], [-1, +0], [0, -1]]
-    @name = "KY"
-    @promoted_name = "NY"
-    super
-  end
-  def room_of_head?(x, y, name)
-    if (name == "KY")
-      if (@sente)
-        return false if (y == 1)
-      else
-        return false if (y == 9)
-      end
-    end
-    return true
-  end
-  def far_movable_grids
-    grids = Array::new
-    if (@promoted)
-      return []
-    else
-      if (@sente)                 # up
-        cand_x = @x
-        cand_y = @y - 1
-        while (jump_to?(cand_x, cand_y))
-          grids.push([cand_x, cand_y])
-          break if (! put_to?(cand_x, cand_y))
-          cand_y = cand_y - 1
-        end
-      else                        # down
-        cand_x = @x
-        cand_y = @y + 1
-        while (jump_to?(cand_x, cand_y))
-          grids.push([cand_x, cand_y])
-          break if (! put_to?(cand_x, cand_y))
-          cand_y = cand_y + 1
-        end
-      end
-      return grids
-    end
-  end
-end
-
-end
index 0a86bdb..fc726e4 100644 (file)
@@ -6,7 +6,6 @@
 # this will force the controller to be mounted on: /otherurl
 
 require File.join(__DIR__, "..", "..", "shogi_server", "piece")
-require File.join(__DIR__, "..", "..", "shogi_server", "piece_ky")
 require File.join(__DIR__, "..", "..", "shogi_server", "board")
 require File.join(__DIR__, "..", "..", "shogi_server", "usi")
 
index 8001108..f55a83c 100644 (file)
@@ -3,7 +3,6 @@ $:.unshift File.join(File.dirname(__FILE__), "..")
 require 'test/unit'
 require 'shogi_server'
 require 'shogi_server/board'
-require 'shogi_server/piece_ky'
 require 'shogi_server/piece'
 
 module ShogiServer
index 28ab8cf..360956c 100644 (file)
@@ -3,7 +3,6 @@ $:.unshift File.join(File.dirname(__FILE__), "..")
 require 'test/unit'
 require 'shogi_server'
 require 'shogi_server/board'
-require 'shogi_server/piece_ky'
 require 'shogi_server/piece'
 
 class TestUsi < Test::Unit::TestCase