diff --git a/checkers.rb b/checkers.rb index 41c898d..e0c4f65 100644 --- a/checkers.rb +++ b/checkers.rb @@ -238,7 +238,7 @@ class Board search_do(team, @top_depth) end - def search_do(team, depth) + def search_do(team, depth, percent) if depth == 0 puts "DONE" return {TEAM_1 => @stats[TEAM_1]['count'], TEAM_2 => @stats[TEAM_2]['count']} @@ -262,7 +262,11 @@ class Board if moves == [] puts "NO MOVES AVAILABLE?" else - results = moves[0].search_do(opposite_team(team), depth -1) + item_percent = percent/moves.length + results = moves[0].search_do(opposite_team(team), depth -1, item_percent) + if item_percent >= 0.1 + # UM WE NEED PERCENT SO FAR + end if results[opposite_team(team)] == 0 return {team => max, opposite_team(team) => 0} elsif results[team] == max