Is there some slick way to do this?
Posted: 25 Feb 2013 00:22
With one line of code? I'm tired of typing all this. I just want the value a to increment by one in my multipad object. Can't I specify a range for Pads.x and then tell a to find the position of the button press?
if (Pads.x[0])a=1;
if (Pads.x[1])a=2;
if (Pads.x[2])a=3;
if (Pads.x[3])a=4;
if (Pads.x[4])a=5;
if (Pads.x[5])a=6;
if (Pads.x[6])a=7;
if (Pads.x[7])a=8;
if (Pads.x[8])a=9;
if (Pads.x[0])a=1;
if (Pads.x[1])a=2;
if (Pads.x[2])a=3;
if (Pads.x[3])a=4;
if (Pads.x[4])a=5;
if (Pads.x[5])a=6;
if (Pads.x[6])a=7;
if (Pads.x[7])a=8;
if (Pads.x[8])a=9;