Results 1 to 5 of 5

Thread: generator

  1. #1
    Join Date
    Nov 2007
    Posts
    25
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default generator

    Can i make scar generate codes for me such as s000000000 to s999999999?

  2. #2
    Join Date
    Dec 2007
    Location
    192.168.1.73
    Posts
    2,439
    Mentioned
    6 Post(s)
    Quoted
    119 Post(s)

    Default

    Do you mean generate a random code between that?

  3. #3
    Join Date
    Jun 2007
    Location
    Wednesday
    Posts
    2,446
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    I think this is what you mean:
    SCAR Code:
    program CodeGenerator;
    var
      i,ii: integer;
      code,extraChars: string;

    begin
      for i:= 0 to 999999999 do
      begin
        for ii:= 0 to 8-Length(IntToStr(i)) do
          extraChars:= extraChars+'0';
        code:= 's'+extraChars+IntToStr(i);
        extraChars:= '';
        Writeln(Code);
      end;
    end.
    That will run through s000000000, s000000001, s0000000002 etc. with code being what it stores it as. It also has built in support for having 9 digits after the s (so it's not s0, s1 etc.). The Writeln will show what number it is on, so just run it for a bit to make sure it does what you want.
    If you just want it to make up a random number, you can just use 'RandomRange(0,999999999);' which generates a random number between 0 and 999999999.
    By reading this signature you agree that mixster is superior to you in each and every way except the bad ways but including the really bad ways.

  4. #4
    Join Date
    Nov 2007
    Posts
    25
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by mixster05 View Post
    I think this is what you mean:
    SCAR Code:
    program CodeGenerator;
    var
      i,ii: integer;
      code,extraChars: string;

    begin
      for i:= 0 to 999999999 do
      begin
        for ii:= 0 to 8-Length(IntToStr(i)) do
          extraChars:= extraChars+'0';
        code:= 's'+extraChars+IntToStr(i);
        extraChars:= '';
        Writeln(Code);
      end;
    end.
    That will run through s000000000, s000000001, s0000000002 etc. with code being what it stores it as. It also has built in support for having 9 digits after the s (so it's not s0, s1 etc.). The Writeln will show what number it is on, so just run it for a bit to make sure it does what you want.
    If you just want it to make up a random number, you can just use 'RandomRange(0,999999999);' which generates a random number between 0 and 999999999.
    thanks exactly what i needed

  5. #5
    Join Date
    Jun 2006
    Posts
    3,861
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    SCAR Code:
    program New;

    procedure WriteOutNums(ToNum: Integer);
    var
      I: Integer;
    begin
      for I:= 0 to ToNum do
        writeln(Replace(PadL(IntToStr(I), Length(IntToStr(ToNum))), ' ' , '0'));
    end;

    begin
      WriteOutNums(10000);
    end.
    I'm sorry, I just MUST make things shorter

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. nickname generator
    By HayHay89 in forum RS3 Outdated / Broken Scripts
    Replies: 3
    Last Post: 01-29-2008, 11:31 AM
  2. palindrome generator
    By lardmaster in forum Java Help and Tutorials
    Replies: 4
    Last Post: 02-04-2007, 08:03 PM

Posting Permissions

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