(FILECREATED "18-May-84 19:07:37" {INDIGO}<LOOPS>RELEASE>1-MAY-84>BIGMAC.;1 14412  

      changes to:  (CLASSES BigMac)
		   (VARS BIGMACCOMS)
		   (METHODS BigMac.GoToStoppingPlace BigMac.SelectTruck)
		   (INSTANCES BigMac.GoToStoppingPlace BigMac.SelectTruck 
			      GoToStoppingPlaceBigMacRules)
		   (FNS BigMac.SelectTruck GoToStoppingPlaceBigMacRules TakeTurnBigMacRules 
			GoToStoppingPlaceTravelerRules FindStoppingPlaceTravelerRules 
			BuyGasTravelerRules TakeTurnTravelerRules))


(PRETTYCOMPRINT BIGMACCOMS)

(RPAQQ BIGMACCOMS ((CLASSES BigMac)
		   (METHODS BigMac.GoToStoppingPlace BigMac.SelectTruck)
		   (INSTANCES GoToStoppingPlaceBigMacRules)
		   (FNS BuyGasTravelerRules FindStoppingPlaceTravelerRules 
			GoToStoppingPlaceBigMacRules GoToStoppingPlaceTravelerRules 
			TakeTurnBigMacRules TakeTurnTravelerRules)))
(DEFCLASSES BigMac)
[DEFCLASS BigMac
   (MetaClass PlayerMeta Edited:                             (* mh: "18-May-84 18:14"))
   (Supers Traveler)
   (ClassVariables (Icon ? doc                               (* Undocumented CV added by HAUSLADEN))
		   (InitializeIVs ?)
		   (CopyCV (Icon InitializeIVs)
			   doc                               (* Undocumented CV added by HAUSLADEN)
			   ))
   (InstanceVariables (nextDestination Nil doc               (* Next destination. A different AlicesRestaurant.)
				       ))]

[METH BigMac  GoToStoppingPlace NIL
      (* RuleSet GoToStoppingPlaceTravelerRules is installed as the selector GoToStoppingPlace of the 
	 class Traveler)
      (method GoToStoppingPlaceBigMacRules RuleSet GoToStoppingPlaceBigMacRules)]


[METH BigMac  SelectTruck NIL
      (* ask player what truck he wants)]


