My Squiggly Lamp

Snowman 0.2.0, 42 chars

)vg10sB]"[--]
"sP:" ()
"sP;bR"/__"sP92wRsP

Sample run:

llama@llama:...Code/snowman/ppcg53483lamp$ snowman lamp.snowman
5
[--]
 ()
 ()
 ()
 ()
 ()
/__\

So I only noticed that I forgot to implement the ability to escape backslashes within strings when I solved this challenge. That's definitely going to be a thing in the next version, but for now, here's what I did to print the final line:

"/__"sP92wRsP

92 is the ASCII code for a backslash, wR wraps it in an array, and I can now print it with sP because "strings" in Snowman are actually just arrays of numbers.


Pyth - 16 bytes

Uses quotes for the shade since N is preinitialized to that.

*N4VQ+d`();"/__\

Try it online here.

* 4            String repetition 4x, implicit print
 N             Preinitialized to Quote
VQ             For N in range(Q)
 +             String concat
  d            Space
   `()         Repr of empty tuple
;              Close for loop
"/__\          Implicitly print string, implicit close quote

Sample for 5:

""""
 ()
 ()
 ()
 ()
 ()
/__\

><>, 43 41 38 bytes

"\__/"aiv
"&-1v!?:<&a" ()
~"!_\
?!;o>l

Input via a code point, e.g. space is 32. This uses part of the program's own code as the lampshade, resulting in something that looks like a satellite dish:

~\_!
 ()
 ()
 ()
 ()
 ()
/__\

(Suggestion thanks to @randomra)

For three more bytes, we can change the third line to add a bit more customisation:

"\__/"aiv
"&-1v!?:<&a" ()
__\"\~"/
?!;o>l

This produces one of those lamps which shoot light upwards, for lack of a better way of putting it:

\__/
 ()
 ()
 ()
 ()
 ()
/__\