Who's Bored? (1 Viewer)

vbaInet

AWF VIP
Local time
Today, 00:46
Joined
Jan 22, 2010
Messages
26,374
Re: Who's bored?

So what is the value after "Z". In this case the answer is "AA". But A = 0, so this is two zeros for each significant digit. The value after "Z" in a hexavigesimal sequence would be to add a significant digit with the first non-zero value (B), followed by a zero (A). So, BA follows Z. And really Z is actually "AZ", we just assume nothing is zero, but again, in this case A=0.
If only pr2-eugin had made his base 1 BlueIshDan would have had less to worry about. :)
 

BlueIshDan

☠
Local time
Yesterday, 20:46
Joined
May 15, 2014
Messages
1,122
Re: Who's bored?

Hmm well when comparing to converters on-line my numbers are the same...

unitconversion.org
extraconversion.com











Code:
(Decimal) Base-10: 99999
To base-26
Alpha: True
-------------------------------------
(0) : 99999 Mod 26
(0) = 3
 (99999 / 26 : 3846)

(1) : 3846 Mod 26
(1) = 24
 (3846 / 26 : 147)

(2) : 147 Mod 26
(2) = 17
 (147 / 26 : 5)

(3) : 5 Mod 26
(3) = 5
 (5 / 26 : 0)


(3) 5 = F
(2) 17 = R
(1) 24 = Y
(0) 3 = D

Any thoughts?
 

Attachments

  • Capture.PNG
    Capture.PNG
    1.5 KB · Views: 237
  • Capture2.PNG
    Capture2.PNG
    1.4 KB · Views: 236
  • Capture3.PNG
    Capture3.PNG
    1.3 KB · Views: 242
  • Capture4.PNG
    Capture4.PNG
    1.4 KB · Views: 234
  • Capture5.PNG
    Capture5.PNG
    1.4 KB · Views: 234

BlueIshDan

☠
Local time
Yesterday, 20:46
Joined
May 15, 2014
Messages
1,122
Re: Who's bored?

The more I think about this, the more I think part of the problem is that is not a straight base-10 to hexavigesimal conversion.

In any base system we use, we include 0, binary has 0,1. Octal has 0,1,2,3,4,5,6,7 and etc. In this case we were given the task of converting as number to an alpha sequence where A = 0.

So what is the value after "Z". In this case the answer is "AA". But A = 0, so this is two zeros for each significant digit. The value after "Z" in a hexavigesimal sequence would be to add a significant digit with the first non-zero value (B), followed by a zero (A). So, BA follows Z. And really Z is actually "AZ", we just assume nothing is zero, but again, in this case A=0.

Make sense or did I just churn up a lot of mud???:eek:

Code:
(Decimal) Base-10: 26
To base-26
Alpha: True
-------------------------------------
(0) : 26 Mod 26
(0) = 0
 (26 / 26 : 1)

(1) : 1 Mod 26
(1) = 1
 (1 / 26 : 0)


(1) 1 = B
(0) 0 = A
 

BigHappyDaddy

Coding Monkey Wanna-Be
Local time
Yesterday, 16:46
Joined
Aug 22, 2012
Messages
205
Re: Who's bored?

BluIshDan:

In the original post, a couple of criteria examples were:
Input : Number - (zero bound) example 5, 51
Output : String - example (for the input 5) F, (for the input 51) AZ
So what do you get for 51?
 

BlueIshDan

☠
Local time
Yesterday, 20:46
Joined
May 15, 2014
Messages
1,122
Re: Who's bored?

See the thing is 5 being F and 51 being AZ does not make any sense.

If you wish for AZ to be 51 then A has to be 1, but you con't have A start at 1 and 5 = F in the same fashion of these numbering styles.

It will either be 5 = F, 51 = BZ,
or 5 = E, 51 = AY and 52 = AZ

I also am not trying to prove anything wrong. I was just trying to get help to fix my function since It was titled as wrong and that it was said that I should write a working function.


Code:
0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X  Y  Z  ^

0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
!  A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X  Y  Z  ^
 

vbaInet

AWF VIP
Local time
Today, 00:46
Joined
Jan 22, 2010
Messages
26,374
Re: Who's bored?

If you wish for AZ to be 51 then A has to be 1, but you con't have A start at 1 and 5 = F in the same fashion of these numbering styles.

