[Question]
  [
Here is an ASCII [saltine cracker](http://en.wikipedia.org/wiki/Saltine_cracker):
```
 _________________
|  .     .     .  |
|     .     .     |
|  .     .     .  |
|     .     .     |
|  .     .     .  |
|_________________|
```
Here are two crackers stacked:
```
 _________________
|  .     .     .  |
|     . __________|______
|  .   |  .     .     .  |
|     .|     .     .     |
|  .   |  .     .     .  |
|______|     .     .     |
       |  .     .     .  |
       |_________________|
```
Write the shortest program possible that takes a positive integer and draws a stack of that many ASCII saltine crackers.
Input may come from stdin, command line, or you may simply write a function. The input will always be valid. Output must go to stdout or closest alternative.
Each stacked cracker is always shifted 2 characters down and 7 characters right of the cracker below it. There should be no trailing spaces or extraneous newlines.
The shortest program [in bytes](https://mothereff.in/byte-counter) wins.
# Examples
If the input is `1` the output is
```
 _________________
|  .     .     .  |
|     .     .     |
|  .     .     .  |
|     .     .     |
|  .     .     .  |
|_________________|
```
If the input is `2` the output is
```
 _________________
|  .     .     .  |
|     . __________|______
|  .   |  .     .     .  |
|     .|     .     .     |
|  .   |  .     .     .  |
|______|     .     .     |
       |  .     .     .  |
       |_________________|
```
If the input is `3` the output is
```
 _________________
|  .     .     .  |
|     . __________|______
|  .   |  .     .     .  |
|     .|     . __________|______
|  .   |  .   |  .     .     .  |
|______|     .|     .     .     |
       |  .   |  .     .     .  |
       |______|     .     .     |
              |  .     .     .  |
              |_________________|
```
And so on.
*[the real saltine challenge](http://en.wikipedia.org/wiki/Saltine_cracker_challenge)*
  
[Answer]
## JavaScript (E6) 249  ~~259 289 304 345~~
~~Not so confident about the string compression.~~ 
Found a good compression for the strings. ~~The simple 1 cracker case seems difficult to manage. There may be a better way...~~
```
F=n=>{
  for(B=",|4.,|1.2,|1.4.4.1|,|5,|4.4.4|, 9|5, 87 ,|87|".replace(/\d/g,c=>' _'[c>4|0][R='repeat'](-~c)).split(','),
  O=(c,b=0,a=0)=>console.log(' '[R](y)+B[a]+B[b][R](x)+B[c]),
  r=x=y=0,
  O(7);
  O(3,2),
  !(z=++r>2)|x;)
    x+=(v=r<n)-z,O(v+5,1,z*4),y+=z*7;
  O(8)
}
```
**Ungolfed** more or less
That is the basic code, before I started golfing. It's not exactly the same and works only for n > 2
```
F=n=>{
  O=t=>console.log(t)
  r=0
  x=0
  y=0
  O(' _________________')
  O(' '.repeat(y)+'|  .   '.repeat(x)+'|  .     .     .  |')
  while (++r<n)
  {
    x++;
    if (r>2)
    {
       x--;
       O(' '.repeat(y)+'|______'+'|     .'.repeat(x)+' __________|______')
       y+=7;
       O(' '.repeat(y)+'|  .   '.repeat(x)+'|     .     .     |')
    }
    else
    {
       O(' '.repeat(y)+'|     .'.repeat(x)+' __________|______')
       O(' '.repeat(y)+'|  .   '.repeat(x)+'|  .     .     .  |')
    }
  }  
  while(x--)
  {
     O(' '.repeat(y)+'|______'+'|     .'.repeat(x)+'|  .     .     .  |')
     y+=7;
     O(' '.repeat(y)+'|  .   '.repeat(x)+'|     .     .     |')
  }
  O(' '.repeat(y)+'|_________________|')
}
```
**Test** In FireFox/FireBug console
```
F(4)
```
*Output*
```
 _________________
|  .     .     .  |
|     . __________|______
|  .   |  .     .     .  |
|     .|     . __________|______
|  .   |  .   |  .     .     .  |
|______|     .|     . __________|______
       |  .   |  .   |  .     .     .  |
       |______|     .|     .     .     |
              |  .   |  .     .     .  |
              |______|     .     .     |
                     |  .     .     .  |
                     |_________________|
```
[Answer]
# Python, ~~252~~ 241 characters
```
s="eJxTiIeDGgiloBBRo6CgpwACcLIGJKaAKlxDmbp4dFADAL+oIFI=".decode('base64').decode('zip').split('X')
N=input()
R=range
G=map(list,[' '*(7*N+12)]*(2*N+5))
for n in R(N):
 for y in R(7):G[2*n+y][7*n:]=s[y]
G[0][11]='_'
for g in G:print''.join(g)
```
Thanks to FryAmTheEggman and Vincent for snipping off 11 characters. 
A preponderance of crackers:
```
$ echo 17 | python saltines.py
 _________________
|  .     .     .  |
|     . __________|______
|  .   |  .     .     .  |
|     .|     . __________|______
|  .   |  .   |  .     .     .  |
|______|     .|     . __________|______
       |  .   |  .   |  .     .     .  |
       |______|     .|     . __________|______
              |  .   |  .   |  .     .     .  |
              |______|     .|     . __________|______
                     |  .   |  .   |  .     .     .  |
                     |______|     .|     . __________|______
                            |  .   |  .   |  .     .     .  |
                            |______|     .|     . __________|______
                                   |  .   |  .   |  .     .     .  |
                                   |______|     .|     . __________|______
                                          |  .   |  .   |  .     .     .  |
                                          |______|     .|     . __________|______
                                                 |  .   |  .   |  .     .     .  |
                                                 |______|     .|     . __________|______
                                                        |  .   |  .   |  .     .     .  |
                                                        |______|     .|     . __________|______
                                                               |  .   |  .   |  .     .     .  |
                                                               |______|     .|     . __________|______
                                                                      |  .   |  .   |  .     .     .  |
                                                                      |______|     .|     . __________|______
                                                                             |  .   |  .   |  .     .     .  |
                                                                             |______|     .|     . __________|______
                                                                                    |  .   |  .   |  .     .     .  |
                                                                                    |______|     .|     . __________|______
                                                                                           |  .   |  .   |  .     .     .  |
                                                                                           |______|     .|     . __________|______
                                                                                                  |  .   |  .   |  .     .     .  |
                                                                                                  |______|     .|     .     .     |
                                                                                                         |  .   |  .     .     .  |
                                                                                                         |______|     .     .     |
                                                                                                                |  .     .     .  |
                                                                                                                |_________________|
```
This code seems really inefficient, but other answers will tell. It just copies and pastes the saltine cracker into an array at the right spot, accounts for the bottom-most cracker being 1-character off, then prints it all.
I can get it down to **230 characters** if I use an external file (202 code + 38 file size + 1 file name).
[Answer]
# Perl 189
Stealing some string compression ideas from choroba, I got it down to:
```
echo 4 | perl -E 's/\d/($&<8?$":_)x$&/ge for@l=("|2.5.5.2|"," 98","|5.5.5|","|98|",7)[102020344=~/./g];map{say for@l[0,1];$l[$_]=substr($l[$_+2],0,7).$l[$_]for 0..6;substr$l[0],-7,1,"|"}2..<>;say for@l[0..6]'
```
For easier viewing in your browser:
```
s/\d/($&<8?$":_)x$&/ge for@l=
("|2.5.5.2|"," 98","|5.5.5|","|98|",7)[102020344=~/./g];map{
    say for@l[0,1];
    $l[$_]=substr($l[$_+2],0,7).$l[$_]for 0..6;
    substr$l[0],-7,1,"|"
}2..<>;say for@l[0..6]
```
For context, my best before that:
# Perl 207
```
$u='_'x11;s/:/ .  /g,s/.(.)/$&$1/g,$_.=$/for@l=("|:: . |"," $u","|  :: |","|$u|",$"x5)[102020344=~/./g];map{print@l[0,1];$l[$_]=substr($l[$_+2],0,7).$l[$_]for 0..6;substr$l[0],-8,1,'|'}2..pop;print@l[0..6]
```
Adding newlines and indentation for ease of reading in your browser:
```
$u="_"x11;
s/:/ .  /g,s/.(.)/$&$1/g,$_.=$/for@l=
("|:: . |"," $u","|  :: |","|$u|",$"x5)[102020344=~/./g];
map{
    print@l[0,1];
    $l[$_]=substr($l[$_+2],0,7).$l[$_]for 0..6;
    substr$l[0],-8,1,"|"
}2..pop;
print@l[0..6]
```
You can replace "pop" with "<>" to take the count from STDIN instead of as a command-line parameter and get to 206 bytes. Going to STDERR would drop it to 204 bytes.
If I could enable the 'say' feature without a byte penalty, then I could get to 202.
```
$u="_"x11;s/:/ .  /g,s/.(.)/$&$1/g for@l=("|:: . |"," $u","|  :: |","|$u|",$"x5)[102020344=~/./g];map{say for@l[0,1];$l[$_]=substr($l[$_+2],0,7).$l[$_]for 0..6;substr$l[0],-7,1,"|"}2..<>;say for@l[0..6]
```
invoked as:
```
echo 4 | perl -E '$u="_"x11;s/:/ .  /g,s/.(.)/$&$1/g for@l=("|:: . |"," $u","|  :: |","|$u|",$"x5)[102020344=~/./g];map{say for@l[0,1];$l[$_]=substr($l[$_+2],0,7).$l[$_]for 0..6;substr$l[0],-7,1,"|"}2..<>;say for@l[0..6]'
```
[Answer]
# CJam, ~~140~~ ~~125~~ ~~119~~ 116 bytes
```
li__7*C+S*a\2*5+*\{5m>S'|6*+_" ."5*5/{'__@\++}:U%3*0@t{S5*U_}%\a+zsB'|tJ/{\(J>@\+a+}/{7m<}%}*{Cm<0{;)_' =}g+}%N*B'_t
```
[Try it online.](http://cjam.aditsu.net/ "CJam interpreter")
### A single saltine
The code snippet
```
S'|6*+_      " Push ' ||||||' twice.                                                      ";
" ."5*5/     " Push [' . . ' '. . .'].                                                    ";
{'__@\++}:U% " Prepend and append an underscore to each string in the previous array.     ";
3*           " Repeat the resulting array thrice.                                         ";
0@t          " Replace its first element with ' ||||||'.                                  ";
{S5*U_}%     " Insert '_     _' after each element of the array.                          ";
\a+          " Append ' ||||||' to the array.                                             ";
z            " Zip; transpose rows with columns.                                          ";
sB'\t        " Flatten the array of strings and replace the 12th element with a '|'.      ";
19/          " Split into chunks of length 19.                                            ";
```
leaves the following on the stack:
```
[
  " __________|______ "
  "|  .     .     .  |"
  "|     .     .     |"
  "|  .     .     .  |"
  "|     .     .     |"
  "|  .     .     .  |"
  "|_________________|"
]
```
### Stacked saltines
Assume the saltine from above is saved in Z.
```
li               " I := int(input())                                                      ";
__7*C+S*a\2*5+*  " R:= [(I * 7 + 12) * ' '] * (I * 2 + 5)                                 ";
\{               " Repeat I times:                                                        ";
  5m>            "   R := R[-5:] + R[:-5]                                                 ";
  Z              "   Push a single saltine, as an array of lines.                         ";
  {              "   For each line L of the saltine:                                      ";
    \(J>@\+a+    "     R := R[1:] + [R[0][19:] +     L]                                   ";
  }/             "                                                                        ";
  {7m<}%         "   R := [ L[7:] + L[:7] : L in R ]                                      ";
}*               "                                                                        ";
{                " R := [                                                                 ";
  Cm<            "   (L[12:] + L[:12])                                                    ";
  0{;)_' =}g+    "                    .rstrip()                                           ";
}%               " : L in R ]                                                             ";
N*               " R := '\n'.join(R)                                                      ";
B'_t             " R[11] := '|'                                                           ";
```
[Answer]
# Perl 201
(remove newlines except the first one to get the #)
```
$_=" 46|6
15.5.5|15.5.5|198|";
s/1/|  .5.5.  ||/g;
s/\d/(5^$&?_:$")x$&/ge;
@o=@l=/.{18}.?/g;
map{
$s=$_*7;
substr$o[$_-5],$s,12,$l[$_]for 0..4;
push@o,($"x$s).$l[$_]for 5,6
}1..-1+pop;
$o[$,=$/]=~y/|/_/;
print@o
```
`say` + `<>` = 198.
[Answer]
# Haskell, 215 bytes
This one builds up the cracker stack inductively, pulling cracker parts and spacing out of a couple of cyclic lists:
```
(b:u:i)=" _|"
(%)=replicate
z=5%b++'.':z
m!n=i++map(z!!)[m..n]
s=7%b:s
d=3!19++i
e=0!16++i
y=i++6%u
g 1=[e,d,e,d,i++17%u++i]
g k=zipWith(++)(0!5:3!8:0!5:3!8:y:s)$(b:10%u++y):d:g(k-1)
f k=mapM putStrLn$(b:17%u):d:g k
```
The control flow is pretty straightforward; most of the trickery is in reusing as much of the cracker parts as possible.
**Ungolfed:**
```
top     = " _________________"
top'    = " __________|______"
dots3   = "|  .     .     .  |"
dots2   = "|     .     .     |"
bot     = "|_________________|"
halfR   = "|     ."
halfL   = "|  .   "
halfBot = "|______"
spacer  = "       "
spaces = repeat spacer
saltine = above ++ [dots2, dots3, dots2, dots3, bot]
above   = [top, dots3]
left    = [halfR, halfL, halfR, halfL, halfBot] ++ spaces
another (oldTop:oldCracker) = above ++ zipWith (++) left (top' : oldCracker)
crackers 1 = saltine
crackers k = another $ crackers (k - 1)
test = putStr . unlines . crackers
```
[Answer]
# Python, 299
I thought I was being clever but the solution turned out to be overly complicated and longer than any straight forward approach, yet I couldn't resist to post it. The program explicitly calculates which character has to be plotted at the different positions of the output string, without looping over the individual crackers.
```
N=input()
m,n,c,r=12+7*N,5+2*N,3.5,range
print''.join(i>m-2and'\n'or(i%7<(i/c<j<7+i/c)*(i<N*7)or(i+4)%7<(i/c<j+4<2+4*(i>m-3)+i/c)*(i>16))and'|'or j%2<(j*c<i<17+j*c)*(j<n-5)+(j*c<i+22<8+10*(j>n-3)+j*c)*(j>5)and'_'or(i-j*3-min(i/7,~-j/2,N-1)+1)%6<(-3<-~i/7-j/2<3)and'.'or' 'for j in r(n)for i in r(m))
```
And the last line expanded to see what's going on:
```
print ''.join(
              '\n' if i>m-2 else
              '|' if i%7<(i/c<j<7+i/c)*(i<N*7) or (i+4)%7<(i/c<j+4<2+4*(i>m-3)+i/c)*(i>16) else
              '_' if j%2<(j*c<i<17+j*c)*(j<n-5)+(j*c<i+22<8+10*(j>n-3)+j*c)*(j>5) else
              '.' if (i-j*3-min(i/7,~-j/2,N-1)+1)%6<(-3<-~i/7-j/2<3) else
              ' '
              for j in r(n)
              for i in r(m)
             )
```
[Answer]
# C,284
For the function `f` and the `#define`s, excluding unnecessary whitespace and `main`. In accordance with edc65's comment, I have included a 128-bit integer type (which I was going to do anyway) but I miscalculated *again* and I can only do 29 crackers before the tops start going missing.
Complete function and test program below. Will comment it later.
```
#define C b,b,c,b,b
#define S s[i/v*7-i%v
f(n){
  __int128 a=4095,b=a+2,c=6281,d=4641,w=998,v=19,s[998]={a,C,d,C,d,C,a},i=v;
  for(;i<n*v;i++)S+18]|=S+11]*16&-1<<(12+i/v*2-i%v/18)*(i%v>7); 
  for(i=(5+n*2)*w;i--;i%w||puts(""))i%w>i/w/2*7-21+i/w%2*6&&s[i%w]&&putchar(" _.|"[(s[i%w]>>i/w*2)&3]);
}
 
main(){
  int m;
  scanf("%d",&m);f(m);
}
```
There are only four different characters in the output. These are decoded from binary numbers 0-3 by `" _.|"`. The array `s[]` contains an integer for each column of the output, 2 bits per symbol, which is intitialised to contain the rightmost cracker.
The first `for` loop copies the previous cracker, leftshifts it to move it up, deletes the bottom right corner using `&`  and ORs it with the previous cracker, 7 steps to the left.
The second `for` loop decodes the 2-bit representation of each character into the actual character and prints the character. There's a lot of code here just to suppress unnecesary whitespace in the output. I'm disappointed that my score went up instead of down from my previous revision.
**Output**
That's 29 crackers. I replaced the space with a `-` for a different look, and to show that no trailing spaces or extraneous newlines in the output.
```
-_________________
|--.-----.-----.--|
|-----.-__________|______
|--.---|--.-----.-----.--|
|-----.|-----.-__________|______
|--.---|--.---|--.-----.-----.--|
|______|-----.|-----.-__________|______
-------|--.---|--.---|--.-----.-----.--|
-------|______|-----.|-----.-__________|______
--------------|--.---|--.---|--.-----.-----.--|
--------------|______|-----.|-----.-__________|______
---------------------|--.---|--.---|--.-----.-----.--|
---------------------|______|-----.|-----.-__________|______
----------------------------|--.---|--.---|--.-----.-----.--|
----------------------------|______|-----.|-----.-__________|______
-----------------------------------|--.---|--.---|--.-----.-----.--|
-----------------------------------|______|-----.|-----.-__________|______
------------------------------------------|--.---|--.---|--.-----.-----.--|
------------------------------------------|______|-----.|-----.-__________|______
-------------------------------------------------|--.---|--.---|--.-----.-----.--|
-------------------------------------------------|______|-----.|-----.-__________|______
--------------------------------------------------------|--.---|--.---|--.-----.-----.--|
--------------------------------------------------------|______|-----.|-----.-__________|______
---------------------------------------------------------------|--.---|--.---|--.-----.-----.--|
---------------------------------------------------------------|______|-----.|-----.-__________|______
----------------------------------------------------------------------|--.---|--.---|--.-----.-----.--|
----------------------------------------------------------------------|______|-----.|-----.-__________|______
-----------------------------------------------------------------------------|--.---|--.---|--.-----.-----.--|
-----------------------------------------------------------------------------|______|-----.|-----.-__________|______
------------------------------------------------------------------------------------|--.---|--.---|--.-----.-----.--|
------------------------------------------------------------------------------------|______|-----.|-----.-__________|______
-------------------------------------------------------------------------------------------|--.---|--.---|--.-----.-----.--|
-------------------------------------------------------------------------------------------|______|-----.|-----.-__________|______
--------------------------------------------------------------------------------------------------|--.---|--.---|--.-----.-----.--|
--------------------------------------------------------------------------------------------------|______|-----.|-----.-__________|______
---------------------------------------------------------------------------------------------------------|--.---|--.---|--.-----.-----.--|
---------------------------------------------------------------------------------------------------------|______|-----.|-----.-__________|______
----------------------------------------------------------------------------------------------------------------|--.---|--.---|--.-----.-----.--|
----------------------------------------------------------------------------------------------------------------|______|-----.|-----.-__________|______
-----------------------------------------------------------------------------------------------------------------------|--.---|--.---|--.-----.-----.--|
-----------------------------------------------------------------------------------------------------------------------|______|-----.|-----.-__________|______
------------------------------------------------------------------------------------------------------------------------------|--.---|--.---|--.-----.-----.--|
------------------------------------------------------------------------------------------------------------------------------|______|-----.|-----.-__________|______
-------------------------------------------------------------------------------------------------------------------------------------|--.---|--.---|--.-----.-----.--|
-------------------------------------------------------------------------------------------------------------------------------------|______|-----.|-----.-__________|______
--------------------------------------------------------------------------------------------------------------------------------------------|--.---|--.---|--.-----.-----.--|
--------------------------------------------------------------------------------------------------------------------------------------------|______|-----.|-----.-__________|______
---------------------------------------------------------------------------------------------------------------------------------------------------|--.---|--.---|--.-----.-----.--|
---------------------------------------------------------------------------------------------------------------------------------------------------|______|-----.|-----.-__________|______
----------------------------------------------------------------------------------------------------------------------------------------------------------|--.---|--.---|--.-----.-----.--|
----------------------------------------------------------------------------------------------------------------------------------------------------------|______|-----.|-----.-__________|______
-----------------------------------------------------------------------------------------------------------------------------------------------------------------|--.---|--.---|--.-----.-----.--|
-----------------------------------------------------------------------------------------------------------------------------------------------------------------|______|-----.|-----.-__________|______
------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--.---|--.---|--.-----.-----.--|
------------------------------------------------------------------------------------------------------------------------------------------------------------------------|______|-----.|-----.-__________|______
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--.---|--.---|--.-----.-----.--|
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|______|-----.|-----.-__________|______
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--.---|--.---|--.-----.-----.--|
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|______|-----.|-----.-----.-----|
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--.---|--.-----.-----.--|
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|______|-----.-----.-----|
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--.-----.-----.--|
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|_________________|
```
[Answer]
# JavaScript (ES6) HTML5 - 233 236 bytes
Probably not a valid answer, but I just couldn't resist posting, sorry :-P
```
F=n=>{d="______";b="\n|  .     .     .  |";a=b+"\n|     .     .     |";for(i=0;i<n;)document.body.innerHTML+="<pre style='background:#fff;position:fixed;top:"+i*28+"px;left:"+i*56+"px'> ____"+d+'|_'[+!i++]+d+a+a+b+"\n|"+d+d+"_____|"}
```
Test in Firefox with `F(1)`, `F(2)`, `F(3)`, etc.
**Example:** <http://jsfiddle.net/Lvmg9fe8/7/>
[Answer]
# [Canvas](https://github.com/dzaima/Canvas), 54 [bytes](https://github.com/dzaima/Canvas/blob/master/files/chartable.md)
```
Ｈ┐“)4╪xω╷┘IＱ+aｚQ┴¾４＊↔⌐∔v│↶++z2；ｅ＼１ｐ9H+m}`1Ｌ²‟19┤ｎ；８３╋╋
```
[Try it here!](https://dzaima.github.io/Canvas/?u=JXVGRjI4JXUyNTEwJXUyMDFDJTI5NCV1MjU2QXgldTAzQzkldTI1NzcldTI1MThJJXVGRjMxK2EldUZGNUFRJXUyNTM0JUJFJXVGRjE0JXVGRjBBJXUyMTk0JXUyMzEwJXUyMjE0diV1MjUwMiV1MjFCNisrejIldUZGMUIldUZGNDUldUZGM0MldUZGMTEldUZGNTA5SCttJTdEJTYwMSV1RkYyQyVCMiV1MjAxRjE5JXUyNTI0JXVGRjRFJXVGRjFCJXVGRjE4JXVGRjEzJXUyNTRCJXUyNTRC,i=Mw__,v=8)
]