Can i make scar generate codes for me such as s000000000 to s999999999?
Can i make scar generate codes for me such as s000000000 to s999999999?
Do you mean generate a random code between that?
I think this is what you mean:
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.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.
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.



I'm sorry, I just MUST make things shorterSCAR 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.![]()
There are currently 1 users browsing this thread. (0 members and 1 guests)