Results 1 to 5 of 5

Thread: Random number generator

  1. #1
    Join Date
    Nov 2006
    Posts
    2,369
    Mentioned
    4 Post(s)
    Quoted
    78 Post(s)

    Default Random number generator

    I quicly made this script and the output isn't very random I think
    Well that must be becouse it makes the numbers too fast and random in computer isn't really random becouse it takes the numbers from your computer clock...It is much more random if you add like wait(100) to the script.

    If you wanna try I suggest you make it write the numbers to notepad.

    SCAR Code:
    begin
      Repeat
        SendKeys(IntToStr(Random(10)));
      Until(False);
    end.

    Here is part of the output:
    Code:
    7777777488888888888888366666666662335433330222222201111111888499188884000000088555377777777777777777775110888888099960000003222222222222222100000043333333337555555510000000799922555555555555799111111111192222222222222225333333333333333333333337744444479999992884485555622239905559611711111554000000030000006222222222228333396666455422222270000013365555567777700366666665599995563335333330550000000399999066666666666666666595557666666666886622222223334444444734444440333477777747777399999999999999991677777777155555504444447888833955555555555555555554330000000003005556000000005555511174444444418819999931111111888888888888803333333355444470000955555508888888893333339444444444444444404444511111889999999733333299999999999999999944332999999660000063337555555550555555554111111111111111111102222211222222232222229444444466999999999999999999999999999999944444822222223888886333333305555572601111111888888880000444446999533711111111111662225573888611117111118999999991444444444444000000211111033333382222296666666666666666669166666554444456666688888888827777772000011111111111111141111117715555590006888888844440000000000000444444999999999883777777335555586666645333333360000377777780000004888888888888888888845555555555555555334444444442111116444533333343333352222228999999999655555591111733336000085555593333333337111117000000222224888802220074444444444444444496666674444460000988888884000000018888888888888888889622222222228144444444444444444444444444062224777771999999444966171133333333332111164444427777788495555555528044444488255558888827777733333333333333335444444444489933100098888843333333333599999777753333099999966777777715551444444726666500005111111166666999999945555549992888889999990033733333338442711112211700000000788887666588888888511111111111111111111144468888879999995577777772233611111111111127333339001333353333333188882222222211111110444122222122222222900000009333333300000000000001333333333133333886666666555557777777888840000042888886199055508966666996655577772282477777330099866663312210000004444445777777665560939666663388888835555550555555277777777719999988888888882774444440666666666669095555555555555555513366666662999999937722220555555777777777770333333766661777771333333356666666855438555555552666669666666777777774999999666666666666666533303333588888888891000002666300000611117799960046666666001666666666666666333333288115555551666666623111277188888600000600000000000000056046555511117666666649999077777767777777777777
    Quote Originally Posted by DeSnob View Post
    ETA's don't exist in SRL like they did in other communities. Want a faster update? Help out with updating, otherwise just gotta wait it out.

  2. #2
    Join Date
    Nov 2007
    Location
    Chile
    Posts
    1,901
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    scar Code:
    program New;
    var
      C : Integer;
      R : String;
    const
      Len = 1000;
    begin
      repeat
        Inc(C);
        R := R + IntToStr(Random(10));
      until C = Len;
      Writeln(R);
    end.
    The same without typing:
    Code:
    4269902581940252026285105352423573319324481855871764804130046018728606344939898694299955946787560938660656157404164045741046372596068889526162290813411940103760360798714656914256230049748479037550619532079297417805219920790730749288536462337363480118350088920066195856215946898062519147489149359185445651154281156736494953425331086946879734831380067268511283971675769661654692813065051682274417929584704668714003528455083705972756873579804362395170228394919651971603768083410365456063107464934256413385330540011175868421376618033972451181374204948787699839258857195516450164846996781316485146216163363632385461611656988396624433351432650011452240795981255865447774598309042529078309359927142163287824800571030625866362468185605439815301432784815689620602443211579430123313073770224390113922459659010924349125387994746672444026057820343693761681458927056020945118928173179936458629863144262438844925917843201406091714280607453007885651030497637055587378524629745517598333284705990990390541856292312717


  3. #3
    Join Date
    Dec 2008
    Posts
    2,813
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    begin
      repeat
        SendKeys(IntToStr(Random(10)));
      until(False);
    end.

    STANDARDIZE ME, CAP'N!

    lol sorry.. I like being a standard nazi

    I used..

    SCAR Code:
    program New;
    {.include srl/srl.scar}

    var
      T, i: integer;
     
    procedure ScriptTerminate;
    begin
      Writeln('Ran for '+IntToStr(TimeFromMark(T))+'ms. Generated '+IntToStr(i)+' numbers.');
    end;

    begin
      SetupSRL;
      MarkTime(T);
      repeat
        SendKeys(IntToStr(Random(10)));
        Inc(i);
      until(False);
    end.



    just cuz I'm special >.>

  4. #4
    Join Date
    Nov 2006
    Posts
    2,369
    Mentioned
    4 Post(s)
    Quoted
    78 Post(s)

    Default

    Yea so what you think about that random isn't really so random...http://en.wikipedia.org/wiki/Pseudor...mber_generator

    I first thought that how does computer make something random... Then I found that from wikipedia and now i know that they are not actually random.
    Quote Originally Posted by DeSnob View Post
    ETA's don't exist in SRL like they did in other communities. Want a faster update? Help out with updating, otherwise just gotta wait it out.

  5. #5
    Join Date
    Nov 2007
    Posts
    12
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Could you please explain this to me :S I have no clue what you are talking about.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •