Post Reply 
(33s) Double Deck Descriptor: A 2-level Description of Input
09-26-2022, 05:34 PM
Post: #1
(33s) Double Deck Descriptor: A 2-level Description of Input
Double Deck Descriptor (DDD)

Irritated by the inadequacies of DESCRIPTOR

https://www.hpmuseum.org/forum/thread-18866.html

I now present the DDD.

For input

0
22367899

the programme returns

211112
987632

to be read as

291817161322

to be read as

two 9s one 8 one 7 one 6 one 3 two 2s.

Limitations: No particular digit may appear more than 9 times in the combination of the two levels - results become incoherent.

The initial zero on stack level Y is needed as a starter - indeed, it could be replaced by any number, but the result would be questionable.

If the programme is now again activated, you get a description of

291817161322

& so on.

[i] is my representation of indirect (i).

Code:
1.    LBL D
1.    CLVARS
2.    STO K
3.    x<>y
4.    STO L
5.    +
6.    x≠0?
7.    GTO E
8.    1
9.    x<>y
10.    RTN
1.    LBL E
2.    CLx
3.    RCL K
4.    RCL+ L
1.    LBL F
2.    x=0?
3.    GTO G
4.    CLx
5.    RMDR(K:10)+1
6.    STO i
7.    SGN
8.    STO+ [i]
9.    CLx
10.    RCL L
11.    x=0?
12.    GTO I
13.    CLx
14.    RMDR(L:10)+1
15.    STO i
16.    SGN
17.    STO+ [i]
18.    CLx
19.    IDIV(L:10)
20.    STO L
1.    LBL I
2.    CLx
3.    IDIV(K:10)
4.    STO K
5.    GTO F
1.    LBL G
2.    CLx
3.    10
4.    STO i
5.    CLx
6.    STO T
7.    STO U
1.    LBL H
2.    CLx
3.    RCL [i]
4.    x=0?
5.    GTO J
6.    CLx
7.    10^(1+IP(LOG([i])))*U+[i]
8.    STO U
9.    CLx
10.    10* T+i-1
11.    STO T
1.    LBL J
2.    DSE i
3.    GTO H
4.    CLx
5.    RCL U
6.    RCL T
7.    RTN

D: LN = 45        G: LN = 33
E: LN = 12        H: LN = 66
F: LN = 94        J: LN = 21
I: LN = 25
Find all posts by this user
Quote this message in a reply
07-12-2023, 11:48 AM
Post: #2
RE: (33s) Double Deck Descriptor: A 2-level Description of Input
A slightly improved version:

Code:
1.    LBL D
2.    CLVARS
3.    STO K
4.    x<>y
5.    STO L
6.    +
7.    x≠0?
8.    GTO F
9.    1
10.    x<>y
11.    RTN
1.    LBL F
2.    x=0?
3.    GTO G
4.    CLx
5.    RMDR(K:10)+1
6.    STO i
7.    SGN
8.    STO+ [i]
9.    CLx
10.    RCL L
11.    x=0?
12.    GTO I
13.    CLx
14.    RMDR(L:10)+1
15.    STO i
16.    SGN
17.    STO+ [i]
18.    CLx
19.    IDIV(L:10)
20.    STO L
1.    LBL I
2.    CLx
3.    IDIV(K:10)
4.    STO K
5.    GTO F
1.    LBL G
2.    CLx
3.    10
4.    STO i
5.    CLx
6.    STO T
7.    STO U
1.    LBL H
2.    CLx
3.    RCL [i]
4.    x=0?
5.    GTO J
6.    CLx
7.    10*U+[i]
8.    STO U
9.    CLx
10.    10* T+i-1
11.    STO T
1.    LBL J
2.    DSE i
3.    GTO H
4.    CLx
5.    RCL U
6.    RCL T
7.    RTN

D: LN = 45        G: LN = 33
F: LN = 94        H: LN = 49
I: LN = 25        J: LN = 21
Find all posts by this user
Quote this message in a reply
07-12-2023, 12:25 PM
Post: #3
RE: (33s) Double Deck Descriptor: A 2-level Description of Input
Excuse me, I don't understand what is this program for. What does it meant Double Deck Descriptor (DDD). Can you explain this a little more for me? Thank you in advance. Pedro
Find all posts by this user
Quote this message in a reply
07-12-2023, 01:32 PM
Post: #4
RE: (33s) Double Deck Descriptor: A 2-level Description of Input
A description of the programme's function, PedroLeiva, is in the text of the 1st posting in this thread.

Another slightly improved version:

Code:
1.    LBL D
2.    CLVARS
3.    STO K
4.    x<>y
5.    STO L
6.    +
7.    x≠0?
8.    GTO F
9.    1
10.    x<>y
11.    RTN
1.    LBL F
2.    CLx
3.    RMDR(K:10)+1
4.    STO i
5.    SGN
6.    STO+ [i]
7.    CLx
8.    RCL L
9.    x=0?
10.    GTO I
11.    CLx
12.    RMDR(L:10)+1
13.    STO i
14.    SGN
15.    STO+ [i]
16.    CLx
17.    IDIV(L:10)
18.    STO L
1.    LBL I
2.    CLx
3.    IDIV(K:10)
4.    STO K
5.    x≠0?
6.    GTO F
7.    CLx
8.    10
9.    STO i
10.    CLx
11.    STO T
12.    STO U
1.    LBL H
2.    CLx
3.    RCL [i]
4.    x=0?
5.    GTO J
6.    CLx
7.    10*U+[i]
8.    STO U
9.    CLx
10.    10* T+i-1
11.    STO T
1.    LBL J
2.    DSE i
3.    GTO H
4.    CLx
5.    RCL U
6.    RCL T
7.    RTN

D: LN = 45        H: LN = 49
F: LN = 88        J: LN = 21
I: LN = 58
Find all posts by this user
Quote this message in a reply
07-13-2023, 08:57 PM
Post: #5
RE: (33s) Double Deck Descriptor: A 2-level Description of Input
(07-12-2023 12:25 PM)PedroLeiva Wrote:  Excuse me, I don't understand what is this program for. What does it meant Double Deck Descriptor (DDD). Can you explain this a little more for me? Thank you in advance. Pedro

It looks like when given a number, this program outputs a description of that number. For example, the number 664555 could be described as "2 sixes, 1 four, 3 fives" which would be represented on the calculator as 261435. Apparently, the original program had trouble with long numbers, so he's splitting the output into a "double deck" (two rows) with the number of times each digit appears being written above the digit. So, the output 261435 would look like:
213
645

Now, if your question is why anyone would want to do this, I don't know. Maybe it has something to do with number theory? It reminded me of a programming class about 40 years ago where we had to convert a number to written text. For example, if the input were 3164, the output would be "Three Thousand One Hundred Sixty Four". This was used by banks and other businesses to write checks.

- Bruce
Find all posts by this user
Quote this message in a reply
07-13-2023, 10:38 PM
Post: #6
RE: (33s) Double Deck Descriptor: A 2-level Description of Input
Bruce, I didn't realize it until I read your post. Many times things are simple, but it is necessary for the brain to interpret them correctly. Thank you so much for your explanation. Pedro
Find all posts by this user
Quote this message in a reply
07-14-2023, 10:50 AM
Post: #7
RE: (33s) Double Deck Descriptor: A 2-level Description of Input
(07-13-2023 08:57 PM)byoung Wrote:  Now, if your question is why anyone would want to do this, I don't know. Maybe it has something to do with number theory?

For further background, this program computes a run-length encoding of the sorted digits of a number. See also A005150, the "look-and-say" sequence.
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 3 Guest(s)