It will either be 5 = F, 51 = BZ,
or 5 = E, 51 = AY and 52 = AZ
I can't believe you're still dwelling on this. ;)

You're putting too much thought into this. The highlighted bit is incorrect because it's not sequential. The best thing for you to do is open up an Excel spreadsheet, paste =COLUMN(A1) in the very first cell and drag it across all the way to 52. Go back to Column 26 and 27 and notice the sequence.
 

BlueIshDan

☠
Local time
Yesterday, 20:46
Joined
May 15, 2014
Messages
1,122
Re: Who's bored?

Right? You don't have to show me this. I understand yours and my own and have the capability of understanding all styles of counting.

Also the above was a response to:

Input : Number - (zero bound) example 5, 51
Output : String - example (for the input 5) F, (for the input 51) AZ

stating that the values didn't match up. and in neither of our (A=0) and (A=1) fashions does AZ = 51

I'm also done with this because I can see that your mind is in no way wanting to unclench from one way of doing this for reason of helping me accomplish something else. Great style for a mentor. I tip my hat to you as I walk away from this forum. haha
 

vbaInet

AWF VIP
Local time
Today, 00:46
Joined
Jan 22, 2010
Messages
26,374
Re: Who's bored?

Merely pointing out that the OP's range is between A and Z for numbers 0 to 25. This is BigDaddyHappy's viewpoint.

If you were trying to accomplish a task using a different counting style i.e. following the ASCII sequence between a range of A to ^ for numbers 0 to 26 then you should have said so and we'll look into it.
 

pr2-eugin

Super Moderator
Local time
Today, 00:46
Joined
Nov 30, 2011
Messages
8,494
Re: Who's bored?

Wow ! Okay, looks like this thread has got a much different reaction than I hoped it would get. Great comments, ideologies. Its great how people perceive one problem and tackle them very differently. So now ! Thanks to BlueIshDan, vbaInet, BigHappyDaddy for your participation. We will all have a beer when we get together lol.

No hard feelings, but I think it is best to close this thread now ! Too long and too much chatter :D
 

pr2-eugin

Super Moderator
Local time
Today, 00:46
Joined
Nov 30, 2011
Messages
8,494
Re: Who's bored?

I'll have a brandy thanks :D
I don't drink any alcohol anyway, so I will have my lemonade please. Lol. Although I have a bottle of brandy, that someone gave me as a house warming gift. It is lying around in my flat for about a month. Not sure what I should do with it, no wait you can have it :D
 

vbaInet

AWF VIP
Local time
Today, 00:46
Joined
Jan 22, 2010
Messages
26,374
Re: Who's bored?

I don't drink any alcohol anyway, so I will have my lemonade please. Lol. Although I have a bottle of brandy, that someone gave me as a house warming gift. It is lying around in my flat for about a month. Not sure what I should do with it, no wait you can have it :D
Yaaaaayyyy!!:D
 

stopher

AWF VIP
Local time
Today, 00:46
Joined
Feb 1, 2006
Messages
2,395
Hang on a minute... LONG only gives us numbers up to around 2 billion which gives us a string of only 7 characters. That's a bit lame :p

I wrote the following to generate the sequence (because I read the OP's task wrong :eek:). But it it nicely chugging away through the 8 character mark and beyond the reach on LONG. Problem is it has no notion of index.

Code:
Public Function IncrementLetter(word() As Variant, pos As Integer)

    Do
        word(pos) = word(pos) + 1    'increment letter
        If word(pos) > 90 Then
            word(pos) = 64
            If pos = word(0) Then    'add a new letter because all current letters as Z
                word(0) = word(0) + 1
                word(word(0)) = 65
            Else                     'increment previous letter (next letter in the array)
                Call IncrementLetter(word(), pos + 1)
            End If
        Else
            Exit Function
        End If
    Loop
 
End Function

I figure my function is constrained only by the length of a string (which is very long - 65k+) and the stack level limit of recursion (some 4000+). Either way, our brightest star will have flickered out long before we reach those limits. On my spare laptop I reckon I'll get to 9 characters in about 12 hours so 10 characters in about 13 days, 11 characters in nearly a year and so on. My point is we should at least be able to deal with 11 characters.

So how do we enter big numbers, say bigger than 141x10^12 (10 digits) that will produce the relevant string?

Chris
 

Users who are viewing this thread

Top Bottom