My code works and I have no idea why


So, I actually solved this exercise by changing the position of the books to "secondBook <=> firstBook". However, looking at the "Hint" section I noted that this "<=>" is equivalent to that "IF" block. My issue is that, even if I changed the placeholders the logic for an IF is still the same, unless, when I changed the placeholders it also changed the comparison operators.

Replace this line with your code.


The order of the expression operands determines the sort order. If they are the same as the block parameters, the sort order is ascending. If they are opposite, the sort order is descending. The background process utilizes an algo similar to that in the hint to judge how the operands relate to each other, but not the sort order. That is determined by our block.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.