"the error", would you clarify what is "the error" explicitly.

You have some difficulties to describe things. How old are you? Are you older than 10 years old? Ask your parents to help you to write down
(1) What is your question? What is your expected result of which method. Or you did not even get any result, you got an error message, then, what is the error message you saw?

(2) Both method IsLegal() and containsJQK() are using a global variable, card[], so I need to see how card[] was initialized.

(3) I need to see the callers of these two functions, so I can tell if selectedCards is well initialized.

(4) From style point of view, both methods are written very verbose. Inner loop in IsLegal() is messy. Your project is practicing Object-Oriented, while you are still struggling in control-statements. So I guess that you proceeded too quick. If so, do not to be afraid of failure. Fail sooner is a good thing for a starter.

 

所有跟帖: 

Here -cm930118- 给 cm930118 发送悄悄话 (304489 bytes) () 05/24/2018 postreply 14:33:20

your test is too faraway from the method you suspect. -LiveInCanada2- 给 LiveInCanada2 发送悄悄话 (1267 bytes) () 05/24/2018 postreply 15:16:45

Deck class as follows below: 谢谢! -cm930118- 给 cm930118 发送悄悄话 (0 bytes) () 05/24/2018 postreply 15:24:18

Deck looks good; -LiveInCanada2- 给 LiveInCanada2 发送悄悄话 (1621 bytes) () 05/24/2018 postreply 15:57:53

I did some searching on Google and found out what implementation -cm930118- 给 cm930118 发送悄悄话 (234 bytes) () 05/24/2018 postreply 16:53:00

请您先登陆,再发跟帖!