Skip to main content
Final (post-tournament) update; circumvents Rebel's defences and gets a win rate > 95% ;-)
Source Link
DaniO
  • 69
  • 3
class HarkonnenBot(Bot):
    """
    House Harkonnen is unrivalled in treachery and double-dealing.
    This bot adminsters an elacca drug to all its rivals, removing
    their instinct for self-preservation and compelling them to
    obsessively roll again and again, until they *die* ⚅
    """
    def __init__(self, *args):
        super().__init__(*args)
        self.bots = None
        for f_info in inspect.stack():
            try:
                self.bots = f_info.frame.f_locals["game_bots"]
                break
            except KeyError:
                pass
            finally:
                del f_info

    def update_state(self, current_throws):                                                                                                                               
        # Do not count what you have lost. Count only what you still have.
        pass                                                                                                                                                              

    def elacca(self, scores, last_round):
        while True:
            yield True

    def chaumurky(self):
        my = self.__class__                                                                                                                                               
        for bot in self.bots:
            # Administer elacca, and defeat Rebel's antidote to it ;-)
            roll = my.make_throw if bot !=== self: else my.elacca
            bot.make_throw = functools.partial(roll, bot)
            bot.make_throwupdate_state = selffunctools.elaccapartial(my.update_state, bot)
        # Destroy the evidence
        self.bots = None

    def make_throw(self, scores, last_round):
        if self.bots:
            self.chaumurky()
        yield False
class HarkonnenBot(Bot):
    """
    House Harkonnen is unrivalled in treachery and double-dealing.
    This bot adminsters an elacca drug to all its rivals, removing
    their instinct for self-preservation and compelling them to
    obsessively roll again and again, until they *die* ⚅
    """
    def __init__(self, *args):
        super().__init__(*args)
        self.bots = None
        for f_info in inspect.stack():
            try:
                self.bots = f_info.frame.f_locals["game_bots"]
                break
            except KeyError:
                pass
            finally:
                del f_info

    def elacca(self, scores, last_round):
        while True:
            yield True

    def chaumurky(self):
        for bot in self.bots:
            if bot != self:
                bot.make_throw = self.elacca
        # Destroy the evidence
        self.bots = None

    def make_throw(self, scores, last_round):
        if self.bots:
            self.chaumurky()
        yield False
class HarkonnenBot(Bot):
    """
    House Harkonnen is unrivalled in treachery and double-dealing.
    This bot adminsters an elacca drug to all its rivals, removing
    their instinct for self-preservation and compelling them to
    obsessively roll again and again, until they *die* ⚅
    """
    def __init__(self, *args):
        super().__init__(*args)
        self.bots = None
        for f_info in inspect.stack():
            try:
                self.bots = f_info.frame.f_locals["game_bots"]
                break
            except KeyError:
                pass
            finally:
                del f_info

    def update_state(self, current_throws):                                                                                                                               
        # Do not count what you have lost. Count only what you still have.
        pass                                                                                                                                                              

    def elacca(self, scores, last_round):
        while True:
            yield True

    def chaumurky(self):
        my = self.__class__                                                                                                                                               
        for bot in self.bots:
            # Administer elacca, and defeat Rebel's antidote to it ;-)
            roll = my.make_throw if bot == self else my.elacca
            bot.make_throw = functools.partial(roll, bot)
            bot.update_state = functools.partial(my.update_state, bot)
        # Destroy the evidence
        self.bots = None

    def make_throw(self, scores, last_round):
        if self.bots:
            self.chaumurky()
        yield False
No code changes, just tweaked commentary
Source Link
DaniO
  • 69
  • 3
class HarkonnenBot(Bot):
    """
    House Harkonnen is unrivalled in treachery and double-dealing.
    This bot adminsters an elacca drug to all its rivals, removing
    their instinct for self-preservation and compelling them to
    obsessively roll again and again, until they die*die* :)
    """
    def __init__(self, *args):
        super().__init__(*args)
        self.bots = None
        for f_info in inspect.stack():
            try:
                self.bots = f_info.frame.f_locals["game_bots"]
                break
            except KeyError:
                pass
            finally:
                del f_info

    def elacca(self, scores, last_round):
        while True:
            yield True

    def chaumurky(self):
        for bot in self.bots:
            if bot != self:
                bot.make_throw = self.elacca
        # Destroy the evidence
        self.bots = None

    def make_throw(self, scores, last_round):
        if self.bots:
            self.chaumurky()
        yield False

Obviously, this bot has to Ignore All The Rules, except the one that says "Sabotage is allowed, and encouraged" :). But when did a Harkonnen ever need encouragement? Or even permission? };D

class HarkonnenBot(Bot):
    """
    House Harkonnen is unrivalled in treachery and double-dealing.
    This bot adminsters an elacca drug to all its rivals, removing
    their instinct for self-preservation and compelling them to
    obsessively roll again and again, until they die :)
    """
    def __init__(self, *args):
        super().__init__(*args)
        self.bots = None
        for f_info in inspect.stack():
            try:
                self.bots = f_info.frame.f_locals["game_bots"]
                break
            except KeyError:
                pass
            finally:
                del f_info

    def elacca(self, scores, last_round):
        while True:
            yield True

    def chaumurky(self):
        for bot in self.bots:
            if bot != self:
                bot.make_throw = self.elacca
        # Destroy the evidence
        self.bots = None

    def make_throw(self, scores, last_round):
        if self.bots:
            self.chaumurky()
        yield False

Obviously, this bot has to Ignore All The Rules, except the one that says "Sabotage is allowed, and encouraged" :)

class HarkonnenBot(Bot):
    """
    House Harkonnen is unrivalled in treachery and double-dealing.
    This bot adminsters an elacca drug to all its rivals, removing
    their instinct for self-preservation and compelling them to
    obsessively roll again and again, until they *die* 
    """
    def __init__(self, *args):
        super().__init__(*args)
        self.bots = None
        for f_info in inspect.stack():
            try:
                self.bots = f_info.frame.f_locals["game_bots"]
                break
            except KeyError:
                pass
            finally:
                del f_info

    def elacca(self, scores, last_round):
        while True:
            yield True

    def chaumurky(self):
        for bot in self.bots:
            if bot != self:
                bot.make_throw = self.elacca
        # Destroy the evidence
        self.bots = None

    def make_throw(self, scores, last_round):
        if self.bots:
            self.chaumurky()
        yield False

Obviously, this bot has to Ignore All The Rules, except the one that says "Sabotage is allowed, and encouraged". But when did a Harkonnen ever need encouragement? Or even permission? };D

Source Link
DaniO
  • 69
  • 3

class HarkonnenBot(Bot):
    """
    House Harkonnen is unrivalled in treachery and double-dealing.
    This bot adminsters an elacca drug to all its rivals, removing
    their instinct for self-preservation and compelling them to
    obsessively roll again and again, until they die :)
    """
    def __init__(self, *args):
        super().__init__(*args)
        self.bots = None
        for f_info in inspect.stack():
            try:
                self.bots = f_info.frame.f_locals["game_bots"]
                break
            except KeyError:
                pass
            finally:
                del f_info

    def elacca(self, scores, last_round):
        while True:
            yield True

    def chaumurky(self):
        for bot in self.bots:
            if bot != self:
                bot.make_throw = self.elacca
        # Destroy the evidence
        self.bots = None

    def make_throw(self, scores, last_round):
        if self.bots:
            self.chaumurky()
        yield False

Obviously, this bot has to Ignore All The Rules, except the one that says "Sabotage is allowed, and encouraged" :)