HP Forums
Powerball Generator! - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: Not HP Calculators (/forum-7.html)
+--- Forum: Not quite HP Calculators - but related (/forum-8.html)
+--- Thread: Powerball Generator! (/thread-21785.html)



Powerball Generator! - rlk281 - 05-23-2024 09:42 PM

...who doesn't need a handy Powerball generator every now and then? Tongue

Picks 1st five numbers between 1-69, no-dupes, then picks the lucky Powerball number between 1-26! Uses the Alpha Register to format the output, a 1x6 array, and the fancy [FIND] function to keep duplicates in check!

00 { 127-Byte Prgm }
01 LBL "PBALL"
02 CLA
03 CLD
04 6
05 1
06 DIM "PBALL"
07 INDEX "PBALL"
08 1.00501
09 STO "CNT"
10 LBL 01
11 RCL "CNT"
12 1
13 STOIJ
14 RAN
15 100
16 ×
17 IP
18 STO 10
19 69
20 X<>Y
21 X>Y?
22 GTO 01
23 X≤0?
24 GTO 01
25 [FIND]
26 GTO 01
27 STOEL
28 ├" "
29 AIP
30 ISG "CNT"
31 GTO 01
32 LBL 02
33 6
34 1
35 STOIJ
36 RAN
37 100
38 ×
39 IP
40 STO 10
41 26
42 X<>Y
43 X>Y?
44 GTO 02
45 X≤0?
46 GTO 02
47 STOEL
48 ├" PB: "
49 AIP
50 AVIEW
51 END


RE: Powerball Generator! - carey - 05-24-2024 12:36 PM

If I run this program and win, do I have to split the winnings? Smile


RE: Powerball Generator! - rlk281 - 05-24-2024 04:18 PM

Winner's choice! Tongue

(05-24-2024 12:36 PM)carey Wrote:  If I run this program and win, do I have to split the winnings? Smile