Crazyplayer2.adb

-- Another crazy player.
-- Also trys to mess upp patternmatching.'

function CrazyPlayer2 return Move is
   Choice : Integer;
   PD: Integer; -- Player Dependant
begin
   for I in ON'Range loop
      PD:=PD+Integer(Character'Pos((ON(I))));
   end loop;
   PD:=(abs(PD)mod 10 )-5;
   Choice:=PD+MN/20;
   if OL = Cooperate then
      Choice := Choice - 5;
   end if;
   if OS > MS then
      CHoice := Choice+2;
   end if;
   if (Choice < 1) then
      return Cooperate;
   else
      return Defect;
   end if;
end CrazyPlayer2;

Tillbaka till huvudsidan