binary out

hi
i'm tiying to make Focalist's code (thanks again!) run, here is how it is now:

void setup()
{
Serial.begin(9600);
int pwr[6] = { 1, 2, 4, 8, 16, 32 };
int bits[6] = { 0, 0, 0, 0, 0, 0 };
int i,val;
pinMode(5,OUTPUT);
pinMode(6,OUTPUT);
pinMode(7,OUTPUT);
pinMode(8,OUTPUT);
pinMode(9,OUTPUT);
pinMode(10,OUTPUT);
};

void loop()
{
// This code samples and converts to a binary array
i=6;
val = analogRead(0); // read the potentiometer and use map() to scale it.
val = map(val, 0, 1023, 0, 63); // convert to our translated number
while (i>-1) // to binary. Just loop the powers
{ // of two, subtract and set bits.
bits*=0;*
_ if (val>=pwr*)_
_
{_
_ val=val-pwr;
bits=1;
};
i=i-1;
};
// Now we have our binary array. Let's send it.
i=5;
while (i>-1)
{_

_serial.Print(bits);_
_if bits=1*
{
digitalWrite(10-i, HIGH);
};
i=i-1;
};
Serial.println(" ");
delay(100);
}
when I click on "verify" there is an error that I don't understand:it's about the higlited part above and says:
In function 'void loop()':
error: 'i' was not declared in this scope
could someone explain why this error appears_