Skip to content

Instantly share code, notes, and snippets.

@amanahuja
Created June 5, 2011 22:57
Show Gist options
  • Save amanahuja/1009516 to your computer and use it in GitHub Desktop.
Save amanahuja/1009516 to your computer and use it in GitHub Desktop.
Algorithm for always playing in Column Four
##
# This function calculates my bot's move in connect four algorithm
# returned mymove indicates what column to play on
# passed variable opponentmove should be the column the opponent just play on
#
# www.code-wars.com
def calculate_my_move (opponentmove):
if opponentmove = anything_at_all:
mymove = 4
return mymove
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment