BEGIN COMMENT: This is the lesson "HOW"; COMMENT: This lesson was written by Dr. Walter Maner, Old Dominion University, Norfolk, VA 23508 ; BOOLEAN firsttry, ihaveblanked, nopause, skip, back, stop, message; INTEGER lasterrors, score, latescore, qcount, lastqcount, lastqkount, carriagereturn, linefeed, pos, blank; INTEGER lastscorecount, lastlatescorecount, lastscorekount, lastlatescorekount; INTEGER randno, answerlength, controlstart, controlg, uparrow; INTEGER lastrights; STRING answer, answercopy, char, endofline, lessonname, firstname, tempfile1, tempfile2, prompt; STRING ARRAY right, rightatlast, wrong[0:9]; EXTERNAL PROCEDURE stopkc; EXTERNAL PROCEDURE pub, nolpt, run, r; FORWARD PROCEDURE putaway; FORWARD BOOLEAN PROCEDURE anywhere; PROCEDURE getline; COMMENT: 'Getline' reads in a line of text input by the student, dumping it in the STRING 'answer'. Column one of the line is checked to see if the student typed '%', indicating that he wanted to interrupt the flow of the lesson; BEGIN INTEGER s, t, i; BOOLEAN quit; Breakoutput; quit:= FALSE; again: FOR i:= 1 STEP 1 UNTIL 132 DO BEGIN Insymbol(t); COMMENT: Lower case transform; IF t >= 97 AND t <= 122 THEN t:= t-32; answer.[i]:= t; IF t = carriagereturn THEN GOTO out; END; GOTO again; out: Insymbol(t); i:= i+1; answer.[i]:= t; pos:= 1; answerlength:= i-2; IF answerlength < 0 THEN answerlength:= 0; Delete(answercopy); answercopy:= Copy(answer,1,i); ihaveblanked:= FALSE; IF answerlength = 1 THEN BEGIN IF answer.[1] = controlstart THEN BEGIN Write("Answer 'STOP'"); Write(", 'SKIP', 'BACK', "); Write("or 'CONTINUE'.[N]"); Outsymbol(controlg); Write(prompt); Breakoutput; quit:= TRUE; GOTO again; END; END; IF quit THEN BEGIN quit:= FALSE; IF anywhere("STOP") THEN BEGIN stop:= TRUE; Write("Lesson aborted."); GOTO exit; END; pos:= 1; IF anywhere("SKIP") THEN BEGIN Write("Question skipped.[N]"); skip:= TRUE; END ELSE BEGIN pos:= 1; IF anywhere("BACK") THEN BEGIN Write("Lesson is backing.[N]"); back:= TRUE; END ELSE BEGIN Write("Please continue, then, giving your response[N]"); Write("to the PREVIOUS '-->' or 'RETURN' prompt...[N]"); GOTO again; END; END; END; exit: END; BOOLEAN PROCEDURE here(comp); VALUE comp; STRING comp; COMMENT: 'Here' determines whether the argument string can be found beginning at 'pos' in the student answer. Blanks, but nothing else, may precede the matching word. 'Here' is mostly used for answers matched in the %NOEXTRA mode; BEGIN INTEGER cpos; blankline: IF answercopy.[pos] = blank THEN BEGIN pos:= pos+1; GOTO blankline; END; FOR cpos:= 1 STEP 1 UNTIL Length(comp) DO BEGIN IF answercopy.[pos] # comp.[cpos] THEN GOTO nofit; pos:= pos+1; END; here:= TRUE; GOTO out; nofit: here:= FALSE; out: END; BOOLEAN PROCEDURE anywhere(comp); VALUE comp; STRING comp; COMMENT: 'Anywhere' determines whether the argument string can be found anywhere in the student answer after 'pos'. Blanks and unmatched strings will be bypassed. 'Anywhere' is used in the %EXTRA mode and in the %NOEXTRA %NOORDER mode. 'Anywhere' will substitute blanks for all characters in the matched strings. This allows the program (e.g., in the %NOEXTRA mode) to determine whether there are any non-blank characters in the student answer. In the %NOEXTRA mode, his answer will be wrong if any non-blank characters remain; BEGIN INTEGER cpos, nextpos; blankline: IF answercopy.[pos] = blank THEN BEGIN pos:= pos+1; GOTO blankline; END; nextpos:= pos+1; FOR cpos:= 1 STEP 1 UNTIL Length(comp) DO BEGIN IF answercopy.[pos] # comp.[cpos] THEN GOTO nofit; pos:= pos+1; END; FOR cpos:= pos-Length(comp) STEP 1 UNTIL pos-1 DO BEGIN answercopy.[cpos]:= blank; END; anywhere:= ihaveblanked:= TRUE; GOTO out; nofit: IF answercopy.[pos] # carriagereturn THEN BEGIN pos:= nextpos; GOTO blankline; END; anywhere:= FALSE; out: END; PROCEDURE restore; COMMENT: Since 'anywhere' substitutes blanks for matched parts of the student answer, the original response must be restored before comparing it to other target patterns. This restoration is done here; BEGIN ihaveblanked:= FALSE; Delete(answercopy); answercopy:= Copy(answer,1,answerlength+2); END; INTEGER PROCEDURE random; COMMENT: 'Random' is a number generator which gives a random number between 0 and 9. The generator will not repeat itself until after 862 generations; BEGIN randno:= randno*10 REM 863; random:= randno DIV 87; END; PROCEDURE personalize(message); VALUE message; STRING message; COMMENT: 'Personalize' uses the student's firstname in conversational I/O to give a personal touch to the lessons. To avoid monotony and to further efficiency, the probability that the message will be personalized is only .2; BEGIN IF firstname = "" OR random < 8 THEN Write(message) ELSE BEGIN INTEGER i, j; i:= 1; j:= Length(message); WHILE i < j DO BEGIN Outsymbol(message.[i]);i:= i + 1; END; Write(", "); Write(firstname); Outsymbol(message.[j]); END; END; PROCEDURE rightmessage; COMMENT: 'Rightmessage' is called when a student has made a correct answer. He is told about this, and the score is updated. The message to the student is different depending on whether he succeeds on the fist try or only after previous fruitless attempts. Random numbers are used to choose between ten different messages to give some variation to the conversation; BEGIN lastrights:= lastrights+1; IF firsttry THEN BEGIN score:= score+1; qcount:= qcount+1; firsttry:= FALSE; personalize(right[random]); END ELSE BEGIN personalize(right[random]); IF lasterrors > 1 THEN Write(rightatlast[random]); END; IF lasterrors > 3 THEN BEGIN personalize("[N]I must admit that last one was a bit tricky!"); Newline; END; latescore:= latescore+1; Newline; END; PROCEDURE wrongmessage; COMMENT: 'Wrongmessage' is called when a student has made an erroneous answer. He is told about this, and the lesson statistics are updated. Random numbers are used to choose between ten different messages in order provide some variation in the conversation; BEGIN lasterrors:= lasterrors+1; IF firsttry THEN BEGIN qcount:= qcount+1; firsttry:= FALSE; END; personalize(wrong[random]); Newline; END; PROCEDURE Pause; COMMENT: Lesson text is given to the student in small portions. One reason for this is that it is easier to read a little at a time. Another reason is that display terminals have a limited screen size. The 'pause' PROCEDURE produces a pause in the display of text to the student, and she can continue whenever she has finished examining the displayed material. To go on, she simply pushes the 'RETURN' key. Normally, this PROCEDURE is called between each %TEXT or %QUESTION, but GNOSIS will introduce ADDITIONAL automatic pause points within large blocks of text or question material. The teacher can inhibit pauses BETWEEN '%' commands by 'nopause:= TRUE', but the pauses which GNOSIS inserts in long text blocks cannot be inhibited; IF nopause THEN nopause:= FALSE ELSE BEGIN Write("[N]Push RETURN "); Write(prompt); Outsymbol(controlg); getline; Newline; IF stop THEN BEGIN stop:= FALSE; GOTO endoflesson END; IF answerlength > 0 THEN BEGIN pos:= 1; IF NOT here(endofline) THEN BEGIN Write("Eh? The computer expected you would just push the RETURN button.[N]"); END; END; END; PROCEDURE Page; COMMENT: 'Page' can be called by the teacher when he wants to blank the screen on a display terminal). The effect produced is, of course, terminal dependent; BEGIN Pause; Outsymbol(12); Outsymbol(12); Newline; END; PROCEDURE extratest; COMMENT: 'Extratest' will flag and display those parts of the student answer which WERE matched by the teacher answer pattern IF the student response contained extra (i.e., superfluous) characters 'Extratest' is called automatically for %RIGHT answers in the %EXTRA mode. Recall that 'here' scans past leading blanks; BEGIN pos:= 1; IF NOT here(endofline) THEN BEGIN Newline; FOR pos:= 1 STEP 1 UNTIL answerlength + 2 DO Outsymbol(answer.[pos]); FOR pos:= 1 STEP 1 UNTIL answerlength DO IF answercopy.[pos] = blank AND answer.[pos] # blank THEN Outsymbol(uparrow) ELSE Outsymbol(blank); Newline; Newline; END; END; REAL PROCEDURE percent; COMMENT: 'Percent' returns the percentage of questions answered correctly by the student on his very first try since the start of the lesson; percent:= IF qcount = 0 OR score = 0 THEN 0.0 ELSE 100.0 * score/qcount; REAL PROCEDURE latepercent; COMMENT: 'Latepercent' returns the percentage of questions answered correctly by the student since the start of the lesson whether student was correct on the first try or afterward; latepercent:= IF qcount = 0 OR latescore = 0 THEN 0.0 ELSE 100.0 * latescore/qcount; INTEGER PROCEDURE lastscore; COMMENT: 'Lastscore' returns number of questions answered correctly on the very first try since this PROCEDURE was last called; BEGIN lastscore:= score - lastscorecount; lastscorecount:= score END; INTEGER PROCEDURE lastlatescore; COMMENT: 'Lastlatescore' returns number of questions answered correctly since this PROCEDURE was last called whether student was correct on the very first try or afterward; BEGIN lastlatescore:= latescore - lastlatescorecount; lastlatescorecount:= latescore END; REAL PROCEDURE lastpercent; COMMENT: 'Lastpercent' returns the percentage of questions answered correctly on the very first try since this PROCEDURE was last called; BEGIN INTEGER x; x:= score - lastscorekount; lastscorekount:= score; lastqcount:= qcount - lastqcount; lastpercent:= IF lastqcount = 0 OR x = 0 THEN 0.0 ELSE 100.0 * x/lastqcount; END; REAL PROCEDURE lastlatepercent; COMMENT: 'Lastlatepercent' returns the percentage of questions answered correctly since this PROCEDURE was last called whether student was correct on the first try or afterward; BEGIN INTEGER x; x:= latescore - lastlatescorekount; lastlatescorekount:= latescore; lastqkount:= qcount - lastqkount; lastlatepercent:= IF lastqkount = 0 OR x = 0 THEN 0.0 ELSE 100.0 * x/lastqkount; END; PROCEDURE putaway(question); COMMENT: If the lesson contained a report-generating command, then unexpected student answers are written into a pair of reports, .DTA and .SRT, which the teacher can use to improve the lesson. 'Putaway' writes the unexpected answers in these files; VALUE question; STRING question; BEGIN INTEGER i; Breakoutput; Selectoutput(2); Write(question); Write(": "); FOR i:= 1 STEP 1 UNTIL answerlength DO Outsymbol(answer.[i]); Newline; Breakoutput; Selectoutput(3); Write(question); Write(": "); FOR i:= 1 STEP 1 UNTIL answerlength DO Outsymbol(answer.[i]); Newline; Breakoutput; Selectoutput(0); END; PROCEDURE putmessage; COMMENT: If no disk files are being generated for teacher reports, 'Putmessage' will tell the student to send hardcopy reports to the teacher -- unless no teacher's name and address was supplied with %TEACHER command); BEGIN Write("He needs the listing to improve the lesson.[N]"); Newline; Write("The name and address of the teacher is:[N]"); Write("Dr. Walter Maner, Old Dominion University, Norfolk, VA 23508[N]"); Newline; END; PROCEDURE noanswer; BEGIN personalize("??? You gave no answer at all."); Newline; Write("If you want to interrupt the lesson, then type the single character ""%"".[N]"); END noanswer; PROCEDURE tryagain; COMMENT: Questions output to students who give no answer, a wrong answer, or an incomplete answer are usually repeated by GNOSIS. 'Tryagain' will output to such students a 'try again' message which varies according to circumstances. In %NEUTRAL mode, the message will always be 'Please try again'. Otherwise, the content of the message depends on the number of times the student has failed to give a correct response; BEGIN Newline; personalize("Please try again."); IF lasterrors = 3 THEN Write("[N]You have at least eliminated some of the possibilities.") ELSE IF lasterrors = 4 THEN Write("[N](You might want to rethink some of your previous answers.)") ELSE IF lasterrors > 4 THEN Write("[N]Or...interrupt the lesson by typing the symbol ""%""."); Newline; Newline; END; PROCEDURE giveanswer; COMMENT: 'Giveanswer' displays a right answer to a student who is skipping the question or who repeatedly fails to give a right answer. The answer given will always be the one following the FIRST %RIGHT command for the preceding %QUESTION; BEGIN Newline; personalize("Just for the record,"); Write(" GNOSIS will simulate an acceptable answer:[2N]-->"); END; PROCEDURE showhowitlooks; BEGIN Write("Your last answer, as received by the computer after you pushed RETURN,[N]"); Write("was as follows: "); Write(answercopy); Newline END; lasterrors:= latescore:= score:= lastqcount:= lastqkount:= qcount:= 0; carriagereturn:= 13; linefeed:= 10; lastrights:= lastscorecount:= lastscorekount:= lastlatescorecount:= lastlatescorekount:= 0; blank:= " ".[1];uparrow:= "^".[1]; controlg:="".[1]; answer:= Newstring(135,7); answercopy:= Copy(" "); firstname:= ""; prompt:= Copy("-->"); answer.[134]:= carriagereturn; answer.[135]:= linefeed; char:= Newstring(1,7); endofline:= Newstring(1,7); endofline.[1]:= carriagereturn; randno:= 1; nopause:= skip:= message:= FALSE; controlstart:= "%".[1]; lessonname:= "HOW"; right[ 0]:= "Good for you!"; right[ 1]:= "Very good."; right[ 2]:= "Sure!"; right[ 3]:= "Bravo!"; right[ 4]:= "Exactly right!"; right[ 5]:= "Right!"; right[ 6]:= "Well done!"; right[ 7]:= "That's it!"; right[ 8]:= "Excellent!"; right[ 9]:= "OK!"; rightatlast[ 0]:= " You're doing better!"; rightatlast[ 1]:= " Now you're catching on!"; rightatlast[ 2]:= " You're improving!"; rightatlast[ 3]:= " Yo've got the idea now!"; rightatlast[ 4]:= " I knew you could do it."; rightatlast[ 5]:= " There is hope for you after all!"; rightatlast[ 6]:= " You're making progress."; rightatlast[ 7]:= " Aren't you glad you kept trying?"; rightatlast[ 8]:= " Keep up the good work!"; rightatlast[ 9]:= " You've got the hang of it now."; wrong[ 0]:= "Wrong!"; wrong[ 1]:= "No!"; wrong[ 2]:= "You gave the wrong answer."; wrong[ 3]:= "Your answer was wrong."; wrong[ 4]:= "Incorrect!"; wrong[ 5]:= "No, you're wrong this time."; wrong[ 6]:= "Sorry."; wrong[ 7]:= "That wasn't correct."; wrong[ 8]:= "You're mistaken."; wrong[ 9]:= "No, you missed this one."; Input(0,"TTY"); Input(1,"DSK"); Output(2,"DSK"); Output(3,"DSK"); stopkc; Breakoutput; Selectoutput(0); Write("[N]Hello! This is GNOSIS talking.[N]"); repeat: Write("I'd like to know your full name--[N]just type it in after the arrow.[N]"); Write("[NT](Unless you enter a made-up name, GNOSIS will"); Write("[NT]generate personal data based on this session.)[2N]"); Outsymbol(controlg); Write(prompt); getline; IF answerlength < 6 THEN BEGIN Write("That's too short to be your FULL name.[N]"); Newline; GOTO repeat; END; FOR pos:= 1 STEP 1 UNTIL answerlength DO IF answer.[pos] = blank THEN GOTO continue; Write("That's only ONE of your names.[N]"); GOTO repeat; continue: Write("Glad to meet you, "); BEGIN INTEGER pos, t; pos:=1; nameloop: t:=answer.[pos]; IF pos for these in its typeout to you. Of [N]"); Write("course, if such a program were running in a student account, the [N]"); Write("actual values would be substituted for these . [N]"); Newline; Write("From this point on, you will have to pretend you are a student who is [N]"); Write("making his first serious attempt to use the computer... [N]"); BEGIN Pause; IF back THEN BEGIN back:= FALSE; GOTO zqxaaa; END; END; COMMENT: Question 1; zqxaac: BEGIN INTEGER subblock; firsttry:= TRUE; lastrights:= lasterrors:= 0; ihaveblanked:= FALSE; IF FALSE THEN BEGIN repeat: tryagain; END; Newline; Write("Is this your first time to use a computer? [N]"); Outsymbol(controlg); Write(prompt); getline; IF stop THEN BEGIN putaway("%QUE 1"); stop:= FALSE; GOTO endoflesson; END; IF back THEN BEGIN putaway("%QUE 1"); back:= FALSE; GOTO zqxaab; END; IF skip THEN BEGIN putaway("%QUE 1"); skip:= FALSE; GOTO simulate; END; IF ihaveblanked THEN restore; pos:= 1; IF NOT anywhere("YES") THEN GOTO qzxaab; extratest; sameqzxaab: Write("Well, then, congratulations for having made it this far. I'm going to [N]"); Write("celebrate a little... [N]"); BEGIN INTEGER i; FOR i:= 1 STEP 1 UNTIL 500 DO Outsymbol(controlg) END; GOTO next; qzxaab: IF ihaveblanked THEN restore; pos:= 1; IF NOT anywhere("NO") THEN GOTO qzxaac; extratest; sameqzxaac: Write("Then I'll skip the gala welcome party I had planned. [N]"); GOTO next; qzxaac: IF ihaveblanked THEN restore; sameqzxaad: GOTO repeat; GOTO next; qzxaad: IF answerlength = 0 THEN BEGIN noanswer; GOTO repeat; END; BEGIN Write("I don't understand your answer.[N]"); putaway("%QUE 1"); END; simulate: next: Pause; IF back THEN BEGIN back:= FALSE; GOTO zqxaab; END; END; COMMENT: Question 2; zqxaad: BEGIN INTEGER subblock; firsttry:= TRUE; lastrights:= lasterrors:= 0; ihaveblanked:= FALSE; IF FALSE THEN BEGIN repeat: tryagain; END; Newline; Write("Would you like to review the log-in procedure with me, just to be [N]"); Write("sure you will remember how to do it the next time you want to log in? [N]"); Outsymbol(controlg); Write(prompt); getline; IF stop THEN BEGIN putaway("%QUE 2"); stop:= FALSE; GOTO endoflesson; END; IF back THEN BEGIN putaway("%QUE 2"); back:= FALSE; GOTO zqxaac; END; IF skip THEN BEGIN putaway("%QUE 2"); skip:= FALSE; GOTO simulate; END; IF ihaveblanked THEN restore; pos:= 1; IF NOT anywhere("YES") THEN GOTO qzxaab; extratest; sameqzxaab: Write("Alright. We will review the essential steps. [N]"); GOTO next; qzxaab: IF ihaveblanked THEN restore; pos:= 1; IF NOT anywhere("NO") THEN GOTO qzxaac; extratest; sameqzxaac: Write("Fine. I won't bother to rehearse the steps for you. [N]"); GOTO skipreview; GOTO next; qzxaac: IF ihaveblanked THEN restore; sameqzxaad: Write("I was expecting a simple 'yes' or 'no' answer from you. [N]"); GOTO repeat; GOTO next; qzxaad: IF answerlength = 0 THEN BEGIN noanswer; GOTO repeat; END; BEGIN Write("I don't understand your answer.[N]"); putaway("%QUE 2"); END; simulate: next: Pause; IF back THEN BEGIN back:= FALSE; GOTO zqxaac; END; END; COMMENT: Text 2; nopause:=TRUE; zqxaae: BEGIN Pause; IF back THEN BEGIN back:= FALSE; GOTO zqxaad; END; END; COMMENT: Question 3; nopause:=TRUE; zqxaaf: BEGIN INTEGER subblock; firsttry:= TRUE; lastrights:= lasterrors:= 0; ihaveblanked:= FALSE; IF FALSE THEN BEGIN repeat: tryagain; END; Newline; Write("What is the very first thing you should do at the terminal? [N]"); Outsymbol(controlg); Write(prompt); getline; IF stop THEN BEGIN putaway("%QUE 3"); stop:= FALSE; GOTO endoflesson; END; IF back THEN BEGIN putaway("%QUE 3"); back:= FALSE; GOTO zqxaae; END; IF skip THEN BEGIN putaway("%QUE 3"); skip:= FALSE; GOTO simulate; END; IF ihaveblanked THEN restore; pos:= 1; IF NOT anywhere("PUSH") THEN GOTO qzxaab; pos:= 1; IF NOT anywhere("THE") THEN GOTO qzxaab; pos:= 1; IF NOT anywhere("RETURN") THEN GOTO qzxaab; pos:= 1; IF NOT anywhere("BUTTON") THEN GOTO qzxaab; rightmessage; extratest; sameqzxaab: Write("The computer will then respond with a period PROMPT '.' for you on [N]"); Write("the bottom left. By this simple token, the computer indicates to you [N]"); Write("that the terminal IS connected and waiting on you to type something [N]"); Write("in. [N]"); Newline; Write("If for some reason you do NOT get a period prompt after you push the [N]"); Write("RETURN button, ask anybody you see around you for advice or [N]"); Write("assistance. [N]"); Newline; Write("There are several reasons why you might fail to get the prompt, none [N]"); Write("of them your fault: (1) the terminal could be out of order, (2) the [N]"); Write("terminal may not be turned on, (3) the terminal might not be connected [N]"); Write("the computer, (4) the computer itself might not be running, or (5) the [N]"); Write("transmit or receive speed of the terminal might need to be adjusted. [N]"); Write("You don't need to remember any of this, however. [N]"); Newline; Write("Almost ANYONE you are likely to see in a terminal room will be more [N]"); Write("than willing to help you when you encounter a problem such as this (it [N]"); Write("makes them feel important), so PLEASE DO ASK FOR HELP. [N]"); GOTO next; qzxaab: IF ihaveblanked THEN restore; pos:= 1; IF NOT anywhere("CONNECT") THEN GOTO qzxaac; rightmessage; extratest; sameqzxaac: GOTO sameqzxaab; qzxaac: IF ihaveblanked THEN restore; pos:= 1; IF NOT anywhere("RETURN") THEN GOTO qzxaad; rightmessage; extratest; sameqzxaad: GOTO sameqzxaab; qzxaad: IF ihaveblanked THEN restore; pos:= 1; IF NOT anywhere("TURN") THEN GOTO qzxaae; pos:= 1; IF NOT anywhere("ON") THEN GOTO qzxaae; extratest; sameqzxaae: Write("Technically, you are right. But let's assume that the terminal is [N]"); Write("switched on and proceed from that point. [N]"); GOTO repeat; GOTO next; qzxaae: IF ihaveblanked THEN restore; pos:= 1; IF NOT anywhere("LOG") THEN GOTO qzxaaf; wrongmessage; sameqzxaaf: Write("You can't log in unless the terminal is connected to the computer. [N]"); Write("The best way to tell whether or not the terminal is patched in is to [N]"); Write("push the RETURN key. If the terminal IS connected properly and the [N]"); Write("computer IS operating, the period PROMPT '.' will appear at the bottom [N]"); Write("left. This is the computer's way of saying it is ready to receive [N]"); Write("input from your terminal. [N]"); GOTO repeat; qzxaaf: IF ihaveblanked THEN restore; IF answerlength = 0 THEN BEGIN noanswer; GOTO repeat; END; IF lasterrors = 0 THEN BEGIN wrongmessage; putaway("%QUE 3"); sameqzxaag: Write("Hint: You push a single button located on the right side of the [N]"); Write("keyboard. [N]"); GOTO repeat; qzxaag: END; BEGIN wrongmessage; putaway("%QUE 3"); END; simulate: giveanswer; Write("Push the RETURN button[N]"); Write(right[random]); Newline; GOTO sameqzxaab; next: Pause; IF back THEN BEGIN back:= FALSE; GOTO zqxaae; END; END; COMMENT: Question 4; zqxaag: BEGIN INTEGER subblock; firsttry:= TRUE; lastrights:= lasterrors:= 0; ihaveblanked:= FALSE; IF FALSE THEN BEGIN repeat: tryagain; END; Newline; Write("What is the second thing you should do? [N]"); Outsymbol(controlg); Write(prompt); getline; IF stop THEN BEGIN putaway("%QUE 4"); stop:= FALSE; GOTO endoflesson; END; IF back THEN BEGIN putaway("%QUE 4"); back:= FALSE; GOTO zqxaaf; END; IF skip THEN BEGIN putaway("%QUE 4"); skip:= FALSE; GOTO simulate; END; IF ihaveblanked THEN restore; pos:= 1; IF NOT anywhere("TYPE") THEN GOTO qzxaab; pos:= 1; IF NOT anywhere("'LOG'") THEN GOTO qzxaab; rightmessage; extratest; sameqzxaab: Write("This causes the computer to check and to see whether any logins are [N]"); Write("going to be allowed at this time. There might be too many jobs already [N]"); Write("logged in. Or the system may be temporarily restricted for various [N]"); Write("kinds of maintenance. But, if all goes well, the computer will proceed [N]"); Write("to log you in. [N]"); GOTO next; qzxaab: IF ihaveblanked THEN restore; pos:= 1; IF NOT anywhere("LOG") THEN GOTO qzxaac; rightmessage; extratest; sameqzxaac: GOTO sameqzxaab; qzxaac: IF ihaveblanked THEN restore; pos:= 1; IF NOT anywhere("ACCOUNT") THEN GOTO qzxaad; wrongmessage; sameqzxaad: Write("That will be entered later. First, the computer has to see if there [N]"); Write("is enough room for you on the system. [N]"); GOTO repeat; qzxaad: IF ihaveblanked THEN restore; pos:= 1; IF NOT anywhere("NUMBER") THEN GOTO qzxaae; wrongmessage; sameqzxaae: GOTO sameqzxaad; qzxaae: IF ihaveblanked THEN restore; pos:= 1; IF NOT anywhere("PPN") THEN GOTO qzxaaf; wrongmessage; sameqzxaaf: GOTO sameqzxaad; qzxaaf: IF ihaveblanked THEN restore; pos:= 1; IF NOT anywhere("ACCOUNT") THEN GOTO qzxaag; wrongmessage; sameqzxaag: GOTO sameqzxaad; qzxaag: IF ihaveblanked THEN restore; pos:= 1; IF NOT anywhere("PASS") THEN GOTO qzxaah; wrongmessage; sameqzxaah: GOTO sameqzxaad; qzxaah: IF ihaveblanked THEN restore; IF answerlength = 0 THEN BEGIN noanswer; GOTO repeat; END; IF lasterrors = 0 THEN BEGIN wrongmessage; putaway("%QUE 4"); sameqzxaai: GOTO repeat; qzxaai: END; BEGIN wrongmessage; putaway("%QUE 4"); END; simulate: giveanswer; Write("Type 'LOG'[N]"); Write(right[random]); Newline; GOTO sameqzxaab; next: Pause; IF back THEN BEGIN back:= FALSE; GOTO zqxaaf; END; END; COMMENT: Question 5; zqxaah: BEGIN INTEGER subblock; firsttry:= TRUE; lastrights:= lasterrors:= 0; ihaveblanked:= FALSE; IF FALSE THEN BEGIN repeat: tryagain; END; Newline; Write("After accepting the 'LOG' command, the computer will respond with a [N]"); Write("'#' prompt in the lower left side of the screen. What do you do next? [N]"); Outsymbol(controlg); Write(prompt); getline; IF stop THEN BEGIN putaway("%QUE 5"); stop:= FALSE; GOTO endoflesson; END; IF back THEN BEGIN putaway("%QUE 5"); back:= FALSE; GOTO zqxaag; END; IF skip THEN BEGIN putaway("%QUE 5"); skip:= FALSE; GOTO simulate; END; IF ihaveblanked THEN restore; pos:= 1; IF NOT anywhere("TYPE") THEN GOTO qzxaab; pos:= 1; IF NOT anywhere("''") THEN GOTO qzxaab; rightmessage; extratest; sameqzxaab: Write("That, of course, is our 'account number,' 'project-programmer [N]"); Write("number,' or 'ppn' (for short). [N]"); GOTO next; qzxaab: IF ihaveblanked THEN restore; pos:= 1; IF NOT anywhere("") THEN GOTO qzxaac; rightmessage; extratest; sameqzxaac: GOTO sameqzxaab; qzxaac: IF ihaveblanked THEN restore; pos:= 1; IF NOT anywhere("PROJECT") THEN GOTO qzxaad; pos:= 1; IF NOT anywhere("PROGRAMMER") THEN GOTO qzxaad; rightmessage; extratest; sameqzxaad: Write("Our account number is , of course. [N]"); GOTO next; qzxaad: IF ihaveblanked THEN restore; pos:= 1; IF NOT anywhere("NUMBER") THEN GOTO qzxaae; rightmessage; extratest; sameqzxaae: GOTO sameqzxaad; qzxaae: IF ihaveblanked THEN restore; pos:= 1; IF NOT anywhere("PPN") THEN GOTO qzxaaf; rightmessage; extratest; sameqzxaaf: GOTO sameqzxaad; qzxaaf: IF ihaveblanked THEN restore; pos:= 1; IF NOT anywhere("ACCOUNT") THEN GOTO qzxaag; rightmessage; extratest; sameqzxaag: GOTO sameqzxaad; qzxaag: IF ihaveblanked THEN restore; pos:= 1; IF NOT anywhere("PASS") THEN GOTO qzxaah; wrongmessage; sameqzxaah: Write("The password is filed UNDER our account number. So the computer can't [N]"); Write("validate your password until it knows where to look (i.e., the account [N]"); Write("number). Our account number is '.' [N]"); GOTO repeat; qzxaah: IF ihaveblanked THEN restore; pos:= 1; IF NOT anywhere("") THEN GOTO qzxaai; wrongmessage; sameqzxaai: GOTO sameqzxaah; qzxaai: IF ihaveblanked THEN restore; IF answerlength = 0 THEN BEGIN noanswer; GOTO repeat; END; IF lasterrors = 0 THEN BEGIN wrongmessage; putaway("%QUE 5"); sameqzxaaj: Write("Hint: It is expecting you to type in two fields of digits, separated [N]"); Write("only by a comma. [N]"); GOTO repeat; qzxaaj: END; IF ihaveblanked THEN restore; IF lasterrors = 1 THEN BEGIN wrongmessage; putaway("%QUE 5"); sameqzxaak: Write("Hint: This number has a name but, if you forgot the name, just type [N]"); Write("in the number itself. [N]"); GOTO repeat; qzxaak: END; BEGIN wrongmessage; putaway("%QUE 5"); END; simulate: giveanswer; Write("Type ''[N]"); Write(right[random]); Newline; GOTO sameqzxaab; next: Pause; IF back THEN BEGIN back:= FALSE; GOTO zqxaag; END; END; COMMENT: Question 6; zqxaai: BEGIN INTEGER subblock; firsttry:= TRUE; lastrights:= lasterrors:= 0; ihaveblanked:= FALSE; IF FALSE THEN BEGIN repeat: tryagain; END; Newline; Write("Alright. Let's suppose the computer is in the process of logging you [N]"); Write("in. It already knows the account number. What is the next thing it [N]"); Write("needs to know? [N]"); Outsymbol(controlg); Write(prompt); getline; IF stop THEN BEGIN putaway("%QUE 6"); stop:= FALSE; GOTO endoflesson; END; IF back THEN BEGIN putaway("%QUE 6"); back:= FALSE; GOTO zqxaah; END; IF skip THEN BEGIN putaway("%QUE 6"); skip:= FALSE; GOTO simulate; END; IF ihaveblanked THEN restore; pos:= 1; IF NOT anywhere("PASSWORD") THEN GOTO qzxaab; rightmessage; extratest; sameqzxaab: Write("Our password is '', of course. [N]"); GOTO next; qzxaab: IF ihaveblanked THEN restore; pos:= 1; IF NOT anywhere("PASS") THEN GOTO qzxaac; pos:= 1; IF NOT anywhere("WORD") THEN GOTO qzxaac; rightmessage; extratest; sameqzxaac: GOTO sameqzxaab; qzxaac: IF ihaveblanked THEN restore; pos:= 1; IF NOT anywhere("") THEN GOTO qzxaad; rightmessage; extratest; sameqzxaad: Write("This, of course, is known as our 'password. [N]"); GOTO next; qzxaad: IF ihaveblanked THEN restore; IF answerlength = 0 THEN BEGIN noanswer; GOTO repeat; END; IF lasterrors = 0 THEN BEGIN wrongmessage; putaway("%QUE 6"); sameqzxaae: Write("Hint: This is the secret 'code' that opens your account. [N]"); GOTO repeat; qzxaae: END; IF ihaveblanked THEN restore; IF lasterrors = 1 THEN BEGIN wrongmessage; putaway("%QUE 6"); sameqzxaaf: GOTO repeat; qzxaaf: END; BEGIN wrongmessage; putaway("%QUE 6"); END; simulate: giveanswer; Write("password[N]"); Write(right[random]); Newline; GOTO sameqzxaab; next: Pause; IF back THEN BEGIN back:= FALSE; GOTO zqxaah; END; END; COMMENT: Question 7; zqxaaj: BEGIN INTEGER subblock; firsttry:= TRUE; lastrights:= lasterrors:= 0; ihaveblanked:= FALSE; IF FALSE THEN BEGIN repeat: tryagain; END; Newline; Write("One last review question: In which order do we do the following [N]"); Write("things? [N]"); Newline; Write(" (1) Push the RETURN button [N]"); Newline; Write(" (2) Type in the PASSWORD [N]"); Newline; Write(" (3) Type 'LOG' [N]"); Newline; Write(" (4) Type in the ACCOUNT NUMBER [N]"); Newline; Write("Your answer should be a series of four digits. [N]"); Outsymbol(controlg); Write(prompt); getline; IF stop THEN BEGIN putaway("%QUE 7"); stop:= FALSE; GOTO endoflesson; END; IF back THEN BEGIN putaway("%QUE 7"); back:= FALSE; GOTO zqxaai; END; IF skip THEN BEGIN putaway("%QUE 7"); skip:= FALSE; GOTO simulate; END; IF ihaveblanked THEN restore; pos:= 1; IF NOT here("1") THEN GOTO qzxaab; IF NOT here("3") THEN GOTO qzxaab; IF NOT here("4") THEN GOTO qzxaab; IF NOT here("2") THEN GOTO qzxaab; IF NOT here(endofline) THEN GOTO qzxaab; rightmessage; sameqzxaab: GOTO next; qzxaab: IF ihaveblanked THEN restore; pos:= 1; IF NOT here("1") THEN GOTO qzxaac; IF NOT here(",") THEN GOTO qzxaac; IF NOT here("3") THEN GOTO qzxaac; IF NOT here(",") THEN GOTO qzxaac; IF NOT here("4") THEN GOTO qzxaac; IF NOT here(",") THEN GOTO qzxaac; IF NOT here("2") THEN GOTO qzxaac; IF NOT here(endofline) THEN GOTO qzxaac; rightmessage; sameqzxaac: GOTO next; qzxaac: IF ihaveblanked THEN restore; IF answerlength = 0 THEN BEGIN noanswer; GOTO repeat; END; IF lasterrors = 0 THEN BEGIN wrongmessage; putaway("%QUE 7"); sameqzxaad: Write("Number 1 is first. [N]"); GOTO repeat; qzxaad: END; IF ihaveblanked THEN restore; IF lasterrors = 1 THEN BEGIN wrongmessage; putaway("%QUE 7"); sameqzxaae: Write("Number 3 is second. [N]"); GOTO repeat; qzxaae: END; IF ihaveblanked THEN restore; IF lasterrors = 2 THEN BEGIN wrongmessage; putaway("%QUE 7"); sameqzxaaf: Write("Number 4 is third. [N]"); GOTO repeat; qzxaaf: END; IF ihaveblanked THEN restore; IF lasterrors = 3 THEN BEGIN wrongmessage; putaway("%QUE 7"); sameqzxaag: Write("Number 2 is fourth. [N]"); GOTO repeat; qzxaag: END; IF ihaveblanked THEN restore; IF lasterrors = 4 THEN BEGIN wrongmessage; putaway("%QUE 7"); sameqzxaah: GOTO repeat; qzxaah: END; BEGIN wrongmessage; putaway("%QUE 7"); END; simulate: giveanswer; Write("1 3 4 2[N]"); Write(right[random]); Newline; GOTO sameqzxaab; next: Pause; IF back THEN BEGIN back:= FALSE; GOTO zqxaai; END; END; COMMENT: Text 3; skipreview: zqxaak: Write("All you do to run one of the lessons is type 'RUN ', followed [N]"); Write("immediately by the name of the lesson you want, and finish with a push [N]"); Write("of the RETURN button. The computer takes over from that point, and the [N]"); Write("rest should be self-explanatory. [N]"); BEGIN Pause; IF back THEN BEGIN back:= FALSE; GOTO zqxaaj; END; END; COMMENT: Text 4; erase: zqxaal: Write("If you type like your professor does, then you're going to make a few [N]"); Write("mistakes from time to time. How do you correct them? [N]"); Newline; Write("Well, you can take advantage of the fact that the computer (usually, [N]"); Write("at least) doesn't pay attention to what you have typed until you push [N]"); Write("the return button. Until you push that button, you have the chance to [N]"); Write("'erase' whatever it is that you have mistyped. [N]"); Newline; Write("The simplest erasing command is the CTRL-U or '^U'. Typing in this [N]"); Write("character causes everything you have typed on a line to be [N]"); Write("erased--instantly. [N]"); Newline; Write("To type a CTRL-U, depress the 'CTRL' key and--while continuing to [N]"); Write("hold it down--depress the 'U' key. Then release both keys. [N]"); Newline; Write("Now I'll let you get some practice using the '^U' command. [N]"); BEGIN Pause; IF back THEN BEGIN back:= FALSE; GOTO zqxaak; END; END; COMMENT: Question 8; zqxaam: BEGIN INTEGER subblock; firsttry:= TRUE; lastrights:= lasterrors:= 0; ihaveblanked:= FALSE; IF FALSE THEN BEGIN repeat: tryagain; END; Newline; Write("Following the arrow prompt, type in some garbage. Then use the '^U' [N]"); Write("to erase it all. Then, before you push RETURN, type in something [N]"); Write("else--something sensible. When you have experimented enough, type 'GO [N]"); Write("ON'. [N]"); Outsymbol(controlg); Write(prompt); getline; IF stop THEN BEGIN putaway("%QUE 8"); stop:= FALSE; GOTO endoflesson; END; IF back THEN BEGIN putaway("%QUE 8"); back:= FALSE; GOTO zqxaal; END; IF skip THEN BEGIN putaway("%QUE 8"); skip:= FALSE; GOTO simulate; END; IF ihaveblanked THEN restore; pos:= 1; IF NOT anywhere("GO") THEN GOTO qzxaab; pos:= 1; IF NOT anywhere("ON") THEN GOTO qzxaab; extratest; sameqzxaab: GOTO next; qzxaab: IF ihaveblanked THEN restore; sameqzxaac: showhowitlooks; GOTO repeat; GOTO next; qzxaac: IF answerlength = 0 THEN BEGIN noanswer; GOTO repeat; END; BEGIN Write("I don't understand your answer.[N]"); putaway("%QUE 8"); END; simulate: next: Pause; IF back THEN BEGIN back:= FALSE; GOTO zqxaal; END; END; COMMENT: Text 5; zqxaan: Write("Of course, you will not want to erase the ENTIRE line just to get rid [N]"); Write("of, say, the last character you typed in. So, you'll need some way to [N]"); Write("erase just one character at a time. [N]"); Newline; Write("To do this, you push the 'DELETE' or 'RUB OUT' key. The first time [N]"); Write("you push it, the computer types a back-slash ('\') and then erases the [N]"); Write("last character you typed. The second time, the next-to-the-last [N]"); Write("character is erased, and so on. [N]"); Newline; Write("NOTE: Every time an erasure is made, the computer RE-TYPES the [N]"); Write("character it has deleted. It does not actually erase the character [N]"); Write("physically from the display. [N]"); Newline; Write("Thus you can erase your answer all the way back to the start of the [N]"); Write("line if necessary and start over. [N]"); Newline; Write("If you typed 'sciences' when you meant to type 'science', then you [N]"); Write("should push the 'RUB OUT' key or the 'DELETE' key once. The computer [N]"); Write("will respond by typing a '\s' to let you know it has deleted the 's' [N]"); Write("(your word will then look like this: 'sciences\s'). When you hit the [N]"); Write("'RETURN' the computer will react as if you had typed in 'science' and [N]"); Write("the 's\s' which appears at the end of the word 'science' will NOT be [N]"); Pause; Write("transmitted to the computer. [N]"); Newline; Write("Before I ask you some questions about the use of the 'RUB OUT' or [N]"); Write("'DELETE' key, I will give you an opportunity to experiment with it. [N]"); BEGIN Pause; IF back THEN BEGIN back:= FALSE; GOTO zqxaam; END; END; COMMENT: Question 9; zqxaao: BEGIN INTEGER subblock; firsttry:= TRUE; lastrights:= lasterrors:= 0; ihaveblanked:= FALSE; IF FALSE THEN BEGIN repeat: tryagain; END; Newline; Write("Following the arrow prompt, type in some garbage. Then, before you [N]"); Write("push RETURN, use the 'RUB OUT' or 'DELETE' key to erase one or more of [N]"); Write("the characters you typed. Then--still before you push RETURN--type in [N]"); Write("a couple of additional characters. THEN (finally) push the RETURN. [N]"); Write("You'll notice the computer is TOTALLY IGNORANT of whatever you erased [N]"); Write("(i.e., the characters BETWEEN the two back-slash marks). [N]"); Newline; Write("Type 'GO ON' when you are ready to proceed with the lesson. [N]"); Outsymbol(controlg); Write(prompt); getline; IF stop THEN BEGIN putaway("%QUE 9"); stop:= FALSE; GOTO endoflesson; END; IF back THEN BEGIN putaway("%QUE 9"); back:= FALSE; GOTO zqxaan; END; IF skip THEN BEGIN putaway("%QUE 9"); skip:= FALSE; GOTO simulate; END; IF ihaveblanked THEN restore; pos:= 1; IF NOT anywhere("GO") THEN GOTO qzxaab; pos:= 1; IF NOT anywhere("ON") THEN GOTO qzxaab; extratest; sameqzxaab: GOTO next; qzxaab: IF ihaveblanked THEN restore; sameqzxaac: showhowitlooks; GOTO repeat; GOTO next; qzxaac: IF answerlength = 0 THEN BEGIN noanswer; GOTO repeat; END; BEGIN Write("I don't understand your answer.[N]"); putaway("%QUE 9"); END; simulate: next: Pause; IF back THEN BEGIN back:= FALSE; GOTO zqxaan; END; END; COMMENT: Question 10; zqxaap: BEGIN INTEGER subblock; firsttry:= TRUE; lastrights:= lasterrors:= 0; ihaveblanked:= FALSE; IF FALSE THEN BEGIN repeat: tryagain; END; Newline; Write("What will your answer look like after you have typed 'politicall' for [N]"); Write("'political' and used the 'RUB OUT' key to delete the 'l'? [N]"); Newline; Write("(Note: When you answer this question, DO NOT actually depress the [N]"); Write("'RUB OUT' or 'DELETE' key. Rather, IMITATE what the computer would do [N]"); Write("and what the answer would look like IF you had used that key. [N]"); Newline; Write("CHECK THE KEYBOARD for the BACK-slash '\'. With that key--NOT the [N]"); Write("OTHER slash '/'--you can imitate what the computer does. [N]"); Outsymbol(controlg); Write(prompt); getline; IF stop THEN BEGIN putaway("%QUE 10"); stop:= FALSE; GOTO endoflesson; END; IF back THEN BEGIN putaway("%QUE 10"); back:= FALSE; GOTO zqxaao; END; IF skip THEN BEGIN putaway("%QUE 10"); skip:= FALSE; GOTO simulate; END; IF ihaveblanked THEN restore; pos:= 1; IF NOT here("POLITICALL\L") THEN GOTO qzxaab; IF NOT here(endofline) THEN GOTO qzxaab; rightmessage; sameqzxaab: GOTO next; qzxaab: IF answerlength = 0 THEN BEGIN noanswer; GOTO repeat; END; IF ihaveblanked THEN restore; pos:= 1; pos:= 1; IF NOT anywhere("\") THEN GOTO lackqzxaac; GOTO qzxaac; lackqzxaac: wrongmessage; putaway("%QUE 10"); sameqzxaac: Write("The computer types a back-slash automatically before it types [N]"); Write("whatever letter you are deleting. Perhaps you typed the wrong kind of [N]"); Write("slash. The back-slash runs from northwest to southeast, so to speak. [N]"); Write("Or perhaps you actually USED the 'RUB OUT' or 'DELETE' key. (Of [N]"); Write("course, if you were REALLY erasing a character instead of merely [N]"); Write("faking how it would look when you did so, then you WOULD use that [N]"); Write("key.) [N]"); Newline; showhowitlooks; GOTO repeat; qzxaac: IF ihaveblanked THEN restore; pos:= 1; IF NOT anywhere("\") THEN GOTO qzxaad; IF NOT anywhere("\") THEN GOTO qzxaad; wrongmessage; sameqzxaad: Write("The computer will type only ONE back-slash at this point. It will not [N]"); Write("type the SECOND back-slash until both these conditions hold: [N]"); Newline; Write(" (1) you have finished using the RUB OUT key;; and [N]"); Newline; Write(" (2) you have begun to type the rest of the word or line. [N]"); GOTO repeat; qzxaad: IF ihaveblanked THEN restore; pos:= 1; IF NOT anywhere("/") THEN GOTO qzxaae; wrongmessage; sameqzxaae: Write("That's not the kind of slash you should be using if you intend to [N]"); Write("imitate EXACTLY what the computer does. [N]"); GOTO repeat; qzxaae: IF ihaveblanked THEN restore; IF lasterrors = 0 THEN BEGIN wrongmessage; putaway("%QUE 10"); sameqzxaaf: Write("Remember: It will re-type the character it is deleting. It doesn't [N]"); Write("REALLY erase it. [N]"); Newline; showhowitlooks; GOTO repeat; qzxaaf: END; IF ihaveblanked THEN restore; IF lasterrors = 1 THEN BEGIN wrongmessage; putaway("%QUE 10"); sameqzxaag: Write("Hint: It's going to look like the last character is doubled. And [N]"); Write("don't forget to put the back-slash ('\') in your answer. [N]"); Newline; showhowitlooks; GOTO repeat; qzxaag: END; IF ihaveblanked THEN restore; IF lasterrors = 2 THEN BEGIN wrongmessage; putaway("%QUE 10"); sameqzxaah: Newline; showhowitlooks; GOTO repeat; qzxaah: END; BEGIN wrongmessage; putaway("%QUE 10"); END; simulate: giveanswer; Write("politicall\l[N]"); Write(right[random]); Newline; GOTO sameqzxaab; next: Pause; IF back THEN BEGIN back:= FALSE; GOTO zqxaao; END; END; COMMENT: Question 11; zqxaaq: BEGIN INTEGER subblock; firsttry:= TRUE; lastrights:= lasterrors:= 0; ihaveblanked:= FALSE; IF FALSE THEN BEGIN repeat: tryagain; END; Newline; Write("Suppose you had typed 'logzical.' How many times would you depress [N]"); Write("the 'RUB OUT' key? [N]"); Outsymbol(controlg); Write(prompt); getline; IF stop THEN BEGIN putaway("%QUE 11"); stop:= FALSE; GOTO endoflesson; END; IF back THEN BEGIN putaway("%QUE 11"); back:= FALSE; GOTO zqxaap; END; IF skip THEN BEGIN putaway("%QUE 11"); skip:= FALSE; GOTO simulate; END; IF ihaveblanked THEN restore; pos:= 1; IF NOT anywhere("5") THEN GOTO qzxaab; rightmessage; extratest; sameqzxaab: GOTO next; qzxaab: IF ihaveblanked THEN restore; pos:= 1; IF NOT anywhere("FIVE") THEN GOTO qzxaac; rightmessage; extratest; sameqzxaac: GOTO next; qzxaac: IF ihaveblanked THEN restore; pos:= 1; IF NOT anywhere("4") THEN GOTO qzxaad; wrongmessage; sameqzxaad: Write("That deletes the 'l', 'a', 'c', and 'i' but it leaves the 'z'. [N]"); GOTO repeat; qzxaad: IF ihaveblanked THEN restore; pos:= 1; IF NOT anywhere("FOUR") THEN GOTO qzxaae; wrongmessage; sameqzxaae: Write("Hint: You'll need to delete some of the good characters to get back [N]"); Write("to the one which is wrong. [N]"); GOTO repeat; qzxaae: IF ihaveblanked THEN restore; IF answerlength = 0 THEN BEGIN noanswer; GOTO repeat; END; IF lasterrors = 0 THEN BEGIN wrongmessage; putaway("%QUE 11"); sameqzxaaf: GOTO repeat; qzxaaf: END; BEGIN wrongmessage; putaway("%QUE 11"); END; simulate: giveanswer; Write("5[N]"); Write(right[random]); Newline; GOTO sameqzxaab; next: Pause; IF back THEN BEGIN back:= FALSE; GOTO zqxaap; END; END; COMMENT: Question 12; zqxaar: BEGIN INTEGER subblock; firsttry:= TRUE; lastrights:= lasterrors:= 0; ihaveblanked:= FALSE; IF FALSE THEN BEGIN repeat: tryagain; END; Newline; Write("What does your answer look like after you have deleted 'logzical' [N]"); Write("back to the 'z'? (Note: DO NOT actually use the 'RUB OUT' or 'DELETE' [N]"); Write("key. Just type a series of characters which imitates how the answer [N]"); Write("would look if you HAD USED IT.) [N]"); Outsymbol(controlg); Write(prompt); getline; IF stop THEN BEGIN putaway("%QUE 12"); stop:= FALSE; GOTO endoflesson; END; IF back THEN BEGIN putaway("%QUE 12"); back:= FALSE; GOTO zqxaaq; END; IF skip THEN BEGIN putaway("%QUE 12"); skip:= FALSE; GOTO simulate; END; IF ihaveblanked THEN restore; pos:= 1; IF NOT here("LOGZICAL\LACIZ") THEN GOTO qzxaab; IF NOT here(endofline) THEN GOTO qzxaab; rightmessage; sameqzxaab: GOTO next; qzxaab: IF answerlength = 0 THEN BEGIN noanswer; GOTO repeat; END; IF ihaveblanked THEN restore; pos:= 1; pos:= 1; IF NOT anywhere("\") THEN GOTO lackqzxaac; GOTO qzxaac; lackqzxaac: wrongmessage; putaway("%QUE 12"); sameqzxaac: Write("The computer types a back-slash before it types the first character [N]"); Write("it is deleting. Perhaps you typed the wrong kind of slash. The [N]"); Write("back-slash runs from northwest to southeast, so to speak. Or perhaps [N]"); Write("you actually used the 'RUB OUT' or 'DELETE' KEY, thus causing the [N]"); Write("computer to type the slash. THIS WILL NOT work!!!!! Type the [N]"); Write("back-slash yourself, and DO NOT use the 'RUB OUT' or 'DELETE' key!!!! [N]"); Write("(Of course, if you were REALLY erasing a character instead of merely [N]"); Write("faking how it would look when you did so, then you WOULD use that [N]"); Write("key.) [N]"); Newline; showhowitlooks; GOTO repeat; qzxaac: IF ihaveblanked THEN restore; pos:= 1; IF NOT here("LOGZICAL\LACIZ\ICAL") THEN GOTO qzxaad; IF NOT here(endofline) THEN GOTO qzxaad; sameqzxaad: Write("That's exactly how it would look after you had both erased the [N]"); Write("incorrect characters and typed in the correct ones. But I wanted to [N]"); Write("know how it would look after you erased but BEFORE you started typing [N]"); Write("in the correct characters. [N]"); showhowitlooks; GOTO repeat; GOTO next; qzxaad: IF ihaveblanked THEN restore; pos:= 1; IF NOT anywhere("\") THEN GOTO qzxaae; IF NOT anywhere("\") THEN GOTO qzxaae; wrongmessage; sameqzxaae: Write("It only types ONE back-slash as long as you are deleting characters. [N]"); Write("It's true, of course, that it types a SECOND back-slash when you push [N]"); Write("some other key besides the 'RUB OUT' or 'DELETE' key. [N]"); GOTO repeat; qzxaae: IF ihaveblanked THEN restore; IF lasterrors = 0 THEN BEGIN wrongmessage; putaway("%QUE 12"); sameqzxaaf: Write("Hint: It will appear that each character is 'added' to the original [N]"); Write("word as they are deleted. [N]"); Newline; showhowitlooks; GOTO repeat; qzxaaf: END; IF ihaveblanked THEN restore; IF lasterrors = 1 THEN BEGIN wrongmessage; putaway("%QUE 12"); sameqzxaag: Write("Hint: If the word was 'universixty' then, after using the 'RUB OUT' [N]"); Write("key three times, the answer would appear to be 'universixty\ytx'. [N]"); Newline; showhowitlooks; GOTO repeat; qzxaag: END; IF ihaveblanked THEN restore; IF lasterrors = 2 THEN BEGIN wrongmessage; putaway("%QUE 12"); sameqzxaah: Write("To see how your answer should look, type the word 'logzical' and then [N]"); Write("push the 'RUB OUT' or 'DELETE' key five times just as you were doing [N]"); Write("earlier when you were experimenting with the key. REMEMBER HOW IT [N]"); Write("LOOKS AT THIS POINT because that is exactly how you will have to type [N]"); Write("it in. Then erase the whole line with a '^U', and re-type the line [N]"); Write("just as it looked before you erased it. This should be a piece of cake [N]"); Write("since the erased line is still visible to you--but not to the [N]"); Write("computer. [N]"); showhowitlooks; GOTO repeat; qzxaah: END; IF ihaveblanked THEN restore; IF lasterrors = 3 THEN BEGIN wrongmessage; putaway("%QUE 12"); sameqzxaai: Newline; showhowitlooks; GOTO repeat; qzxaai: END; IF ihaveblanked THEN restore; IF lasterrors = 4 THEN BEGIN wrongmessage; putaway("%QUE 12"); sameqzxaaj: Newline; showhowitlooks; GOTO repeat; qzxaaj: END; BEGIN wrongmessage; putaway("%QUE 12"); END; simulate: giveanswer; Write("logzical\laciz[N]"); Write(right[random]); Newline; GOTO sameqzxaab; next: Pause; IF back THEN BEGIN back:= FALSE; GOTO zqxaaq; END; END; COMMENT: Text 6; zqxaas: Write("Well, you are finished with the hardest section of this lesson. [N]"); Write("Congratulations! [N]"); Newline; Write("Before we leave erasing entirely, however, I want to teach you about [N]"); Write("one other useful command, the '^R' or CTRL-R. Suppose you want to know [N]"); Write("how your answer is going to look to the computer before you actually [N]"); Write("push the RETURN key. (You might want to know, for example, that you [N]"); Write("actually SUCCEEDED in correcting a misspelled word.) The CTRL-R gives [N]"); Write("you this computer's eye view. Try it out now and see. [N]"); Newline; Write("The procedure is the same as before: Hold the CTRL key down while you [N]"); Write("push the 'R' key. Then release both. [N]"); BEGIN Pause; IF back THEN BEGIN back:= FALSE; GOTO zqxaar; END; END; COMMENT: Question 13; nopause:= TRUE; zqxaat: BEGIN INTEGER subblock; firsttry:= TRUE; lastrights:= lasterrors:= 0; ihaveblanked:= FALSE; IF FALSE THEN BEGIN repeat: tryagain; END; Newline; Write("Following the arrow prompt, deliberately misspell a word. Then, using [N]"); Write("'RUB OUT' or 'DELETE', correct it. Next, type a CTRL-R to be sure you [N]"); Write("succeeded. Finally, push RETURN to get the computer to tell you how it [N]"); Write("'sees' your answer. [N]"); Newline; Write("When you are ready to move on, type 'GO ON'. [N]"); Outsymbol(controlg); Write(prompt); getline; IF stop THEN BEGIN putaway("%QUE 13"); stop:= FALSE; GOTO endoflesson; END; IF back THEN BEGIN putaway("%QUE 13"); back:= FALSE; GOTO zqxaas; END; IF skip THEN BEGIN putaway("%QUE 13"); skip:= FALSE; GOTO simulate; END; IF ihaveblanked THEN restore; pos:= 1; IF NOT anywhere("GO") THEN GOTO qzxaab; IF NOT anywhere("ON") THEN GOTO qzxaab; extratest; sameqzxaab: GOTO next; qzxaab: IF ihaveblanked THEN restore; pos:= 1; sameqzxaac: showhowitlooks; GOTO repeat; GOTO next; qzxaac: IF answerlength = 0 THEN BEGIN noanswer; GOTO repeat; END; BEGIN Write("I don't understand your answer.[N]"); putaway("%QUE 13"); END; simulate: next: Pause; IF back THEN BEGIN back:= FALSE; GOTO zqxaas; END; END; COMMENT: Text 7; zqxaau: Write("When you want to leave the computer for a while, you cannot just walk [N]"); Write("away or unplug it. Since the computer can't see you, it thinks you are [N]"); Write("still there....... [N]"); Newline; Write("Therefore, it will wait patiently (forever) for you to give it some [N]"); Write("more input. Since others are waiting to use the machine, this kind of [N]"); Write("loyalty is not a virtue. [N]"); Newline; Write("To prevent this, when you leave the terminal, you M-U-S-T have the [N]"); Write("computer perform a 'LOGOUT' for you. The correct way to do this is to [N]"); Write("type 'K/F'. [N]"); Newline; Write("ALTHOUGH WE CAN PRACTICE THIS OPERATION DURING THE LESSON, IN REALITY [N]"); Write("YOU WILL NOT REALLY BE LOGGING OFF UNTIL LATER. [N]"); Newline; Write("Here is why. Before we can ACTUALLY log off, we need to have our old [N]"); Write("friend from the first part of the lesson--the period prompt--in the [N]"); Write("lower left corner of the screen. [N]"); BEGIN Pause; IF back THEN BEGIN back:= FALSE; GOTO zqxaat; END; END; COMMENT: Text 8; zqxaav: Write("The 'K/F' command is the one required to log you off. [N]"); Newline; Write("Here is the procedure to follow: [N]"); Newline; Write("1. Wait until you see a period prompt at the bottom left. [N]"); Newline; Write("2. When you do (assuming you want to log out), type 'K/F'. [N]"); Newline; Write("3. Stand by until the computer actually logs you off the system. This [N]"); Write("may take a while during peak loads but, eventually, the computer will [N]"); Write("inform you that it has logged you off and, just for the record, will [N]"); Write("throw in a bunch of statistics. [N]"); Newline; Write("4. If, after a reasonable wait, the computer has not logged you off, [N]"); Write("ask someone around you for help or advice. [N]"); BEGIN Pause; IF back THEN BEGIN back:= FALSE; GOTO zqxaau; END; END; COMMENT: Question 14; zqxaaw: BEGIN INTEGER subblock; firsttry:= TRUE; lastrights:= lasterrors:= 0; ihaveblanked:= FALSE; IF FALSE THEN BEGIN repeat: tryagain; END; Newline; Write("What do you type to log off, saving all the lessons? [N]"); Outsymbol(controlg); Write(prompt); getline; IF stop THEN BEGIN putaway("%QUE 14"); stop:= FALSE; GOTO endoflesson; END; IF back THEN BEGIN putaway("%QUE 14"); back:= FALSE; GOTO zqxaav; END; IF skip THEN BEGIN putaway("%QUE 14"); skip:= FALSE; GOTO simulate; END; IF ihaveblanked THEN restore; pos:= 1; IF NOT here("K/F") THEN GOTO qzxaab; IF NOT here(endofline) THEN GOTO qzxaab; rightmessage; sameqzxaab: Write("In just a moment (upon completion of this lesson) you will get to log [N]"); Write("off of your terminal. [N]"); Newline; Write("Never leave the terminal--not even momentarily--without logging off. [N]"); Write("Even if the computer has 'CRASHED' (i.e., stopped running), at least [N]"); Write("TRY to log off. It may not react in the normal fashion to your log off [N]"); Write("attempt. However, when it comes 'UP' again, it will log you off if it [N]"); Write("hasn't forgotten all about you in the meantime. [N]"); Newline; Write("Here is one final reminder. A 'K/F' will not log you off while the [N]"); Write("lesson program is still in progress. First, the the lesson will have [N]"); Write("to finish running all the way to the end. When it has ended, the [N]"); Write("computer will type 'Leaving the lesson ' followed (after a [N]"); Write("pause) by the words 'End of execution' and -- finally -- will give you [N]"); Write("a period prompt. After THIS prompt you will be able to log off -- but [N]"); Write("not before! [N]"); GOTO next; qzxaab: IF ihaveblanked THEN restore; pos:= 1; IF NOT here("KJOB/F") THEN GOTO qzxaac; IF NOT here(endofline) THEN GOTO qzxaac; rightmessage; sameqzxaac: GOTO sameqzxaab; qzxaac: IF ihaveblanked THEN restore; pos:= 1; IF NOT here("K") THEN GOTO qzxaad; IF NOT here(endofline) THEN GOTO qzxaad; rightmessage; sameqzxaad: GOTO sameqzxaab; qzxaad: IF ihaveblanked THEN restore; pos:= 1; IF NOT anywhere("KISS") THEN GOTO qzxaae; extratest; sameqzxaae: Write("We call it 'kissing off,' but what do we actually TYPE when it is [N]"); Write("time to 'kiss off'? [N]"); GOTO repeat; GOTO next; qzxaae: IF answerlength = 0 THEN BEGIN noanswer; GOTO repeat; END; IF ihaveblanked THEN restore; pos:= 1; pos:= 1; IF NOT anywhere("/") THEN GOTO lackqzxaaf; GOTO qzxaaf; lackqzxaaf: wrongmessage; putaway("%QUE 14"); sameqzxaaf: Write("You forgot the slash character. It looks like this: '/'. Do not type [N]"); Write("the BACK-slash by mistake. It looks like this: '\'. [N]"); GOTO repeat; qzxaaf: IF ihaveblanked THEN restore; IF lasterrors = 0 THEN BEGIN wrongmessage; putaway("%QUE 14"); sameqzxaag: Write("Hint: The command is an abbreviation for Kill (my job) Fast. [N]"); GOTO repeat; qzxaag: END; IF ihaveblanked THEN restore; IF lasterrors = 1 THEN BEGIN wrongmessage; putaway("%QUE 14"); sameqzxaah: GOTO repeat; qzxaah: END; IF ihaveblanked THEN restore; IF lasterrors = 2 THEN BEGIN wrongmessage; putaway("%QUE 14"); sameqzxaai: GOTO repeat; qzxaai: END; BEGIN wrongmessage; putaway("%QUE 14"); END; simulate: giveanswer; Write("K/F[N]"); Write(right[random]); Newline; GOTO sameqzxaab; next: Pause; IF back THEN BEGIN back:= FALSE; GOTO zqxaav; END; END; END of block started with makeblock INTEGER; IF FALSE THEN BEGIN zqxaab: zqxaac: zqxaad: zqxaae: zqxaaf: zqxaag: zqxaah: zqxaai: zqxaaj: zqxaak: zqxaal: zqxaam: zqxaan: zqxaao: zqxaap: zqxaaq: zqxaar: zqxaas: zqxaat: zqxaau: zqxaav: zqxaaw: Write("NOTE: The backing procedure is unable to go back just ONE step [N]"); Write("from this point. It is going all the way back to the start.[N]"); GOTO start; END; endoflesson: Newline; Write("During the lesson ""HOW"" you answered"); Print(qcount,3); Write(" questions,[N]and you gave the right answer"); Print(latescore,3); Write(" times.[N]On"); Print(score,3); Write(" questions your answer was right on your very first try.[N]"); Breakoutput; Selectoutput(2); Newline; Write("SCORES: "); Print(latepercent,2,1); Write("% ("); Print(percent,2,1); Write("%)[NT]-"); Print(score,3); Write(" right answers on first tries and[NT]-"); Print(latescore,3); Write(" total right out of a total of[NT]-"); Print(qcount,3); Write(" questions attempted.[2N]"); Breakoutput; Selectoutput(0); Newline; Write("If you have any message for the teacher, then type it now, one[N]"); Write("line at a time. Finish with an EXTRA push on the RETURN key.[2N]"); mess: Outsymbol(controlg); Selectoutput(0); Write(prompt); Breakoutput; getline; IF back THEN BEGIN back:= FALSE; GOTO zqxaaw; END; IF answerlength > 0 THEN BEGIN message:= TRUE; Selectoutput(2); Write("MESSAGE: "); FOR pos:= 1 STEP 1 UNTIL answerlength DO Outsymbol(answer.[pos]); GOTO mess; END; Breakoutput; Selectoutput(0); Write("Leaving the lesson ""HOW""...[N]"); Openfile(1,"HOW.DTA", %155); Selectinput(1); Breakoutput; Selectoutput(2); Transfile; Openfile (1,""); Openfile (2,"HOW.DTA", %155); Closefile(1); Openfile(1,"HOW.SRT", %155); Selectinput(1); Selectoutput(3); Transfile; Openfile (1,""); Openfile (3,"HOW.SRT", %155); Selectoutput(0); Write("[2N]Have a nice day"); IF firstname # "" THEN BEGIN Write(", "); Write(firstname); END; Write("!"); r("QUOLST"); END;