Switching Ints
in
Programming Questions
•
2 years ago
Hello,
I am trying randomly switch between two coordinate sets. The case switch works fine. The gist is that triangle() cant read the int determined by the switch. I get a “Cannot find anything named a1″… Why?
float pos = random(2); switch(int(pos)){ case 0: // 1st Position int a1 = 50; int a2 = 50; int a3 = 100; int a4 = 0; int a5 = 0; int a6 = 0; break; case 1: // 2nd Position int a1 = 50; int a2 = 50; int a3 = 0; int a4 = 100; int a5 = 0; int a6 = 0; break; } triangle(a1, a2, a3, a4, a5, a6);
1