home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / pascal / 7502 < prev    next >
Encoding:
Internet Message Format  |  1992-12-16  |  802 b 

  1. Path: sparky!uunet!munnari.oz.au!metro!usage!csdvax.csd.unsw.edu.au!p2112899
  2. From: p2112899@csdvax.csd.unsw.edu.au
  3. Newsgroups: comp.lang.pascal
  4. Subject: help with die rolls...
  5. Message-ID: <1992Dec16.170959.3637@csdvax.csd.unsw.edu.au>
  6. Date: 16 Dec 92 17:09:58 +1000
  7. Organization: University of New South Wales
  8. Lines: 18
  9.  
  10. Could someone please show me how to get random die rolls going.
  11.  
  12. I am writing an attribute program for a roll playing game and need to roll die
  13. for it.
  14.  
  15. The code I have done is:
  16.  
  17. for i := 0 to 3 do  pe := pe + random(6);
  18.  
  19. to roll a 6 sided die 3 times, but it doesn't work as it should. Some values
  20. produced are actually lower than possible.
  21.  
  22. The minimum roll from 3 six sided die is 3, sometimes I get 2???
  23.  
  24. Any help will be appreciated.
  25.  
  26. Richard.
  27. P2112899@csdvax.csd.unsw.edu.au
  28.