home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 9 / 09.iso / e / e050 / 1.ddi / MBDEF.OPS < prev    next >
Encoding:
Text File  |  1986-08-08  |  1.4 KB  |  77 lines

  1. -----------------------------------------------------------------------
  2. -----------------------------------------------------------------------
  3. --                                     --
  4. -- An OPS83 program for a version of the Monkey-and-Bananas problem. --
  5. --                                     --
  6. -----------------------------------------------------------------------
  7. -----------------------------------------------------------------------
  8.  
  9. module mbdef ()
  10. {
  11.  
  12. --
  13. -- TYPES
  14. --
  15.  
  16.  
  17. type monkey=element
  18.   (
  19.     X:integer;
  20.     Y:integer;
  21.     on:symbol;
  22.     holds:symbol;
  23.   );
  24.  
  25. type object=element
  26.   (
  27.     X:integer;
  28.     Y:integer;
  29.     name:symbol;
  30.     weight:symbol;
  31.     on:symbol;
  32.   );
  33.  
  34. type goal=element
  35.   (
  36.     X:integer;
  37.     Y:integer;
  38.     status:symbol;
  39.     object:symbol;
  40.     type:symbol;
  41.   );
  42.  
  43.  
  44. --
  45. -- UTILITIES
  46. --
  47.  
  48.  
  49. simple function eqlmg(&A:monkey, &B:goal):logical
  50. -- return true if &A and &B are at the same place 
  51.   {
  52.     return(&A.X=&B.X /\ &A.Y=&B.Y);
  53.   };
  54.  
  55.  
  56. simple function eqlog(&A:object, &B:goal):logical
  57. -- return true if &A is at the same place specified by &B
  58.   {
  59.     return(&A.X=&B.X /\ &A.Y=&B.Y);
  60.   };
  61.  
  62.  
  63. simple function eqlmo(&A:monkey, &B:object):logical
  64. -- return true if &A and &B are at the same place 
  65.   {
  66.     return(&A.X=&B.X /\ &A.Y=&B.Y);
  67.   };
  68.  
  69.  
  70. simple function eqloo(&A:object, &B:object):logical
  71. -- return true if &A and &B are at the same place 
  72.   {
  73.     return(&A.X=&B.X /\ &A.Y=&B.Y);
  74.   };
  75.  
  76. };
  77.