blockmap.rb
# Calculate the minimal number of flips necessary to finish the current
# grid. Actually, it's not quite optimal, since I've beaten it several
# times!
Calculate the minimal number of flips necessary to finish the current
grid. Actually, it's not quite optimal, since I've beaten it several
times!
Calculate the minimal number of flips necessary to finish the current grid . Actually it ' s not quite optimal since I ' ve beaten it several times!
def calculate_minimal_flips
      @optimal = 0
      until game_over?
        change_colour(best_colour)
        @optimal += 1
      end
      reset
    end
def calculate_minimal_flips @optimal = 0 until game_over? change_colour ( best_colour ) @optimal += 1 end reset end
Calculate the minimal number of flips necessary to finish the current
grid.
Calculate the minimal number of flips necessary to finish the current grid .