chess-challenge:nyc-rock-doves-2015 国际象棋挑战赛

时间:2024-07-05 16:57:36
【文件属性】:

文件名称:chess-challenge:nyc-rock-doves-2015 国际象棋挑战赛

文件大小:23KB

文件格式:ZIP

更新时间:2024-07-05 16:57:36

Ruby

棋 使用面向对象的编程构建命令行国际象棋游戏。 概括 今天,让我们构建一个命令行国际象棋游戏。 下面是一个游戏开始的例子: (注意:ASCII 艺术可能在浏览器中有点不对齐)。 $ ruby chess.rb 8 ♜ ♞ ♝ ♛ ♚ ♝ ♞ ♜ 7 :chess_pawn: :chess_pawn: :chess_pawn: :chess_pawn: :chess_pawn: :chess_pawn: :chess_pawn: :chess_pawn: 6 5 4 3 2 ♙ ♙ ♙ ♙ ♙ ♙ ♙ ♙ 1 ♖ ♘ ♗ ♕ ♔ ♗ ♘ ♖ a b c d e f g h white's turn. white, your move? d2 moves for white pawn d2: d3, d4 white, move d2 where? d4 Ok, white's pawn d2 to d4. 如果捕获可用,程序会在列出移动时说明: 8 ♜ ♞


【文件预览】:
chess-challenge-master
----pawn.rb(1KB)
----square.rb(881B)
----bishop.rb(294B)
----piece.rb(4KB)
----board.rb(3KB)
----notation.rb(753B)
----knight.rb(1KB)
----view.rb(891B)
----coordinate.rb(163B)
----.rspec(30B)
----player.rb(146B)
----spec()
--------king_spec.rb(4KB)
--------bishop_spec.rb(2KB)
--------pawn_spec.rb(5KB)
--------board_spec.rb(3KB)
--------notation_spec.rb(2KB)
--------test.rb(2KB)
--------rook_spec.rb(4KB)
--------square_spec.rb(2KB)
--------pawn_promotion_test.rb(71B)
--------queen_spec.rb(4KB)
--------game_spec.rb(151B)
--------test_square.rb(101B)
--------piece_spec.rb(1KB)
--------spec_helper.rb(4KB)
----king.rb(2KB)
----queen.rb(335B)
----game.rb(6KB)
----rook.rb(288B)
----README.md(10KB)

网友评论