03-17-2020, 12:06 PM
A visualization of the random generator
safe as file random
compile thee script
and run with arguments [range of numbers] [number of random generations]
safe as file random
compile thee script
Code:
compile random
and run with arguments [range of numbers] [number of random generations]
Code:
random 20 1000
Code:
var i,j,len,c,out
varexists ext1
!len=10
if varexists
!len=ext1
endif
varexists ext2
!c=100
if varexists
!c=ext2
endif
!i=0
while i<len do
var rand_%i%
!rand_%i%=
!i=i+1
done
!j=0
while j<c do
// clear
rndint %len%
!rand_%rndint%=%rand_%rndint%%#
!i=0
!out=####################\n
while i<len do
!out=%out%%i%:\t%rand_%i%%\n
!i=i+1
done
!out=%out%####################
? %out%
wait 10
!j=j+1
done
!c=0
!i=0
while i<len do
strlen rand_%i%
!c=c+strlen
free rand_%i%
!i=i+1
done
say 0 sum: %c%
free i,j,len,c,out,strlen