btw: the author of the linked tutorial didn't
tell us why you can also use
instead of
Code:
new keys=(1<<0|1<<1|1<<2|1<<3|..|1<<9)
Well this is quite easy:
With the above code you set bits. Written side by side, this looks as following:
Code:
Keys: 9 8 7 6 5 4 3 2 1 0
Bits: 1 1 1 1 1 1 1 1 1 1
This way makes clear that these bits represent a binary number, which, "translated" into the decimal system, is equal to 1023.
Let's see what happens if u only need keys 0-4:
Code:
Keys: 9 8 7 6 5 4 3 2 1 0
Bits: 0 0 0 0 0 1 1 1 1 1
The corresponding decimal value for this would be 31.
I think it's a lot easier using the bitwise notation cuz u won't lose the overview there, just wanted to give a hint...
__________________