Comments on Gamer Meme Creator
Parent
Gamer Meme Creator
+5
−0
Challenge
You will be given a string and an ascii art as input.
- The string must be placed above the ascii art, and centered based on its longest line.
- The text
BOTTOM TEXT
must be placed below the art and centered based on the ascii art's longest line.
The centering can be biased toward the left or right by 1 character if given text cannot be centered exactly.
Examples
Text: Hello, World!
Art(source:https://www.asciiart.eu/animals/camels):
_
.--' |
/___^ | .--.
) | / \
/ | /` '.
| '-' / \
\ | |\
\ / \ /\|
\ /'----`\ /
||| \\ |
((| ((|
||| |||
jgs //_( //_(
Output:
Hello, World!
_
.--' |
/___^ | .--.
) | / \
/ | /` '.
| '-' / \
\ | |\
\ / \ /\|
\ /'----`\ /
||| \\ |
((| ((|
||| |||
jgs //_( //_(
BOTTOM TEXT
More info
- You may have trailing and leading whitespace on each line as long as the art is properly centered.
- ascii art can be taken as array of string, character arrays, so on.
- art will always be in ascii/extended ascii.
- given string will not exceed the width of ascii art, and ascii art will always have width ≥ 11.
+4
−0
[Ruby], 67 65 bytes -2 from …
3y ago
+2
−0
Japt, 19 bytes Takes the ar …
3y ago
+2
−0
Scala, 98 83 bytes Saved 15 …
3y ago
+2
−0
[Haskell], 116 bytes …
3y ago
Post
+4
−0
Ruby, 67 65 bytes
->s,a{[s.center(l=a.map(&:size).max),*a,"BOTTOM TEXT".center(l)]}
Takes the art and outputs as a list of lines.
1 comment thread