SWRPG 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 dices for the Star Wars RPG. 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... The WildDice ------------ The Star Wars roleplaying game uses an original system designed by West-End Games where a certain dice is called the wilddice... When the wilddice comes up as 2-5, add it to the total normally. When the wilddice comes up as a 6, add it to the total and roll it again. Add this new result to the total. If the roll was a 6, add the result and roll it again. When the wilddice comes up as a 1, subtract the wilddice and the highest other die from the total. Using the program ----------------- The programs ask for the (N) number of dice to be rolled, including the wilddice and (P) pips modifiers... so the dice formula looks like this : (N)D6+(P)... Then it shows the (W) wilddice total or (M) mishap total and then the (T) total of the dice with wilddice, mishap and pips 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 and the (P) pips 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 N=0 ; Initialising Variables P=0 ; " " Input N ; Ask for number of dices Input P ; Ask for any pips modifiers Label B ; Line 7 L=N ; Initialising Variables D=0 ; " " H=0 ; " " M=0 ; " " R=0 ; " " T=0 ; " " Label C ; Line 14 W=int 6random+1 ; Roll the wild dice If W=1Goto D ; If the wild dice equal 1 then goto line 19 If W=6Goto E ; If the wild dice equal 6 then goto line 22 Goto F ; Goto line 27 Label D ; Line 19 M=1 ; Take notice of a mishap Goto F ; Goto line 27 Label E ; Line 22 W=W+D ; Adds the successive wilddice rolled to the wilddice D=int 6random+1 ; Rolls the successive wildice If D=6Goto E ; If the successive wildice is equal to 6 then goto line 22 W=W+D ; Adds the successive wilddice rolled to the wilddice Label F ; Line 27 T=T+W ; Adds the wilddice and the successive wilddice to the total of dice rolled L=L-1 ; Reduce loop by one Label G ; Line 30 If L<1Goto I ; If loop is less than 1 goto line 42 D=int 6random+1 ; Roll one dice of 6 side If H0Goto L ; Check if the total of dice rolled is higher than 0 if yes goto line 54 T=0 ; Since total is less than 0, total is 0 Label L ; Line 54 T=T+P ; Adds pips to the total of dice rolled Print T ; Display 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 dices and pips modifiers