function RandomRotate(p:integer):boolean;
UPDATED
I know this is a basic function but it can be very useful to some. Please remember to post feedback. Also, you may edit this code freely but you cannot distribute this code without my permission.
It has worked well in my private scripts.
Information:
SCAR Code:
{*******************************************************************************
Name: function RandomRotate:boolean;
Author: IP-Drowner
Description: Will rotate the compass to a random direction then it
return's true.
*******************************************************************************}
Usage:
The Code:
SCAR Code:
function RandomRotate:Boolean;
begin
case random(5) of
0: begin
MakeCompass('N');
Writeln('Changed the compass to North');
Result:=True;
end;
1: begin
MakeCompass('S');
Writeln('Changed the compass to South');
Result:=True;
end;
2: begin
MakeCompass('E');
Writeln('Changed the compass to East');
Result:=True;
end;
3: begin
MakeCompass('W');
Writeln('Changed the compass to West');
Result:=True;
end;
4: begin
Writeln('Did not change the compass angle.');
Result:=True;
end;
end;
end;
Enjoy!