49 minutes ago · 8 min read1542 words · Tech · hide · 0 comments

Hello, loves! Buzz is supposed to take the flower. Make it so. Tout le monde déteste l’IA. Blurb says it all. Let’s look at Buzz’s code when he encounters Dot while she has the yellow flower. class QuestGiverDenizen: def __init__(self, *, knowledge): self.knowledge = knowledge self.machine=Machine( initial_state='seeking', seeking=State( has_item=Event(to='satisfied', hook=self._giving_hook), no_item=Event(to='seeking', hook=self._seeking_hook), ), satisfied=State( has_item=Event(to='satisfied', hook=self._satisfied_hook), no_item=Event(to='satisfied', hook=self._satisfied_hook), ), ) def event(self, event, interactor): self.machine.event(event, interactor) def _seeking_hook(self, interactor): interactor.announce(next(self.knowledge.seeking_sayings)) def _giving_hook(self, interactor): for saying in self.knowledge.giving_sayings: interactor.announce(saying) interactor.receive_content(self.knowledge.gift) def _satisfied_hook(self, interactor):…

No comments yet. Log in to reply on the Fediverse. Comments will appear here.