(program  8, INTERCEPTS, 1,  0, 7, 0,  , THECOLOR,  , 0 ;  : (program (make THEPOINT {getpoint() } ) 
 (make XCOOR {THEPOINT(1) } ) 
 (make YCOOR {THEPOINT(2) } ) 
 (program  (pencolor THECOLOR)  (penwidth 1 ) (line (eval {vector[XCOOR,0]}) (eval THEPOINT)))

 (program  (pencolor THECOLOR)  (penwidth 1 ) (line (eval {vector[0,YCOOR]}) (eval THEPOINT)))

 ); COMMAND INTERCEPTS (CONSTANT THECOLOR)
{LET THEPOINT GETPOINT();
LET XCOOR THEPOINT(1);
LET YCOOR THEPOINT(2);
LINE [XCOOR,0] THEPOINT WIDTH 1 COLOR THECOLOR; 
LINE [0,YCOOR] THEPOINT WIDTH 1 COLOR THECOLOR; 
} |
  8, HORIZONTAL, 4,  0, 7, 0,  , THECOLOR,  , 0 ; 0, 7, 0,  , XSTART,  , 0 ; 0, 7, 0,  , XLIMIT,  , 0 ; 0, 7, 0,  , WIDE,  , 0 ;  : (program (make LEVEL {getpoint() } ) 
 (make YVALUE {LEVEL(2) } ) 
 (program  (pencolor THECOLOR)  (penwidth WIDE  ) (line (eval {vector[XSTART,YVALUE]}) (eval {vector[XLIMIT,YVALUE]})))

 ); COMMAND HORIZONTAL (CONSTANT THECOLOR) (CONSTANT XSTART) (CONSTANT XLIMIT) (CONSTANT WIDE)
{LET LEVEL GETPOINT();
LET YVALUE LEVEL(2);
LINE [XSTART,YVALUE], [XLIMIT,YVALUE] WIDTH WIDE  COLOR THECOLOR;
} |
  8, VERTICAL, 1,  0, 7, 0,  , THECOLOR,  , 0 ;  : (program (make LEVEL {getpoint() } ) 
 (make XVALUE {LEVEL(1) } ) 
 (program  (pencolor THECOLOR)  (penwidth 1 ) (line (eval {vector[XVALUE, 0]}) (eval {vector[XVALUE,9.5]})))

 ); COMMAND VERTICAL (CONSTANT THECOLOR)
{LET LEVEL GETPOINT();
LET XVALUE LEVEL(1);
LINE [XVALUE, 0], [XVALUE,9.5] WIDTH 1 COLOR THECOLOR;
} |
  8, DECREASEDEMAND, 1,  0, 7, 0,  , DOMAINVAR,  , 0 ;  : (program (make IT {solve1(DEMAND(X), 100, vector[-20, 300]) } ) 
 (make XINT_DEMAND {IT(1) } ) 
 (domaingraph (eval {DOMAINVAR}) (eval {XINT_DEMAND- DOMAINVAR}))

 (program  (program (fillcolor {8}) (pencolor {8}))  (penwidth 2) (graph DEMAND ))

 (make DSH {DSH- 5 } ) 
 (make IT {solve1(DEMAND(X), 100, vector[-20, 300]) } ) 
 (make XINT_DEMAND {IT(1) } ) 
 (domaingraph (eval {DOMAINVAR}) (eval {XINT_DEMAND- DOMAINVAR}))

 (program  (program (fillcolor {DEMCOL}) (pencolor {DEMCOL}))  (penwidth 2) (graph DEMAND ))

 (pencolor 0)

 (program  (select "price") (cleartext))

 (print "This decreases demand, or shifts demand back.")

 ); COMMAND DECREASEDEMAND (CONSTANT DOMAINVAR)
{
LET IT ROOTS(DEMAND(X), 100, [-20, 300]);
LET XINT_DEMAND IT(1);
GRAPHDOMAIN DOMAINVAR XINT_DEMAND-DOMAINVAR;
GRAPH DEMAND COLOR GREY WIDTH 2;
LET DSH DSH-5;
LET IT ROOTS(DEMAND(X), 100, [-20, 300]);
LET XINT_DEMAND IT(1);
GRAPHDOMAIN DOMAINVAR XINT_DEMAND-DOMAINVAR;
GRAPH DEMAND COLOR DEMCOL WIDTH 2; 
PENCOLOR BLACK;
CLEARTEXT WINDOW "price";
PRINT "This decreases demand, or shifts demand back."; 
} |
  8, INCREASEDEMAND, 1,  0, 7, 0,  , DOMAINVAR,  , 0 ;  : (program (make IT {solve1(DEMAND(X), 100, vector[-20, 300]) } ) 
 (make XINT_DEMAND {IT(1) } ) 
 (domaingraph (eval {DOMAINVAR}) (eval {XINT_DEMAND- DOMAINVAR}))

 (program  (program (fillcolor {8}) (pencolor {8}))  (penwidth 2) (graph DEMAND ))

 (make DSH {DSH+ 5 } ) 
 (make IT {solve1(DEMAND(X), 100, vector[-20, 300]) } ) 
 (make XINT_DEMAND {IT(1) } ) 
 (domaingraph (eval {DOMAINVAR}) (eval {XINT_DEMAND- DOMAINVAR}))

 (program  (program (fillcolor {DEMCOL}) (pencolor {DEMCOL}))  (penwidth 2) (graph DEMAND ))

 (pencolor 0)

 (program  (select "price") (cleartext))

 (print "This increases demand, or shifts demand out.")

 ); COMMAND INCREASEDEMAND (CONSTANT DOMAINVAR)
{
LET IT ROOTS(DEMAND(X), 100, [-20, 300]);
LET XINT_DEMAND IT(1);
GRAPHDOMAIN DOMAINVAR XINT_DEMAND-DOMAINVAR;
GRAPH DEMAND COLOR GREY WIDTH 2;
LET DSH DSH+5;
LET IT ROOTS(DEMAND(X), 100, [-20, 300]);
LET XINT_DEMAND IT(1);
GRAPHDOMAIN DOMAINVAR XINT_DEMAND-DOMAINVAR;
GRAPH DEMAND COLOR DEMCOL WIDTH 2; 
PENCOLOR BLACK;
CLEARTEXT WINDOW "price";
PRINT "This increases demand, or shifts demand out."; 
} |
  8, DEMAND_P_Q, 1,  0, 7, 0,  , ANY,  , 0 ;  : (program (select "price")

 (cleartext)

 (print "Click on a point on the demand curve.")

 (make PT {getpoint() } ) 
 (make XVALUE {trunc(PT(1)) } ) 
 (make YVALUE {DEMAND(XVALUE) } ) 
 (select "price")

 (cleartext)

 (print "When the price is $")

 (prin1 YVALUE)

 (prin1 ", consumers would like to purchase ")

 (prin1 XVALUE)

 (prin1 "pizzas.")

 (select "scroll")

 (program  (pencolor {4})  (penwidth 6) (point (eval {vector[XVALUE,DEMAND(XVALUE)]})))

 (program  (pencolor {4})  (penwidth 1) (line (eval {vector[XVALUE,DEMAND(XVALUE)]}) (eval {vector[XVALUE,0]})))

 (program  (pencolor {4})  (penwidth 1) (line (eval {vector[XVALUE,DEMAND(XVALUE)]}) (eval {vector[0,DEMAND(XVALUE)]})))

 (pencolor 0)

 (penwidth 2)

 ); COMMAND DEMAND_P_Q (CONSTANT ANY)
{
SELECT "price";
CLEARTEXT;
PRINT "Click on a point on the demand curve.";
LET PT GETPOINT();
LET XVALUE TRUNCATE(PT(1));
LET YVALUE DEMAND(XVALUE);
SELECT "price";
CLEARTEXT;
PRINT "When the price is $";
PRINTON YVALUE;
PRINTON ", consumers would like to purchase ";
PRINTON XVALUE;
PRINTON "pizzas.";
SELECT "scroll";  
POINT [XVALUE,DEMAND(XVALUE)] COLOR RED WIDTH 6;
LINE [XVALUE,DEMAND(XVALUE)] [XVALUE,0] COLOR RED WIDTH 1;
LINE [XVALUE,DEMAND(XVALUE)] [0,DEMAND(XVALUE)] COLOR RED WIDTH 1;
PENCOLOR BLACK;  
PENWIDTH 2; 
} |
  8, SUPPLY_P_Q, 1,  0, 7, 0,  , ANY,  , 0 ;  : (program (select "price")

 (cleartext)

 (print "Click on a point on the supply curve.")

 (make PT {getpoint() } ) 
 (make XVALUE {trunc(PT(1)) } ) 
 (make YVALUE {SUPPLY(XVALUE) } ) 
 (select "price")

 (cleartext)

 (print "When the price is $")

 (prin1 YVALUE)

 (prin1 ", producers are willing to supply ")

 (prin1 XVALUE)

 (prin1 "pizzas.")

 (select "scroll")

 (program  (pencolor {4})  (penwidth 6) (point (eval {vector[XVALUE,SUPPLY(XVALUE)]})))

 (program  (pencolor {4})  (penwidth 1) (line (eval {vector[XVALUE,SUPPLY(XVALUE)]}) (eval {vector[XVALUE,0]})))

 (program  (pencolor {4})  (penwidth 1) (line (eval {vector[XVALUE,SUPPLY(XVALUE)]}) (eval {vector[0,SUPPLY(XVALUE)]})))

 (pencolor 0)

 (penwidth 2)

 ); COMMAND SUPPLY_P_Q (CONSTANT ANY)
{ 
SELECT "price";
CLEARTEXT;
PRINT "Click on a point on the supply curve.";
LET PT GETPOINT();
LET XVALUE TRUNCATE(PT(1));
LET YVALUE SUPPLY(XVALUE);
SELECT "price";
CLEARTEXT;
PRINT "When the price is $";
PRINTON YVALUE;
PRINTON ", producers are willing to supply ";
PRINTON XVALUE;
PRINTON "pizzas.";
SELECT "scroll";  
POINT [XVALUE,SUPPLY(XVALUE)] COLOR RED WIDTH 6;
LINE [XVALUE,SUPPLY(XVALUE)] [XVALUE,0] COLOR RED WIDTH 1;
LINE [XVALUE,SUPPLY(XVALUE)] [0,SUPPLY(XVALUE)] COLOR RED WIDTH 1;
PENCOLOR BLACK;  
PENWIDTH 2; 
} |
  8, EQUILIBRIUM, 1,  0, 7, 0,  , ANY,  , 0 ;  : (program (select "price")

 (cleartext)

 (make XVALUE {(DSH+ SSH)/(SSL+ DSL) } ) 
 (make YVALUE {SUPPLY(XVALUE) } ) 
 (program  (pencolor {4})  (penwidth 6) (point (eval {vector[XVALUE,YVALUE]})))

 (program  (pencolor {4})  (penwidth 1) (line (eval {vector[XVALUE,YVALUE]}) (eval {vector[XVALUE,0]})))

 (program  (pencolor {4})  (penwidth 1) (line (eval {vector[XVALUE,YVALUE]}) (eval {vector[0,YVALUE]})))

 (pencolor 0)

 (print "At the point of equilibrium, the price is")

 (print "$")

 (prin1 YVALUE)

 (prin1 ".  At this price, ")

 (prin1 {trunc(XVALUE)})

 (prin1 "pizzas are demanded and ")

 (prin1 {trunc(XVALUE)})

 (prin1 "pizzas are supplied.")

 (pencolor 0)

 ); COMMAND EQUILIBRIUM (CONSTANT ANY)
{ 
SELECT "price";
CLEARTEXT;
LET XVALUE (DSH+SSH)/(SSL+DSL); 
LET YVALUE SUPPLY(XVALUE);
POINT [XVALUE,YVALUE] COLOR RED WIDTH 6; 
LINE [XVALUE,YVALUE] [XVALUE,0] COLOR RED WIDTH 1;
LINE [XVALUE,YVALUE] [0,YVALUE] COLOR RED WIDTH 1;
PENCOLOR BLACK;
PRINT "At the point of equilibrium, the price is";
PRINT "$";
PRINTON YVALUE;
PRINTON ".  At this price, ";
PRINTON TRUNCATE(XVALUE);
PRINTON "pizzas are demanded and ";
PRINTON TRUNCATE(XVALUE);
PRINTON "pizzas are supplied."; 
PENCOLOR BLACK; 
} |
 )