23
3
This is supposed to be a code golf challenge on the simpler end of the spectrum. But I figured it could be nice to bring out some micro-optimisation here.
There are three basic types of DVI connectors: DVI-A (analog), DVI-D (digital) and DVI-I (integrated). Furthermore, there are single-link and dual-link versions of the DVI-D and DVI-I connectors. Each of those five different connectors uses a different set of pins.
Given one of A
, D1
, D2
, I1
, I2
as an identifier for the type of connector, print the corresponding ASCII representation of the connector's pins:
A:
# # # # # # #
===== # # #
# # # # # #
D1:
# # # # # #
===== # # # # # #
# # # # # #
D2:
# # # # # # # #
===== # # # # # # # #
# # # # # # # #
I1:
# # # # # # # #
===== # # # # # #
# # # # # # # #
I2:
# # # # # # # # # #
===== # # # # # # # #
# # # # # # # # # #
(The X:
lines are not part of the output, you should only print 3 lines.)
You may write a program or function, taking input via STDIN, ARGV or function argument. The output must be printed to STDOUT, with an optional trailing line feed.
You may or may not include trailing spaces in the second line of the A
connector. You must not use additional leading or trailing spaces anywhere else.
This is code golf, so the shortest answer (in bytes) wins.
Can I require input to be surrounded in quotes, e.g.
"I1"
instead ofI1
? – Claudiu – 2014-11-17T05:58:37.063Are trailing spaces on other lines allowed? – gone_native – 2014-11-17T10:45:35.450
1@Claudiu Nope, sorry. – Martin Ender – 2014-11-17T12:04:17.773
@gone_native Also no, sorry (will add that to the post). – Martin Ender – 2014-11-17T12:04:37.367