旧站的内容可能已过时。您可以前往“真魂”分站查看本页面,那里的内容将会定期同步。
“流枫模拟器”的版本间的差异
来自个人维基
小 |
小 |
||
(未显示1个用户的3个中间版本) | |||
第1行: | 第1行: | ||
− | [https://tieba.baidu.com/home/main?un=zeng135792468m 流枫-沐珀◆] | + | [https://tieba.baidu.com/home/main?un=zeng135792468m 流枫-沐珀◆]模拟器(交互式,建议用Python IDLE运行) |
+ | |||
+ | [https://tio.run/##lVRLb9NAEL7nVwyLKtm0VNACh6ot4tBKXEBC3BCHPDbEkmsb2xH0lqhFfVDSoITQVhEVQWlLoTQCIdJA6X9BWSec@AlhH3YcOy4Sl92d2dlvvvlmd41FO6Nrk72esmDopg1mXEvpC7EUTkNa0VKSlTXG4JKVTVjyVAwgrZtADVA0NlnMBaCkqWGMu/EJGS7MwOWrYg/AxHbW1OC@mcWxvjUfVy3MsyQzcS2JJcPUEzyDGyB4jItJkmEaWAQ/oSrZNNYe3cOGuigZumXzc4pLmDnGAKmPER07GwVSX2Erp7LiNJtIFqyMuGXRBVZDp5xKo91qsfhucYMaSAZKIBiyXv@dLyGxIqsND9LljZyPte5Z4Vduz8WCUa@WZEZXaKUPKPinBvn5mqfZy/Pp@BuChzKNRZ3qc1Lc7@4vk9IeRUGcpoW9JLRmmIE7uoY96QPkvuadNx88SudsO1vHEXWRlzXGhBQ5r5ts@PNj14fiYJpuBwGrLbJ94EpGnh10Vw7J@gEzbt12c7j9vTJ@bQDKrwS1my8Yof6WX2woMBClpH3g6xHAo/RAZ2f5/w4wCWKCQ0g4Uj91coe86blD2hhvtV3zVpUyl@D4pLu0RDbf@br1@XfPtigM7e05Odrfc@2TVYbSbrbIq7pALlAfye8g0SHWEbdJIXVvDCekynZ22WXt1zV0ISgyqX/plAUqN8jRe3JU5PZpybdD6SYGJPQFpPdVtNM/F12rU11zPr@lY4RO7kbs332L6BoN5d6By69iTeI@GWZhIljCMBoDK5fZo2OPlrlCqnHfGK8zLMhkJLeLEmlstk8qsldO8HYHlEOD34jIbpu8mCcZRcX8A3V/LyoiJatoRtaWZOEyFc2W0CyMWAhGeERgY9rdGP47B8PkGH6axIYNc3fn50xTN6fET9nr9X8O0d/@uxd38i8 用<span lang=en>Try It Online</span>在线运行](处理输入输出的代码略有改动) | ||
<source lang="python"> | <source lang="python"> | ||
第47行: | 第49行: | ||
try: | try: | ||
while True: | while True: | ||
− | print("< %s" % | + | print("< %s" % liufengReply(input("> "))) |
print() | print() | ||
except EOFError: pass | except EOFError: pass | ||
</source> | </source> | ||
− | [[分类:整活]] | + | {{DEFAULTSORT:LiuFeng moniqi}}[[分类:整活]] |
2021年9月4日 (六) 19:50的最后版本
流枫-沐珀◆模拟器(交互式,建议用Python IDLE运行)
用Try It Online在线运行(处理输入输出的代码略有改动)
import random def find(sup, *subs): for sub in subs: if sup.find(sub) != -1: return True return False def chance(prob): return random.random() < prob def liufengReply(post): if find(post, "lq", "猎奇", "文游"): pass elif find(post, "新人", "萌新") and find(post, "报道", "报到"): return "欢迎…新人" + random.choice([ "记得", "要", "请" ]) + "看吧规哦…" else: reply = None if find(post, "流枫"): if find(post, "流枫是") and find(post, "呢", "吗", "?", "?"): if not find(post, "机器人", "全自动", "AI") and chance(0.4): reply = "不是" else: reply = "是" if chance(0.5): reply += "的" if chance(0.5): reply += "呢" elif find(post, "好怪", "怪哦", "怪噢", "怪喔", "对胃口"): reply = "还好吧" elif find(post, "什么", "为啥", "怎么做", "呢?", "吗") and chance(0.6): reply = "不知道呢" if find(post, "做女生", "做女孩子", "当女孩子") and chance(0.2): reply += "…不是女孩子" elif find(post, "有没有"): reply = "没有" if chance(0.5): reply += "呢" if reply: if len(reply) > 2 and chance(0.5): reply = "唔…" + reply if find(reply, "…") and chance(0.3): reply += "#(小乖)" else: reply += "…" return reply try: while True: print("< %s" % liufengReply(input("> "))) print() except EOFError: pass