Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Utility Scripts
#2
A visualization of the random generator
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
Reply


Messages In This Thread
Utility Scripts - by flederohr - 03-17-2020, 11:52 AM
RE: Utility Scripts - by flederohr - 03-17-2020, 12:06 PM
- - by VanessaHic - 07-07-2021, 01:00 AM
- - by MyCreditDom - 01-04-2022, 09:54 PM
- - by AugustDiumb - 01-09-2022, 06:24 AM
- - by AudreyCib - 01-18-2022, 06:51 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)