From e003aab4fe76515593b86b6bd40f7f7d816fd12c Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sun, 2 Jul 2017 01:03:59 +1200 Subject: Very important addenda to pks(6df) --- games/pks.awk | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 72 insertions(+), 3 deletions(-) (limited to 'games') diff --git a/games/pks.awk b/games/pks.awk index fb40ce7b..2219872b 100644 --- a/games/pks.awk +++ b/games/pks.awk @@ -3,8 +3,27 @@ # Process arguments BEGIN { - # If no arguments, assume a dictionary file - if (ARGC == 1) { + # Look for options; keep a count of non-option args + ac = ARGC + for (i = 1; i <= ARGC; i++) { + + # Show a pic of Phil + if (ARGV[i] == "--phil") { + pic = 1 + ARGV[i] = "" + ac-- + } + + # End-of-options + if (ARGV[i] == "--") { + break + ARGV[i] = "" + ac-- + } + } + + # If no arguments left, assume a dictionary file + if (ac == 1) { ARGC = 2 if ("DICT" in ENVIRON) ARGV[1] = ENVIRON["DICT"] @@ -43,5 +62,55 @@ END { wr = toupper(substr(wr,1,1)) substr(wr,2) # Return the laughter and the word - printf "%s! %s!\n", ha, wr + if (pic) + dopic(ha, wr) + else + printf "%s! %s!\n", ha, wr +} + +# Ha, ha! Low-res! +function dopic(ha, wr) { + print "" + print " " ha "! " wr "!" + print " \\" + print " .''''''''''''''''''''''.." + print " .'''''''''''''''''''''''''''" + print " .'''''''''''''''''''''''''''''" + print " ,'''''''''''''''''''''''''''''''" + print " '''''''''''''''''''''''''''''''':" + print " ,'''''''''''##`'''''''''''''''.'''`" + print " ;''''''''.###########,'''''',###'''" + print " ;'''''';#################:'#####.''" + print " `:''''''#########################'." + print " ::` ,'+########################';" + print " ''''''': .#####################''" + print " ''''''''.####` `;#############;##'" + print " ;''''''',####,###: +############." + print " ,###''''''#############` ;##:#######" + print " ,#:##''';+#####+ :###### +##+ +" + print " ,'#;#,''#####',+###` ;####`+ " + print " ,#'#,#';############++. ,`## " + print " :#####+:#######,@,``@@,#####' " + print " ;#+#+#############++++##.#+## +" + print " ###+################'####'## " + print " #######+###################.# :." + print " ######'########################'" + print " ,+#####;#######################" + print " ,#######;############'####+###:" + print " ,#######################+#####'" + print " ,###############' ` #'# +'#" + print " #,##.###########'##+##'###'####" + print " ``@.############## `+#@@@@@######" + print " +```@@################ ,,. . ####." + print " ;````@@,##.##############':..:######" + print " ;`````@@@########.##################" + print " +````````@@@@#####;####################:" + print " +`````.`````@@@@######`###################```+" + print " +````````,`````'@@@@@##'#####################`````." + print "+ ``````````.``````@@@@@@##'###'################```````` +" + print "```````````````````@@@@@@@'#####;##########,##'`````````````.+" + print "```````````````````@@@@@@@@@+#####':####+:+'````````````````````," + print "```````````````````,@@@@@@@@@#:#########'@@@``````````````````````" + print "```````````.````````@@@@@@@@@@@@#'#####@@@@@```````````````````````" + print "```````````.````````@@@@@@@@@@@@@@' @@@@@@@.``````````````````````" } -- cgit v1.2.3