Random.st
changeset 271 29e79420636f
parent 258 c2933c08c83a
child 350 93d5932c76e6
--- a/Random.st	Sat Apr 27 20:04:14 1996 +0200
+++ b/Random.st	Tue Apr 30 15:00:01 1996 +0200
@@ -78,9 +78,31 @@
     claus: the algorithm may need a rewrite for better numbers
 
     [author:]
+        Steve Byrne
         Claus Gittinger
-        Steve Byrne
+"
+!
+
+examples
+"
+                                                                        [exBegin]
+    |rnd|
 
+    rnd := Random new.
+    10 timesRepeat:[
+        Transcript showCr:(rnd next)
+    ]
+                                                                        [exEnd]
+
+    rolling a dice:
+                                                                        [exBegin]
+    |rnd|
+
+    rnd := Random new.
+    10 timesRepeat:[
+        Transcript showCr:(rnd nextIntegerBetween:1 and:6)
+    ]
+                                                                        [exEnd]
 "
 ! !
 
@@ -249,5 +271,5 @@
 !Random class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic2/Random.st,v 1.15 1996-04-25 16:59:40 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic2/Random.st,v 1.16 1996-04-30 13:00:01 cg Exp $'
 ! !