Sha256: 7230ce91fc09e5691d51fc67a4b82779b48bc4291fab413416117ad2bbeb75ce

Contents?: true

Size: 379 Bytes

Versions: 2

Compression:

Stored size: 379 Bytes

Contents

module MCTS
  class Playout

    attr_reader :game_state

    def initialize(game_state)
      @game_state = game_state.dup
    end

    def play
      my_color = @game_state.last_turn_color
      playout
      @game_state.won?(my_color)
    end

    def playout
      until @game_state.finished?
        @game_state.set_move @game_state.generate_move
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rubykon-0.3.1 lib/mcts/playout.rb
rubykon-0.3.0 lib/mcts/playout.rb