home *** CD-ROM | disk | FTP | other *** search
- -----------------------------------------------------------------------
- -----------------------------------------------------------------------
- -- --
- -- An OPS83 program for a version of the Monkey-and-Bananas problem. --
- -- --
- -----------------------------------------------------------------------
- -----------------------------------------------------------------------
-
- module mbdef ()
- {
-
- --
- -- TYPES
- --
-
-
- type monkey=element
- (
- X:integer;
- Y:integer;
- on:symbol;
- holds:symbol;
- );
-
- type object=element
- (
- X:integer;
- Y:integer;
- name:symbol;
- weight:symbol;
- on:symbol;
- );
-
- type goal=element
- (
- X:integer;
- Y:integer;
- status:symbol;
- object:symbol;
- type:symbol;
- );
-
-
- --
- -- UTILITIES
- --
-
-
- simple function eqlmg(&A:monkey, &B:goal):logical
- -- return true if &A and &B are at the same place
- {
- return(&A.X=&B.X /\ &A.Y=&B.Y);
- };
-
-
- simple function eqlog(&A:object, &B:goal):logical
- -- return true if &A is at the same place specified by &B
- {
- return(&A.X=&B.X /\ &A.Y=&B.Y);
- };
-
-
- simple function eqlmo(&A:monkey, &B:object):logical
- -- return true if &A and &B are at the same place
- {
- return(&A.X=&B.X /\ &A.Y=&B.Y);
- };
-
-
- simple function eqloo(&A:object, &B:object):logical
- -- return true if &A and &B are at the same place
- {
- return(&A.X=&B.X /\ &A.Y=&B.Y);
- };
-
- };