Random.st
changeset 271 29e79420636f
parent 258 c2933c08c83a
child 350 93d5932c76e6
equal deleted inserted replaced
270:efae030b0514 271:29e79420636f
    76             restriction from my (CG) side.
    76             restriction from my (CG) side.
    77 
    77 
    78     claus: the algorithm may need a rewrite for better numbers
    78     claus: the algorithm may need a rewrite for better numbers
    79 
    79 
    80     [author:]
    80     [author:]
       
    81         Steve Byrne
    81         Claus Gittinger
    82         Claus Gittinger
    82         Steve Byrne
    83 "
    83 
    84 !
       
    85 
       
    86 examples
       
    87 "
       
    88                                                                         [exBegin]
       
    89     |rnd|
       
    90 
       
    91     rnd := Random new.
       
    92     10 timesRepeat:[
       
    93         Transcript showCr:(rnd next)
       
    94     ]
       
    95                                                                         [exEnd]
       
    96 
       
    97     rolling a dice:
       
    98                                                                         [exBegin]
       
    99     |rnd|
       
   100 
       
   101     rnd := Random new.
       
   102     10 timesRepeat:[
       
   103         Transcript showCr:(rnd nextIntegerBetween:1 and:6)
       
   104     ]
       
   105                                                                         [exEnd]
    84 "
   106 "
    85 ! !
   107 ! !
    86 
   108 
    87 !Random class methodsFor:'instance creation'!
   109 !Random class methodsFor:'instance creation'!
    88 
   110 
   247 ! !
   269 ! !
   248 
   270 
   249 !Random class methodsFor:'documentation'!
   271 !Random class methodsFor:'documentation'!
   250 
   272 
   251 version
   273 version
   252     ^ '$Header: /cvs/stx/stx/libbasic2/Random.st,v 1.15 1996-04-25 16:59:40 cg Exp $'
   274     ^ '$Header: /cvs/stx/stx/libbasic2/Random.st,v 1.16 1996-04-30 13:00:01 cg Exp $'
   253 ! !
   275 ! !