RPG Dice Roller by anakinsolo@geocities.com http://www.geocities.com/Area51/Vault/3170/index.html http://www.geocities.com/Area51/Vault/3170/rpg.html -------------------------------------------------------- Here's a program I have written for the Sharp El-9200c calculator that rolls any RPG dices. I have put notes for each line so that the program can be adapted to any programming calculator... The only requirements are : - Simple Basic-like programming - enough memory or steps - user input variables - randomize function - label or line numbers and "branching function" (goto, etc) - result analysing (if ... <,>,=,etc then ...) - the formula for rolling dice may have to be changed Originally the program used the statistic capabilities of the calculator and I decided to reprogram the old damn thing recently to remove the need of statistic capabilities. In fact to make the program more easily adapted... Using the program ----------------- The programs ask for the (N) number of dice to be rolled, the (S) number of sides of the dices and the (M) modifiers to be applied when the rolls are done... so the dice formula looks like this : (N)D(S)+(M)... Then it shows the (T) total of the dice with all modifiers. Finally the program ask if you want to (R) restart the whole thing by entering 1 or simply to roll again by pressing the enter key making it rolls dice again without having to change the (N) number of dice, (S) side number and the (M) modifiers. About the program ----------------- Here's the program... Oh, by the way this is e-mailware, I only ask an e-mail from you telling me where you got it and where are you from IRL and finally that you give me credits for it... Thanks :), bugs report :|, flames :( ... anakinsolo@geocities.com P.S. I will gladly put adapted version for other calculators on my homepage P.S.S. Forget the comments after the ; they are only there so the program can be adapted. P.S.S.S. Sorry for my english, it's my 2nd language. Label A ; Line 1 ClrT ; Clear screen M=0 ; Initialising Variables N=0 ; " " S=0 ; " " Input N ; Ask for number of dices Input S ; Ask for number of sides Input M ; Ask for any modifiers Label B ; Line 9 L=N ; Initialising Variables R=0 ; " " T=0 ; " " Label C ; Line 13 If L<1Goto D ; If loop is less than 1 goto line 19 D=int Srandom+1 ; Roll one dice of S side T=T+D ; Adds the dice to the total of dice already rolled L=L-1 ; Reduce loop by one Goto C ; Goto line 13 Label D ; Line 19 If T>0Goto E ; Check if the total is higher than 0 if yes goto line 22 T=0 ; Since total is less than 0, total is 0 Label E ; Line 22 T=T+M ; Adds modifiers to the total of dice rolled ClrT ; Clear screen Print T ; Display the total of dice rolled Input R ; Ask if you want to restart program If R=1Goto A ; If restart is equal to one then restart program by going to line 1 Goto B ; Goto line 9 with same number of dice, side and modifiers