Print a Singing Angel
JS (ES6), 328 330 bytes
a=(b,c)=>b.repeat(c);f=prompt().split(" ");if(f[1].length<5)f[1]+=" ";console.log(a(" ",18)+a("_",12)+`
(\\ ___ /) /`+a(" ",12)+`\\
( \\ (‘o‘) / ) / `+f[0]+` \\
(`+a(" ",11)+`) < `+f[1]+a(" ",21)+`
( ‘> <’ ) \\`+a(" ",14)+`/
/ \\ \\`+a("_",12)+`/
/ \\
‘ – “ - ‘`)
- 1 helper function (a gets charcode (one char shorter) and repeats c times)
- 1 variable for getting input via
prompt()
and doing a split to array - arguably abuses the special cases there but still does the job
- I assumed the extra 21 spaces in the middle column were needed
a=(b,c)=>b.repeat(c);f=prompt().split(" ");if(f[1].length<5)f[1]+=" ";console.log(a(" ",18)+a("_",12)+`
(\\ ___ /) /`+a(" ",12)+`\\
( \\ (‘o‘) / ) / `+f[0]+` \\
(`+a(" ",11)+`) < `+f[1]+a(" ",21)+`
( ‘> <’ ) \\`+a(" ",14)+`/
/ \\ \\`+a("_",12)+`/
/ \\
‘ – “ - ‘`)
Python 3.5, 207 chars, 226 bytes
def f(s):a,b=s.split();u='_'*12;[print(' '*int(x)if x.isdigit()else x,end='')for x in"99"+u+"\n(\\3___3/)4/66\\\n( \\ (‘o‘) / )3/4"+a+"4\\\n(92)2<5"+b+"\n (2‘> <’2)4\\95/\n4/4\\7\\"+u+"/\n3/6\\\n2‘ – “ - ‘"]
Output:
____________
(\ ___ /) / \
( \ (‘o‘) / ) / Jingle \
( ) < Bells
( ‘> <’ ) \ /
/ \ \____________/
/ \
‘ – “ - ‘
Slightly ungolfed:
def angel(s):
a, b = s.split()
u = '_' * 12;
out = "99" + u + "\n"
out += "(\\3___3/)4/66\\\n"
out += "( \\ (‘o‘) / )3/4" + a + "4\\\n"
out += "(92)2<5" + b + "\n"
out += " (2‘> <’2)4\\95/\n"
out += "4/4\\7\\" + u + "/\n"
out += "3/6\\\n"
out += "2‘ – “ - ‘"
[print(' '*int(x) if x.isdigit() else x, end='') for x in out]
It replaces numerical digits with the same number of spaces.
Python 3.6 - 286 241 224 bytes
def x(L):X,Y=L.split();E,D=' '*11,'_'*12;print(f"""{' '*18}{D}
(\ ___ /) /{E} \\
( \ (‘o‘) / ) / {X+' '*(10-len(X))}\\
({E}) < {Y}
( ‘> <’ ) \{E} /
/ \ \{D}/
/ \
‘ – “ - ‘""")
Input: x("Silent Night")
Output:
____________
(\ ___ /) / \
( \ (‘o‘) / ) / Silent \
( ) < Night
( ‘> <’ ) \ /
/ \ \____________/
/ \
‘ – “ - ‘
Note - The version is 3.6
where string literal formatting was introduced. Hence, this won't work in earlier versions.