Class: NeuroGammon::LazyPlayer

Inherits:
BasePlayer show all
Defined in:
lib/neuro_gammon/lazy_player.rb

Instance Attribute Summary

Attributes inherited from BasePlayer

#id, #name

Instance Method Summary collapse

Constructor Details

#initializeLazyPlayer

Returns a new instance of LazyPlayer.



11
12
13
# File 'lib/neuro_gammon/lazy_player.rb', line 11

def initialize
  super
end

Instance Method Details

#suggest_move(board, dice, colour) ⇒ Object



15
16
17
18
19
20
21
22
23
# File 'lib/neuro_gammon/lazy_player.rb', line 15

def suggest_move board,dice,colour
  valid=board.valid_moves(colour, dice)
  if (valid.size>0)
    move=valid.first
    return move
  else
    return nil
  end
end