Skip to content
Snippets Groups Projects
Unverified Commit 2507c63c authored by meng ke's avatar meng ke Committed by GitHub
Browse files

Merge pull request #12 from Sunbread/master

防止文章局部过于内容重复
parents 36257180 236aa9f1
No related branches found
No related tags found
No related merge requests found
...@@ -174,10 +174,24 @@ xx = "学生会退会" ...@@ -174,10 +174,24 @@ xx = "学生会退会"
"说过一句富有哲理的话", "说过一句富有哲理的话",
] ]
重复度 = 2
def 洗牌遍历(列表):
global 重复度
= list(列表) * 重复度
while True:
random.shuffle()
for 元素 in :
yield 元素
下一句废话 = 洗牌遍历(废话)
下一句名人名言 = 洗牌遍历(名人名言)
def 来点名人名言(): def 来点名人名言():
xx = random.choice(名人名言) global 下一句名人名言
xx = xx.replace( "a", random.choice(前面垫话)) xx = next(下一句名人名言)
xx = xx.replace( "b", random.choice(后面垫话)) xx = xx.replace( "a",random.choice(前面垫话) )
xx = xx.replace( "b",random.choice(后面垫话) )
return xx return xx
def 另起一段(): def 另起一段():
...@@ -197,6 +211,6 @@ if __name__ == "__main__": ...@@ -197,6 +211,6 @@ if __name__ == "__main__":
elif 分支 < 20 : elif 分支 < 20 :
tmp += 来点名人名言() tmp += 来点名人名言()
else: else:
tmp += random.choice(废话) tmp += next(下一句废话)
tmp = tmp.replace("x",xx) tmp = tmp.replace("x",xx)
print(tmp) print(tmp)
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment