Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,13 @@
py = '''\
#### # # ##### # # ### # #
# # # # # # # # # ## #
#### # # ##### # # # # #
# # # # # # # # ##
# # # # # ### # #'''
lines = py.replace('#', '<<<').replace(' ','X') \
.replace('X', ' ').replace('\n', ' Y') \
.replace('< ', '<>').split('Y')
for i, l in enumerate(lines):
print(' ' * (len(lines) - i) + l)

View file

@ -0,0 +1,73 @@
charWidth = 10
charHeight = 8
# char table is split into sets to prevent very long lines...
charSet1 = [
" ###### /####### ###### /###### /######## /######## ###### /## /##",
" /##__ ##| ##__ ## /##__ ##| ##__ ## | ##_____/| ##_____/ /##__ ##| ## | ##",
"| ## | ##| ## | ##| ## \__/| ## \ ##| ## | ## | ## \__/| ## | ##",
"| ########| ####### | ## | ## | ##| ########| ########| ## #####| ########",
"| ##__ ##| ##__ ##| ## | ## | ##| ##_____/| ##_____/| ##|_ ##| ##__ ##",
"| ## | ##| ## | ##| ## /##| ## /##/| ## | ## | ## | ##| ## | ##",
"| ## | ##| #######/| ######/| ######/ | ########| ## | ######/| ## | ##",
"|__/ |__/|_______/ \______/ |______/ |________/|__/ \______/ |__/ |__/",
]
charSet2 = [
" /######## /## /## /## /## /### ### /## /## ###### /####### ",
"|__ ##__/ | ##| ## /##/| ## | ########| ### | ## /##__ ##| ##__ ##",
" | ## | ##| ## /##/ | ## | ## ## ##| ####| ##| ## | ##| ## | ##",
" | ## | ##| #####/ | ## | ## ## ##| ## ## ##| ## | ##| #######/",
" | ## | ##| ## ## | ## | ## ## ##| ## ####| ## | ##| ##____/ ",
" | ## /## | ##| ##\ ## | ## | ##__/ ##| ##\ ###| ## | ##| ## ",
" /########\ ######/| ## \ ##| ########| ## | ##| ## \ ##| ######/| ## ",
"|________/ \______/ |__/ \__/|________/|__/ |__/|__/ \__/ \______/ |__/ ",
]
charSet3 = [
" ###### /####### ###### /######## /## /## /## /## /## /## /## /##",
" /##__ ##| ##__ ## /##__ ##|__ ##__/| ## | ##| ## | ##| ## | ##\ ## /##/",
"| ## | ##| ## | ##| ## \__/ | ## | ## | ##| ## | ##| ## ## ## \ ####/ ",
"| ## | ##| #######/ \ ###### | ## | ## | ##| ## | ##| ## ## ## \ ##/ ",
"| ## ## ##| ## ## \___ ## | ## | ## | ##| ## ##/| ## ## ## / #### ",
"| ##\ ###/| ##\ ## /## \ ## | ## | ## | ## \ ####/ | ######## / ## ## ",
"| #### ##| ## \ ##\ ######/ | ## | ######/ \ ##/ | ###| ###/ ## \ ##",
" \____\__/|__/ \__/ \______/ |__/ \______/ \__/ |___/|___/\__/ \__/",
]
charSet4 = [
" /## /## /######## ###### ",
"\ ## /##/|____ ##/ /##__ ## ",
" \ ####/ / ##/ | ## | ## ",
" \ ##/ / ##/ |__//####/ ",
" | ## / ##/ | ##_/ ",
" | ## / ##/ |__/ ",
" | ## / ######## /## ",
" |__/ \________/ |__/ ",
]
# ...then the sets are combined back by barbequing them together!
charTable = [(charSet1[i] +
charSet2[i] +
charSet3[i] +
charSet4[i]) for i in range(charHeight)]
if __name__ == '__main__':
text = input("Enter the text to convert:\n")
if not text:
text = "PYTHON"
for i in range(charHeight):
lineOut = ""
for chr in text:
# get value of character 'chr' in alphabet
if chr.isalpha():
val = ord(chr.upper()) - 65
elif chr == " ":
val= 27
else:
val = 26
beginStr = val * charWidth # begin string position of 3D letter
endStr = (val + 1) * charWidth # end string position of 3D letter
lineOut += charTable[i][beginStr:endStr]
print(lineOut)

View file

@ -0,0 +1,17 @@
import requests
import html
text = "Python"
font = "larry3d"
url = f"http://www.network-science.de/ascii/ascii.php?TEXT={text}&FONT={font}&RICH=no&FORM=left&WIDT=1000"
r = requests.get(url)
r.raise_for_status()
ascii_text = html.unescape(r.text)
pre_ascii = "<TD><PRE>"
post_ascii = "\n</PRE>"
ascii_text = ascii_text[ascii_text.index(pre_ascii) + len(pre_ascii):]
ascii_text = ascii_text[:ascii_text.index(post_ascii)]
print(ascii_text)