You can also fix that by adding:

Code:
  procedure playerturn;
  Procedure aiturn;
in the interface part of your unit (usually just above the word "implementation"). That will make sure that they can always be found by all code in the implementation section.

Also, I see that you have two procedures calling eachother. You have to make sure that this won't cause in anfinite loop. These kinds of inifite loops will cause the Stack-overflow error.