读书人的干的事能算抄袭么……


title: 读书人的干的事能算抄袭么…… tags:

  • python
  • 古风
  • 写诗 categories: python date: 2017-07-25 18:18:53

抄袭了livc.io/162 同学的代码,发觉还是挺有意思的 O(∩_∩)O

直接上代码

    # coding=utf-8
    from time import sleep
    from random import choice
    from random import randint
    import sys
    defaultencoding = 'utf-8'
    if sys.getdefaultencoding() != defaultencoding:
        reload(sys)
        sys.setdefaultencoding(defaultencoding)
     
    two_chars_words = "朱砂 天下 杀伐 人家 韶华 风华 繁华 血染 墨染 白衣 \
    素衣 嫁衣 倾城 孤城 空城 旧城 旧人 伊人 心疼 春风 古琴 无情 迷离 奈何 \
    断弦 焚尽 散乱 陌路 乱世 笑靥 浅笑 明眸 轻叹 烟火 一生 三生 浮生 桃花 \
    梨花 落花 烟花 离殇 情殇 爱殇 剑殇 灼伤 仓皇 匆忙 陌上 清商 焚香 墨香 \
    微凉 断肠 痴狂 凄凉 黄梁 未央 成双 无恙 虚妄 凝霜 洛阳 长安 江南 忘川 \
    千年 纸伞 烟雨 回眸 公子 红尘 红颜 红衣 红豆 红线 青丝 青史 青冢 白发 \
    白首 白骨 黄土 黄泉 碧落 紫陌".split(" ")
     
    four_chars_words = "情深缘浅 情深不寿 莫失莫忘 阴阳相隔 如花美眷 \
    似水流年 眉目如画 曲终人散 繁华落尽 不诉离殇 一世长安".split(" ")
     
    sentence_model = "xx,xx,xx了xx。 xxxx,xxxx,不过是一场xxxx。 \
    你说xxxx,我说xxxx,最后不过xxxx。 xx,xx,许我一场xxxx。 \
    一x一x一xx,半x半x半xx。 你说xxxxxxxx,后来xxxxxxxx。 \
    xxxx,xxxx,终不敌xxxx。".split(" ")
     
     
    def get_sentence():
        model = choice(sentence_model)
        while "xxxx" in model:
            model = model.replace("xxxx", choice(four_chars_words), 1)
        while "xx" in model:
            model = model.replace("xx", choice(two_chars_words), 1)
        while "x" in model:
            model = model.replace(
                "x", choice(two_chars_words).decode("utf-8")[randint(0, 1)])
        print(model)
     
    while True:
        get_sentence()
        sleep(1)
复制代码

我可以写小说了………………

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值