If you don't want the same random numbers over and over again, at the very beginning of your program, call the randomize procedure.
begin
randomize; // init number generator from system clock
...
end.
As for the range, the problem is purely mathematical. If you have a list of seven numbers (0, 1, 2, 3, 4, 5, 6), what do you have to do to it to make it (-3, -2, -1, 0, 1, 2, 3)?
Hope this helps.
Duoas
Postaholic
2,043 posts since Oct 2007
Reputation Points: 1,140
Solved Threads: 229
No, the only function is random. If you say
x = random( 7 );
thenx will be one of (0, 1, 2, 3, 4, 5, 6).
Duoas
Postaholic
2,043 posts since Oct 2007
Reputation Points: 1,140
Solved Threads: 229