02-10-2019, 09:54 AM

Hello,

I am a sheer beginner of DM42 programming and interesting in a simple and useful program. Today I conceive something like the random number generator and show sets of integers on DM42/Free42 or HP-42S. In short, Linux command:

but I can't translate some parts.

By the way, this program would suggest horse racing Trio BOX or Lotto 7 (which I don't buy them so often.)

I wish you could help me to improve this idea.

Sample select 4 nominations from 18 horses. Y=18 X=4

--- X and Y register into R0 and R1

STO 00

R↓

STO 01

--- Random Number Part to store into Alpha memory

LBL "RNG"

DATE

TIME

x

SEED

RAN

RCLx 01

IP

-- Verify given numbers are not the same each other. (This is going to mess my brain)

x=y?

R↓

ASTO

GTO "RNG"

---Loop for X times

LBL "LOOP"

1

STO- 00

RCL 00

X≤0?

RTN

AVIEW

END

How you combine or improve these, I only know a little about 8-bit BASIC.

Thank you for reading and I look forward to hearing your great help.

Best regards,

I am a sheer beginner of DM42 programming and interesting in a simple and useful program. Today I conceive something like the random number generator and show sets of integers on DM42/Free42 or HP-42S. In short, Linux command:

Code:

`shuf -i 1-Y -n X`

By the way, this program would suggest horse racing Trio BOX or Lotto 7 (which I don't buy them so often.)

I wish you could help me to improve this idea.

Sample select 4 nominations from 18 horses. Y=18 X=4

--- X and Y register into R0 and R1

STO 00

R↓

STO 01

--- Random Number Part to store into Alpha memory

LBL "RNG"

DATE

TIME

x

SEED

RAN

RCLx 01

IP

-- Verify given numbers are not the same each other. (This is going to mess my brain)

x=y?

R↓

ASTO

GTO "RNG"

---Loop for X times

LBL "LOOP"

1

STO- 00

RCL 00

X≤0?

RTN

AVIEW

END

How you combine or improve these, I only know a little about 8-bit BASIC.

Thank you for reading and I look forward to hearing your great help.

Best regards,