[Question]
  [
I love sardines, I can't get enough of them, and so does my computer, the Omnilang 5000, which is language agnostic.
To give my computer the joy of experiencing sardines, I've decided to feed him a number of programs that are capable of displaying on the screen tins of sardines in various orientations, and showing up to ten sardines.
In this challenge, you'll be responsible for creating the programs based on these parameters:
## The input
A number (between 0 and 10) and a letter from one of the following "LR" (representing Left or Right respectively)
For example: `3L` or `5R`; how this is input into the program is up to you.
## Output
An open tin of sardines with the sardines facing the indicated direction, with the key (represented by the "`%`" character) and peeled lid (rolled up tin at the end represented by the "`@`" character) located at the top of the tin.
* All sardines must face the direction indicated by the input.
* All sardines will have bodies five characters long between the gill (either "`)`" or "`(`" ) and the tail "`><`"
* The key and peeled lid roll will always be facing the opposite direction to the sardines.
* The tin must have a 3-D look to it as shown below in the examples.
* The minimum height of the tin is 3 sardines in height. So if a number is less than 3, a tin of 3 sardines in height must be shown, with the inputted number of sardines in it. Otherwise, the tin must be the number of sardines high indicated in the input. So input of `0R` or `0L` will show an empty sardine tin.
* Any other input that can't be validated will not show anything.
For example, for "`3L`"
```
 __________
(__________@%
|<*)_____><||
|<*)_____><||
|<*)_____><||
'==========''
```
For "`7R`"
```
   __________
 %@__________)
 ||><_____(*>|
 ||><_____(*>|
 ||><_____(*>|
 ||><_____(*>|
 ||><_____(*>|
 ||><_____(*>|
 ||><_____(*>|
 ''=========='  
```
For "`2L`"
```
 __________
(__________@%
|<*)_____><||
|<*)_____><||
|          ||
'==========''
```
For "`0R`"
```
   __________
 %@__________)
 ||          |
 ||          |
 ||          |
 ''=========='
```
"`0L`"
```
 __________
(__________@%
|          ||
|          ||
|          ||
'==========''
```
Invalid input will not return anything...
* This is code golf, so the smallest number of characters will win this challenge.
* [No Loopholes](https://codegolf.meta.stackexchange.com/questions/1061/loopholes-that-are-forbidden-by-default) as per usual.
  
[Answer]
# [><>](https://esolangs.org/wiki/Fish), ~~250~~ 235 + 3 = 238 bytes
```
</~?{"  __________"a:="L"i&
o/?=1l
:/}rv?{~$?{"()__________@%":
l< o/?=1
:&oa/&~$?(3$@0-3:
/!?:</"||><_____(*>|"av?@:$-1
 /=?/v"|<*)_____><||"a/
 \2lo/
\~&
\>:?!\1+$::{a"|"{?:"          ||"{?~
<\?=2 lo
"'":~/~?{"''==========":?{
;!?lo<
```
[Try it online](https://tio.run/##RY/BqsIwEEX38xXp0NdWH2Vs3Y1Jpx/gJwSkG7EQCLwH3STm12OtqGd553C5c53/bzlrShJQqcsHnNjgGecKPInpHDDd/xYJqVzFZvcVxx9kcFptGnDlJ6pWqTmW46E9MlAhrAljHPTmN/sh4rTIyGXbgSIjtGDU@1floON6JVC2d57ApgrswFLY7rdkDhNGDMLr0jfxGSTQVkyvnAeskdP2TV2bD8gS4FSI8zrnc24X1T8A "><> ‚Äì Try It Online"), or watch it at the [fish playground](https://fishlanguage.com/playground)! Reads the "L" or "R" from STDIN and assumes the number of sardines is already on the stack (needs a `-v` flag for +3 bytes).
Because of course I had to write this in ><>.
[Answer]
# [Emojicode](http://www.emojicode.org/), ~~456~~ 448 bytes
```
üêãüöÇüçáüêñüêüdüöÇüçáüç¶aüòõ0düçäaüçáüòÄüî§ __________‚ùån(__________@%üî§üçâüçìüçáüòÄüî§  __________‚ùån%@__________)üî§üçâüîÇi‚è©0üêïüçáüçäaüçáüòÄüî§|<*)_____><||üî§üçâüçìüçáüòÄüî§||><_____(*>|üî§üçâüçâüçä‚ñ∂Ô∏è4üêïüçáüîÇi‚è©0‚ûñ3üêïüçáüçäaüçáüòÄüî§|          ||üî§üçâüçìüçáüòÄüî§||          |üî§üçâüçâüçâüçäaüçáüòÄüî§'==========''üî§üçâüçìüçáüòÄüî§''=========='üî§üçâüçâüçâ
```
Takes 2 arguments: first one is lines, second one is direction (0 or 1).
[Try it online!](https://tio.run/##S83Nz8pMzk9J/f//w/wJ3R/mz2r6ML@3HcieBsTzUxACvcsSP8yfMdsAKNTblQgRm9HwYf6UJQrxcPBobk@eBoLroAqSB6rtBOLJKHrQNKk6IPiaCE1TmjIf9a80ADplKtQVqFbX2GhpgvXY2dTU4LKrpsbOBqxIQ8sOWREIdz2atu39jn4ThA1QKx/Nm2aM21oFOMBnLZIqNGs7MYxUt4UDdXVcRqojq0I3EhiB/Y0KIOVcCgqgyFMwUjDkAssAAA)
"Readable" ungolfed version and pseudocode version:
```
üêã üöÇ üçá
  üêñ üêü  d üöÇ  üçá
    üç¶ a  üòõ 0 d
    üçä a üçá
      üòÄ üî§ __________‚ùån(__________@%üî§
    üçâ
    üçì üçá
      üòÄ üî§  __________‚ùån%@__________)üî§
    üçâ
    üîÇ i ‚è© 0 üêï üçá
      üçä a üçá
        üòÄ üî§|<*)_____><||üî§
      üçâ
      üçì üçá
        üòÄ üî§||><_____(*>|üî§
      üçâ
    üçâ
    üçä ‚ñ∂Ô∏è 4 üêï üçá
      üîÇ i ‚è© 0  ‚ûñ 3 üêï  üçá
        üçä a üçá
          üòÄ üî§|          ||üî§
        üçâ
        üçì üçá
          üòÄ üî§||          |üî§
        üçâ
      üçâ
    üçâ
    üçä a üçá
      üòÄ üî§'==========''üî§
    üçâ
    üçì üçá
      üòÄ üî§''=========='üî§
    üçâ
  üçâ
üçâ
üëµ
extendclass int { // this makes the first argument be an int without declaring it
  func üêü(int d) {
    const a = 0 == d // a bool
    if a {
      print " __________\n(__________@%"
    }
    else {
      print "  __________\n%@__________)"
    }
    for i in range(1, arg) {
      if a {
        print "|<*)_____><||"
      }
      else {
        print "||><_____(*>|"
      }
    }
    if 4 > arg {
      for i in range(0, arg - 3) {
        if a {
          print "|          ||"
        }
        else {
          print "||          |"
        {
      }
    }
    if a {
      print "'==========''"
    }
    else {
      print "''=========='"
    {
  }
}
üëµ
```
[Answer]
# [Python 2](https://docs.python.org/2/), 155 bytes
```
lambda x,y,t='_'*10:'\n'.join(x[::1-2*y]for x in[' %s  '%t,'()'[y]+t+'@%']+['|'+('<>**)(%s><<>'%t)[y::2]+'||']*x+['|'+' '*10+'||']*(3-x)+["'"+'='*10+"''"])
```
[Try it online!](https://tio.run/##Lc3dCoIwAIbhWxmD8e3PyHU2VLqPOaIIyagpuoMNvPf1e/rywDvneJuCKUPbl8f5ebmeSdJZxxYnyHpv0Qfs7tMYeHLW1pWR2Q/TQhIZgwNhKyFgUYMLuOxVVDgyeOWwQXE0nZSCs7Vrmu7NhMvWGq@wbfAy/RTIZ/Rv/FAloRwFVWi/nQLUizIvY4hk4EbXorwA "Python 2 ‚Äì Try It Online")
Input consists of a length 2 tuple. The first element indicates the number of sardines. The second element indicates the direction; `0` for left, `1` for right.
-84 bytes using lambda magic thanks to notjagan and officialaimm
[Answer]
# [Fishing](https://esolangs.org/wiki/Fishing), 1311 bytes
```
v+CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC?CCCDCC[CCCCCCCCCCCCCCCCCCCCC?CCCCCCCCCCCCCCCCCCCC[CCC[CCCCC?CCCC?DDDDD[CCCCCCCCCCCCCCCCCCC?CCCCCCCCCCCCCCCCC[?CCCCCCCCCCCCCCCC_
  `3`n{n{In{I{`L`{`  __________ `}}!{{rD}}D{{NE`%@__________)`}}!{{E`(__________@%`}}D{{NDE}}}}={d}}!  d  D{{{{{`><_____(*>`}}!{{E`<*)_____><`}}D!{{{E`|`P}PE`||`ND
                                   [DDDDDD|                     [DDDDDDDDDDDDDDDDDDDD|   D     [C?CDDDDDDDDCCCCCCCCCCCCCCCCCCC[DDDDDDDDDDDDDDDDD|[CCCCCCCCCCCCCCCC_
                                                                                         D      }=d [^+Cv-|{{{{{`          `}}                    {{{E`||`P}PE`|`ND
                                                                                         D       [CCCCCCCCCCCCCCCCCCC?DDDDDDDDD+CCCC                              D
                                                                                         D        E`''=========='`{{{= }}}r{{{ [CCCC                              D
                                                                                         D                           [^CCCCCCCv|}}}N                              D
                                                                                         |DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD]
```
Takes input from `stdin` in the form:
```
5
R
```
Fishing isn't on [Try It Online](https://tryitonline.net), but there's an interpreter for it in Ruby on the linked esolangs page.
This is the first program I've made in Fishing -- in fact, it's the first program I've made in any 2D language -- so it can probably be a lot shorter. Golfing tips are welcome (though I wouldn't be surprised if no one gave any, considering that even I don't know what the heck I just wrote).
Here's a GIF of the path the program takes for input `1R` (sorry for low quality):
![GIF](https://i.stack.imgur.com/xNd9L.gif)
(This was created using an interpreter that I made; there are no publicly available programs that "visualize" Fishing, as far as I know)
[Answer]
# [Charcoal](https://github.com/somebody1234/Charcoal), 49 bytes
```
Ôº°‚åà‚ü¶Ôº©Œ∏¬≥‚üßŒ∂Ôº¢œá¬≤_‚Üê‚Üì(‚ÜìŒ∂'√ó=œá''‚ÜñÔº∞‚ÜëŒ∂‚Üê‚ÜëŒ∂@%Ôº¶ÔºÆ‚Äú#‚à®‚ÄπÔº∂Ôº¢“¬´ji‚ÄùÔº¶ÔºÆ‚ÄñÔº¥
```
[Try it online!](https://tio.run/##dY5Lq8IwEIX3/ooQECdSwerOF3rv3QhWRHSlUmJJNdAkvUmq4p@PEesD0VkMzDmH70yypzpRNHNuZAzfSYjoiYtCwOqXGgv/JEDtjV9n0q38qBOEzQC1AoRj7IVIHRh0Jiy1/phpLi10/tRReh/wu3R@CLj2NBdcMAO4jwMUNslLpPYsWOZlRVRkluc36DK/IT/9cPdK1rB6ZaVKIxjLvLDTQmyZBkJQGVjrXp3E1xn0vkXnLM1YYheaSuN9AaTrXAuFrnFwDZNdAA "Charcoal ‚Äì Try It Online") Link is to verbose version of code. First argument is number of sardines, second is direction (0 = left, 1 = right).
[Answer]
# [SOGL V0.12](https://github.com/dzaima/SOGL), ~~51~~ 48 [bytes](https://github.com/dzaima/SOGL/blob/master/chartable.md)
```
!gX‚Å¥‚Äògj‚Å∞%!‚Åµ‚Äòb‚å°"Œ∫N‚ï•‚ñà*‚â§‚å°‚ïë)‚Äò3b-"√∑AZ‚Å¥‚Äò‚àô_"ŒßccœÉ¬´‚Äò‚Å∞e?¬±‚Üî
```
[Try it Here!](https://dzaima.github.io/SOGLOnline/?code=JTIxZ1gldTIwNzQldTIwMThnaiV1MjA3MCUyNSUyMSV1MjA3NSV1MjAxOGIldTIzMjElMjIldTAzQkFOJXUyNTY1JXUyNTg4KiV1MjI2NCV1MjMyMSV1MjU1MSUyOSV1MjAxODNiLSUyMiVGN0FaJXUyMDc0JXUyMDE4JXUyMjE5XyUyMiV1MDNBN2NjJXUwM0MzJUFCJXUyMDE4JXUyMDcwZSUzRiVCMSV1MjE5NA__,inputs=MSUwQTA_)  
Expects input as the 1st one being the count and the 2nd one - left or right represented by 1 or 0.
Explanation:
```
..‚Äò..‚Äò                          push 2 compressed strings - the 1st two lines of the box - "  __________ " and "%@__________)"
      b‚å°                        input times do
        "..‚Äò                      push a line with a sardine - "||><_____(*>|"
            3b-                 push 3-input
               "..‚Äò‚àô            get an array of that many "||          |"
                    _           put all the arrays contents on the stack
                     "..‚Äò       push "''=========='" - the last line
                         ‚Å∞      wrap all of that in an array
                          e?    if the 2nd input [is not 0]
                            ¬±‚Üî    reverse the array horizontally
```
[Answer]
# R, 334 bytes 311 bytes
```
s=function(n,d){
a="__________"
b="'=========='"
if(d == "L"){cat(paste(c(" ",a,"\n(",a,"@%\n",rep("|<*)_____><||\n",n),rep("|          ||\n",max(c(3-n,0))),b,"'\n"),collapse=""))} else {cat(paste(c("  ",a,"\n%@",a,")\n",rep("||><_____(*>|\n",n),rep("||          |\n",max(c(3-n,0))),"'",b,"\n"),collapse=""))}}
```
Function takes a numeric value for n and a string for the direction.
This is my first time posting, so I'll admit I'm not sure how to count bytes of code.
[Answer]
## C++, ~~307~~ ~~296~~ 292 bytes
```
#include<string>
auto z(int n,char c){std::string r=c-82?" __________\n(__________@%\n":"  __________\n%@__________)\n";int l=0;for(;l<n;++l)r+=c-82?"|<*)_____><||\n":"||><_____(*>|\n";for(;l<3;++l)r+=c-82?"|          ||\n":"||          |\n";r+=c-82?"'==========''":"''=========='";return r;}
```
Usage :
```
z(<number of sardines>,<'L' or 'R'>);
```
-11 bytes saved thanks to user ThePirateBay
-4 bytes thanks to Zachar√Ω
[Answer]
# [Python 2](https://docs.python.org/2/), 287 bytes
```
n,d=input()
t,a,b,c,e,k=' __________   ','(__________@% ','|<*)_____><|| ','|          || ',"'=========='' ",'\n'
print[t+k+a+k+k.join([b]*n)+k+k.join([c]*(3-n))+k*(n<3)+e,t[::-1]+k+a[::-1].replace(*'()')+k+k.join([b[::-1].replace(*')(')]*n)+k+k.join([c[::-1]]*(3-n))+k*(n<3)+e[::-1]][d]
```
[Try it online!](https://tio.run/##ZY3bCoMwEETf/YoglE3iKqhvoqX/kUrxBrWWNUj6UPDfUy/FSh1Y2DnMMPpt7j1F1hLWWUv6ZbhwDBZYYoUNdhmw2ybGGCDwH7icZjCmUiz2nI7jAtimBbiQbQJgLsKVwNFDS0YZr/OK6brg0bfEVZlLEjtf5ZLHPomJSU5pLLwGjUoSP8zn5voFQ6OfRdVwCVzAvl4eAoKD@N9YQ8elL1d1bm2ELPwA "Python 2 ‚Äì Try It Online")
Input is a comma separated tuple of numbers of this format: `2, 1`. The first number is the amount of fish and the second is is 0 for left and 1 for right.
This started out as an attempt to out-golf the other answer (I totally thought I could), but it sucks. :P If anybody can make head and tail of it and help golf it (I blame it on it being 12 am right now), I'd be glad.
[Answer]
# C# (.NET Core), 289 bytes
```
(h,d)=>{var l=d=='L';string r=(l?" ":"  ")+"__________\n"+(l?"(":"%@")+"__________"+(l?"@%":")")+"\n";for(int i=0;i<(h>3?h:3);i++){r+=(l?"|":"||")+(i<h?(d=='L'?"<*)_____><":(d=='R'?"><_____(*>":"")):"          ")+(l?"||":"|")+'\n';}var b=(l?"'":"''")+"=========="+(l?"''":"'");return r+b;}
```
[Try it online!](https://tio.run/##jVBNa8IwGL77K14CksR2IjgYNE0rDHZyMNxhhzlGrdUGagpvojC0v71LUia4k88tz1eepDQPZYtVXzaFMfCG7R6Lw@g8AgdjC6tKOLVqC6@F0sxYVHr/@QUF7g0PnsHp8f5jbHWYvhx1mSptYyjrAmMYMhnsQPasjrdcZudTgdDIrZR0ScVgAJSsyQmQhAAQHpHvK9aaRF5jThsvbrVBWYydxL3ivGLXInMDQMmZUCmrs3leJ3MuVBTxM0bhnosLXC4uwVRa52yYkpN0wkNtlpIkkCtHZmng2CRzIcK5X/gH3@DrQp870LWmovPv24R7qOMp9cvkFcNmGiTCBVb2iBow2oiuF/@/87nVpm2q6QcqWy2VrtiOPcbg1nJ@l/nJmVf3mmc3zd2o638B "C# (.NET Core) ‚Äì Try It Online")
Takes an integer and a char (L, R) as parameters and outputs the resulting string.
Ugh. Had to deal with some annoying string constants, sadly you cant just do `string * length` in C#. And the method with `new string(char, length)` wouldn't have been worth the byte cost.
---
The algorithm works as follows:
1. At the start we determine if the sardines face right or left, since we will then format our strings accordingly. We create a string for the top, with some conditional operators to switch between the L and R perspective.
2. Then we create a loop that runs 3 times at minimum and the left input times at maximum. That way we can create empty spaces if we have less than 3 sardines in our box.
3. Inside this loop we format a string, depending on the perspective and also, if `h > i`, we put a sardine inside of it. If `i >= h`, there will be an empty space where a sardine would normally be.
4. At the end we create the bottom of the box, again formatted according to perspective.
[Answer]
# [Perl 5](https://www.perl.org/), 167 + 1 (-n) = 168 bytes
```
($n,$d)=/(\d+)([LR])/ or die;say('R'eq$d?(reverse$_)=~y/()></)(<>/r:$_)for" __________  ","(__________@%",("|<*)_____><||")x$n,("|          ||")x(3-$n),"'==========''"
```
[Try it online!](https://tio.run/##RY1LCsIwFACvEh6RvKep8UM3mlYPoJtuVYqQCAVJaipioXh0Y@mizm5mM7UN9zRG5E5yQ5nCs5kRng7FhRTzgZnKbptri6IQ9sHNDoN92dBYXlL2aRVSrhWhzlXY9OnmA7ByhDGQgH/fT0AidHpKg@a664De/bqPbGSIuE64IwkiGxECYlwVX18/K@@amBzT@WK5iIn7AQ "Perl 5 ‚Äì Try It Online")
[Answer]
# [JavaScript](https://developer.mozilla.org/en-US/docs/Web/JavaScript) (ES6), ~~283~~ ~~273~~ ~~269~~ 251 bytes
*Saved 10 bytes thanks to @WallyWest*
*Saved 4 bytes removing extra parens*
*Saved 18 bytes thanks to @ThePirateBay*
Suffers from lack of string reversal in the standard library. Defines a function that takes inputs `n` for number of fish and `d` for direction. Throws if `d` is not "L" or "R".
```
(n,d,_=c=>c.repeat(10),x=_(`_`),z=a=>a.reverse``.join``)=>
([p,q,g,r,s]=d>`L`?d>`R`?[]:[`)`,`(`,`>`,z,y=>z(y.split``)]:
[`(`,`)`,`<`,a=>a.join``,y=>y],` ${x}
`+r([p,x,s(`@%`)])+`
`+(r([`|`,g,`*`,q,`_____`,`><`,`||`])+`
`).repeat(n)+r([`'`,_(`=`),`''`]))
```
[Try it online](https://tio.run/##NY/NboMwEITvPIUPqbxutlZ/bk3t9AFyypUixiIkIqKGAkX5fXZqJ6olW6udb2e8eze6vuiqdnjyzaactmYizxvOTWFsobuyLd1AL8@KDyYnmUvFJ@OMdUEay64vAb1vKg8oYylt@Yd33HGfmY3FCsvwrrFMs/cUCgwK14JPfDT2REfdt3U1hNmoRy0yH@BbwN02kseMIWbnwzXBvIshB@4Jnw9hTs0RmhS6uCBE4xHhC8jjiVnBDJcL7pz638er6AMJzgkGiiFlYNQ0uk5Uvv0dhBFpIkT6xnIlM47lK8u1zJJskSRF4/umLnXd7OiG62/XkhPGCszOW9JaO3UNeXEHkl9eKrWY/gA)
[Answer]
# [Vyxal](https://github.com/Lyxal/Vyxal) `j`, 91 bytes
```
√∞\_‚ÇÄ*+√∞d+‚Öõ\(\_‚ÇÄ*`@%`++‚Öõ‚Å∞3WG(\|n‚Å∞‚â•[√∞‚ÇÄ*|`<*)_____><`]\|d++‚Öõ)\'\=‚ÇÄ*\'d++‚Öõ¬æ¬π\R=[∆õ·πò`<>()``><)(`ƒø
```
[Try it Online!](http://lyxal.pythonanywhere.com?flags=j&code=%C3%B0%5C_%E2%82%80*%2B%C3%B0d%2B%E2%85%9B%5C%28%5C_%E2%82%80*%60%40%25%60%2B%2B%E2%85%9B%E2%81%B03WG%28%5C%7Cn%E2%81%B0%E2%89%A5%5B%C3%B0%E2%82%80*%7C%60%3C*%29_____%3E%3C%60%5D%5C%7Cd%2B%2B%E2%85%9B%29%5C%27%5C%3D%E2%82%80*%5C%27d%2B%2B%E2%85%9B%C2%BE%C2%B9%5CR%3D%5B%C6%9B%E1%B9%98%60%3C%3E%28%29%60%60%3E%3C%29%28%60%C4%BF&inputs=R%0A2&header=&footer=)
```
=== Top row ===
√∞\_‚ÇÄ*+√∞d+‚Öõ
√∞          # A space
 \_‚ÇÄ*      # Ten underscores
     +     # Concatenated
      √∞d+  # Two more spaces
         ‚Öõ # Push to global array
=== Next row ===
\(\_‚ÇÄ*`@%`++‚Öõ
\(            # The parenthesis
  \_‚ÇÄ*        # Ten underscores
      `@%`    # Literal
          ++‚Öõ # Concatenated and pushed to global array
=== The fishes ===
‚Å∞3WG(\|n‚Å∞‚â•[√∞‚ÇÄ*|`<*)_____><`]\|d++‚Öõ)
‚Å∞3WG                                # Max(3,fish)
    (                             ) # times....
     \|                             # Push pipe
          [                ]        # If...
       n‚Å∞‚â•                          # Iteration number is greater than or equal to input (missing fish)
           √∞‚ÇÄ*                      # Ten spaces
              |                     # Else...
               `<*)_____><`         # A fish
                            \|d     # `||`
                               ++‚Öõ  # Concatenate and push to global array
=== The final row === 
\'\=‚ÇÄ*\'d++‚Öõ
\'           # Literal
  \=‚ÇÄ*       # Ten equalses
      \'d    # Two more apostrophes
             # Concatenated and pushed to global array
=== Flipping + Formatting === 
¬æ¬π\R=[∆õ·πò`<>()``><)(`ƒø
¬æ                     # Push global array
     [                # If...
 ¬π\R=                 # Input is R
      ∆õ               # Foreach...
       ·πò              # Reverse...
        `<>()``><)(`ƒø # Flip brackets
```
]