A leaper is a category of fairy chess piece which moves by "jumping." A normal knight is a (1,2)-leaper, meaning each move involves moving a distance of 1 square in an orthogonal direction and 2 squares in the perpendicular direction.
.o.o.
o...o
..N..
o...o
.o.o.
There are many different leapers. The (1,3)-leaper is called the Long Knight, or Camel. Its move pattern looks like this:
..o.o..
.......
o.....o
...L...
o.....o
.......
..o.o..
There's also the (2,2) Alfil...
o...o
.....
..A..
.....
o...o
...and even the (0,1) Wazir.
.o.
oWo
.o.
Challenge
Given a pair of numbers as input, output the corresponding movement diagram. You may write a program or function, with input provided via STDIN/command-line or as an argument, and output provide by STDOUT or the return value. This is code-golf.
Input
Input will be a comma-separated list of two integers and an uppercase letter. The two integers will be in the range 0-7
(inclusive) and in non-decreasing order. Trailing newline optional for input and output.
Here are the inputs for the above four examples:
1,2,N
1,3,L
2,2,A
0,1,W
Output
Output will be a square-shaped multiline string. The capital letter will be placed in the center to represent the current location of the piece. The movement locations will be represented by either 4 or 8 lowercase o
s. All other spaces in the square will be filled with periods.
If the movement pattern is 0,0
, output just the capital letter.
As a hint, if the second integer (the larger one) has value N, then the square will always have side length 2N+1. The o
s will always be on the perimeter of the square.
Additional Testcases
1,1,F
o.o
.F.
o.o
5,7,Q
..o.........o..
...............
o.............o
...............
...............
...............
...............
.......Q.......
...............
...............
...............
...............
o.............o
...............
..o.........o..
0,0,J
J