#MATL, 4 bytes
MATL, 4 bytes
d0>d
Explanation:
d % Implicitly take input. Take difference between each element
0> % Check whether diff's are positive. Should result in [0 1 0 1 ...] pattern.
d % Again take the difference. Any consecutive rises or falls results in a
% difference of 0, which is a falsy value in MATL
This is my first MATL entry, so I wonder how much improvement there can be from this naive port from my MATLAB/Octave attempt (which would be @(a)all(diff(diff(a)>0))). Note that the all is not necessary because any zero makes an array false, so there's no A in the MATL port.
#MATL, 4 bytes
d0>d
Explanation:
d % Implicitly take input. Take difference between each element
0> % Check whether diff's are positive. Should result in [0 1 0 1 ...] pattern.
d % Again take the difference. Any consecutive rises or falls results in a
% difference of 0, which is a falsy value in MATL
This is my first MATL entry, so I wonder how much improvement there can be from this naive port from my MATLAB/Octave attempt (which would be @(a)all(diff(diff(a)>0))). Note that the all is not necessary because any zero makes an array false, so there's no A in the MATL port.
MATL, 4 bytes
d0>d
Explanation:
d % Implicitly take input. Take difference between each element
0> % Check whether diff's are positive. Should result in [0 1 0 1 ...] pattern.
d % Again take the difference. Any consecutive rises or falls results in a
% difference of 0, which is a falsy value in MATL
This is my first MATL entry, so I wonder how much improvement there can be from this naive port from my MATLAB/Octave attempt (which would be @(a)all(diff(diff(a)>0))). Note that the all is not necessary because any zero makes an array false, so there's no A in the MATL port.
#MATL, 4 bytes
d0>d
Explanation:
d % Implicitly take input. Take difference between each element
0> % Check whether diff's are positive. Should result in [0 1 0 1 ...] pattern.
dAd % Again take the difference. Any consecutive rises or falls results in a
% difference of 0, which is a falsy value in MATL
This is my first MATL entry, so I wonder how much improvement there can be from this naive port from my MATLAB/Octave attempt (which would be @(a)all(diff(diff(a>0a)>0))). Note that the all is not necessary because any zero makes an array false, so there's no A in the MATL port.
#MATL, 4 bytes
d0>d
Explanation:
d % Implicitly take input. Take difference between each element
0> % Check whether diff's are positive. Should result in [0 1 0 1 ...] pattern.
dA % Again take the difference. Any consecutive rises or falls results in a
% difference of 0, which is a falsy value in MATL
This is my first MATL entry, so I wonder how much improvement there can be from this naive port from my MATLAB/Octave attempt (which would be @(a)all(diff(diff(a>0)))). Note that the all is not necessary because any zero makes an array false, so there's no A in the MATL port.
#MATL, 4 bytes
d0>d
Explanation:
d % Implicitly take input. Take difference between each element
0> % Check whether diff's are positive. Should result in [0 1 0 1 ...] pattern.
d % Again take the difference. Any consecutive rises or falls results in a
% difference of 0, which is a falsy value in MATL
This is my first MATL entry, so I wonder how much improvement there can be from this naive port from my MATLAB/Octave attempt (which would be @(a)all(diff(diff(a)>0))). Note that the all is not necessary because any zero makes an array false, so there's no A in the MATL port.
#MATL, 54 bytes
d0>dAd0>d
Explanation:
d % Implicitly take input. Take difference between each element
0> % Check whether diff's are positive. Should result in [0 1 0 1 ...] pattern.
dA % Again take the difference. Any consecutive rises or falls results in a
% difference of 0. With `A`, makewhich sureis thata therefalsy arevalue noin zeroes.MATL
Implicitly displays a truthy 1 or falsy 0. This is my first MATL entry, so I wonder how much improvement there can be from this naive port from my MATLAB/Octave attempt (which would be @(a)all(diff(diff(a>0)))). Note that the all is not necessary because any zero makes an array false, so there's no A in the MATL port.
#MATL, 5 bytes
d0>dA
Explanation:
d % Implicitly take input. Take difference between each element
0> % Check whether diff's are positive. Should result in [0 1 0 1 ...] pattern.
dA % Again take the difference. Any consecutive rises or falls results in a
% difference of 0. With `A`, make sure that there are no zeroes.
Implicitly displays a truthy 1 or falsy 0. This is my first MATL entry, so I wonder how much improvement there can be from this naive port from my MATLAB/Octave attempt (which would be @(a)all(diff(diff(a>0))))
#MATL, 4 bytes
d0>d
Explanation:
d % Implicitly take input. Take difference between each element
0> % Check whether diff's are positive. Should result in [0 1 0 1 ...] pattern.
dA % Again take the difference. Any consecutive rises or falls results in a
% difference of 0, which is a falsy value in MATL
This is my first MATL entry, so I wonder how much improvement there can be from this naive port from my MATLAB/Octave attempt (which would be @(a)all(diff(diff(a>0)))). Note that the all is not necessary because any zero makes an array false, so there's no A in the MATL port.