{ HL3_TXL.INC ntw 8/95
A procedure to establish **bidirectional** equivalence between the
Discriminator Flags and the lowermost four bits of a Sentence pointer.
Made into an Include file to ensure **total** agreement between
HL2-FLGS.INC and MAKEHLXX.PAS, when inserted into an approp. Proc. }
Procedure Translate;
begin
case Task_Phase of
Preamble:
begin { Comment on my situation: }
Determine(Present, 8); { Am I speaking to anyone? }
Determine(New_Req, 4); { And is this a 2nd request? }
if Is_True[New_Req] then
begin { If 1st request, }
Determine(Was_Prs, 2); { Is it to a newcomer ? }
Determine(Targ_Rt, 1); { (Use this as a random factor) }
end
else
begin { But if it's a repeat request, }
if Is_True[Present] then
begin { and if someone's there, }
Determine(Task_TO, 2);
if Is_True[Task_TO] then { and I timed out, }
Determine(Any_Imp, 1) { did they cooperate at all? }
else { Or, if didn't time out, }
Determine(Patient, 1); { am I still patient? }
end
else { If no-one's around, }
begin
Determine(Was_Prs, 2); { did they just leave? }
if Is_True[Was_Prs] then { if so, }
Determine(Was_Imp, 1) { were they any help? }
else { If they didn't just leave, }
Determine(Rct_Act, 1); { has the place been dead? }
end;
end;
end { Preamble };
reQuest:
begin { Ask for help: }
Determine(Present, 8);
if Is_True[Present] then { If someone's out there, }
begin
Determine(New_Req, 4);
if Is_True[New_Req] then { and, if this is a new request, }
begin
Determine(Targ_Nr, 2); { do I want to be turned far? }
Determine(Targ_Rt, 1); { Which direction? }
end
else { But if it's an old request, }
begin
Determine(Any_Imp, 2); { are they helping at all? }
Determine(Was_Imp, 1); { Were they helping before? }
end;
end
{}
else { But if no-one's out there now, }
begin
Determine(Was_Prs, 4); { Did they just leave? }
Determine(Targ_Nr, 2); { Else use these last 2 flags}
Determine(Targ_Rt, 1); { as random moan selectors! }
end;
end { reQuest };
encouRage:
begin { Comment during task: }
Determine(Sns_Rot, 8);
if Is_True[Sns_Rot] then { If I'm turning, }
begin
Determine(Dir_OK, 4); { Is it in the right directn? }
Determine(Targ_Nr, 2); { Am I almost there? }
Determine(Gentle, 1); { Are they being gentle? }
end
else { But if I'm not turning, }
begin
Determine(Was_Prs, 4); { Did they just arrive or leave? }
Determine(Present, 2);
if Is_True[Present] then { If they are around, }
Determine(Targ_Rt, 1) { which way's the target? }
else
Determine(Patient, 1); { If I'm alone, am I impatient? }
end;
end;
ScoreIt:
begin { Give feedback on results }
Determine(On_Targ, 8); { If I did get to where I }
if Is_True[On_Targ] then { wanted to go... }
begin
Determine(Patient, 4); { Have I been waiting long? }
Determine(Gentle, 2); { Were they gentle? }
Determine(New_Req, 1); { Did I previously overshoot? }
end
else { If not on target... }
begin
Determine(Ovshoot, 4); { Did I overshoot? }
if Is_True[Ovshoot] then
begin
Determine(Gentle, 2);
Determine(Patient,1);
end
else { must have timed out! }
begin
Determine(Any_Imp, 2); { Was I at least closer? }
Determine(Present, 1); { Was I deserted in the middle? }
end;
end;
end;
end { cases };
end;