Snowman Bowling
Snowman 1.0.2, 157 bytes
(()("789:045600230001"4aG::48nSdU][:#:]eq]/nM;AsI[:"_____"wR[" "wR/aC;:"( : )"wR["(.,.)"wR/aC;bI;:" "wRdUaC;bI\#**\;aMaZ:" "aJ1AfL;aM;aM1AfL"
"aJ1AfL*))
Try it online!
When I saw this challenge, I knew I just had to answer in the perfect language...
This is a subroutine that takes input as an array of numbers and outputs as a string via the current permavar.
Wrapped for "readability" / aesthetics:
(()("789:045600230001"4aG::48nSdU][:#:]eq]/nM;AsI[
:"_____"wR[" "wR/aC;:"( : )"wR["(.,.)"wR/aC;bI
;:" "wRdUaC;bI\#**\;aMaZ:" "aJ1AfL;aM;aM1AfL"
"aJ1AfL*))
Slightly ungolfed / commented version:
}
1wR`
3wR`aC`
5wR`aC`
6wR`aC`
9wR`aC`
*
((
)(
"789:045600230001" // pin layout data
4aG // split into groups of 4; we need each row twice
: // map over groups of 2 output lines
: // map over pins (or whitespace)
48nS // subtract ascii '0'
dU][ // duplicate the pin; we need it in the if{}
: // if (pin) {
#:]eq]/nM;AsI[:"_____"wR[" "wR/aC;:"( : )"wR["(.,.)"wR/aC;bI
;: // } else {
" "wRdUaC
;bI // }
\#**\ // maneuver the permavars around to discard pin
;aM
aZ:" "aJ1AfL;aM
;aM
1AfL // flatten (simulate a flatmap)
"
"aJ // join on newline
1AfL // flatten again into a single string
*
))
#sP
stacked, noncompeting, 118 bytes
I added deepmap
and a few other things after this challenge, along with tons of bugfixes. Try it here!
@a((7 8 9 10)(4 5 6)(2 3)(1)){e:('(.,.)
( : )' '
_'5 hrep)a e has#' 'hcat
}deepmap{e i:'
'i 3*hrep e,$hcat#/!LF+}map
Ungolfed
{ a :
((7 8 9 10) (4 5 6) (2 3) (1))
{ e :
(
'(.,.)' LF '( : )' + +
' ' LF '_' + + 5 hrep
) @possible
a e has @ind
possible ind get @res
' ' @padding
res padding hcat return
} deepmap
{ e i:
' ' LF ' ' + + i 3 * hrep
e ,
$hcat insert!
LF +
} map
} @:bowl
(1 2 3 4 6 10) bowl out
Output:
(.,.) (.,.) (.,.)
( : ) ( : ) ( : ) _____
(.,.)
_____ ( : ) _____
_____ _____
_____
05AB1E, 45 44 bytes
TF"(.,.)( : )"„ _5×{«4ä2ä¹N>åè})4L£Rvyø»}».c
Try it online!
Explanation
TF # for N in [0 ... 9] do:
"(.,.)( : )" # push string
„ _ # push the string " _"
5× # repeat it 5 times
{ # sort
« # concatenate the strings
4ä # split the string in 4 parts
2ä # split the list in 2 parts
¹N>åè # if index+1 is in the input, push the first part
# else push the second part
} # end loop
) # wrap stack in a list
4L£ # split list in parts of size 1,2,3,4
R # reverse list
v # for each list in list of lists
yø # transpose the list
» # join by spaces and newlines
} # end loop
» # join by newlines
.c # centralize