ascii-art

Text-to-ASCII art generator in Python

有些话、适合烂在心里 提交于 2019-12-12 08:34:31
问题 I would like to add an easter egg to one our developers' command line tools, which will greet its user if a certain date is matched. Basically, I'm looking for: >>> print big_text("Happy\nBirthday") . _________ _...._ _________ _...._ .'| \ |.' '-. \ |.' '-. .-. .- < | \ .'```'. '.\ .'```'. '.\ \ / / | | __ \ | \ \\ | \ \\ \ / / | | .'''-. .:--.'. | | | | | | | | \ \ / / | |/.'''. \ / | \ | | \ / . | \ / . \ \ / / | / | | `" __ | | | |\`'-.-' .' | |\`'-.-' .' \ ` / | | | | .'.''| | | | '-....

rank ascii characters by intensity/darkness/lightness

南楼画角 提交于 2019-12-12 02:59:56
问题 I want to quickly output contour plots of result calculated on a server. I log in with putty so the output should be text based (i know how to send graphics i prefer text). To output the contour plots i need to know light intensity of each symbol. is there a table like that? 回答1: Use a library, like aalib or libcaca. Don't know a table though... EDIT: Intensity is font specific... 来源: https://stackoverflow.com/questions/15335412/rank-ascii-characters-by-intensity-darkness-lightness

Finding the whitespace algorithm for a tentative size ASCII art program

倖福魔咒の 提交于 2019-12-11 17:42:24
问题 So I've been tasked with making a "Programming textbook" that can change size based off what the constant SIZE var is set at. Here is what I have to shoot for. (NOTE: It is normal for odd-number SIZEd books to have awkward indentation towards the end). Notice how when SIZE = 8, there is one space on either side of the text, 4 spaces on either side for SIZE = 10, and so on. Now here is what I've programmed so far. I'm almost done, the only thing I cannot figure out is the algorithm I can use

How do I echo ASCII art that contains special characters in a batch file?

左心房为你撑大大i 提交于 2019-12-10 00:50:36
问题 So.. This is (to me anyway) the most important feature of this program. I need this to work. Please don't laugh.. (okay you can laugh) but when my program errors, I want it to display this: _ _,---._ ,-',' `-.___ /-;' `._ /\/ ._ _,'o \ ( /\ _,--'\,','"`. ) |\ ,'o \' //\ | \ / ,--'""`-. : \_ _/ ,-' `-._ \ `--' / ) `. \`._ ,' ________,',' .--` ,' ,--` __\___,;' \`.,-- ,' ,`_)--' /`.,' \( ; | | ) (`-/ `--'| |) |-/ | | | | | | | |,.,-. | |_ | `./ / )---` ) _| / ,', ,-' ,'|_( /-<._,' |--, | `--'--

Creating shapes or letters using Python

萝らか妹 提交于 2019-12-08 10:11:48
问题 So I'm trying to create the letter H out of asterisks using Python, but I can't seem to figure out on how to create a vertical line to go across in order to create the letter H using the code I have written so far: def across(n): for i in range(n): print ('*', end=' ') print() def straight(n): for i in range(n): print ('*') def main(): n=6 straight ((n-3)//2) across(n//2) straight ((n-3)//2) main() this is the output: * *** * Any ideas? Thanks for any help in advance. 回答1: You have to print

In PHP, how to display array contents in a table

烈酒焚心 提交于 2019-12-08 01:16:01
问题 If I do a select in the MySQL client, I will have output that looks like this: mysql> select * FROM `group` LIMIT 2; +----------+---------------------+-----------------+-------------+ | group_id | group_supergroup_id | group_deletable | group_label | +----------+---------------------+-----------------+-------------+ | 1 | 4 | 0 | defaut | | 8 | 1 | 1 | dbdfg | +----------+---------------------+-----------------+-------------+ How can I convert a PDO fetch (or fetchAll ) array in a table like

In PHP, how to display array contents in a table

心已入冬 提交于 2019-12-06 05:14:02
If I do a select in the MySQL client, I will have output that looks like this: mysql> select * FROM `group` LIMIT 2; +----------+---------------------+-----------------+-------------+ | group_id | group_supergroup_id | group_deletable | group_label | +----------+---------------------+-----------------+-------------+ | 1 | 4 | 0 | defaut | | 8 | 1 | 1 | dbdfg | +----------+---------------------+-----------------+-------------+ How can I convert a PDO fetch (or fetchAll ) array in a table like that? Here's a code usage example: $prep = $pdo->query('SELECT * FROM `group` LIMIT 2;'); $arr = $prep-

How do I echo ASCII art that contains special characters in a batch file?

穿精又带淫゛_ 提交于 2019-12-05 00:25:59
So.. This is (to me anyway) the most important feature of this program. I need this to work. Please don't laugh.. (okay you can laugh) but when my program errors, I want it to display this: _ _,---._ ,-',' `-.___ /-;' `._ /\/ ._ _,'o \ ( /\ _,--'\,','"`. ) |\ ,'o \' //\ | \ / ,--'""`-. : \_ _/ ,-' `-._ \ `--' / ) `. \`._ ,' ________,',' .--` ,' ,--` __\___,;' \`.,-- ,' ,`_)--' /`.,' \( ; | | ) (`-/ `--'| |) |-/ | | | | | | | |,.,-. | |_ | `./ / )---` ) _| / ,', ,-' ,'|_( /-<._,' |--, | `--'---. \/ \ | / \ /\ \ ,-^---._ | \ / \ \ ,-' \----' \/ \--`. / \ \ \ Echoing each line doesn't work...

minimizing overlap in random rectangles

佐手、 提交于 2019-12-04 10:52:52
问题 I have a number of possibly overlapping rectangles, of random size and position within a fixed plane. Since these rectangles are random, some may not overlap: |----- | | |----| |----| | | |----| Some may overlap by just one corner: |-----| | |--|--| |--|--| | |-----| Some may be contained inside another rectangle: |----------------| | | | |-----| | | | | | | |-----| | |----------------| Some may pass through another rectangle: |----------------| | | |--|-------------------| | | | | |--|------

Text-to-ASCII art generator in Python

旧时模样 提交于 2019-12-04 04:08:41
I would like to add an easter egg to one our developers' command line tools, which will greet its user if a certain date is matched. Basically, I'm looking for: >>> print big_text("Happy\nBirthday") . _________ _...._ _________ _...._ .'| \ |.' '-. \ |.' '-. .-. .- < | \ .'```'. '.\ .'```'. '.\ \ / / | | __ \ | \ \\ | \ \\ \ / / | | .'''-. .:--.'. | | | | | | | | \ \ / / | |/.'''. \ / | \ | | \ / . | \ / . \ \ / / | / | | `" __ | | | |\`'-.-' .' | |\`'-.-' .' \ ` / | | | | .'.''| | | | '-....-'` | | '-....-'` \ / | | | | / / | |_ .' '. .' '. / / | '. | '.\ \._,\ '/'-----------' '-----------' |