Haskell, \$n= 10\$\$n = 8\$
No comments!
Takes input as a 1-D list
s a b=
a/=b
f =s<*>
reverse
esrever
>*<s= f
b=/a
=b a s
\$n= 10\$
Takes input as a 2-D matrix
r =reverse
s a b=a/=b
f =s<*>r
c =concat
g = f<$>c
c>$<f = g
tacnoc= c
r>*<s= f
b=/a=b a s
esrever= r
Thanks to potato44 for all their help in chat. And Lynn for golfing off a row.
Explanation
The general idea here is a simple one, we concatconcat the list and compare it to it's reverse. However since we want to be centrosymmetric we have to tread carefully. First we write the code as we would normally:
g=((==)<*>reverse).concat
Now in order for our reverse lines to also be valid Haskell we need the left hand side of our equations to look like a function definition tacnoc.)esrever>*<)==(( doesn't.
The first step to fixing this is disposing of parentheses.
s a b=a==b
f=s<*>reverse
g=f.concat
However we have some new problems now. Both . and == when reversed are the same, so our reversed lines attempt to redefine the operators (<*> reversed is >*< so we are fine on that front). . can be replaced with <$> since functions are functors. And we can replace == with /=, which negates our output, but that is still within the specs. Now we have
s a b=a/=b
f=s<*>reverse
g=f<$>concat
In order to trim down our line length we alias concat and reverse.
r=reverse
s a b=a/=b
f=s<*>r
c=concat
g=f<$>c
Now we just finish this by making everything centrosymmetric and square.
\$n = 8\$
If we decide to take input as aThe shorter 1-D list we don'tversion works in much the same way except since there is no need to concat saving uswe can save two rowslines by removing it.
s a b=
a/=b
f =s<*>
reverse
esrever
>*<s= f
b=/a
=b a s
Haskell, \$n= 10\$
No comments
r =reverse
s a b=a/=b
f =s<*>r
c =concat
g = f<$>c
c>$<f = g
tacnoc= c
r>*<s= f
b=/a=b a s
esrever= r
Thanks to potato44 for all their help in chat. And Lynn for golfing off a row.
Explanation
The general idea here is a simple one, we concat the list and compare it to it's reverse. However since we want to be centrosymmetric we have to tread carefully. First we write the code as we would normally:
g=((==)<*>reverse).concat
Now in order for our reverse lines to also be valid Haskell we need the left hand side of our equations to look like a function definition tacnoc.)esrever>*<)==(( doesn't.
The first step to fixing this is disposing of parentheses.
s a b=a==b
f=s<*>reverse
g=f.concat
However we have some new problems now. Both . and == when reversed are the same, so our reversed lines attempt to redefine the operators (<*> reversed is >*< so we are fine on that front). . can be replaced with <$> since functions are functors. And we can replace == with /=, which negates our output, but that is still within the specs. Now we have
s a b=a/=b
f=s<*>reverse
g=f<$>concat
In order to trim down our line length we alias concat and reverse.
r=reverse
s a b=a/=b
f=s<*>r
c=concat
g=f<$>c
Now we just finish this by making everything centrosymmetric and square.
\$n = 8\$
If we decide to take input as a 1-D list we don't need to concat saving us two rows.
s a b=
a/=b
f =s<*>
reverse
esrever
>*<s= f
b=/a
=b a s
Haskell, \$n = 8\$
No comments!
Takes input as a 1-D list
s a b=
a/=b
f =s<*>
reverse
esrever
>*<s= f
b=/a
=b a s
\$n= 10\$
Takes input as a 2-D matrix
r =reverse
s a b=a/=b
f =s<*>r
c =concat
g = f<$>c
c>$<f = g
tacnoc= c
r>*<s= f
b=/a=b a s
esrever= r
Thanks to potato44 for all their help in chat. And Lynn for golfing off a row.
Explanation
The general idea here is a simple one, we concat the list and compare it to it's reverse. However since we want to be centrosymmetric we have to tread carefully. First we write the code as we would normally:
g=((==)<*>reverse).concat
Now in order for our reverse lines to also be valid Haskell we need the left hand side of our equations to look like a function definition tacnoc.)esrever>*<)==(( doesn't.
The first step to fixing this is disposing of parentheses.
s a b=a==b
f=s<*>reverse
g=f.concat
However we have some new problems now. Both . and == when reversed are the same, so our reversed lines attempt to redefine the operators (<*> reversed is >*< so we are fine on that front). . can be replaced with <$> since functions are functors. And we can replace == with /=, which negates our output, but that is still within the specs. Now we have
s a b=a/=b
f=s<*>reverse
g=f<$>concat
In order to trim down our line length we alias concat and reverse.
r=reverse
s a b=a/=b
f=s<*>r
c=concat
g=f<$>c
Now we just finish this by making everything centrosymmetric and square.
The shorter 1-D version works in much the same way except since there is no need to concat we can save two lines by removing it.
Haskell, \$n= 10\$
No comments
r =reverse
s a b=a/=b
f =s<*>r
c =concat
g = f<$>c
c>$<f = g
tacnoc= c
r>*<s= f
b=/a=b a s
esrever= r
Thanks to potato44 for all their help in chat. And Lynn for golfing off a row.
Explanation
The general idea here is a simple one, we concat the list and compare it to it's reverse. However since we want to be centrosymmetric we have to tread carefully. First we write the code as we would normally:
g=((==)<*>reverse).concat
Now in order for our reverse lines to also be valid Haskell we need the left hand side of our equations to look like a function definition tacnoc.)esrever>*<)==(( doesn't.
The first step to fixing this is disposing of parentheses.
s a b=a==b
f=s<*>reverse
g=f.concat
However we have some new problems now. Both . and == when reversed are the same, so our reversed lines attempt to redefine the operators (<*> reversed is >*< so we are fine on that front). . can be replaced with <$> since functions are functors. And we can replace == with /=, which negates our output, but that is still within the specs. Now we have
s a b=a/=b
f=s<*>reverse
g=f<$>concat
In order to trim down our line length we alias concat and reverse.
r=reverse
s a b=a/=b
f=s<*>r
c=concat
g=f<$>c
Now we just finish this by making everything centrosymmetric and square.
\$n = 8\$
If we decide to take input as a 1-D list we don't need to concat saving us two rows.
s a b=
a/=b
f =s<*>
reverse
esrever
>*<s= f
b=/a
=b a s
Haskell, \$n= 10\$
No comments
r =reverse
s a b=a/=b
f =s<*>r
c =concat
g = f<$>c
c>$<f = g
tacnoc= c
r>*<s= f
b=/a=b a s
esrever= r
Thanks to potato44 for all their help in chat. And Lynn for golfing off a row.
Explanation
The general idea here is a simple one, we concat the list and compare it to it's reverse. However since we want to be centrosymmetric we have to tread carefully. First we write the code as we would normally:
g=((==)<*>reverse).concat
Now in order for our reverse lines to also be valid Haskell we need the left hand side of our equations to look like a function definition tacnoc.)esrever>*<)==(( doesn't.
The first step to fixing this is disposing of parentheses.
s a b=a==b
f=s<*>reverse
g=f.concat
However we have some new problems now. Both . and == when reversed are the same, so our reversed lines attempt to redefine the operators (<*> reversed is >*< so we are fine on that front). . can be replaced with <$> since functions are functors. And we can replace == with /=, which negates our output, but that is still within the specs. Now we have
s a b=a/=b
f=s<*>reverse
g=f<$>concat
In order to trim down our line length we alias concat and reverse.
r=reverse
s a b=a/=b
f=s<*>r
c=concat
g=f<$>c
Now we just finish this by making everything centrosymmetric and square.
Haskell, \$n= 10\$
No comments
r =reverse
s a b=a/=b
f =s<*>r
c =concat
g = f<$>c
c>$<f = g
tacnoc= c
r>*<s= f
b=/a=b a s
esrever= r
Thanks to potato44 for all their help in chat. And Lynn for golfing off a row.
Explanation
The general idea here is a simple one, we concat the list and compare it to it's reverse. However since we want to be centrosymmetric we have to tread carefully. First we write the code as we would normally:
g=((==)<*>reverse).concat
Now in order for our reverse lines to also be valid Haskell we need the left hand side of our equations to look like a function definition tacnoc.)esrever>*<)==(( doesn't.
The first step to fixing this is disposing of parentheses.
s a b=a==b
f=s<*>reverse
g=f.concat
However we have some new problems now. Both . and == when reversed are the same, so our reversed lines attempt to redefine the operators (<*> reversed is >*< so we are fine on that front). . can be replaced with <$> since functions are functors. And we can replace == with /=, which negates our output, but that is still within the specs. Now we have
s a b=a/=b
f=s<*>reverse
g=f<$>concat
In order to trim down our line length we alias concat and reverse.
r=reverse
s a b=a/=b
f=s<*>r
c=concat
g=f<$>c
Now we just finish this by making everything centrosymmetric and square.
\$n = 8\$
If we decide to take input as a 1-D list we don't need to concat saving us two rows.
s a b=
a/=b
f =s<*>
reverse
esrever
>*<s= f
b=/a
=b a s
Haskell, 109 bytes\$n= 10\$
No comments
r =reverse
s a b=a/=b
f =s<*>r
c =concat
g = f<$>c
c>$<f = g
tacnoc= c
r>*<s= f
b=/a=b a s
esrever= r
Thanks to potato44 for all their help in chat. And Lynn for golfing off a row.
Explanation
The general idea here is a simple one, we concat the list and compare it to it's reverse. However since we want to be centrosymmetric we have to tread carefully. First we write the code as we would normally:
g=((==)<*>reverse).concat
Now in order for our reverse lines to also be valid Haskell we need the left hand side of our equations to look like a function definition tacnoc.)esrever>*<)==(( doesn't.
The first step to fixing this is disposing of parentheses.
s a b=a==b
f=s<*>reverse
g=f.concat
However we have some new problems now. Both . and == when reversed are the same, so our reversed lines attempt to redefine the operators (<*> reversed is >*< so we are fine on that front). . can be replaced with <$> since functions are functors. And we can replace == with /=, which negates our output, but that is still within the specs. Now we have
s a b=a/=b
f=s<*>reverse
g=f<$>concat
In order to trim down our line length we alias concat and reverse.
r=reverse
s a b=a/=b
f=s<*>r
c=concat
g=f<$>c
Now we just finish this by making everything centrosymmetric and square.
Haskell, 109 bytes
No comments
r =reverse
s a b=a/=b
f =s<*>r
c =concat
g = f<$>c
c>$<f = g
tacnoc= c
r>*<s= f
b=/a=b a s
esrever= r
Thanks to potato44 for all their help in chat. And Lynn for golfing off a row.
Explanation
The general idea here is a simple one, we concat the list and compare it to it's reverse. However since we want to be centrosymmetric we have to tread carefully. First we write the code as we would normally:
g=((==)<*>reverse).concat
Now in order for our reverse lines to also be valid Haskell we need the left hand side of our equations to look like a function definition tacnoc.)esrever>*<)==(( doesn't.
The first step to fixing this is disposing of parentheses.
s a b=a==b
f=s<*>reverse
g=f.concat
However we have some new problems now. Both . and == when reversed are the same, so our reversed lines attempt to redefine the operators (<*> reversed is >*< so we are fine on that front). . can be replaced with <$> since functions are functors. And we can replace == with /=, which negates our output, but that is still within the specs. Now we have
s a b=a/=b
f=s<*>reverse
g=f<$>concat
In order to trim down our line length we alias concat and reverse.
r=reverse
s a b=a/=b
f=s<*>r
c=concat
g=f<$>c
Now we just finish this by making everything centrosymmetric and square.
Haskell, \$n= 10\$
No comments
r =reverse
s a b=a/=b
f =s<*>r
c =concat
g = f<$>c
c>$<f = g
tacnoc= c
r>*<s= f
b=/a=b a s
esrever= r
Thanks to potato44 for all their help in chat. And Lynn for golfing off a row.
Explanation
The general idea here is a simple one, we concat the list and compare it to it's reverse. However since we want to be centrosymmetric we have to tread carefully. First we write the code as we would normally:
g=((==)<*>reverse).concat
Now in order for our reverse lines to also be valid Haskell we need the left hand side of our equations to look like a function definition tacnoc.)esrever>*<)==(( doesn't.
The first step to fixing this is disposing of parentheses.
s a b=a==b
f=s<*>reverse
g=f.concat
However we have some new problems now. Both . and == when reversed are the same, so our reversed lines attempt to redefine the operators (<*> reversed is >*< so we are fine on that front). . can be replaced with <$> since functions are functors. And we can replace == with /=, which negates our output, but that is still within the specs. Now we have
s a b=a/=b
f=s<*>reverse
g=f<$>concat
In order to trim down our line length we alias concat and reverse.
r=reverse
s a b=a/=b
f=s<*>r
c=concat
g=f<$>c
Now we just finish this by making everything centrosymmetric and square.