Plan 9 from Bell Labs’s /usr/web/sources/contrib/fgb/root/sys/src/cmd/4th/examples/random.4th

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


\ Random generator test 4tH - (c) 1994,7 HanSoft & partners

cr ." Random generator test... Wait!" cr cr

10 array times                         ( initialize )
10 0 do 0 times i th ! loop

1000000 0 do 1 times random 10 mod th +! loop
                                       ( run random generator )
10 0 do i 7 .r loop cr                 ( report )
space 10 0 do ." ------ " loop cr
10 0 do times i th @ 7 .r loop cr
space 10 0 do ." ------ " loop cr
10 0 do times i th @ 100000 - 7 .r loop cr cr

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.