Skip to content

Instantly share code, notes, and snippets.

@ria3100
Created March 18, 2016 03:06
Show Gist options
  • Save ria3100/1d5706102ae4bf8db505 to your computer and use it in GitHub Desktop.
Save ria3100/1d5706102ae4bf8db505 to your computer and use it in GitHub Desktop.
ズンドコキヨシ
'''
[‘ズン’, ‘ドコ’]のいずれかをランダムで出力し続け
どこかで「ズンズンズンズンドコ」に一致したら「キヨシ」を出力して終了する問題
twitterで先頭に
@paiza_run python3:
を含めツイート出来るバイト数にする。
'''
# coding: utf-8
import random
p=print
b=0
while b!=30:
r=random.randrange(2)
p(['ドコ','ズン'][r])
b=(b<<1)+r&31
p('キヨシ')
@ria3100
Copy link
Author

ria3100 commented Mar 18, 2016

ズン ドコ ドコ ドコ ドコ ドコ ズン ドコ ズン ズン ドコ ズン ズン ドコ ドコ ズン ドコ ズン ドコ ズン ズン ズン ドコ ドコ ズン ズン ドコ ドコ ドコ ズン ドコ ドコ ズン ズン ドコ ドコ ズン ズン ズン ズン ドコ キヨシ

バイト数問題なければ print(str, end='') を付けたかった

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment