Not really real, sshh!
It all started one day when a coworker brought in a homemade loaf of bread for my boss's birthday.
My boss really liked this loaf of bread, and he wanted another. Unfortunately, my coworker has quit, so my boss needs me to give him another loaf.
The problem is, I have no idea how to make bread. So I told my boss that i'm not a chef and to look harder for someone who is.
He said, "Sure...but you lose your job if you can't make me a loaf."
Then I had an idea.
I would make him an ascii-art loaf with my coding skilz! He said yes, under 1 condition: "You must make it in under 351 bytes." Unfortunately for me, my best code golfing got me to 375 bytes. Uh oh.
Then my boss added 2 things: "You must give me that loaf in a week (4/13), and if you do so you get an increased salary. The lower the amount of bytes you use, the better salary. But remember, if you go over 349 you lose your job."
So I need your help in your language of choice to help me keep my job!
I was about to do a
curl ... | sh on a TinyURL, but my boss told me that I can't use a list of loopholes. I probably could skirt the rules, but my job is at stake, so it's not a good idea.
What counts as a loaf
Your program or function must take 3 positive integers as input. If your language has a list or array, you can take a list or array of those numbers. You can also take them as arguments to a function or program, or a space-separated string of numbers to STDIN, a command-line or function argument, etc.
The first number is the width of your loaf
The second number is the height of your loaf.
The third number is the depth of your loaf.
Here's a loaf with a width of
3, a height of
2, and a depth of
/---\ /---\| | || |___|/
Looks wierd? Here's a 3x2x2:
/---\ / | /---\ | | | / |___|/
How about a 3x3x3:
/---\ / | / | /---\ | | | / | | / |___|/
/----\ / | /----\ / |____|/
I hope you understand! See my JS (ES6) answer below for an example.
- Don't worry about valid input. All sizes will be positive integers.
- You must accept any positive integers that your language can support.
- If the numbers are so high your languages crashes from StackOverflow, maximum string length overflow, etc. that's OK.