It seems that there is a small error in 'rand':
Code: Select all
> (set 'N 10)
10
> (rand 3 N)
(2 0 1 1 0 2 2 2 2 0 2)
> (length (rand 3 N))
11
This way:
Code: Select all
> (rand 5 0)
(4)
Code: Select all
> (rand 5 -1)
- Fanda
PS: I am using newLISP v.8.9.0 on Win32 MinGW