From 749efc52dff680438f93840d065b71b9f7272345 Mon Sep 17 00:00:00 2001 From: "Thomas A. Christensen II" <25492070+MillironX@users.noreply.github.com> Date: Tue, 23 Nov 2021 11:20:17 -0600 Subject: [PATCH] Abstract cow to cowfile Signed-off-by: Thomas A. Christensen II <25492070+MillironX@users.noreply.github.com> --- src/Cowsay.jl | 12 +++--------- src/cows/default.cow.jl | 11 +++++++++++ 2 files changed, 14 insertions(+), 9 deletions(-) create mode 100644 src/cows/default.cow.jl diff --git a/src/Cowsay.jl b/src/Cowsay.jl index 9a74e56..936586b 100644 --- a/src/Cowsay.jl +++ b/src/Cowsay.jl @@ -2,6 +2,8 @@ module Cowsay export cowsay +include("cows/default.cow.jl") + """ cowsay(message::AbstractString) @@ -52,15 +54,7 @@ function cowsay(message::AbstractString) ) end - cow = string( - " \\ ^__^\n", - " \\ (oo)\\_______\n", - " (__)\\ )\\/\\\n", - " ||----w |\n", - " || ||" - ) - -println(string(balloon, cow)) +println(string(balloon, default())) end diff --git a/src/cows/default.cow.jl b/src/cows/default.cow.jl new file mode 100644 index 0000000..c16b506 --- /dev/null +++ b/src/cows/default.cow.jl @@ -0,0 +1,11 @@ +function default(;eyes="oo", tongue=" ", thoughts="\\") +thecow = +""" + $thoughts ^__^ + $thoughts ($eyes)\\_______ + (__)\\ )\\/\\ + $tongue ||----w | + || || +""" +return thecow +end