Post Reply 
(11C) (15C) Simple configurable dice
04-06-2018, 12:53 PM (This post was last modified: 04-06-2018 09:51 PM by Michael Zinn.)
Post: #1
(11C) (15C) Simple configurable dice
A simple dice role program that rolls R1 many R2 sided dice and adds them together. The idea is that you don't change the configuration often, but can roll dice easily with just one button press. E.g. if you want to play Monopoly you would put 2 in R1 and 6 in R2 at the start of the game, set your calculator to USER mode and then role the dice with just one button press.

Example Configurations
Code:
R1 R2  Result
-- --- ------
 1   2 Coin toss
 1   6 dice roll
 2   6 Monopoly / Settlers of Catan
 3  20 Roll 3d20 (Dungeons & Dragons)
 1 100 Cthulhu RPG

Code
Code:
LBL 3  ; You could use label D for Dice here
  FIX 0
  RCL 1
  STO I
  CLx
  LBL 4
    RAN#
    RCL * 2   ; On 11C: RCL 2 * (two lines of code)
    INT
    +
    DSE I
      GTO 4
  RCL + 1  ; On 11C: RCL 1 + (two lines of code)
  RTN
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
(11C) (15C) Simple configurable dice - Michael Zinn - 04-06-2018 12:53 PM



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