def testSearchValidConnection():
    """
    Routine to try out our connected dots searching algorithm. Also attempt to remove it from Board once a valid
    connection were found.
    """
    b = createRandomBoard()
    print("new board {}".format(b))

    conn = game.findAnyValidConnection(b)
    if conn is None:
        print("can't find any connection after max attempt")
    else:
        print("connection found.", conn)
        b.remove(conn)

    print("post removal {}".format(b))
Exemple #2
0
def testSearchValidConnection():
    """
    Routine to try out our connected dots searching algorithm. Also attempt to remove it from Board once a valid
    connection were found.
    """
    b = createRandomBoard()
    print("new board {}".format(b))

    conn = game.findAnyValidConnection(b)
    if conn is None:
        print("can't find any connection after max attempt")
    else:
        print("connection found.", conn)
        b.remove(conn)

    print("post removal {}".format(b))
def testFillHoles():
    """
    Routine to try filling up gaps on the Board after some removal attempts.
    """
    b = createRandomBoard()
    print("new board {}".format(b))

    conn = game.findAnyValidConnection(b)
    if conn is None:
        print("can't find any connection after max attempt")
    else:
        print("connection found.", conn)
        b.remove(conn)

    if conn is not None:
        print("post removal {}".format(b))

        b.fillHolesByGravity()
        print("post fillHolesByGravity {}".format(b))

        b.fillHolesWithNewCookies()
        print("post fillHolesWithNewCookies {}".format(b))
Exemple #4
0
def testFillHoles():
    """
    Routine to try filling up gaps on the Board after some removal attempts.
    """
    b = createRandomBoard()
    print("new board {}".format(b))

    conn = game.findAnyValidConnection(b)
    if conn is None:
        print("can't find any connection after max attempt")
    else:
        print("connection found.", conn)
        b.remove(conn)

    if conn is not None:
        print("post removal {}".format(b))

        b.fillHolesByGravity()
        print("post fillHolesByGravity {}".format(b))

        b.fillHolesWithNewCookies()
        print("post fillHolesWithNewCookies {}".format(b))