I think it really depends on some questions about your lines / programs. If, for example, you knew that your number would not exceed 255 (IE you used only 8 bits or 8 0s / 1s), you could create a function in which you pass it 8 bits from your string, move it and add to the amount you returned every time you press 1. IE, if you press the bit at 2 ^ 7, add 128, and the next bit that you typed is 2 ^ 4, add 16.
This is my quick and dirty idea. I think more and google for being at school .: D
Chris
source share