start of percentage tracker
This commit is contained in:
parent
29b6987759
commit
a1f48682c0
|
@ -238,7 +238,7 @@ class Board
|
||||||
search_do(team, @top_depth)
|
search_do(team, @top_depth)
|
||||||
end
|
end
|
||||||
|
|
||||||
def search_do(team, depth)
|
def search_do(team, depth, percent)
|
||||||
if depth == 0
|
if depth == 0
|
||||||
puts "DONE"
|
puts "DONE"
|
||||||
return {TEAM_1 => @stats[TEAM_1]['count'], TEAM_2 => @stats[TEAM_2]['count']}
|
return {TEAM_1 => @stats[TEAM_1]['count'], TEAM_2 => @stats[TEAM_2]['count']}
|
||||||
|
@ -262,7 +262,11 @@ class Board
|
||||||
if moves == []
|
if moves == []
|
||||||
puts "NO MOVES AVAILABLE?"
|
puts "NO MOVES AVAILABLE?"
|
||||||
else
|
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
|
if results[opposite_team(team)] == 0
|
||||||
return {team => max, opposite_team(team) => 0}
|
return {team => max, opposite_team(team) => 0}
|
||||||
elsif results[team] == max
|
elsif results[team] == max
|
||||||
|
|
Loading…
Reference in New Issue