Dominik K :: lightgambler.py

This bot has played 390 games (150 wins / 13 draws / 227 losses).

Play against this bot as X or as O.

These bots have done best aganist lightgambler.py...

Bot P W D L Points Size From beginner One hit wonder Goldfish
Martijn Pieters : : zopatista.py (v9) 10 10 0 0 10 2649 False False False
Robert Seaman : : not_minimax.py (v25) 10 9 1 0 9 3501 False False True
Séverin Hatt : : romuald_no_last_check.py (v1) 10 9 0 1 8 1598 False False True
Sergey Kolosov : : sergeykolosov_0004.py 10 9 0 1 8 146 False True True
Robert Howlett : : smart11.py (v1) 10 8 1 1 7 191 False False True

...and these bots have done worst

Bot P W D L Points Size From beginner One hit wonder Goldfish
James Campbell : : horrible.py (v4) 10 0 0 10 -10 246 False False True
Ronan Murphy : : loser.py 10 0 0 10 -10 105 False False True
Luke Spademan : : lossingbot.py (v3) 10 0 0 10 -10 129 False False True
house : : opportunist.py 10 0 0 10 -10 None None None None
Peter Inglesby : : random.py 10 0 0 10 -10 26 False True True

All standings against lightgambler.py

The code

      
import copy
import random
from botany_connectfour import game

def gaussian_move():
    cand = None
    while cand is None:
        cand = int(random.gauss(3.5, 1))
        if cand >= 7 or cand < 0 :
            cand = None
    return cand

def get_next_move(board, token):
    available_moves = game.available_moves(board)
    if token == 'X':
        other_token = 'O'
    else:
        other_token = 'X'

    for col in available_moves:
        board1 = copy.deepcopy(board)
        game.make_move(board1, col, other_token)
        if game.check_winner(board1) is not None:
            return col

    gm = gaussian_move()
    if gm in available_moves:
        return gm
    else:
        return random.choice(available_moves)