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