나는 실수를 발견하지 못했지만 if 문을 제거하면 정상적으로 실행됩니다. 코드가 매우 짧아 문제를 쉽게 찾을 수 있어야합니다.if()에서 예상치 못한 식별자 처리
int zw1;
int zw2;
int px = 100;
int py = 100;
int ppx = px + random(-20, 20);
int ppy = py + random(-20, 20);
int cx;
int cy;
int xrand = 50;
int yrand = 50;
int opacity = 49;
frameRate(30);
background(74, 71, 74);
int timetoclear = 0;
int x0 = 0;
int y0 = 0;
void setup() {
size(400, 400);
}
void draw() {
cx = px + random(-xrand, xrand);
cy = py + random(-xrand, xrand);
// fill(74, 72, 74,5);
// rect(-10,-10,1000,1000);
//cx = mouseX;
//cy = mouseY;
if (cx <= 0) {
cx = 0;
}
if (cx >= 400) {
cx = 400;
}
if (cy <= 0) {
cy = 0;
}
if (cy >= 640) {
cy = 640;
}
stroke(30 + random(-100, 100), 195 + random(-100, 100), 201, 60);
fill(30 + random(-100, 100), 195 + random(-100, 100), 201, 50);
triangle(ppx, ppy, px, py, cx, cy);
ppx = px;
ppy = py;
px = cx;
py = cy;
}
예외 : catch되지 않은 구문 에러를 : 예기치 않은 식별자
이 실패한 이유를
정확한 오류 메시지를 포함하십시오. – JosephGarrone
잡히지 않은 SyntaxError : 예기치 않은 식별자 – Lauritz
어떻게 그 JavaScript입니까? –