Thanks. It works fine now. I changed it to 10 and now it returns 3 if I divide with 9 and mod is 0 or divide with 8 and mod is 1(I didn't want 0 to count for both) else it returns 0. I did this because 50-50% was not the optimal randomization for what I wanted. However I'm proud of myself I solved a problem all by myself by using OOP which I'm still very new to Problem was this:
Code:
Procedure playerturn;
begin
//do some things and loop until player misses.
aiturn;
end;

Procedure aiturn;
begin
//do some things and loop utnil AI misses
playerturn;
end;
this returned an error because the first procedure couldn't find the second. I found out however if I make an object for both of these procedures I'm able to make the procedures call each other. Cheers