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 >
Wrap
Text File
|
1979-12-31
|
12KB
|
867 lines
Editing Session I
To create a new file
- 1 -
A>ked b:blue1 b:blue2
TYPE MN TO SEE MENU
BEGINNING-OF-PROGRAM
<instruction>df
DEFINE-NEW-INSTRUCTION <new-name>AStr
DEFINE-NEW-INSTRUCTION tr AS
BEGIN
<instruction>tl
turnleft;
<instruction>tl
turnleft;
<instruction>tl
turnleft;
<instruction>nd
END;
<instruction>bx
BEGINNING-OF-EXECUTION
<instruction>m
move;
<instruction>if
IF <test>c
IF next-to-a-beeper
THEN
<instruction>b
BEGIN
<instruction>pi
pickbeeper;
<instruction>m
move;
<instruction>tr
tr;
<instruction>nd
END;
<instruction>el
ELSE
<instruction>m
move;
<instruction>ndc
<instruction>m
move;
<instruction>to
turnoff;
<instruction>ndx
END-OF-EXECUTION
END-OF-PROGRAM
- 2 -
?t
BEGINNING-OF-PROGRAM
?n
?DEFINE-NEW-INSTRUCTION ?n
tr AS
?d
ENTER REPLACEMENT <new-name>turnright
DEFINE-NEW-INSTRUCTION turnright AS
?t
BEGINNING-OF-PROGRAM
?l
BEGINNING-OF-PROGRAM
DEFINE-NEW-INSTRUCTION turnright AS
BEGIN
turnleft;
turnleft;
turnleft
END;
BEGINNING-OF-EXECUTION
move;
IF next-to-a-beeper
THEN
BEGIN
pickbeeper;
move;
turnright;
END
ELSE
move;
move;
move;
turnoff
END-OF-EXECUTION
END-OF-PROGRAM
END OF FILE
?s
?q
HAS PROGRAM BEEN SAVED ? (Y/N)
y
- 3 -
Editing Session II
To correct errors
in an old file
- 4 -
A>ked b:blue1 b:blue2
BEGINNING-OF-PROGRAM
DEFINE-NEW-INSTRUCTION turnright AS
BEGIN
turnleft;
turnleft
END;
BEGINNING-OF-EXECUTION
move;
IF next-to-a-beeper
THEN
BEGIN
pickbeeper;
move;
turnleft
END
ELSE
move;
move;
?t
BEGINNING-OF-PROGRAM
?nc
DEFINE-NEW-INSTRUCTION ?nc
BEGINNING-OF-EXECUTION
?n-
END;
?i
?tl
turnleft;
<instruction>nc
BEGINNING-OF-EXECUTION
?nc
IF ?nc
THEN
?nc
ELSE
?n-
END
?n-
turnleft
?d
turnleft
?i
?turnright
turnright;
<instruction>t
BEGINNING-OF-PROGRAM
- 5 -
?l
BEGINNING-OF-PROGRAM
DEFINE-NEW-INSTRUCTION turnright AS
BEGIN
turnleft;
turnleft;
turnleft
END;
BEGINNING-OF-EXECUTION
move;
IF next-to-a-beeper
THEN
BEGIN
pickbeeper;
move;
turnright
END
ELSE
move;
move;
move;
turnoff
END-OF-EXECTION
END-OF-PROGRAM
END OF FILE
?s
?q
HAS PROGRAM BEEN SAVED? (Y/N)
y
- 6 -
Editing Session III
To illustrate insert
and delete features of KED
- 7 -
A>ked b:blue1 b:blue2
BEGINNING-OF-PROGRAM
DEFINE-NEW-INSTRUCTION turnright AS
BEGIN
turnleft;
turnleft;
turnleft
END;
BEGINNING-OF-EXECUTION
move;
IF next-to-a-beeper
THEN
BEGIN
pickbeeper;
move;
tunrnright
END
ELSE
move;
move;
?t
BEGINNING-OF-PROGRAM
?nc
DEFINE-NEW-INSTRUCTION ?nc
BEGINNING-OF-EXECUTION
?nc
IF ?n
next-to-a-beeper
?d
ENTER REPLACEMENT <test>f
IF front-is-clear
?t
BEGINNING-OF-PROGRAM
- 8 -
?l
BEGINNING-OF-PROGRAM
DEFINE-NEW-INSTRUCTION turnright AS
BEGIN
turnleft;
turnleft;
turnleft
END;
BEGINNING-OF-EXECUTION
move;
IF front-is-clear
THEN
BEGIN
pickbeeper;
move;
turnright
END
ELSE
move;
move;
move;
turnoff
END-OF-EXECUTION
END-OF-PROGRAM
END OF FILE
?n-
turnoff
?i
?it
ITERATE <positive-number> TIMES4
ITERATE 4 TIMES
<instruction>b
BEGIN
<instruction>wh
WHILE <test> DOb
WHILE any-beepers-in-beeper-bag DO
<instruction>pu
putbeeper;
<instruction>ndc
<instruction>m
move;
<instruction>nd
END;
<instruction>t
BEGINNING-OF-PROGRAM
- 9 -
?l
BEGINNING-OF-PROGRAM
DEFINE-NEW-INSTRUCTION turnright AS
BEGIN
turnleft;
turnleft;
turnleft
END;
BEGINNING-OF-EXECUTION
move;
IF front-is-clear
THEN
BEGIN
pickbeeper;
move;
turnright
END
ELSE
move;
move;
move;
ITERATE 4 TIMES
BEGIN
WHILE any-beepers-in-beeper-bag DO
putbeeper;
move;
turnright
END;
turnoff
END-OF-EXECUTION
END-OF-PROGRAM
END OF FILE
- 10 -
?t
BEGINNING-OF-PROGRAM
?nc
DEFINE-NEW-INSTRUCTION ?nc
BEGINNING-OF-EXECUTION
?nc
IF ?nc
THEN
?nc
ELSE
?nc
ITERATE ?n
4 TIMES
?d
ENTER REPLACEMENT <positive-number>6
ITERATE 6 TIMES
?t
BEGINNING-OF-PROGRAM
?nc
DEFINE-NEW-INSTRUCTION ?nc
BEGINNING-OF-EXECUTION
?nc
IF ?i
?turnright
turnright;
<instruction>t
BEGINNING-OF-PROGRAM
- 11 -
?l
BEGINNING-OF-PROGRAM
DEFINE-NEW-INSTRUCTION turnright AS
BEGIN
turnleft;
turnleft;
turnleft
END;
BEGINNING-OF-EXECUTION
move;
turnright;
IF front-is-clear
THEN
BEGIN
pickbeeper;
move;
turnright
END
ELSE
move;
move;
move;
ITERATE 6 TIMES
BEGIN
WHILE any-beepers-in-beeper-bag DO
putbeeper;
move;
turnright
END;
turnoff
END-OF-EXECUTION
END-OF-PROGRAM
END OF FILE
?t
BEGINNING-OF-PROGRAM
?n
DEFINE-NEW-INSTRUCTION ?d
DELETE ENTIRE CONSTRUCT? (Y/N)
y
turnright;
turnright;
turnright;
DEFINE-NEW-INSTRUCTION turnright AS
BEGIN
turnleft;
turnleft;
turnleft
END;
?t
BEGINNING-OF-PROGRAM
- 12 -
?l
BEGINNING-OF-PROGRAM
BEGINNING-OF-EXECUTION
move;
IF front-is-clear
THEN
BEGIN
pickbeeper;
move
END
ELSE
move;
move;
move;
ITERATE 6 TIMES
BEGIN
WHILE any-beepers-in-beeper-bag DO
putbeeper;
move
END;
turnoff
END-OF-EXECUTION
END-OF-PROGRAM
END OF FILE
?s
?q
HAS PROGRAM BEEN SAVED? (Y/N)
y
- 13 -
nleft;
turnleft
END;
?t
BEGINNING-OF-PROGRAM