Welcome to the Ranch
You should use the shortcut operators && and || rather than & and | for
booleans, unless you specifically need to evaluate the right operand as well as the left.
Have you come across the
?: operator? And the
% tags? The ?: operator will allow you to get 1 and 0 out of
true and
false, and the % tags are a nice way to print them
Note you should use
%n rather than
\n in this context, but
\t is all right. You can use a similar technique to get the output
1 && 0: 0 1 || 0: 1
... and you can reuse an argument with a number and a $ sign after the %.