(DEFINEQ

(BigMac.SelectTruck
  [LAMBDA (self)                                             (* mh: "18-May-84 18:06")
                                                             (* ask player what truck he wants)
    (← ($ Truck)
       MacTruck])
)
[DEFINST RuleSet (GoToStoppingPlaceBigMacRules "YQT0.al4.ll=.74")
         (perspectiveNode #&(RuleSetNode "YQT0.al4.ll=.82") myViewName RuleSet)
	 (name #(GoToStoppingPlaceBigMacRules NIL RememberName))
	 (compiledRules GoToStoppingPlaceBigMacRules)
	 (workSpace BigMac)
	 (args NIL)
	 (tempVars NIL)
	 (taskVars NIL)
	 (debugVars NIL)
	 (numRules 2)
	 (controlStructure DOALL)
	 (whileCondition NIL)
	 (compilerOptions (A))
	 (auditClass NIL)
	 (metaAssignments NIL)
	 (ruleClass NIL)
	 (taskClass)]


[DEFINST RuleSetNode ("YQT0.al4.ll=.82")
         (perspectives ? RuleSet #&(RuleSet "YQT0.al4.ll=.74") Source 
		       #&(RuleSetSource "YQT0.al4.ll=.83"))]


[DEFINST RuleSetSource ("YQT0.al4.ll=.83")
         (indexedVars ((#&(Rule "YQT0.al4.ll=.84"))
		       (#&(Rule "YQT0.al4.ll=.85"))))
	 (perspectiveNode #&(RuleSetNode "YQT0.al4.ll=.82") myViewName Source)
	 (created "27-JAN-83 00:02:00")
	 (creator STEFIK)
	 (edited "18-May-84 18:55:43")
	 (editor NotLoggedIn)]


[DEFINST Rule ("YQT0.al4.ll=.84")
         (source 
"(* Ask to go to a stopping place returned by FindStoppingPlace)

	-> .FindStoppingPlace (← \PlayerInterface Move self stoppingPlace);")
	 (edited "18-May-84 18:55:43")
	 (editor NotLoggedIn)
	 (ruleNumber 1)
	 (ruleSet #&(RuleSet "YQT0.al4.ll=.74"))]


[DEFINST Rule ("YQT0.al4.ll=.85")
         (source 
" 
(* Check if real truck location is a gas station.  Don't  
   use stoppingPlace, since chosen it may not have been reached  
   because of cops or robbers)

	IF (ISA truck:location $GasStation)
	 THEN .BuyGas;")
	 (edited "18-May-84 18:55:43")
	 (editor NotLoggedIn)
	 (ruleNumber 2)
	 (ruleSet #&(RuleSet "YQT0.al4.ll=.74"))]


(DEFINEQ

(BuyGasTravelerRules
  [LAMBDA (self)                                             (* mh: "18-May-84 16:37")
                                                             (* RuleSet BuyGasTravelerRules Lisp code)
    (PROG (↑auditRecord ↑value spaceInTank fuelAffordable fuelAvailable qty)
      ↑firstRules
          [SETQ ↑value (PROGN [SETQ spaceInTank (DIFFERENCE (GetClassValue (GetValue self
										     (QUOTE truck))
									   (QUOTE MaxFuel))
							    (GetValue (GetValue self (QUOTE truck))
								      (QUOTE fuel]
			      (SETQ fuelAvailable (GetValue (GetValue (GetValue self (QUOTE truck))
								      (QUOTE location))
							    (QUOTE qty)))
			      [SETQ fuelAffordable (QUOTIENT (GetValue (GetValue self (QUOTE truck))
								       (QUOTE cashBox))
							     (PricePerUnit
							       (GetValue (GetValue self (QUOTE truck))
									 (QUOTE location]
			      (SETQ qty (MIN spaceInTank fuelAffordable fuelAvailable]
          [COND
	    ((GREATERP qty 0)
	      (SETQ ↑value (← PlayerInterface Buy self qty]
      QUIT
      ↑lastRules
          (RETURN ↑value])

(FindStoppingPlaceTravelerRules
  [LAMBDA (self)                                             (* mh: "18-May-84 17:42")
                                                             (* RuleSet FindStoppingPlaceTravelerRules Lisp code)
    (PROG (↑value wStation gasStation)
      ↑firstRules
          [COND
	    [(AND (PROGN                                     (* Rule Breaking and Tracing Code)
			 (TraceLHS (QUOTE FindStoppingPlaceTravelerRules)
				   NIL 1)
			 (← (GetObjFromUID "YQT0.al4.ll=.56")
			    Print)
			 (RE))
		  (EQ (GetValue (GetValue self (QUOTE truck))
				(QUOTE fuel))
		      0))
	      (SETQ ↑value (PROGN (PROGN                     (* Rule Breaking and Tracing Code)
					 (TraceRHS (QUOTE FindStoppingPlaceTravelerRules)
						   NIL 1)
					 (RE))
				  (PutValue self (QUOTE stoppingPlace)
					    (AnyRoadStop ($ UnionHall]
	    [[AND (PROGN                                     (* Rule Breaking and Tracing Code)
			 (TraceLHS (QUOTE FindStoppingPlaceTravelerRules)
				   NIL 2)
			 (← (GetObjFromUID "YQT0.al4.ll=.57")
			    Print)
			 (RE))
		  [SETQ wStation (NearestRoadStop (RoadStops ($ WeighStation)
							     (← self Range1)
							     (GetValue self (QUOTE direction))
							     (QUOTE Room]
		  (LESSP (Distance wStation)
			 (Distance (GetValue self (QUOTE destination]
	      (SETQ ↑value (PROGN (PROGN                     (* Rule Breaking and Tracing Code)
					 (TraceRHS (QUOTE FindStoppingPlaceTravelerRules)
						   NIL 2)
					 (RE))
				  (PutValue self (QUOTE stoppingPlace)
					    wStation]
	    [[AND (PROGN                                     (* Rule Breaking and Tracing Code)
			 (TraceLHS (QUOTE FindStoppingPlaceTravelerRules)
				   NIL 3)
			 (← (GetObjFromUID "YQT0.al4.ll=.58")
			    Print)
			 (RE))
		  [SETQ gasStation (FurthestRoadStop (RoadStops ($ GasStation)
								(← self Range1)
								(GetValue self (QUOTE direction))
								(QUOTE Room]
		  (LESSP (Distance gasStation)
			 (Distance (GetValue self (QUOTE destination]
	      (SETQ ↑value (PROGN (PROGN                     (* Rule Breaking and Tracing Code)
					 (TraceRHS (QUOTE FindStoppingPlaceTravelerRules)
						   NIL 3)
					 (RE))
				  (PutValue self (QUOTE stoppingPlace)
					    gasStation]
	    [[AND (PROGN                                     (* Rule Breaking and Tracing Code)
			 (TraceLHS (QUOTE FindStoppingPlaceTravelerRules)
				   NIL 4)
			 (← (GetObjFromUID "YQT0.al4.ll=.59")
			    Print)
			 (RE))
		  (LEQ (Distance (GetValue self (QUOTE destination)))
		       (← self Range1))
		  (RoomToParkP (GetValue self (QUOTE destination]
	      (SETQ ↑value (PROGN (PROGN                     (* Rule Breaking and Tracing Code)
					 (TraceRHS (QUOTE FindStoppingPlaceTravelerRules)
						   NIL 4)
					 (RE))
				  (PutValue self (QUOTE stoppingPlace)
					    (GetValue self (QUOTE destination]
	    ((PROGN                                          (* Rule Breaking and Tracing Code)
		    (TraceLHS (QUOTE FindStoppingPlaceTravelerRules)
			      NIL 5)
		    (← (GetObjFromUID "YQT0.al4.ll=.60")
		       Print)
		    (RE))
	      (SETQ ↑value (PROGN (PROGN                     (* Rule Breaking and Tracing Code)
					 (TraceRHS (QUOTE FindStoppingPlaceTravelerRules)
						   NIL 5)
					 (RE))
				  (PutValue self (QUOTE stoppingPlace)
					    (NthRoadStop (GetValue self (QUOTE maxMove))
							 (GetValue self (QUOTE direction))
							 NIL
							 (QUOTE Room]
      QUIT
      ↑lastRules
          (RETURN ↑value])

(GoToStoppingPlaceBigMacRules
  [LAMBDA (self)                                             (* mh: "18-May-84 18:55")
                                                             (* RuleSet GoToStoppingPlaceBigMacRules Lisp code)
    (PROG (↑auditRecord ↑value)
      ↑firstRules
          [SETQ ↑value (PROGN (← self FindStoppingPlace)
			      (← PlayerInterface Move self (GetValue self (QUOTE stoppingPlace]
          [COND
	    ((ISA (GetValue (GetValue self (QUOTE truck))
			    (QUOTE location))
		  ($ GasStation))
	      (SETQ ↑value (← self BuyGas]
      QUIT
      ↑lastRules
          (RETURN ↑value])

(GoToStoppingPlaceTravelerRules
  [LAMBDA (self)                                             (* mh: "18-May-84 16:37")
                                                             (* RuleSet GoToStoppingPlaceTravelerRules Lisp code)
    (PROG (↑auditRecord ↑value)
      ↑firstRules
          [SETQ ↑value (PROGN (← self FindStoppingPlace)
			      (← PlayerInterface Move self (GetValue self (QUOTE stoppingPlace]
          [COND
	    ((ISA (GetValue (GetValue self (QUOTE truck))
			    (QUOTE location))
		  ($ GasStation))
	      (SETQ ↑value (← self BuyGas]
      QUIT
      ↑lastRules
          (RETURN ↑value])

(TakeTurnBigMacRules
  [LAMBDA (self)                                             (* mh: "18-May-84 19:02")
                                                             (* RuleSet TakeTurnBigMacRules Lisp code)
    (PROG (↑auditRecord ↑value alices temp)
      ↑firstRules
          [COND
	    ((NOT (GetValue self (QUOTE destination)))
	      (SETQ ↑value (PROGN (PROGN                     (* Make an audit record for this rule and set its audit 
							     values.)
					 (SETQ ↑auditRecord (← ($ StandardAuditRecord)
							       NewTemp))
					 (PutValue ↑auditRecord (QUOTE rule)
						   (GetObjFromUID "YQT0.al4.ll=.79")))
				  (SETQ alices (RoadStops ($ AliceRestaurant)))
				  (PutAuditRec self (QUOTE destination)
					       (CAR alices)
					       ↑auditRecord)
				  (PutAuditRec self (QUOTE direction)
					       (DirectionOf (GetValue self (QUOTE destination)))
					       ↑auditRecord)
				  (PutAuditRec self (QUOTE nextDestination)
					       (CADR alices)
					       ↑auditRecord]
          [COND
	    ((← (GetValue (GetValue self (QUOTE truck))
			  (QUOTE location))
		InstOf
		($ UnionHall))
	      (SETQ ↑value (PROGN (PROGN                     (* Make an audit record for this rule and set its audit 
							     values.)
					 (SETQ ↑auditRecord (← ($ StandardAuditRecord)
							       NewTemp))
					 (PutValue ↑auditRecord (QUOTE rule)
						   (GetObjFromUID "YQT0.al4.ll=.80")))
				  (PutAuditRec self (QUOTE destination)
					       (AnyRoadStop ($ AlicesRestaurant))
					       ↑auditRecord)
				  (PutAuditRec self (QUOTE direction)
					       (QUOTE Forward)
					       ↑auditRecord]
          [COND
	    ((← (GetValue (GetValue self (QUOTE truck))
			  (QUOTE location))
		InstOf
		($ AliceRestaurant))
	      (SETQ ↑value (PROGN (PROGN                     (* Make an audit record for this rule and set its audit 
							     values.)
					 (SETQ ↑auditRecord (← ($ StandardAuditRecord)
							       NewTemp))
					 (PutValue ↑auditRecord (QUOTE rule)
						   (GetObjFromUID "YQT0.al4.ll=.81")))
				  (SETQ temp (GetValue self (QUOTE destination)))
				  (PutAuditRec self (QUOTE destination)
					       (GetValue self (QUOTE nextDestination))
					       ↑auditRecord)
				  (PutAuditRec self (QUOTE nextDestination)
					       temp ↑auditRecord)
				  (PutAuditRec self (QUOTE direction)
					       (DirectionOf (GetValue self (QUOTE destination)))
					       ↑auditRecord]
          (SETQ ↑value (← self GoToStoppingPlace))
      QUIT
      ↑lastRules
          (RETURN ↑value])

(TakeTurnTravelerRules
  [LAMBDA (self)                                             (* mh: "18-May-84 16:37")
                                                             (* RuleSet TakeTurnTravelerRules Lisp code)
    (PROG (↑auditRecord ↑value)
      ↑firstRules
          [COND
	    ((NOT (GetValue self (QUOTE destination)))
	      (SETQ ↑value (PROGN (PROGN                     (* Make an audit record for this rule and set its audit 
							     values.)
					 (SETQ ↑auditRecord (← ($ StandardAuditRecord)
							       NewTemp))
					 (PutValue ↑auditRecord (QUOTE rule)
						   (GetObjFromUID "YQT0.al4.ll=.29")))
				  (PutAuditRec self (QUOTE destination)
					       (AnyRoadStop ($ AlicesRestaurant))
					       ↑auditRecord)
				  (PutAuditRec self (QUOTE direction)
					       (QUOTE Forward)
					       ↑auditRecord]
          [COND
	    ((← (GetValue (GetValue self (QUOTE truck))
			  (QUOTE location))
		InstOf
		($ UnionHall))
	      (SETQ ↑value (PROGN (PROGN                     (* Make an audit record for this rule and set its audit 
							     values.)
					 (SETQ ↑auditRecord (← ($ StandardAuditRecord)
							       NewTemp))
					 (PutValue ↑auditRecord (QUOTE rule)
						   (GetObjFromUID "YQT0.al4.ll=.30")))
				  (PutAuditRec self (QUOTE destination)
					       (AnyRoadStop ($ AlicesRestaurant))
					       ↑auditRecord)
				  (PutAuditRec self (QUOTE direction)
					       (QUOTE Forward)
					       ↑auditRecord]
          [COND
	    ((← (GetValue (GetValue self (QUOTE truck))
			  (QUOTE location))
		InstOf
		($ AlicesRestaurant))
	      (SETQ ↑value (PROGN (PROGN                     (* Make an audit record for this rule and set its audit 
							     values.)
					 (SETQ ↑auditRecord (← ($ StandardAuditRecord)
							       NewTemp))
					 (PutValue ↑auditRecord (QUOTE rule)
						   (GetObjFromUID "YQT0.al4.ll=.31")))
				  (PutAuditRec self (QUOTE destination)
					       (AnyRoadStop ($ UnionHall))
					       ↑auditRecord)
				  (PutAuditRec self (QUOTE direction)
					       (QUOTE Backward)
					       ↑auditRecord]
          (SETQ ↑value (← self GoToStoppingPlace))
      QUIT
      ↑lastRules
          (RETURN ↑value])
)
(DECLARE: DONTCOPY
  (FILEMAP (NIL (1713 1974 (BigMac.SelectTruck 1723 . 1972)) (3667 14390 (BuyGasTravelerRules 3677 . 
4789) (FindStoppingPlaceTravelerRules 4791 . 8331) (GoToStoppingPlaceBigMacRules 8333 . 8958) (
GoToStoppingPlaceTravelerRules 8960 . 9589) (TakeTurnBigMacRules 9591 . 12163) (TakeTurnTravelerRules 
12165 . 14388)))))
STOP