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
or0L
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 as per usual.