start of percentage tracker
This commit is contained in:
parent
29b6987759
commit
a1f48682c0
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue