daveVk

msg:3922182 | 3:48 am on May 29, 2009 (gmt 0) |
As cardCheck is set each time, the final value depends only on last 2 cards. Use innocent until proved otherwise method. var cardCheck="valid"; for (var i=0; i<(cardArray.length-1); i++){ var s=Number(cardArray[i+1])-Number(cardArray[i]); if(s!==1){cardCheck="notvalid";} } You will need to also that there are at least 2 cards
|
thegreatpretender

msg:3922772 | 1:18 am on May 30, 2009 (gmt 0) |
That's perpect. Thanks a lot.
|
thegreatpretender

msg:3930331 | 11:37 am on Jun 10, 2009 (gmt 0) |
I also want to check the card suits if all are the same. I have an array of cards suits and would like to find out if all the values are the same. Thanks a lot for the help.
|
daveVk

msg:3930340 | 12:04 pm on Jun 10, 2009 (gmt 0) |
Much the same var suiteCheck="valid"; for (var i=0; i<(suiteArray.length-1); i++){ if( suiteArray[i+1] !== suiteArray[i] ){suiteCheck="notvalid";} } Regards
|
thegreatpretender

msg:3930351 | 12:29 pm on Jun 10, 2009 (gmt 0) |
Thanks a lot really. I missed the -1 part. Thanks again.
|
|