Together, the digits of a number represent its value. Each digit represents a part of the whole number's value. For base 10 numbers, the rightmost digit is the ones digit, the next digit is the tens digit, the next is the hundreds (ten times ten) digit, and so forth. The same pattern holds in other bases.
As an example, let's figure out the value of 1011 in base two. The rightmost digit is the ones digit. The next one is the twos; the next is the fours (two times two); and, the leftmost one is the eights digit (two times two times two). So, the base 10 value of the number is 1 * 8 plus 0 * 4 plus 1 * 2 plus 1 * 1 or 11.
Base 36 would have 36 symbols. The first ten are the base 10 digits. The next 26 are all 26 letters of the alphabet.
As an example, the number 230 in base 36 takes only two digits: a thirty-sixes place and a ones place. The number is 6E: 6 * 36 plus 14 * 1 (remember: E's value is 14).
So, the algorithm is to multiply the base 10 value so far by the base (36 for us); then, add the base 10 value of the new digit. Repeat this step for each digit of a number, and you'll have found the base 10 value of the number.
Remember that we said you could translate characters to ints by casting them. Normally, this is not a very useful operation.. the integer value of a particular character is not very interesting. However, the difference between two characters can be quite interesting. For example:
(int)'3' - (int)'0' == 3The upshot of this is that you can translate a digit between '0' and '9' into a numerical value. How? Just subtract the integer value of '0' from the digit's integer value.
So, what about letter digits (like 'D')? Well:
(int)'D' - (int)'A' == 3How can you get the value of 13 from this? If you're not sure, notice that the following are also true:
(int)'A' - (int)'A' == 0 (int)'E' - (int)'A' == 4Where A's base 10 value is 10 and E's is 14. Do you see a pattern?
That should be enough information to get you up and running with bases. Good luck!