In the burial place of King Silo of Asturias there is an inscription that reads SILO PRINCEPS FECIT (King Silo made this).
The first letter is found in the very middle, and from there one reads by going in any non-diagonal direction radiating outward. The final letter is found on all four corners. In this challenge, you'll generalize the process to make them.
Input
A string (or equivalent), and an integer. You may make the following assumptions about the input:
- The string will have an odd length.
- The integer will be an odd number between 1 and one less than twice the length of the string.
Output
An inscriptio labyrinthica for the string, using the integer for the height or width (see models for height examples). Output should be each letter with no spaces, line break as default to your system/language.
Test cases
Note that an input of 1 or (length * 2 - 1) will result in a horizontal or vertical palindrome.
Input: FOO, 3 Input: BAR, 1 Input: BAR, 3 Input: BAR, 5
Output: OOO Output: RABAR Output: RAR Output: R
OFO ABA A
OOO RAR B
A
R
Input: ABCDE, 5 Input: ABCDE, 3 Input: *<>v^, 5
Output: EDCDE Output: EDCBCDE ^v>v^
DCBCD DCBABCD v><>v
CBABC EDCBCDE ><*<>
DCBCD v><>v
EDCDE ^v>v^
Scoring
This is code-golf so shortest answer in bytes wins. Standard loopholes forbidden.