Patrollers

version 12 by Michael Callaghan

  • Home page
  • Beginning
  • Previous
  • Next



  • Example: * The Chase - A short example to show the patrolling rules.
        "The Chase" by Michael Callaghan
        Include Patrollers by Michael Callaghan.
        The Guard Room is a room. "From the guard room you can watch the movements of the prisoner on the monitors".
        The Empty Corridor is a room. "A deserted corridor leads from the Guard Room to the Exercise Yard". The Empty Corridor is east of the Guard Room.
        The Exercise Yard is a room. "Here the prisoners can take their ten minute constitutional before being slammed back into their cells". The Exercise Yard is east of the Empty Corridor.
        The Rest Room is a room. "The rest room is where off-duty guards can take their well deserved naps". The Rest Room is south of the Guard Room. The Rest Room is southwest of the Empty Corridor.
        The Observation Room is a Room. "Here guards can look in on the high security cell to check that the prisoner is OK". The Observation Room is east of the Rest Room. The Observation Room is southwest of the Exercise Yard.
        The Cell is a room. "Only 10 feet by 10 feet - this is where high security prisoners are kept under close observation". The Cell is south of the Exercise Yard.
        The Red Door is east of the Observation Room and west of the cell. The Red Door is a door. The red door is closed and unlocked.

        The Prisoner is a Patroller in the Cell.
        The Prisoner is Circular.
        The Prisoner is DirectionLed.
        The DirectionTable of the Prisoner is Table of Escape.
        The OpeningCapability of the Prisoner is UnlockedOnly.
        The ReclosingCapability of the Prisoner is Reinstate.
        Table of Escape
      TargetDirection  
      North  
      West  
      West  
      South  
      East  
      East  
        The monitor is scenery in the Guard Room.
        The dog is a Patroller in the Guard Room. The dog is Aimless. The OpeningCapability of the Dog is none.
        When play begins:
            say "Here you are all alone on duty and the electronic locks chose this moment to fail. The prisoner is on the loose and the only way to retrieve him is to send the guard dog out. There is no way that you want to tackle him.";
            activate the Prisoner;
            activate the Dog.
        Instead of examining the monitor:
            say "The monitor shows that the prisoner is in [the location of the prisoner] and the dog is in [the location of the dog]."
        Instead of going somewhere from the Guard Room:
            say "The prison rules are very clear on this point. if a prisoner escapes, you must remain in the guard room and monitor the situation."
        Every turn:
            try examining the monitor;
            if the location of the dog is the location of the prisoner:
                if the location of the dog is the location of the player:
                    say "In front of your eyes, the dog leaps on the prisoner and pins him to the ground.";
                if the location of the dog is not the location of the player:
                    say "The fearsome sounds of the dog's barking tells you that the prisoner has been apprehended.";
                end the story finally.
        Test me with "wait / wait / wait / wait / wait / wait / wait / wait / wait / wait".