"Basic" Challenge help

Masti6
Posts: 55
Joined: Sat May 15, 2010 12:04 pm
Location: Finland, Nurmes

Post by Masti6 »

Omgaskinhead wrote:Base 7 is a different way to "write" integers. For example: base 2 (or binary) is 01010001100 and so on.. it means, that you can write 2 different chars to write your number. in base 3 you can use 0, 1 and 2, in base 4 you can use 0, 1, 2 and 3. So we use base 10 (0 till 9 are 10 different integers)

Hexadecimal is with 16 different chars.. but we do only have 10 digits, so we use the first few letters from the alphabet (A, B, C .. F)

So in Base 7 you cannot have digits which are higher than 6 --> 0, 1, 2, 3, 4, 5, 6

to convert your number, you have to use the division algorithm (maybe you know '%' or 'modulo', division with remainder)

...
Thank you so much for clearing that out. I couldn't find anything useful about base 7 on google, but as soon as I knew how it works I got my little piece of code to work :)
Not so hard with a little loop after you know this.
User avatar
CodeX
Posts: 350
Joined: Fri Oct 17, 2008 5:28 pm

Post by CodeX »

Simples, although you'd probably get a better understanding by looking at a couple of bases and noticing the pattern for yourself.
Post Reply