87
6
Note to mods, if the title doesn't do justice, change it to whatever, I thought it was funny.
You're tasked with hanging up the lights for this Christmas season, and your family has decided that for it to be a merry Christmas, you need to hang at least 2 Christmas lights on your house. So, your challenge is, given a number 1 < n
, output the corresponding number of christmas lights you're going to be hanging according to the following specifications...
Here is the structure of a basic christmas light:
_?_
[___]
/:' \
|:: |
\::. /
\::./
'='
The only uncertain part is the question mark, as depending on where the light lands in the chain, the connection will greatly differ.
For the first light in the chain, you will need to output:
.--._
_(_
[___]
/:' \
|:: |
\::. /
\::./
'='
For the last light in the chain, you will need to output:
_.--.
_)_
[___]
/:' \
|:: |
\::. /
\::./
'='
And for all lights in the middle:
_.--.--._
_Y_
[___]
/:' \
|:: |
\::. /
\::./
'='
Example:
N=2:
.--.__.--.
_(_ _)_
[___] [___]
/:' \ /:' \
|:: | |:: |
\::. / \::. /
\::./ \::./
'=' '='
N=6:
.--.__.--.--.__.--.--.__.--.--.__.--.--.__.--.
_(_ _Y_ _Y_ _Y_ _Y_ _)_
[___] [___] [___] [___] [___] [___]
/:' \ /:' \ /:' \ /:' \ /:' \ /:' \
|:: | |:: | |:: | |:: | |:: | |:: |
\::. / \::. / \::. / \::. / \::. / \::. /
\::./ \::./ \::./ \::./ \::./ \::./
'=' '=' '=' '=' '=' '='
Credit
ASCII-Art was taken from: http://www.chris.com/ascii/index.php?art=holiday/christmas/other
It was developed by a user named "jgs", who is responsible for around 40% of content on that site.
Rules
- Trailing spaces are fine, same with a trailing newline.
- There is 1 more space between the first and last bulb from the rest of the chain.
- You may only take 1 integer as input, and the output MUST be a string, no arrays.
- Your program may have undefined functions for values less than 2.
This is ascii-artcode-golf, lowest byte-count wins.
What if strings are synonyms for arrays of characters? – Οurous – 2017-12-20T11:25:18.980
36That basic christmas light looks ridiculously similar to the grenade :) – nicael – 2017-12-20T22:15:12.090
18@nicael Alternative challenge description: Santa is cracking down on bad kids this year, and for each naughty deed comitted the child will receive a live hand grenade. As the thoughtful provider of gifts that he is, Santa has tied the grenades together so the bad kids of the world won't lose them by accident! – Magic Octopus Urn – 2017-12-21T14:39:17.727
@MagicOctopusUrn Uhm, 3 spaces on left and right and 2 spaces otherwise? I wish spacing was consistent. This is an ugly grenade belt. – polkovnikov.ph – 2017-12-25T17:47:34.787
1@polkovnikov.ph it was either that, or the dots being over the parentheses (which looks strange), or the parentheses not being parentheses. IMO this is the best looking (though not the most golfable) approach. – dzaima – 2017-12-25T18:10:12.700