Leaping Kangaroos
MATLAB, 92 90 86 84 bytes
n=input('');p=eye(n)+32;A=repmat([fliplr(p),p,''],1,2^n/2);A(:,n+1:n:end)=[];disp(A)
Try it online!
eye
creates an identity matrix. If we flip it and concatenate the original i.e. [fliplr(p),p]
we get (for n=3
):
0 0 1 1 0 0
0 1 0 0 1 0
1 0 0 0 0 1
With repmat(...,1,2^n/2)
we repeat this 2^(n-1)
times and get
0 0 1 1 0 0 0 0 1 1 0 0 0 0 1 1 0 0
0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 ...
1 0 0 0 0 1 1 0 0 0 0 1 1 0 0 0 0 1
From this we just delete the unnecessary columns, with A(:,n+1:n:end)=[];
Charcoal, 14 bytes
NλP^×λoF⁻λ¹‖O→
Try it online!
Explanation
Nλ
inputs an integer into λ
. P^
is a multidirectional print (SE and SW) of ×λo
(string multiplication of λ
with o
). Then F⁻λ¹
runs a for loop λ - 1
times, in which ‖O→
reflects the whole thing to the right with overlap.
05AB1E, 12 10 bytes
Îj¹FÐvû},À
Explanation:
Î # Push zero and input
j # Prepend input - 1 spaces
¹F # Input times do..
Ð # Triplicate the string
v } # Length times do..
û # Palindromize
, # Pop and print with a newline
À # Rotate the string on to the right
Uses the CP-1252 encoding. Try it online!