Skip to main content
edited body
Source Link
Luis Mendo
  • 106.7k
  • 10
  • 139
  • 382

MATL, 10 9 bytes

BXs&=?I&]

Input is a string enclosed with single qoutesquotes (if the input contains single qoutes, escape them by duplicating).

Output is 3 as truthy and nothing (empty output) as falsy.

Try it online!

The code in binary is as follows:

B     1 0 0 0 0 1 0
X     1 0 1 1 0 0 0
s     1 1 1 0 0 1 1
&     0 1 0 0 1 1 0
=     0 1 1 1 1 0 1
?     0 1 1 1 1 1 1
I     1 0 0 1 0 0 1
&     0 1 0 0 1 1 0
]     1 0 1 1 1 0 1

Sum   5 5 5 5 5 5 5

###Explanation

B      % Input string (implicit). Convert each char to its ASCII code, and 
       % then to binary. This gives a binary matrix, with each char of the 
       % input corresponding to a row
Xs     % Sum of each column. Gives a row vector
&=     % All pairwise equality comparisons
?      % If all are true
  I    %    Push 3
  &    %    Specify that the next function, namely implicit display, will 
       %    take one input, instead of the whole stack which is the default
]      % End
       % Display (implicit)

MATL, 10 9 bytes

BXs&=?I&]

Input is a string enclosed with single qoutes (if the input contains single qoutes, escape them by duplicating).

Output is 3 as truthy and nothing (empty output) as falsy.

Try it online!

The code in binary is as follows:

B     1 0 0 0 0 1 0
X     1 0 1 1 0 0 0
s     1 1 1 0 0 1 1
&     0 1 0 0 1 1 0
=     0 1 1 1 1 0 1
?     0 1 1 1 1 1 1
I     1 0 0 1 0 0 1
&     0 1 0 0 1 1 0
]     1 0 1 1 1 0 1

Sum   5 5 5 5 5 5 5

###Explanation

B      % Input string (implicit). Convert each char to its ASCII code, and 
       % then to binary. This gives a binary matrix, with each char of the 
       % input corresponding to a row
Xs     % Sum of each column. Gives a row vector
&=     % All pairwise equality comparisons
?      % If all are true
  I    %    Push 3
  &    %    Specify that the next function, namely implicit display, will 
       %    take one input, instead of the whole stack which is the default
]      % End
       % Display (implicit)

MATL, 10 9 bytes

BXs&=?I&]

Input is a string enclosed with single quotes (if the input contains single qoutes, escape them by duplicating).

Output is 3 as truthy and nothing (empty output) as falsy.

Try it online!

The code in binary is as follows:

B     1 0 0 0 0 1 0
X     1 0 1 1 0 0 0
s     1 1 1 0 0 1 1
&     0 1 0 0 1 1 0
=     0 1 1 1 1 0 1
?     0 1 1 1 1 1 1
I     1 0 0 1 0 0 1
&     0 1 0 0 1 1 0
]     1 0 1 1 1 0 1

Sum   5 5 5 5 5 5 5

###Explanation

B      % Input string (implicit). Convert each char to its ASCII code, and 
       % then to binary. This gives a binary matrix, with each char of the 
       % input corresponding to a row
Xs     % Sum of each column. Gives a row vector
&=     % All pairwise equality comparisons
?      % If all are true
  I    %    Push 3
  &    %    Specify that the next function, namely implicit display, will 
       %    take one input, instead of the whole stack which is the default
]      % End
       % Display (implicit)
added 11 characters in body
Source Link
Luis Mendo
  • 106.7k
  • 10
  • 139
  • 382

MATL, 10 9 bytes

BXs&=?I&]

Input is a string enclosed with single qoutes (if the input contains single qoutes, escape them by duplicating).

Output is 3 as truthy and nothing (empty output) as falsy.

Try it online!

The code in binary is as follows:

B     1 0 0 0 0 1 0
X     1 0 1 1 0 0 0
s     1 1 1 0 0 1 1
&     0 1 0 0 1 1 0
=     0 1 1 1 1 0 1
?     0 1 1 1 1 1 1
I     1 0 0 1 0 0 1
&     0 1 0 0 1 1 0
]     1 0 1 1 1 0 1

Sum   5 5 5 5 5 5 5

###Explanation

B      % ImplicitInput inputstring (implicit). Convert each char to its ASCII code, and then to
       % then to binary. This gives a binary matrix, with each char of the input
       % input corresponding to a row
Xs     % Sum of each column. Gives a row vector
&=     % All pairwise equality comparisons
?      % If all are true
  I    %    Push 3
  &    %    Specify that the next function, namely implicit display, will 
       %    take one input, instead of the whole stack which is the default
]      % End
       % Display (implicit)

MATL, 10 9 bytes

BXs&=?I&]

Input is a string enclosed with single qoutes (if the input contains single qoutes, escape them by duplicating).

Output is 3 as truthy and nothing (empty output) as falsy.

Try it online!

The code in binary is as follows:

B     1 0 0 0 0 1 0
X     1 0 1 1 0 0 0
s     1 1 1 0 0 1 1
&     0 1 0 0 1 1 0
=     0 1 1 1 1 0 1
?     0 1 1 1 1 1 1
I     1 0 0 1 0 0 1
&     0 1 0 0 1 1 0
]     1 0 1 1 1 0 1

