A set amount of times?
Say, something like
repeat
{ stuff }
until(3) //the until would make it try 3 times to do stuff
Any way?
Printable View
A set amount of times?
Say, something like
repeat
{ stuff }
until(3) //the until would make it try 3 times to do stuff
Any way?
Try using the For.. To.. Do Loop
Simba Code:For i:=0 to 3 Do
Begin
Stuff;
MoreStuff;
End;
A basic way of doing this would be having an integer that simple increases every time:
Simba Code:I := 0;
repeat
Stuff;
I := I + 1
until(I >= 3)
~Caotom
Or alternatively:
Simba Code:var I: Integer;
I := 0;
repeat
//MyStuff;
Inc(I);
until(I >= 3);
Another loop you can use is While ... Do for example:
Simba Code:var i: Integer;
i := 0
While (i < 5) Do
begin
DoStuff;
IncEx(i, 1);
writeln(IntToStr(i));
end;