6. And That’s The Way It Is
In this problem, you’re asked to enter an APL expression (some APL code), including arguments (data given to APL symbols). Your code will be tested by the APL Challenge system to check whether it gives the correct answer and uses the methods described below.
Remember from problem 3 that APL uses 1 and 0 for yes
and no
. The And function ∧ (looks a bit like the letter A for And) allows you to combine such values; it gives 1 if both left and right arguments are 1, but 0 if either is 0. For example, 1 1 0 0 ∧ 0 1 0 1 gives 0 1 0 0, because:
0(no
): left list has1(yes
) but right list has0(no
)1(yes
): left list has1(yes
) and right list also has1(yes
)0(no
): left list has0(no
) and right list also has0(no
)0(no
): left list has0(no
) even though right list has1(yes
)
Write an expression that ∧ with / (from problem 4), = (from problem 3), and ⌽ (from problem 5) to find out whether the matrix [1 2 1 ⋄ 3 4 3 ⋄ 5 5 5] stays the same when it is mirrored. The answer should be 1 (yes
).