Post Reply 
Powerball Generator!
09-14-2024, 11:27 AM
Post: #9
RE: Powerball Generator!
(09-13-2024 08:26 PM)lrdheat Wrote:  ... On my HP 50, I programmed it to only present a non repeating 1 row matrix of 6 numbers.

I would have the same chance of a win if I simply chose 1,2,3,4,5,6 !

Indeed the chance of winning is minuscule but at least we get some entertainment by programming our HP's Smile

This is my Powerball program for the HP 50 using ListExt and LSORT. It returns a list of 5 numbers in the range 1..69 on level 2 and a number in the range 1..26 on level 1. For MegaMillions (the other US multi-state lottery) replace the 69 with 70 and replace the 26 with 25.

Code:

\<< 69 LSEQ             @ List of numbers 1..69
    LSHUF               @ Shuffle list
    5 LTAKE LSORT       @ Take first 5 numbers and sort
    RAND 26. * IP 1. +  @ Random integer in range 1..26
    R\->I               @ Convert to exact integer for display
\>>
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Powerball Generator! - rlk281 - 05-23-2024, 09:42 PM
RE: Powerball Generator! - carey - 05-24-2024, 12:36 PM
RE: Powerball Generator! - rlk281 - 05-24-2024, 04:18 PM
RE: Powerball Generator! - knife31 - 09-13-2024, 04:11 AM
RE: Powerball Generator! - Thomas Klemm - 09-13-2024, 07:18 AM
RE: Powerball Generator! - Thomas Klemm - 09-13-2024, 07:37 AM
RE: Powerball Generator! - lrdheat - 09-13-2024, 08:26 PM
RE: Powerball Generator! - John Keith - 09-14-2024 11:27 AM
RE: Powerball Generator! - DGM - 09-14-2024, 06:40 PM
RE: Powerball Generator! - Thomas Klemm - 09-13-2024, 10:20 PM
RE: Powerball Generator! - AnnoyedOne - 09-14-2024, 12:41 PM
RE: Powerball Generator! - C.Ret - 09-14-2024, 03:13 PM
RE: Powerball Generator! - AnnoyedOne - 09-14-2024, 03:45 PM
RE: Powerball Generator! - Thomas Klemm - 09-14-2024, 04:43 PM



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