Given two positive integers, 'a' and 'b', output an ascii-art "box" that is a characters wide and b characters tall. For example, with '4' and '6':
****
* *
* *
* *
* *
****
Simple right? Here's the twist: The border of the box must be the characters of "a" and "b" alternating. This starts at the top left corner, and continues in a clockwise spiral. For example, the previous example with 4 and 6 should be
4646
6 4
4 6
6 4
4 6
6464
A and B may be two-digit numbers. For example, the inputs "10" and "3" should output this:
1031031031
1 0
3013013013
In order to keep the output relatively small, you do not have to support three or more digit numbers. Also, since inputs are restricted to positive integers, '0' is an invalid input, which you do not have to handle.
Here are some more test cases:
Input: (3, 5)
Output:
353
5 5
3 3
5 5
353
Input: (1, 1)
Output:
1
Input: (4, 4)
Output:
4444
4 4
4 4
4444
Input: (27, 1)
Output:
271271271271271271271271271
Input: (1, 17)
Output:
1
1
7
1
1
7
1
1
7
1
1
7
1
1
7
1
1
Input: (12, 34):
Output:
123412341234
4 1
3 2
2 3
1 4
4 1
3 2
2 3
1 4
4 1
3 2
2 3
1 4
4 1
3 2
2 3
1 4
4 1
3 2
2 3
1 4
4 1
3 2
2 3
1 4
4 1
3 2
2 3
1 4
4 1
3 2
2 3
1 4
432143214321
You may take input and output in any reasonable format, and standard loopholes are banned. Since this is code-golf, the shortest answer in bytes wins!
a
is 1 is it the left wall or the right wall? \$\endgroup\$