No one up for the challenge?
Category None
I think this entry got lost with everyone travelling to Ireland, so I'll repost it, A Domino formula puzzler... basically create a formula that can convert base 16 to base 36. I'm beginning to think it might not be possible in the Domino formula language.
I think this entry got lost with everyone travelling to Ireland, so I'll repost it, A Domino formula puzzler... basically create a formula that can convert base 16 to base 36. I'm beginning to think it might not be possible in the Domino formula language.
Comments
Posted by Christopher Byrne At 03:24:06 PM On 06/21/2006 | - Website - |
I would approach it in four parts. First, I would convert the hex string to a string of "1"s and "0"s, representing the number a long binary string. That will be easy. No loop required.
The next part is to implement a binary string division algorithm. But this is the hard part. Hardware can do it, so obviously software can too. I'm sure there are plenty of textbook descriptions of the algorithm, in various machine languages.
The third part is a loop, successively applying the binary division algorithm to divide a binary string by "10010". You're working backwards, from the last digit to first. You start with your converted binary string as the dividend. On each iteration, you take the remainder, convert it to decimal and use it to index into an array of base 36 chars to get a char, and pre-pend that char to your answer. Take the quotient as your new dividend and repeat until your quotient gets to zero.
The third part is the algorithm to convert the remainder from a binary string to decimal. But that's a piece of cake. You're only dealing with values "00000" to "10010", so you might as well just create a list with the 36 possible values and use @member.
So, that's how someone can do it. But sorry... I don't have the time.
Posted by Richard Schwartz At 05:06:16 PM On 06/21/2006 | - Website - |
Posted by Richard Schwartz At 05:39:50 PM On 06/21/2006 | - Website - |
Posted by Steven At 09:35:40 PM On 06/21/2006 | - Website - |