Example #1
0
        PATH = list(BESTPATHS[playerLocation][CURRENTCOIN])
        PATH.pop()
        
        MOVING = True
    
    nextPos = PATH.pop()

    return ut.convertPosesToDir(nextPos, playerLocation, mazeMap)



####



if __name__ == "__main__" :

    # We let technical stuff happen
    (mazeWidth, mazeHeight, mazeMap, preparationTime, turnTime, playerLocation, opponentLocation, coins, gameIsOver) = api.initGame(BOT_NAME)


    initializationCode(mazeWidth, mazeHeight, mazeMap, preparationTime, playerLocation, opponentLocation, coins)
    
    # We decide how to move and wait for the next step
    while not gameIsOver :
        (playerLocation, opponentLocation, coins, gameIsOver) = api.processNextInformation()
        if gameIsOver :
            break
        nextMove = determineNextMove(mazeWidth, mazeHeight, mazeMap, turnTime, playerLocation, opponentLocation, coins)
        api.writeToPipe(nextMove)
Example #2
0
              "timeAllowed = " + str(timeAllowed) + "\n" +
              "playerLocation = " + str(playerLocation) + "\n" +
              "opponentLocation = " + str(opponentLocation) + "\n" +
              "coins = " + str(coins))


def determineNextMove(mazeWidth, mazeHeight, mazeMap, timeAllowed,
                      playerLocation, opponentLocation, coins):

    return api.UP


if __name__ == "__main__":

    # We let technical stuff happen
    (mazeWidth, mazeHeight, mazeMap, preparationTime, turnTime, playerLocation,
     opponentLocation, coins, gameIsOver) = api.initGame(BOT_NAME)

    initializationCode(mazeWidth, mazeHeight, mazeMap, preparationTime,
                       playerLocation, opponentLocation, coins)

    # We decide how to move and wait for the next step
    while not gameIsOver:
        (playerLocation, opponentLocation, coins,
         gameIsOver) = api.processNextInformation()
        if gameIsOver:
            break
        nextMove = determineNextMove(mazeWidth, mazeHeight, mazeMap, turnTime,
                                     playerLocation, opponentLocation, coins)
        api.writeToPipe(nextMove)
Example #3
0
        PATH = BESTPATHS[playerLocation][nextCoin]
        PATH.pop()
        
        MOVING = True
    
    nextPos = PATH.pop()

    return ut.convertPosesToDir(nextPos, playerLocation, mazeMap)



####



if __name__ == "__main__" :

    # We let technical stuff happen
    (mazeWidth, mazeHeight, mazeMap, preparationTime, turnTime, playerLocation, opponentLocation, coins, gameIsOver) = api.initGame(BOT_NAME)


    initializationCode(mazeWidth, mazeHeight, mazeMap, preparationTime, playerLocation, opponentLocation, coins)
    
    # We decide how to move and wait for the next step
    while not gameIsOver :
        (playerLocation, opponentLocation, coins, gameIsOver) = api.processNextInformation()
        if gameIsOver :
            break
        nextMove = determineNextMove(mazeWidth, mazeHeight, mazeMap, turnTime, playerLocation, opponentLocation, coins)
        api.writeToPipe(nextMove)