Problem 1: card game solution
Working version of problem3. May need optimising
cleanup