I know I am missing something and thought I could just use && to check for unlimited conditions in an If statement. I'm self taught so I might have missed this chapter. Can anyone help school me on this?
// JavaScript Document
/* This is a check for variables to win a game of tick tac toe. A1-3 is the first column, B1-3 second column, C1-3 the third column.
"ShowFeedback" shows the line indicating 3 in a row.
*/
//A1 B1 C1
if((window.A1Answer=="true") && (window.B1Answer == "true") && (window.C1Answer= "true")) {
cp.changeState("ShowFeedback","A1_B1_C1");
cp.disable("A1_288");
cp.disable("B1_291");
cp.disable("C1_294");
cp.disable("A2_297");
cp.disable("B2_300");
cp.disable("C2_303");
cp.disable("A3_306");
cp.disable("B3_309");
cp.disable("C3_312");
}else if((window.A1Answer=="false") && (window.B1Answer == "false") && (window.C1Answer= "false")) {
cp.changeState("ShowFeedback","F_A1_B1_C1");
cp.show("Restart_56_grp")
cp.disable("A1_288");
cp.disable("B1_291");
cp.disable("C1_294");
cp.disable("A2_297");
cp.disable("B2_300");
cp.disable("C2_303");
cp.disable("A3_306");
cp.disable("B3_309");
cp.disable("C3_312");
Aucun commentaire:
Enregistrer un commentaire