Skip to content

Instantly share code, notes, and snippets.

@tobynet
Created July 4, 2018 07:04
Show Gist options
  • Save tobynet/6934f44a0a817ca2f95068b6c80e3ab2 to your computer and use it in GitHub Desktop.
Save tobynet/6934f44a0a817ca2f95068b6c80e3ab2 to your computer and use it in GitHub Desktop.
#54文字の文学賞 のジェネレータ https://ujiqn.github.io/54-novel/ に入れる用スクリプト(ランダム版)
#!/usr/bin/env python
WIDTH = 9
HEIGHT = 6
import random
#src = "┣╋┻┳┫"
src = "☐⊡▤▥▩▨▧▦▣"
# string -> [shuffled string]
lines = [ "".join(random.choices(src,k=WIDTH)) for _ in range(HEIGHT) ]
print("".join(lines))
@tobynet
Copy link
Author

tobynet commented Jul 4, 2018

動作例:

$ python random-string-for-54-novel.py
☐▥▩▨▧▣▩☐▧▦⊡▦☐▧▣▤▤▧▦▣☐▨▧▦▨⊡▨▦▥▤▦▦⊡▧▥☐▧☐☐☐▩▥▣▩▩▧⊡▧▨▦▤▨▤☐

https://ujiqn.github.io/54-novel/ での例:

Image from Gyazo

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