Class: Computer

Inherits:
Player show all
Includes:
AI
Defined in:
lib/sapphire-chess/player.rb

Constant Summary

Constants included from OpeningsAndDefenses

OpeningsAndDefenses::DEFENSES, OpeningsAndDefenses::OPENINGS

Instance Attribute Summary collapse

Attributes inherited from Player

#board, #color, #history, #last_move

Instance Method Summary collapse

Methods inherited from Player

#initialize

Methods included from CastlingRights

#castle_rights?

Constructor Details

This class inherits a constructor from Player

Instance Attribute Details

#depthObject

depth: Levels of AI#minimax recursion. Deeper means harder (computer can think ‘depth` turns ahead) See Engine#set_difficulty



34
35
36
# File 'lib/sapphire-chess/player.rb', line 34

def depth
  @depth
end

Instance Method Details

#select_moveObject



36
37
38
# File 'lib/sapphire-chess/player.rb', line 36

def select_move
  computer_chooses_move
end