0 and -1 could easily be mistaken for each other by the script
I really don't understand this. I guess you maybe talk about a way ,how solver works:
Simba Code:
if (SRL_Randoms[rand].solve <> nil) and (SRL_Randoms[rand].solve())
,but I don't want to replace current FindNornalRandoms ,but add second expanded. Well ,maybe I should name it FindNormalRandomsEx.
There is not big deal to add it:
Simba Code:
var
SRL_FailedRandomFlag : boolean; // global flag
function FindNormalRandomsEx : byte;
begin
SRL_FailedRandomFlag := FALSE; // reset flag
if FindNormalRandoms then
Result := 1
else begin
if SRL_FailedRandomFlag then Result := -1
else Result := 0;
end;
end;
then inside function _SolveRandom:
Simba Code:
if (SRL_Randoms[rand].solve <> nil) and (SRL_Randoms[rand].solve()) then
begin
addToSRLLog('***** Solved Random: '+SRL_Randoms[rand].name+' *****');
players[currentPlayer].rand := '';
inc(SRL_Randoms[rand].solved);
solved := true;
end else
SRL_FailedRandomFlag := TRUE;