After doing the first exercise, together with your partner write down exact instructions, in plain English, on how to sort cards under the circumstances described above. Get a third person and ask this person to take your instructions and follow them, while one of you two takes the role of processor. Ask the third person to perform the steps as literally as possible, without trying to interpret meaning. This exercise is most illustrative if the third person has no idea what the exact function of the instructions is. Once the sorting procedure has finished, check if the result is correct.
Your textual description is comparable to a real program. If the third person is unable to follow the steps, you seem to have made a syntax error. If the person can follow the steps but the end result is not as you want, you seem to have made a functional error. When programming computers, you will have to deal with both kinds of errors.
Note: writing such instructions is actually quite hard. Fortunately, writing similar instructions in a computer language is easier, as the syntax and semantics of the language are well-defined. English, as any other human language, is rather unsuitable to write unambiguous instructions.