Unexpected token help
in
Programming Questions
•
11 months ago
I was messing around with switch statements when this occurred:
- void setup() {
- size(800, 800);
- smooth();
- background(255, 204, 0);
- textFont(createFont("Serif", 25));
- int iden = 0;
- text("Press up to draw a shape, right to draw a name, and left to drag a name", 75, 75);
- }
- void keyPressed() {
- if (key == CODED) {
- if (keyCode == UP) {
- int iden = 1;
- }
- else if (keyCode == RIGHT) {
- int iden == 2;
- }
- else if (keyCode == LEFT) {
- int iden == 3;
- }
- else {
- int iden == 4;
- }
- }
- void draw() {
- switch(iden)
- {
- case 1:
- break;
- case 2:
- break;
- case 3:
- break;
- case 4:
- break;
- default:
- println("WORK!!");
- break;
- }
- }
I am getting a "unexpected token: int" at "int iden = 2"
Any suggestions?
1