Write language name in 3D ASCII: Difference between revisions
→{{header|Python}}: Beautified Impl 1 and 2
Thundergnat (talk | contribs) m (syntax highlighting fixup automation) |
Simple9371 (talk | contribs) (→{{header|Python}}: Beautified Impl 1 and 2) |
||
Line 2,856:
<b>Implementation 1:</b> based on the Scala type idea of 'fleshing out' a 2D banner version.
<syntaxhighlight lang="python">py = '''\
####
#
#
#
lines = py.replace('#', '<<<').replace(' ','X')
.replace('X', ' ').replace('\n', ' Y') \
.replace('< ', '<>').split('Y')
▲lines = py.replace('#', '<<<').replace(' ','X').replace('X', ' ').replace('\n', ' Y').replace('< ', '<>').split('Y')
for i, l in enumerate(lines):
print(
{{out}}
<pre
<<<>
<b>Implementation 2:</b>
<syntaxhighlight lang="python">charWidth = 10
charHeight = 8
# char table is split into sets to prevent very long lines...
charSet1 = [
"
"
"| ##
"| ########| ####### | ## | ## | ##| ########| ########| ## #####| ########",
"| ##__ ##| ##__ ##| ## | ## | ##| ##_____/| ##_____/| ##|_ ##| ##__ ##",
"| ## | ##| ##
"| ## | ##| #######/| ######/| ######/ | ########| ## | ######/| ## | ##",
"|__/ |__/|_______/ \______/ |______/ |________/|__/ \______/ |__/ |__/",
Line 2,893:
charSet2 = [
" /######## /## /## /## /## /###
"|__ ##__/ | ##| ## /##/| ## | ########| ### | ##
" | ## | ##| ## /##/ | ## | ## ## ##| ####| ##| ##
" | ## | ##| #####/ | ## | ## ## ##| ## ## ##| ## | ##| #######/",
" | ## | ##| ## ## | ## | ## ## ##| ## ####| ## | ##| ##____/ ",
Line 2,904:
charSet3 = [
"
"
"| ##
"| ## | ##| #######/ \ ###### | ## | ## | ##| ## | ##| ## ## ## \ ##/ ",
"| ## ## ##| ## ## \___ ## | ## | ## | ##| ##
"| ##\ ###/| ##\ ## /## \ ## | ## | ## | ## \ ####/ | ######## / ## ## ",
"| #### ##| ## \ ##\ ######/ | ## | ######/ \ ##/ | ###| ###/ ## \ ##",
Line 2,915:
charSet4 = [
" /## /## /########
"\ ## /##/|____ ##/
" \ ####/ / ##/ | ##
" \ ##/ / ##/ |__//####/ ",
" | ## / ##/ | ##_/ ",
Line 2,935:
if not text:
text = "PYTHON"
for i in range(charHeight):
lineOut = ""
Line 2,952:
{{out}}
<pre> /####### /## /## /######## /## /##
| ##__ ##\ ## /##/|__ ##__/| ## | ##
| ##
| #######/ \ ##/ | ## | ########| ## | ##| ## ## ##
| ##____/ | ## | ## | ##__ ##| ## | ##| ## ####
|