Sha256: 871924c3587158d3e05441a6aece7477145600725ed805c515b19ba2966061c4

Contents?: true

Size: 1.53 KB

Versions: 8

Compression:

Stored size: 1.53 KB

Contents

class Bishop < Piece
  MOVE_DIRECTIONS = [
    [1, 1], [1, -1], [-1, 1], [-1, -1]
  ].freeze

  BLACK = '♝'
  WHITE = '♗'

  VALUE = 330

  WHITE_LOCATION_VALUE = [
    [-20, -10, -10, -10, -10, -10, -10, -20],
    [-10, 0, 0, 0, 0, 0, 0, -10],
    [-10, 0, 5, 10, 10, 5, 0, -10],
    [-10, 5, 5, 10, 10, 5, 5, -10],
    [-10, 0, 10, 10, 10, 10, 0, -10],
    [-10, 10, 10, 10, 10, 10, 10, -10],
    [-10, 5, 0, 0, 0, 0, 5, -10],
    [-20, -10, -10, -10, -10, -10, -10, -20]
  ].freeze

  BLACK_LOCATION_VALUE = [
    [-20, -10, -10, -10, -10, -10, -10, -20],
    [-10, 5, 0, 0, 0, 0, 5, -10],
    [-10, 10, 10, 10, 10, 10, 10, -10],
    [-10, 0, 10, 10, 10, 10, 0, -10],
    [-10, 5, 5, 10, 10, 5, 5, -10],
    [-10, 0, 5, 10, 10, 5, 0, -10],
    [-10, 0, 0, 0, 0, 0, 0, -10],
    [-20, -10, -10, -10, -10, -10, -10, -20]
  ].freeze

  WHITE_LOCATION_VALUE_EASY = [
    [-20, -10, -10, -10, -10, -10, -10, -20],
    [-10, 0, 0, 0, 0, 0, 0, -10],
    [-10, 0, 5, 15, 15, 5, 0, -10],
    [-10, 5, 5, 50, 50, 5, 5, -10],
    [-10, 0, 20, 50, 50, 20, 0, -10],
    [-10, 10, 20, 50, 50, 20, 10, -10],
    [-10, 5, 0, 0, 0, 0, 5, -10],
    [-20, -10, -10, -10, -10, -10, -10, -20]
  ].freeze

  BLACK_LOCATION_VALUE_EASY = [
    [-20, -10, -10, -10, -10, -10, -10, -20],
    [-10, 5, 0, 0, 0, 0, 5, -10],
    [-10, 10, 20, 50, 50, 20, 10, -10],
    [-10, 0, 20, 50, 50, 20, 0, -10],
    [-10, 5, 5, 50, 50, 5, 5, -10],
    [-10, 0, 5, 15, 15, 5, 0, -10],
    [-10, 0, 0, 0, 0, 0, 0, -10],
    [-20, -10, -10, -10, -10, -10, -10, -20]
  ].freeze

  include SlidePattern
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
sapphire-chess-1.1.7 lib/sapphire-chess/pieces/bishop.rb
sapphire-chess-1.1.6 lib/sapphire-chess/pieces/bishop.rb
sapphire-chess-1.1.5 lib/sapphire-chess/pieces/bishop.rb
sapphire-chess-1.1.4 lib/sapphire-chess/pieces/bishop.rb
sapphire-chess-1.1.3 lib/sapphire-chess/pieces/bishop.rb
sapphire-chess-1.1.2 lib/sapphire-chess/pieces/bishop.rb
sapphire-chess-1.1.1 lib/sapphire-chess/pieces/bishop.rb
sapphire-chess-1.1.0 lib/sapphire-chess/pieces/bishop.rb