Skip to content

Instantly share code, notes, and snippets.

@ellehallal
Last active April 21, 2019 15:43
Show Gist options
  • Save ellehallal/53e7ae5c796d415632391223d5e3fb83 to your computer and use it in GitHub Desktop.
Save ellehallal/53e7ae5c796d415632391223d5e3fb83 to your computer and use it in GitHub Desktop.
def score_move(board, depth, current_player, opponent)
if board.winning_line?(current_player)
10 - depth
elsif board.winning_line?(opponent)
depth - 10
elsif board.complete?
0
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment