That error message is incredibly unhelpful (Turing's fault, not yours).
The problem is that you have declared the
cards argument without the
var keyword.
If you look at
http://compsci.ca/holtsoft/doc/procedure.html , you can see that parameter declarations have a form described at
http://compsci.ca/holtsoft/doc/paramdeclaration.html . The optional
[ var ] has this documentation:
Turing Help wrote:
Parameters to a procedure may be declared using var, which means that the parameter can be changed inside the procedure.
Unfortunately Turing is pretty awful at error messages (compared to modern languages, anyway). It
should tell you that you can't change a constant (not variable) object, but instead you get that unhelpful error message.