LoginSignup
3
3

More than 5 years have passed since last update.

ズンドコキヨシ with Python ワンライナー

Last updated at Posted at 2016-03-17

なんか流行っているみたいなので便乗します。

Pythonのコードは結構掲載されていたのですが、Pythonのワンライナー枠が空いてそうだったので書きました。

$ python3 -c'import random as r;z,d,p="ズン","ドコ",lambda v:print(v) or v;t=[z,z,z,z,d];_=lambda s:s==t or _((s+[p(r.choice([z,d]))])[-5:]);_([]);p("キ・ヨ・シ!!")'

実行結果

$ python3 -c'import random as r;z,d,p="ズン","ドコ",lambda v:print(v) or v;t=[z,z,z,z,d];_=lambda s:s==t or _((s+[p(r.choice([z,d]))])[-5:]);_([]);p("キ・ヨ・シ!!")'
ドコ
ズン
ドコ
ドコ
ドコ
ズン
ドコ
ドコ
ドコ
ドコ
ドコ
ドコ
ドコ
ズン
ドコ
ズン
ドコ
ズン
ズン
ドコ
ドコ
ズン
ドコ
ドコ
ズン
ズン
ドコ
ズン
ドコ
ズン
ズン
ズン
ズン
ドコ
キ・ヨ・シ!!
$

[追記]

ゴミが表示されるよとのご指摘をいただいたのでちょっとだけ修正したのも載せておきます。

python3 -c'import random as r;z,d,p="ズン","ドコ",lambda v:print(v) or v;t=[z,z,z,z,d];_=lambda s:s==t or _((s+[p(r.choice([z,d]))])[-5:]);n=_([]);n=p("キ・ヨ・シ!!")'
3
3
4

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
3
3