home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 24
/
CD_ASCQ_24_0995.iso
/
vrac
/
homonlib.zip
/
DICE.BAS
< prev
next >
Wrap
BASIC Source File
|
1995-04-13
|
746b
|
24 lines
DEFINT A-Z
DECLARE FUNCTION Dice (rolls, sides, add)
FUNCTION Dice (rolls, sides, add)
'****************************************************************************
'Returns the results of the specified dice roll(s).
'
'If you are a role-playing gamer, you will notice that the syntax of this
' function is similar to "standard gaming notation" of dice. For example,
' "3d6" can be easily translated to Dice(3,6,0), or "2d4+1" as Dice(2,4,1).
'
'****************************************************************************
RANDOMIZE TIMER
total = 0 'I think you can figure this one out!
FOR x = 1 TO rolls
total = total + INT(RND * sides) + 1 + add
NEXT x
Dice = total
END FUNCTION