Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@greymd
Last active August 31, 2015 13:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save greymd/c4c1a6c3df31c83a6970 to your computer and use it in GitHub Desktop.
Save greymd/c4c1a6c3df31c83a6970 to your computer and use it in GitHub Desktop.
# 参考: https://twitter.com/ryuichiueda/status/637570756138823680
W=9; H=9 ;printf $(printf "+%%0${W}d\\\n%0${H}s\n" | sed "s/ /|%${W}s\\\n+%0${W}d\\\n/g") | sed 's/0/---+/g' | sed 's/ / |/g'
# 結果
# +---+---+---+---+---+---+---+---+---+
# | | | | | | | | | |
# +---+---+---+---+---+---+---+---+---+
# | | | | | | | | | |
# +---+---+---+---+---+---+---+---+---+
# | | | | | | | | | |
# +---+---+---+---+---+---+---+---+---+
# | | | | | | | | | |
# +---+---+---+---+---+---+---+---+---+
# | | | | | | | | | |
# +---+---+---+---+---+---+---+---+---+
# | | | | | | | | | |
# +---+---+---+---+---+---+---+---+---+
# | | | | | | | | | |
# +---+---+---+---+---+---+---+---+---+
# | | | | | | | | | |
# +---+---+---+---+---+---+---+---+---+
# | | | | | | | | | |
# +---+---+---+---+---+---+---+---+---+
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment