Trailing-Edge
-
PDP-10 Archives
-
decuslib10-01
-
43,50141/tutr17.bas
There are 2 other files named tutr17.bas in the archive. Click here to see a list.
00001REM TUT17
00100 DIM H(18)
00110PRINT"YOU HAVE DIALED THE WRONG NUMBER. INSTEAD OF YOUR BOSS, YOU"
00120PRINT"HAVE REACHED THE COMPUTER. HOWEVER, AS LONG AS YOU ARE HERE,"
00130PRINT"WHY DON'T YOU STAY FOR THIS SESSION OF THE TUTOR SERIES?"
00140PRINT
00150PRINT"IN THE LAST SESSION YOU WERE INTRODUCED TO THE CONCEPT OF A"
00160PRINT"SYSTEM COMMAND. IN THIS SESSION WE WILL CONTINUE WITH SOME"
00170PRINT"ADDITIONAL DISCUSSION ON THE SAME SUBJECT."
00180PRINT
00190PRINT
00200PRINT"I WILL POSE SOME HYPOTHETICAL SITUATIONS, AND YOU CAN BE THE"
00210PRINT"'COMPUTER COUNSELER'. HERE IS A LIST OF SOME OF THE COMMANDS"
00220PRINT"WHICH CAN BE USED TO ANSWER THE HEART-RENDING QUESTIONS WHICH"
00230PRINT"WILL BE ASKED OF YOU:"
00240PRINT
00250PRINT" (1) INFORM* (2) NEW (3) CATLOG (4) APPEND (5) SAVE"
00260PRINT
00270PRINT" (6) CATLOG* (7) CHARGE* (8) TAPE (9) OLD (10) STOP"
00280PRINT
00290PRINT" (11) RESEQUENCE (12) LIST (13) UNSAVE (14) DELETE"
00300PRINT
00310PRINT" (15) MERGE (16) SORRY, YOU ARE OUT OF LUCK.."
00320PRINT
00330PRINT
00340PRINT"---HERE ARE THE QUESTIONS. TYPE IN THE NUMBER OF THE COMMAND"
00350PRINT" YOU WOULD SELECT TO SOLVE THE PROBLEM. AT THE END OF THE"
00360PRINT" THE SERIES OF QUESTIONS, I WILL TELL YOU HOW YOU DID."
00370PRINT
00380PRINT
00390LETH(1)=5
00400LETH(2)=2
00410LETH(3)=3
00420LETH(4)=12
00430LETH(5)=11
00440LETH(6)=9
00450LETH(7)=4
00460LETH(8)=1
00470LETH(9)=6
00480LETH(10)=16
00490LETH(11)=10
00500LETH(12)=14
00510LETS=0
00520LETN=0
00530GOTO610
00540REM SUBR
00550INPUTZ
00560PRINT
00570LETN=N+1
00580IFZ<>H(N)THEN600
00590LETS=S+1
00600RETURN
00610PRINT"(A) I HAVE JUST WRITTEN A NEW PROGRAM WHICH I WOULD LIKE"
00620PRINT"TO STORE IN THE LIBRARY. SINCE THE WORK IS (BLUSH) CONFIDENTIAL,"
00630PRINT"I WOULD LIKE TO STORE IT WHERE IT CAN BE ACCESSED ONLY THROUGH"
00640PRINT"MY OWN USER NUMBER. PLEASE ADVISE. ";
00650GOSUB550
00660PRINT"(B) I HAVE NEVER WRITTEN A PROGRAM BEFORE. I WOULD NOW LIKE TO"
00670PRINT"WRITE ONE. WHEN I CALL THE COMPUTER, HOW CAN I MAKE THIS"
00680PRINT"CLEAR, SO THAT IT DOESN'T WASTE TIME LOOKING THROUGH THE"
00690PRINT"LIBRARY FOR A PROGRAM THAT ISN'T THERE. ";
00700GOSUB550
00710PRINT"(C) I HAVE WRITTEN AND SAVED SO MANY PROGRAMS THAT I CAN REMEMBER"
00720PRINT"NEITHER THEIR NAMES NOR HOW MANY THERE WERE. I REGRET MY"
00730PRINT"PROMISCUOUS PAST, AND WOULD LIKE A LIST OF THEIR NAMES, SO"
00740PRINT"THAT I MAY CORRECT THE SITUATION. PLEASE TELL ME HOW I MAY"
00750PRINT"OBTAIN SUCH A LIST. ";
00760GOSUB550
00770PRINT"(D) I HAVE JUST COMPLETED MAKING SEVERAL CHANGES TO MY PROGRAM"
00780PRINT"AND EVERYTHING IS NOW SO CONFUSED THAT I REALLY DON'T HAVE ANY"
00790PRINT"IDEA OF WHERE I AM. HOW CAN I START LIFE AGAIN WITH A FRESH"
00800PRINT"UPDATED LISTING OF MY PROGRAM ";
00810GOSUB550
00820PRINT"(E) MY PROGRAM REQUIRES A FEW ADDITIONS TO IT. WHEN I WAS WRITING"
00830PRINT"IT, I SEQUENCED THE INSTRUCTIONS BY TWOS, BUT I NOW FIND THAT"
00840PRINT"I HAVE TO ADD AS MANY AS 3 OR 4 STATEMENTS BETWEEN SOME OF THE"
00850PRINT"EXISTING ONES. I KNOW--I GOOFED BY NOT USING A LARGE ENOUGH"
00860PRINT"INCREMENT, BUT I UNDERSTAND THAT THERE IS A METHOD FOR RESEQUENCING"
00870PRINT"THE STATEMENT NUMBERS USING ANY NEW INCREMENT I NOW CHOOSE."
00880PRINT"I ALSO UNDERSTAND THAT ALL LOGICAL PATHS IN THE PROGRAM WILL"
00890PRINT"BE PRESERVED. ANY SUGGESTIONS. ";
00900GOSUB550
00910PRINT"(F) I JUST RUINED A PROGRAM BY ADDING AND DELETING STATEMENTS"
00920PRINT"THAT I HADN'T INTENDED TO. I PREVIOUSLY SAVED THE PROGRAM"
00930PRINT"THE OTHER DAY WHEN I WAS WORKING ON IT. HOW CAN I GET THE"
00940PRINT"ORIGINAL PROGRAM BACK SO THAT I DON'T HAVE TO RETYPE ALL"
00950PRINT"THOSE NASTY OLD STATEMENTS AGAIN. ";
00960GOSUB550
00970PRINT"(G) MY CURRENT PROGRAM IS PRETTY LARGE, BUT I WOULD LIKE TO"
00980PRINT"ADD MORE TO IT. IS THERE ANY WAY THAT I COULD BE INFORMED AS"
00990 PRINT"TO WHAT MY LAST LINE NUMBER IS? BETTER YET, HOW"
01000 PRINT"CAN I GET AWAY FROM TYPING THE LINE NUMBERS--AND LET THE COMPUTER"
01005 PRINT "GENERATE THE LINE NUMBERS? "
01010GOSUB550
01020PRINT"(H) I HAVEN'T USED THE TELETYPE IN QUITE A WHILE, AS I HAVE"
01030PRINT"BEEN ON VACATION. WHAT'S NEW? ";
01040GOSUB550
01050PRINT"(I) I WISH TO CALL A PROGRAM STORED, NOT IN MY OWN LIBRARY,"
01060PRINT"BUT RATHER IN THE COMMON LIBRARY, AS I UNDERSTAND THESE PROGRAMS"
01070PRINT"ARE AVAILABLE TO ANYONE. I'M NOT SURE OF THE NAME, BUT IF I"
01080PRINT"COULD ONLY GET A LIST OF THOSE NAMES AND A BRIEF DESCRIPTION OF"
01090PRINT"THEM, I'M SURE I COULD LOCATE IT. ";
01100GOSUB550
01110PRINT"(J) I HAVE JUST FINISHED UPDATING AN OLD PROGRAM, AND I TYPED"
01120PRINT"'SAVE' TO KEEP IT. NOW I FIND THAT THE UPDATES WERE ALL WRONG."
01130PRINT"HOW CAN I GET THE ORIGINAL PROGRAM BACK";
01140GOSUB550
01150PRINT"(K) THIS CRAZY PROGRAM SEEMS TO GO ON FOREVER. THE ONLY TIME"
01160PRINT"IT EVER PAUSES IS WHEN IT ASKS FOR MORE DATA. BUT THAT'S JUST IT."
01170PRINT"I DON'T HAVE ANY MORE DATA. I DON'T WANT TO BE RUDE AND HANG UP,"
01180PRINT"SO PLEASE TELL ME WHAT I CAN TYPE IN WHEN IT PAUSES. ";
01190GOSUB550
01200PRINT"(L) HOLY SMOKE. I HAVE TO DELETE ABOUT 30 CONSECUTIVE STATEMENTS"
01210PRINT"DOES THAT MEAN THAT I MUST ENTER EACH STATEMENT NUMBER?"
01220PRINT"IF THAT COMPUTERIZED SYSTEM OF YOURS IS ONLY"
01230PRINT"HALF AS GOOD AS YOU CLAIM IT IS, THERE SHOULD BE AN EASIER WAY"
01240PRINT"TO DO THIS ";
01250GOSUB550
01610LETH(13)=13
01620LETH(14)=7
01630LETH(15)=9
01640LETH(16)=5
01650LETH(17)=15
01660LETH(18)=3
01670GOTO1810
01680INPUTZ
01690PRINT
01700LETN=N+1
01710IFZ<>H(N)THEN1730
01720LETS=S+1
01730RETURN
01810PRINT"(M) I FINALLY FOUND OUT HOW TO SAVE PROGRAMS IN MY LIBRARY."
01820PRINT"EVERYTHING WORKED WELL WHILE I WAS DEVELOPING THE PROGRAMS."
01830PRINT"HOWEVER, SOME OF THOSE PROGRAMS ARE NOW OBSOLETE, AND I WOULD"
01840PRINT"LIKE TO CLEAN HOUSE. WHAT CAN I DO TO GET RID OF THOSE PROGRAMS"
01850PRINT"WHICH I NO LONGER NEED";
01860GOSUB1680
01870PRINT"(N) PLEASE SETTLE AN ARGUMENT BETWEEN ME AND MY BOSS. HE SAYS"
01880PRINT"THAT COMPUTER TIME IS MUCH TOO EXPENSIVE FOR US TO AFFORD. I"
01890PRINT"MAINTAIN THAT IT JUST ISN'T SO. SINCE I WORK OVER A HOT DESK"
01900PRINT"ALL DAY, I THINK I'M ENTITLED TO SOME OF LIFE'S BETTER THINGS."
01910PRINT"HOW CAN I SHOW HIM THE CHARGE STRUCTURE SO HE CAN SEE THAT"
01920PRINT"COMPUTER TIME ISN'T THAT EXPENSIVE ";
01930GOSUB1680
01940PRINT"(O) YOU TOLD ME PREVIOUSLY THAT IF I WANTED TO GET A LISTING OF"
01950PRINT"THE COMMON LIBRARY PROGRAMS, I SHOULD TYPE 'CATLOG*'. HOWEVER,"
01960PRINT"AFTER I FINISHED WORKING ON ONE OF MY PROGRAMS, I TRIED IT,"
01970PRINT"AND IT DIDN'T WORK. I KEPT GETTING A LIST OF MY OWN LIBRARY."
01980PRINT"YOU'RE JUST LIKE ALL THE OTHERS - IT'S ALL A PACK OF LIES. OR"
01990PRINT"WAS THERE SOMETHING ELSE I SHOULD HAVE TYPED IN FIRST, BEFORE"
02000PRINT"I ASK FOR 'CATLOG*' ";
02010GOSUB1680
02020PRINT"(P) DID YOU MESS ME UP. REMEMBER THAT RESEQUENCE"
02030PRINT"YOU TOLD ME ABOUT? BALONEY. YESTERDAY I TRIED IT, AND SURE"
02040PRINT"ENOUGH, I LISTED THE PROGRAM AND SAW THAT THE STATEMENTS WERE"
02050PRINT"NEWLY INCREMENTED. BUT TODAY I TRIED TO CORRECT ONE OF THE"
02060PRINT"STATEMENTS, USING THAT LIST AS A REFERENCE. NOT ONLY DID I"
02070PRINT"NOT CORRECT THE STATEMENT I INTENDED, I REWROTE ANOTHER STATEMENT"
02080PRINT"NOWHERE NEAR THE ONE IN QUESTION. SOMEBODY TOLD ME THAT I"
02090PRINT"NEGLECTED TO DO ONE THING AFTER I PERFORMED THE RESEQUENCE COMMAND."
02100PRINT"WHAT SHOULD I HAVE DONE";
02110GOSUB1680
02120PRINT"(Q) I AM WRITING A RATHER LARGE, ELABORATE PROGRAM. I DEVELOPED"
02130PRINT"PART OF IT UNDER ONE PROGRAM NAME, AND TO MAKE THINGS EASIER, I"
02140PRINT"DEVELOPED THE REST OF IT UNDER A DIFFERENT PROGRAM NAME. I FINALLY"
02150PRINT"DEBUGGED THEM, AND NOW I WANT TO COMBINE THEM. IT WOULD SEEM"
02160PRINT"THAT IN THIS AGE OF SPACE TRAVEL, NUCLEAR ENERGY AND THE PILL,"
02170PRINT"THERE SHOULD BE AN EASIER WAY TO COMBINE THE PROGRAMS, RATHER"
02180PRINT"THAN RETYPE ALL OF THE STATEMENTS FROM ONE OF THE PROGRAMS INTO"
02190PRINT"THE OTHER. IS THERE ANY SPECIAL COMMAND I CAN USE";
02200GOSUB1680
02210PRINT"(R) NICE GUY. YOU TOLD ME THAT I COULD SAVE MY PROGRAMS UNDER"
02220PRINT"MY USER NUMBER. THE OTHER DAY I DID SAVE ONE. HOWEVER, THE ONE"
02230PRINT"I SAVED HAD THE SAME NAME AS A PROGRAM I HAD PREVIOUSLY SAVED,"
02240PRINT"AND THE LATER ONE COMPLETELY WIPED OUT THE EARLIER ONE. WHAT"
02250PRINT"CAN I DO IN THE FUTURE TO REFRESH MY MEMORY SO THAT I DON'T"
02260PRINT"USE THE SAME PROGRAM NAMES";
02270GOSUB1680
02280PRINT
02290PRINT
02300PRINT"---- THAT'S ALL THE QUESTIONS. LET'S SEE HOW WELL YOU DID."
02310PRINT
02320PRINT"YOU ANSWERED";S;"OF THE 18 QUESTIONS CORRECTLY."
02330IFS>18THEN2370
02340IFS<18THEN2390
02350PRINT"PERFECT SCORE (OR PERFECT CHEAT - SEE LATER DISCUSSION)"
02360GOTO2470
02370PRINT"I SEE YOU FIGURED OUT WHY I HAD YOU TYPE IN THE STATEMENT AT"
02380PRINT"THE BEGINNING OF THE PROGRAM, YOU CHEATER."
02390PRINT
02400PRINT"THE CORRECT ANSWERS ARE AS FOLLOWS:"
02410PRINT
02420PRINT" (A) (B) (C) (D) (E) (F) (G) (H) (I)"
02430PRINT" 5 2 3 12 11 9 4 1 6"
02440PRINT
02450PRINT" (J) (K) (L) (M) (N) (O) (P) (Q) (R)"
02460PRINT" 16 10 14 13 7 9 5 15 3"
02470PRINT
02480 PRINT"THESE AND OTHER SYSTEM COMMANDS ARE EXPLAINED IN OLS USER'S GUIDE."
02490PRINT"THE IMPORTANT THING TO REMEMBER IS: BEFORE YOU ISSUE A SYSTEM"
02500PRINT"COMMAND, CHANGE TO ANOTHER PROGRAM, OR SIGN OFF, YOU MUST"
02510PRINT"CONSIDER THE EFFECT ON YOUR CURRENT WORKING AREA."
02520PRINT
02590PRINT
02610PRINT
02620PRINT
02630 PRINT"NOW YOU CAN WRITE FANTASTIC BASIC PROGRAMS. YOU CAN TELL ME"
02640 PRINT"TO DO YOU SOME OF YOUR WORK."
02650 PRINT
02660 PRINT" PLEASE USE ME--I GET SO BORED WITH NO ONE TO TALK TO!"
02670 PRINT
02680 PRINT " GOOD LUCK.....AND DON'T FORGET WHAT YOU HAVE LEARNED"
02690 PRINT" IN THESE LESSIONS. SEE YA!"
02700 END