Random Number Generator
4.207
|
Tutorials and Samples
write requests to:
takehiko@mit.edu
last revised : 2/5/01
AutoLOADER© Set Up
AutoLISP file
random_01.lsp
: this program provides a pseudo-random number generator adopted from Kernighan and Ritchie's "C Programming Language," second edition, p46.
Functions Defined (click button for dispatching to AutoCAD)
(rand16)
: generates a random number between 0 and 32767 (a positive 16-bit integer).
(rand
min max
)
: generates a random number between
min
and
max
.
Min
and
max
must be integers including and between 0 and 32767.
(rand
2 5
)
(rand
0 32
)
(c:demo)
: draws 500 random points randomly colored from default 256 color set.
(c:demo2)
: draws 500 random points randomly colored via rgb coding.
Standard AutoCAD Commands
Education
|
Research
|
Who we are
|
Gallery
|
Bookmarks
Copyright © 1996 Takehiko Nagakura
Massachusetts Institute of Technology