Advertisement
mixster

mixster

Aug 13th, 2009
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 1.36 KB | None | 0 0
  1. program Lumberjack;
  2. {.include srl/srl.scar}
  3.  
  4. procedure DeclarePlayers;
  5. begin
  6.   HowManyPlayers := 1;
  7.   NumberOfPlayers(HowManyPlayers);
  8.   CurrentPlayer := 0;
  9.  
  10.   with Players[0] do
  11.   begin
  12.     Name := '';
  13.     Pass := '';
  14.     Active := True;
  15.     Strings[0] := 'draynor';
  16.     // Tree, Oak, Willow, Yew
  17.     Integers := [0, 20, 40, 70];
  18.     Loc := '';
  19.   end;
  20. end;
  21.  
  22. type
  23.   floop = array of function: Boolean;
  24.  
  25. procedure AppendLoop(var loopy: floop; toAdd: function: Boolean);
  26. var
  27.   l: Integer;
  28. begin
  29.   l := Length(loopy);
  30.   SetLength(loopy, l + 1);
  31.   loopy[l] := ___Pointer(toAdd);
  32. end;
  33.  
  34. function CheckLocation: Integer;
  35. begin
  36.  
  37. end;
  38.  
  39. function WalkToTree: Boolean;
  40. begin
  41.  
  42. end;
  43.  
  44. function ChopLoop: Boolean;
  45. begin
  46.  
  47. end;
  48.  
  49. function HandleLogs: Boolean;
  50. begin
  51.  
  52. end;
  53.  
  54. function WalkToBank: Boolean;
  55. begin
  56.  
  57. end;
  58.  
  59. var
  60.   mloop: floop;
  61.   s, h, i, t: Integer;
  62.   np: Boolean;
  63. begin
  64.   Writeln('Begin');
  65.   SetupSRL;
  66.   DeclarePlayers;
  67.   AppendLoop(mloop, @WalkToTree);
  68.   AppendLoop(mloop, @ChopLoop);
  69.   AppendLoop(mloop, @HandleLogs);
  70.   AppendLoop(mloop, @WalkToBank);
  71.   h := High(mloop);
  72.   repeat
  73.     np := True;
  74.     s := CheckLocation;
  75.     for i := s to h do
  76.     begin
  77.       if (not mloop[i]()) then
  78.       begin
  79.         np := False;
  80.         break;
  81.       end;
  82.     end;
  83.     NextPlayer(np);
  84.   until False;
  85.   Writeln('End');
  86. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement