aigamedev/resistance — pull request #2 by tJener (2012-09-08 05:44:29+00:00)
Title: Check type of value returned from sabotage

Similar to the check in place for voting, adding this check to the
sabotage call prevents bots from playing multiple sabotage cards or
a negative amount of sabotage cards.

An example of a cheating bot:

from player import Bot
import random

class CheatingHippie(Bot):
def select(self, players, count):
return [self] + random.sample(self.others(), count - 1)

def vote(self, team):
return True

def sabotage(self):
# Frames team members!
return 2