Sum   5 5 5 5 5 5 5

###Explanation

B      % Implicit input. Convert each char to its ASCII code, and then to
       % binary. This gives a binary matrix, with each char of the input
       % corresponding to a row
Xs     % Sum of each column. Gives a row vector
&=     % All pairwise equality comparisons
?      % If all are true
  I    %    Push 3
  &    %    Specify that the next function, namely implicit display, will 
       %    take one input, instead of the whole stack which is the default
]      % End
       % Display (implicit)

MATL, 10 9 bytes

BXs&=?I&]

Input is a string enclosed with single qoutes (if the input contains single qoutes, escape them by duplicating).

Output is 3 as truthy and nothing (empty output) as falsy.

Try it online!

The code in binary is as follows:

B     1 0 0 0 0 1 0
X     1 0 1 1 0 0 0
s     1 1 1 0 0 1 1
&     0 1 0 0 1 1 0
=     0 1 1 1 1 0 1
?     0 1 1 1 1 1 1
I     1 0 0 1 0 0 1
&     0 1 0 0 1 1 0
]     1 0 1 1 1 0 1

Sum   5 5 5 5 5 5 5

###Explanation

B      % Input string (implicit). Convert each char to its ASCII code, and 
       % then to binary. This gives a binary matrix, with each char of the 
       % input corresponding to a row
Xs     % Sum of each column. Gives a row vector
&=     % All pairwise equality comparisons
?      % If all are true
  I    %    Push 3
  &    %    Specify that the next function, namely implicit display, will 
       %    take one input, instead of the whole stack which is the default
]      % End
       % Display (implicit)
added 84 characters in body
Source Link
Luis Mendo
  • 106.7k
  • 10
  • 139
  • 382

MATL, 1010 9 bytes

GBXs&=BXs&=?9}NI&]

Input is a string enclosed with single qoutes (if the input contains single qoutes, escape them by duplicating).

Output is 93 as truthy and nothing 0(empty output) as falsy.

Try it online!Try it online!

CodeThe code in binary is as follows:

G     1 0 0 0 1 1 1
B     1 0 0 0 0 1 0
X     1 0 1 1 0 0 0
s     1 1 1 0 0 1 1
&     0 1 0 0 1 1 0
=     0 1 1 1 1 0 1
?     0 1 1 1 1 1 1
9I     0 1 10 0 1 0 0 1
}&     10 1 10 0 1 1 0 1
N]     1 0 0 1 1 1 0 1

Sum   65 65 65 65 65 65 65

###Explanation

GB      % PushImplicit input
B. Convert each char to its ASCII %code, Convertand then to
       % binary. This gives a binary matrix., Eachwith each char of the input,
       % convertedcorresponding to ASCII, produces a row
Xs     % Sum of each column. Gives a row vector
&=     % All pairwise equality comparisons
?      % If all are true
  9I    %    Push 93
}  &    % Else   Specify that the next function, namely implicit display, will 
  N     %   Push numbertake one input, instead of elementsthe inwhole stack, which is 0
the default
]      % End 
 (implicit).      % Display (implicit)

MATL, 10 bytes

GBXs&=?9}N

Output is 9 as truthy and 0 as falsy.

Try it online!

Code in binary:

G     1 0 0 0 1 1 1
B     1 0 0 0 0 1 0
X     1 0 1 1 0 0 0
s     1 1 1 0 0 1 1
&     0 1 0 0 1 1 0
=     0 1 1 1 1 0 1
?     0 1 1 1 1 1 1
9     0 1 1 1 0 0 1
}     1 1 1 1 1 0 1
N     1 0 0 1 1 1 0

Sum   6 6 6 6 6 6 6

###Explanation

G      % Push input
B      % Convert to binary. This gives binary matrix. Each char of the input,
       % converted to ASCII, produces a row
Xs     % Sum of each column. Gives a row vector
&=     % All pairwise equality comparisons
?      % If all are true
  9    %   Push 9
}      % Else
  N    %   Push number of elements in stack, which is 0
       % End (implicit). Display (implicit)

MATL, 10 9 bytes

BXs&=?I&]

Input is a string enclosed with single qoutes (if the input contains single qoutes, escape them by duplicating).

Output is 3 as truthy and nothing (empty output) as falsy.

Try it online!

The code in binary is as follows:

B     1 0 0 0 0 1 0
X     1 0 1 1 0 0 0
s     1 1 1 0 0 1 1
&     0 1 0 0 1 1 0
=     0 1 1 1 1 0 1
?     0 1 1 1 1 1 1
I     1 0 0 1 0 0 1
&     0 1 0 0 1 1 0
]     1 0 1 1 1 0 1

Sum   5 5 5 5 5 5 5

###Explanation

B      % Implicit input. Convert each char to its ASCII code, and then to
       % binary. This gives a binary matrix, with each char of the input
       % corresponding to a row
Xs     % Sum of each column. Gives a row vector
&=     % All pairwise equality comparisons
?      % If all are true
  I    %    Push 3
  &    %    Specify that the next function, namely implicit display, will 
       %    take one input, instead of the whole stack which is the default
]      % End 
       % Display (implicit)
added 460 characters in body
Source Link
Luis Mendo
  • 106.7k
  • 10
  • 139
  • 382
Loading
Source Link
Luis Mendo
  • 106.7k
  • 10
  • 139
  • 382
Loading