Prince Pwn @ Mon May 28, 2007 10:33 am wrote:
Java: |
for (int i = 1 ; i <= maxBall ; i++) // counts to 4
{
if (key == char (i)) // if i press any number, 1 - 4 // DOESNT WORK!
amount = i; // amount becomes equal to the number I press
}
|
Consider this: (char)0x30 is '0'.
So your conversion should be (char)(i | 0x30)--this is okay because you control the value of "i"; this will not work with # > 9.
You can also check out Java characters and their relation to Unicode.