100 days ago · Tech · hide · Fediverse post

Hello, loves! A small idea about the Denizen state machine. Tout le monde déteste l’IA. Here’s Denizen: class Denizen: def __init__(self, *, name, initial_sayings=None, gift=None): if initial_sayings is None: initial_sayings = ['Hmm...'] self.name = name self.initial_sayings = NameSayer.cycle(self.name, initial_sayings) self.gift = gift self.say = 0 self.gift = gift self.state = 'seeking' def interact(self, interactor): if self.state == 'seeking': self.seeking(interactor) elif self.state == 'satisfied': self.satisfied(interactor) else: interactor.announce(message='Buzz: "Impossible Situation"') return False def seeking(self, interactor): if interactor.has('flower'): if self.gift: interactor.announce(message='Buzz: "Oh thank you!"') interactor.announce(message='Buzz: "Here\'s something you may need."') interactor.receive_content(self.gift) self.state = 'satisfied' else: interactor.announce(self.initial_sayings.saying) def satisfied(self, interactor): interactor.announce(message =…

Commenting on Bubbles has been removed. Why? If you want to talk about this post, write to the author, use the comments on their blog if it has them, or reply with a "RE:" post on your own blog. Suggestions? feedback@bubbles.town