Short cleanup
This commit is contained in:
parent
eb5e6771b6
commit
4a8d1c8d1e
6
bot.rb
6
bot.rb
|
@ -9,9 +9,6 @@ class Bot
|
|||
end
|
||||
|
||||
def move board
|
||||
|
||||
return "\nGame is done!" if board.is_full?
|
||||
return "\nSomeone won!" if board.any_winner?
|
||||
minmax board, @piece
|
||||
board.set @piece, @best_choice
|
||||
end
|
||||
|
@ -53,8 +50,7 @@ class Bot
|
|||
end
|
||||
|
||||
def score board
|
||||
#p @piece
|
||||
#p @opponent
|
||||
|
||||
if board.is_winner? @piece
|
||||
return 10
|
||||
elsif board.is_winner? @opponent
|
||||
|
|
Loading…
Reference in New Issue
Block a user