예제 #1
0
파일: Player.py 프로젝트: dogbyday/SET
def getLeastSet(board, deck, sets):
    minSet = -1
    minExistingSets = -1
    numSetsForSet = 0
    setNum = 0
    
    for eachSet in sets:
        cards = eachSet.returnSet()
        for card in cards:
            for secondCard in (board + deck):
                if secondCard != card:
                    thirdCard = Set.predictThird(card, secondCard)
                    if thirdCard in (board + deck):
                        numSetsForSet += 1
        if minExistingSets == -1 or numSetsForSet < minExistingSets:
            minExistingSets = numSetsForSet
            minSet = setNum
        numSetsForSet = 0
        setNum += 1
    return sets[minSet]
예제 #2
0
파일: Player.py 프로젝트: dogbyday/SET
def getMostCard(board, deck, sets):
    minSet = -1
    maxExistingSets = -1
    numSetsForCard = 0
    setNum = 0
    
    for eachSet in sets:
        cards = eachSet.returnSet()
        for card in cards:
            for secondCard in (board + deck):
                if secondCard != card:
                    thirdCard = Set.predictThird(card, secondCard)
                    if thirdCard in (board + deck):
#                             print( card, secondCard, thirdCard)
                        numSetsForCard += 1
            if maxExistingSets == -1 or numSetsForCard > maxExistingSets:
                
                maxExistingSets = numSetsForCard
                minSet = setNum
        numSetsForCard = 0
        setNum += 1
    return sets[minSet]