Hi, I’m in the process of creating a submit button that will check for a certain placing order, here I’ve place a portion of my code.
this is the errors that I’m getting. (Please view the attachments)
line 17 expecting ;, found ‘k’. (BCE0044)
Line 17 Unexpected token: ). (BCE0043)
Line 18 Unexpected token: for. (BCE0043)
Line 18 expecting ), found ‘l’. (BCE0044)
Line 18 Unexpected token: ). (BCE0043)
Line 19 Unexpected token: if. (BCE0043)
Line 19 ‘;’ expected. Insert a semicolon at the end. (UCE0001)
Line 20 Unexpected token: if. (BCE0043)
Line 20 ‘;’ expected. Insert a semicolon at the end. (UCE0001)
Line 21 Unexpected token: if. (BCE0043)
Line 21 ‘;’ expected. Insert a semicolon at the end. (UCE0001)
Line 23 expecting EOF, found ‘}’. (BCE0044)
#pragma strict
function signal(cij,ckl){
if(ckl==cij-1) return 0;
else if(ckl==cij+1) return 0;
else return 1;
}
function coupleAction(i,j){
//out layer
if((i==0)(j==0)) return 0;
if((i==0)(j==3)) return 0;
if((i==2)(j==0)) return 0;
if((i==2)(j==3))return 0;
return 1;
}
function check(box,i,j){
for(int k=i-1;k<=i+1; k++){
for(int l=j-1;l<=j+1; l++){//range
if(((k>=0)(k<=2))((l>=0)(l<=3))){
if((coupleAction(k,l)==1)(!((k==i)(l==j)))){
if(signal(box[i][j],box[k][l])==0) return 0;
}
}return 1;
}
function submit(cube){
for(int i=0;i<3; i++){
for(int j=0;j<4; j++){
//out layer
if((i==0)(j==0)) continue;
if((i==0)(j==3)) continue;
if((i==2)(j==0)) continue;
if((i==2)(j==3)) continue;
if(check(cube,i,j)==0) return 0;
}
}
return 1;
}
}
var cube[][];
submit(cube);
1601141–96673–$Errors.pdf (27.1 KB)