Friday, 15 June 2012

Error in switch statement, Javascript -


I have found a function that depends on a deal Black Jack hand. I used a switch statement for this, although I'm not sure that you can use several switches in the function. Either way I got an error saying 'Missing'; The first 'first' result in the 'before the text' statement in the 'first' case, I have been taught this code, so I am not sure where I went wrong. Can you please give me a hint or anything, please? Refards, Thomas.

  function printResult (playResult, dealResult) {var text = ""; Switch (playResult) {case (playResult == 21): the result "black jack"; break; Cases (Plarscult> 21): The results are "crappy"; break; Case (Plarscult and lieutenant; 21): Results "safe"; break; } Switch (dealage) {case (order and lieutenant; 17): Results "safe"; break; Case (SaDarekha == 17 & amp; amp; 21): Result "Stop"; break; Case (dealResult == 21): Results "black jack"; break; } Return results; } Var Results = "Player:" + playResult + ", Dealer:" + dealResult; Answers = (print result (5 + 9 + 10, 6 + 3 + 7));  

Maybe you want the result of being a variable assessment?

  RESULT = "Black Jack"  

Or maybe return?

  Returns "Black Jack"  

No comments:

Post a Comment