Recommend
2 
 Thumb up
 Hide
8 Posts

Wargames» Forums » General

Subject: Random die generator program for HP calculators rss

Your Tags: Add tags
Popular Tags: [View All]
Rob Johnson
United States
St. Cloud
Minnesota
flag msg tools
Avatar
mbmbmbmbmb
Back in the Grog Age (1977), I wrote a program for the TI-55 specifically for my SPI games, which required random 1-6 (1d6) or number generation 0-9.

I graduated to HP calculators and reworked the program for my HP-42S. Now I have a HP-48SX.

I can't find that program anywhere. snarl Worse, I can't remember how I wrote it!

The HP's use a random number generator (not truly random but close enough for gaming purposes) which generates a real integer zero to one. My old Noggin is so full of bat droppings I can't work out a program so simple. Age is a ghastly thing, wot?

My Grognard Brethren, I need help here!
1 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
David Molnar
United States
Ridgewood
New Jersey
flag msg tools
Avatar
mbmbmbmbmb
multiply by 6, add 1, take the floor?
3 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Rob Johnson
United States
St. Cloud
Minnesota
flag msg tools
Avatar
mbmbmbmbmb
It was far too simple.

RAND
*
n
+
1
INT

Caffeine! I keep forgeting the bloody caffeine!

Thanks, Dave!

never going to live this one down.....
1 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Gary Bacchus
United States
Altamonte Springs
Florida
flag msg tools
badge
Avatar
mbmbmbmbmb
This works on my HP50g. They're all UserRPL commands, so it should work on the SX as well. I just encapsulated your bit into something that will support multiple dice of any number of sides. Use this as you will.


« "NUM DICE" "" INPUT OBJ->
"NUM SIDES" "" INPUT OBJ->
-> dice sides
« 1 dice START RAND sides * 1 + FLOOR NEXT
»
»


The -> is the arrow character. Sorry for not tabbing it out. I've yet to figure out how that works. Never thought I'd use the code tags on BGG.

EDIT: OBJ -> should be OBJ->
 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Gary Bacchus
United States
Altamonte Springs
Florida
flag msg tools
badge
Avatar
mbmbmbmbmb
jakal323 wrote:
This works on my HP50g. They're all UserRPL commands, so it should work on the SX as well. I just encapsulated your bit into something that will support multiple dice of any number of sides. Use this as you will.


« "NUM DICE" "" INPUT OBJ ->
"NUM SIDES" "" INPUT OBJ ->
-> dice sides
« 1 dice START RAND sides * 1 + FLOOR NEXT
»
»


The -> is the arrow character. Sorry for not tabbing it out. I've yet to figure out how that works. Never thought I'd use the code tags on BGG.



Made a slight error transposing this. The top two lines should be OBJ-> with no space. Again, the -> is the arrow character.
 
 Thumb up
1.00
 tip
 Hide
  • [+] Dice rolls
Rob Johnson
United States
St. Cloud
Minnesota
flag msg tools
Avatar
mbmbmbmbmb
Thanks Gary!

I was and still am a die-hard HP-42S fan, but mine took a bath on the shop floor years ago and never recovered.....15 years of hard environments and it never blinked- I loved that HP. The 42S now goes for about $270 on EBay...rape!

The 48SX is more like climbing into the cockpit of a fighter jet after training on biplanes.........just too much!!!

Thanks!
 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Gary Bacchus
United States
Altamonte Springs
Florida
flag msg tools
badge
Avatar
mbmbmbmbmb
You're very welcome. I'm glad that I could help.

I hear you on the pricing for some of the HP's back catalog. I've been jonesing for a HP-16C for some time. Last time I checked, they were fetching a neat sum as well.
1 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Bruce Murphy
Australia
Pyrmont
NSW
flag msg tools
badge
Avatar
mbmbmbmbmb
Of course "real integer" is a lot like "real america", no?

B>
1 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Front Page | Welcome | Contact | Privacy Policy | Terms of Service | Advertise | Support BGG | Feeds RSS
Geekdo, BoardGameGeek, the Geekdo logo, and the BoardGameGeek logo are trademarks of BoardGameGeek, LLC.