7
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

ズンドコキヨシ with Python

Last updated at Posted at 2016-03-14
なんか流行ってるらしいのでPythonでも書いてみた。
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import re
import random


def say_zundoko(kiyoshi):
    word=["ズン", "ドコ"]
    kiyoshi = kiyoshi + word[random.randint(0,1)]
    if re.search(r"ズンズンズンズンドコ", kiyoshi):
        print (kiyoshi + "  キ・ヨ・シ!!")
    else:
        say_zundoko(kiyoshi)


if __name__=='__main__':
    say_zundoko('')

出力例
$ python zundoko.py 
ズンズンドコドコズンドコドコドコドコズンドコズンズンドコズンドコズンドコドコドコズンドコズンドコドコドコドコドコドコドコズンズンズンドコズンドコドコドコドコズンズンドコドコズンドコズンズンドコズンドコズンドコズンドコズンズンズンズンドコ  キ・ヨ・シ!!
7
8
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?