home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_200 / 202_01 / sessions.doc < prev    next >
Text File  |  1979-12-31  |  12KB  |  867 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.                                 Editing Session I
  33.  
  34.                               To create a new file
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.                                       - 1 -
  63.           
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.           A>ked b:blue1 b:blue2
  76.           TYPE MN TO SEE MENU
  77.           BEGINNING-OF-PROGRAM
  78.             <instruction>df
  79.             DEFINE-NEW-INSTRUCTION <new-name>AStr
  80.             DEFINE-NEW-INSTRUCTION tr AS
  81.               BEGIN
  82.                 <instruction>tl
  83.                 turnleft;
  84.                 <instruction>tl
  85.                 turnleft;
  86.                 <instruction>tl
  87.                 turnleft;
  88.                 <instruction>nd
  89.               END;
  90.             <instruction>bx
  91.             BEGINNING-OF-EXECUTION
  92.               <instruction>m
  93.               move;
  94.               <instruction>if
  95.               IF <test>c
  96.               IF next-to-a-beeper
  97.                 THEN
  98.                   <instruction>b
  99.                   BEGIN
  100.                     <instruction>pi
  101.                     pickbeeper;
  102.                     <instruction>m
  103.                     move;
  104.                     <instruction>tr
  105.                     tr;
  106.                     <instruction>nd
  107.                   END;
  108.                 <instruction>el
  109.                 ELSE
  110.                   <instruction>m
  111.                   move;
  112.                   <instruction>ndc
  113.                 <instruction>m
  114.               move;
  115.               <instruction>to
  116.               turnoff;
  117.               <instruction>ndx
  118.             END-OF-EXECUTION
  119.           END-OF-PROGRAM
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.                                       - 2 -
  129.           
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140.           ?t
  141.           BEGINNING-OF-PROGRAM
  142.           ?n
  143.           ?DEFINE-NEW-INSTRUCTION ?n
  144.           tr AS
  145.           ?d
  146.           ENTER REPLACEMENT <new-name>turnright
  147.             DEFINE-NEW-INSTRUCTION turnright AS
  148.           ?t
  149.           BEGINNING-OF-PROGRAM
  150.           ?l
  151.           BEGINNING-OF-PROGRAM
  152.             DEFINE-NEW-INSTRUCTION turnright AS
  153.               BEGIN
  154.                 turnleft;
  155.                 turnleft;
  156.                 turnleft
  157.               END;
  158.             BEGINNING-OF-EXECUTION
  159.               move;
  160.               IF next-to-a-beeper
  161.                 THEN
  162.                   BEGIN
  163.                     pickbeeper;
  164.                     move;
  165.                     turnright;
  166.                   END
  167.                 ELSE
  168.                   move;
  169.               move;
  170.               move;
  171.               turnoff
  172.             END-OF-EXECUTION
  173.           END-OF-PROGRAM
  174.           END OF FILE
  175.           ?s
  176.           ?q
  177.           HAS PROGRAM BEEN SAVED ? (Y/N)
  178.           y
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.                                       - 3 -
  195.           
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.  
  206.  
  207.  
  208.  
  209.  
  210.  
  211.  
  212.  
  213.  
  214.  
  215.  
  216.  
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.                                Editing Session II
  231.  
  232.                                 To correct errors
  233.                                  in an old file
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.                                       - 4 -
  261.           
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.  
  272.  
  273.           A>ked b:blue1 b:blue2
  274.           BEGINNING-OF-PROGRAM
  275.             DEFINE-NEW-INSTRUCTION turnright AS
  276.               BEGIN
  277.                 turnleft;
  278.                 turnleft
  279.               END;
  280.             BEGINNING-OF-EXECUTION
  281.               move;
  282.               IF next-to-a-beeper
  283.                 THEN
  284.                   BEGIN
  285.                     pickbeeper;
  286.                     move;
  287.                     turnleft
  288.                   END
  289.                 ELSE
  290.                   move;
  291.               move;
  292.           ?t
  293.           BEGINNING-OF-PROGRAM
  294.           ?nc
  295.             DEFINE-NEW-INSTRUCTION ?nc
  296.             BEGINNING-OF-EXECUTION
  297.           ?n-
  298.                 END;
  299.           ?i
  300.           ?tl
  301.                   turnleft;
  302.                   <instruction>nc
  303.             BEGINNING-OF-EXECUTION
  304.           ?nc
  305.               IF ?nc
  306.                 THEN
  307.           ?nc
  308.                 ELSE
  309.           ?n-
  310.                   END
  311.           ?n-
  312.                     turnleft
  313.           ?d
  314.                     turnleft
  315.           ?i
  316.           ?turnright
  317.                     turnright;
  318.                     <instruction>t
  319.           BEGINNING-OF-PROGRAM
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.                                       - 5 -
  327.           
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.  
  338.           ?l
  339.           BEGINNING-OF-PROGRAM
  340.             DEFINE-NEW-INSTRUCTION turnright AS
  341.               BEGIN
  342.                 turnleft;
  343.                 turnleft;
  344.                 turnleft
  345.               END;
  346.             BEGINNING-OF-EXECUTION
  347.               move;
  348.               IF next-to-a-beeper
  349.                 THEN
  350.                   BEGIN
  351.                     pickbeeper;
  352.                     move;
  353.                     turnright
  354.                   END
  355.                 ELSE
  356.                   move;
  357.               move;
  358.               move;
  359.               turnoff
  360.             END-OF-EXECTION
  361.           END-OF-PROGRAM
  362.           END OF FILE
  363.           ?s
  364.           ?q
  365.           HAS PROGRAM BEEN SAVED? (Y/N)
  366.           y
  367.  
  368.  
  369.  
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.                                       - 6 -
  393.           
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403.  
  404.  
  405.  
  406.  
  407.  
  408.  
  409.  
  410.  
  411.  
  412.  
  413.  
  414.  
  415.  
  416.  
  417.  
  418.  
  419.  
  420.  
  421.  
  422.  
  423.  
  424.  
  425.  
  426.  
  427.  
  428.                                Editing Session III
  429.  
  430.                               To illustrate insert
  431.                            and delete features of KED
  432.  
  433.  
  434.  
  435.  
  436.  
  437.  
  438.  
  439.  
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447.  
  448.  
  449.  
  450.  
  451.  
  452.  
  453.  
  454.  
  455.  
  456.  
  457.  
  458.                                       - 7 -
  459.           
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.  
  467.  
  468.  
  469.  
  470.  
  471.           A>ked b:blue1 b:blue2
  472.           BEGINNING-OF-PROGRAM
  473.             DEFINE-NEW-INSTRUCTION turnright AS
  474.               BEGIN
  475.                 turnleft;
  476.                 turnleft;
  477.                 turnleft
  478.               END;
  479.             BEGINNING-OF-EXECUTION
  480.               move;
  481.               IF next-to-a-beeper
  482.                 THEN
  483.                   BEGIN
  484.                     pickbeeper;
  485.                     move;
  486.                     tunrnright
  487.                   END
  488.                 ELSE
  489.                   move;
  490.               move;
  491.           ?t
  492.           BEGINNING-OF-PROGRAM
  493.           ?nc
  494.             DEFINE-NEW-INSTRUCTION ?nc
  495.             BEGINNING-OF-EXECUTION
  496.           ?nc
  497.               IF ?n
  498.           next-to-a-beeper
  499.           ?d
  500.           ENTER REPLACEMENT <test>f
  501.               IF front-is-clear
  502.           ?t
  503.           BEGINNING-OF-PROGRAM
  504.  
  505.  
  506.  
  507.  
  508.  
  509.  
  510.  
  511.  
  512.  
  513.  
  514.  
  515.  
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524.                                       - 8 -
  525.           
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532.  
  533.  
  534.  
  535.  
  536.           ?l
  537.           BEGINNING-OF-PROGRAM
  538.             DEFINE-NEW-INSTRUCTION turnright AS
  539.               BEGIN
  540.                 turnleft;
  541.                 turnleft;
  542.                 turnleft
  543.               END;
  544.             BEGINNING-OF-EXECUTION
  545.               move;
  546.               IF front-is-clear
  547.                 THEN
  548.                   BEGIN
  549.                     pickbeeper;
  550.                     move;
  551.                     turnright
  552.                   END
  553.                 ELSE
  554.                   move;
  555.               move;
  556.               move;
  557.               turnoff
  558.             END-OF-EXECUTION
  559.           END-OF-PROGRAM
  560.           END OF FILE
  561.           ?n-
  562.               turnoff
  563.           ?i
  564.           ?it
  565.               ITERATE <positive-number> TIMES4
  566.               ITERATE  4 TIMES
  567.                 <instruction>b
  568.                 BEGIN
  569.                   <instruction>wh
  570.                   WHILE <test> DOb
  571.                   WHILE any-beepers-in-beeper-bag DO
  572.                     <instruction>pu
  573.                     putbeeper;
  574.                     <instruction>ndc
  575.                   <instruction>m
  576.                   move;
  577.                   <instruction>nd
  578.                 END;
  579.               <instruction>t
  580.           BEGINNING-OF-PROGRAM
  581.  
  582.  
  583.  
  584.  
  585.  
  586.  
  587.  
  588.  
  589.  
  590.                                       - 9 -
  591.           
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598.  
  599.  
  600.  
  601.  
  602.           ?l
  603.           BEGINNING-OF-PROGRAM
  604.             DEFINE-NEW-INSTRUCTION turnright AS
  605.               BEGIN
  606.                 turnleft;
  607.                 turnleft;
  608.                 turnleft
  609.               END;
  610.             BEGINNING-OF-EXECUTION
  611.               move;
  612.               IF front-is-clear
  613.                 THEN
  614.                   BEGIN
  615.                     pickbeeper;
  616.                     move;
  617.                     turnright
  618.                   END
  619.                 ELSE
  620.                   move;
  621.               move;
  622.               move;
  623.               ITERATE  4 TIMES
  624.                 BEGIN
  625.                   WHILE any-beepers-in-beeper-bag DO
  626.                     putbeeper;
  627.                   move;
  628.                   turnright
  629.                 END;
  630.               turnoff
  631.             END-OF-EXECUTION
  632.           END-OF-PROGRAM
  633.           END OF FILE
  634.  
  635.  
  636.  
  637.  
  638.  
  639.  
  640.  
  641.  
  642.  
  643.  
  644.  
  645.  
  646.  
  647.  
  648.  
  649.  
  650.  
  651.  
  652.  
  653.  
  654.  
  655.  
  656.                                      - 10 -
  657.           
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664.  
  665.  
  666.  
  667.  
  668.           ?t
  669.           BEGINNING-OF-PROGRAM
  670.           ?nc
  671.             DEFINE-NEW-INSTRUCTION  ?nc
  672.             BEGINNING-OF-EXECUTION
  673.           ?nc
  674.               IF ?nc
  675.                 THEN
  676.           ?nc
  677.                 ELSE
  678.           ?nc
  679.               ITERATE ?n
  680.            4 TIMES
  681.           ?d
  682.           ENTER REPLACEMENT <positive-number>6
  683.               ITERATE  6 TIMES
  684.           ?t
  685.           BEGINNING-OF-PROGRAM
  686.           ?nc
  687.             DEFINE-NEW-INSTRUCTION ?nc
  688.             BEGINNING-OF-EXECUTION
  689.           ?nc
  690.               IF ?i
  691.           ?turnright
  692.               turnright;
  693.               <instruction>t
  694.           BEGINNING-OF-PROGRAM
  695.  
  696.  
  697.  
  698.  
  699.  
  700.  
  701.  
  702.  
  703.  
  704.  
  705.  
  706.  
  707.  
  708.  
  709.  
  710.  
  711.  
  712.  
  713.  
  714.  
  715.  
  716.  
  717.  
  718.  
  719.  
  720.  
  721.  
  722.                                      - 11 -
  723.           
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730.  
  731.  
  732.  
  733.  
  734.           ?l
  735.           BEGINNING-OF-PROGRAM
  736.             DEFINE-NEW-INSTRUCTION turnright AS
  737.               BEGIN
  738.                 turnleft;
  739.                 turnleft;
  740.                 turnleft
  741.               END;
  742.             BEGINNING-OF-EXECUTION
  743.               move;
  744.               turnright;
  745.               IF front-is-clear
  746.                 THEN
  747.                   BEGIN
  748.                     pickbeeper;
  749.                     move;
  750.                     turnright
  751.                   END
  752.                 ELSE
  753.                   move;
  754.               move;
  755.               move;
  756.               ITERATE  6 TIMES
  757.                 BEGIN
  758.                   WHILE any-beepers-in-beeper-bag DO
  759.                     putbeeper;
  760.                   move;
  761.                   turnright
  762.                 END;
  763.              turnoff
  764.             END-OF-EXECUTION
  765.           END-OF-PROGRAM
  766.           END OF FILE
  767.           ?t
  768.           BEGINNING-OF-PROGRAM
  769.           ?n
  770.             DEFINE-NEW-INSTRUCTION ?d
  771.           DELETE ENTIRE CONSTRUCT? (Y/N)
  772.           y
  773.                     turnright;
  774.                  turnright;
  775.               turnright;
  776.  
  777.             DEFINE-NEW-INSTRUCTION turnright AS
  778.               BEGIN
  779.                 turnleft;
  780.                 turnleft;
  781.                 turnleft
  782.               END;
  783.           ?t
  784.           BEGINNING-OF-PROGRAM
  785.  
  786.  
  787.  
  788.                                      - 12 -
  789.           
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796.  
  797.  
  798.  
  799.  
  800.           ?l
  801.           BEGINNING-OF-PROGRAM
  802.             BEGINNING-OF-EXECUTION
  803.               move;
  804.               IF front-is-clear
  805.                 THEN
  806.                   BEGIN
  807.                     pickbeeper;
  808.                     move
  809.                   END
  810.                 ELSE
  811.                   move;
  812.               move;
  813.               move;
  814.               ITERATE  6 TIMES
  815.                 BEGIN
  816.                   WHILE any-beepers-in-beeper-bag DO
  817.                     putbeeper;
  818.                   move
  819.                 END;
  820.               turnoff
  821.             END-OF-EXECUTION
  822.           END-OF-PROGRAM
  823.           END OF FILE
  824.           ?s
  825.           ?q
  826.           HAS PROGRAM BEEN SAVED? (Y/N)
  827.           y
  828.  
  829.  
  830.  
  831.  
  832.  
  833.  
  834.  
  835.  
  836.  
  837.  
  838.  
  839.  
  840.  
  841.  
  842.  
  843.  
  844.  
  845.  
  846.  
  847.  
  848.  
  849.  
  850.  
  851.  
  852.  
  853.  
  854.                                      - 13 -
  855.           
  856.  
  857.  
  858.  
  859. nleft;
  860.                 turnleft
  861.               END;
  862.           ?t
  863.           BEGINNING-OF-PROGRAM
  864.  
  865.  
  866.  
  867.