Class: NextNumberPositioner

Inherits:
Object
  • Object
show all
Defined in:
lib/threesmodel/next_number_positioner.rb

Overview

This class is responsible for selecting the number to add to a certain game board state and to select the cell where the number should go

Instance Method Summary collapse

Instance Method Details

#select_position(candidates) ⇒ Object

Selects one of the candidate positions to add the next number



6
7
8
# File 'lib/threesmodel/next_number_positioner.rb', line 6

def select_position(candidates)
    return candidates[rand(0..candidates.size - 1)]
end