The mid-autumn festival has begun!
Unfortunately, all my mooncakes were stolen -- they're getting too expensive for small folk such as myself, and I fear I won't be able to eat any this year!
So I turn to you for help. Would you be able to make me some?
For those unaware, let me educate you on what a mooncake looks like.
Mooncakes come in many different sizes!
So I'm gonna give you my input, n, when I want one.
Here are some examples of the output I want:
Mooncake of size n = 3:
(@@@@@)
(@MAF@)
(@@@@@)
Mooncake of size n = 6:
(@@@@@@@@@@@)
(@ @)
(@ M @)
(@ F @)
(@ @)
(@@@@@@@@@@@)
That is to say, a mooncake of size n is:
- n lines high
- 2n - 1 @s long
- 2n + 1 characters long (@s and brackets)
And you better not throw me your too-tiny practice mooncakes!
Assume input will always be n >= 3.
Mooncakes also contain one of the following decorations:
- MF
- MAF
- HMF
- JCJ
- TTT
- ZJ
- LF
- RF
- CF
Which one, it doesn't matter - as long as it is vertically and horizontally centered.
It can be written vertically or horizontally too!
I want variety!
If you're really going to make me two of the same mooncake, the decoration better be different!
That is, multiple executions of your program with the exact same input must not always yield the same decoration.
I can't wait to eat your moon cakes, so the sooner I can receive them (the shorter your code) the better!
Good Luck!
For those wondering about the decorations:
They are the initials of all alternative names for the Mid-Autumn Festival.
A list can be found in the Wikipedia page linked at the top of this post.
Clarifications:
There are no rules regarding leading and trailing whitespace.
Have as much or as little as you like!
The decorations must be in the very center of your mooncake!
On horizontal decorations, this means it must be on the middle line of your cake, and the number of characters to the left and right of the decoration string must be equal.
On vertical decorations, this means it must reside in the middle column of your cake, and the number of characters above and below the decoration must be equal.
Not all decorations must be used!
The only requirement is that there must be more than one possibility for any given input n. The possibilities also do not need to be even.
Functions are acceptable.
MAF
and notMF
? I don't see anA
in your decoration-options. \$\endgroup\$