Google
 

Trailing-Edge - PDP-10 Archives - decuslib20-01 - decus/20-0024/tutr03.bas
There are 2 other files named tutr03.bas in the archive. Click here to see a list.
00001REM   TUT3
00100GOTO 130
00110PRINT"NOT A VALID CHOICE. TRY AGAIN. WHICH";
00120RETURN
00130PRINT"HI. GOOD TO SEE YOU AGAIN. I'M ASSUMING YOU HAVE BEEN THROUGH"
00140PRINT"'TUTR01' AND 'TUTR02'. YOU HAVE, HAVEN'T YOU(0=N0, 1=YES)";
00150 INPUT A
00160 PRINT
00170IFA=0THEN 210
00180 IF A=1 THEN 350
00190GOSUB 110
00200GOTO 150
00210PRINT"THIS MAY PRESENT SOME DIFFICULTIES, SINCE 'TUTR01' AND 'TUTR02'"
00220PRINT"SHOULD PRECEDE THIS LESSON. WOULDN'T YOU RATHER GO BACK AND TRY"
   00230PRINT"THEM FIRST OR SHOULD WE CONTINUE (0=GO BACK, 1=CONTINUE)";
00240 INPUT B
00250PRINT
00260IFB=0THEN 300
00270 IF B=1 THEN 350
00280GOSUB 110
00290GOTO 240
00300PRINT"THEN WHEN I TYPE THE TIME, YOU TYPE 'OLD'. WHEN I TYPE 'OLD'"
00310PRINT"PROBLEM NAME--?, YOU TYPE 'TUTR01***'. WHEN I TYPE'*',"
00320PRINT"YOU TYPE 'RUN'. BE SURE YOU USE A CARRIAGE RETURN EACH TIME YOU"
00330PRINT"TYPE SOMETHING BACK TO ME. SEE YOU LATER."
00340 STOP
00350PRINT"THEN LETS REVIEW THE EXAMPLE PROGRAM USED IN 'TUTR01':"
             00360 PRINT
00370PRINT"      9 PRINT ''WHAT ARE YOUR VALUES OF X, Y, AND Z? '';"
00380PRINT"     10 INPUT X,Y,Z"
00390PRINT"     20 LET R=SQR(X^2+Y^2+Z^2)"
00400PRINT"     30 PRINT ''THE RADIUS VECTOR EQUALS'';R"
00410PRINT"     35 GO TO 9"
00420PRINT"    40 END"
00430PRINT
00440PRINT"THIS IS NOW A COMPLETE PROGRAM AND SHOWS YOU HOW TO USE SOME"
00450PRINT"OF THE 'BASIC' LANGUAGE STATEMENTS.  BY THE WAY, DID YOU GET"
00460PRINT"A CHANCE TO WRITE A PROGRAM OF YOUR OWN (0=NO, 1=YES)";
00470INPUT C
00480PRINT
00490IFC=0THEN 530
                                                               00500IFC=1THEN 580
00510GOSUB 110
00520GOTO 470
00530PRINT"THAT'S TOO BAD -- IT HELPS ME TO TEACH YOU IF YOU GET A"
00540PRINT"CHANCE TO PRACTICE WITH A PROBLEM THAT IS FAMILIAR TO YOU."
00550PRINT"BUT WE'LL GET GOING HERE AND YOU CAN TRY SOMETHING ON YOUR"
00560PRINT"OWN AFTER THIS LESSON."
00570GOTO 620
00580PRINT"THAT'S GREAT.  I HOPE YOU WERE SUCCESSFUL IN WORKING OUT ANY"
00590PRINT"PROBLEMS THAT AROSE.  ACTUALLY, PRACTICE IN WRITING PROGRAMS"
00600PRINT"THAT SOLVE SOME OF YOUR PROBLEMS IS THE BEST WAY FOR YOU TO"
        00610PRINT"GET FAMILIAR WITH A COMPUTER AND ITS LANGUAGE."
00620PRINT
00630PRINT"NOW, LET'S TAKE A LOOK AT SOME OF THE STATEMENTS WE'VE USED."
00640PRINT"FOR EXAMPLE, WE USED 'X', 'Y', AND 'Z' AS OUR KNOWN VARIABLES"
00650PRINT"AND 'R' AS OUR UNKNOWN VARIABLE. IN THE 'LET' STATEMENT, THE"
00660PRINT"UNKNOWN (R) WAS 'SET EQUAL TO' THE KNOWNS IN AN EXPRESSION."
00670PRINT"THUS WE UNDERSTAND 'EQUATION' TO MEAN:"
00680PRINT
00690PRINT"    ''DO THE COMPUTATIONS ON THE RIGHT HAND SIDE OF THE '='"
00700PRINT"      SIGN AND LET THE VARIABLE ON THE LEFT REPRESENT THE"
        00710PRINT"      VALUE AFTER THE COMPUTATION IS PERFORMED.''"
00720PRINT
00730PRINT"YOU CAN SEE THAT THIS IS NOT AN 'ALGEBRAIC' EQUATION BECAUSE"
00740PRINT"WE CAN TYPE A STATEMENT LIKE:"
00750PRINT
00760PRINT"     25 LET V=V+1"
00770PRINT
00780PRINT"THIS STATEMENT SIMPLY MEANS:"
00790PRINT
00800PRINT"    ''TAKE THE PRESENT VALUE OF 'V' AND INCREMENT IT BY 1.''"
00810PRINT
00820PRINT"THERE IS ONE THING YOU SHOULD NOTICE:"
00830PRINT
00840PRINT"    ALL VARIABLES ARE EITHER ONE LETTER OR ONE LETTER FOLLOWED"
   00850PRINT"    BY ONE DIGIT. YOU MAY USE ANY OF THE LETTERS OF THE ALPHABET"
00860PRINT"    AND ANY DIGIT FROM 0 TO 9."
00870PRINT
00880PRINT"LET'S TRY A FEW EXAMPLES AND YOU TELL ME WHICH ONES ARE WRONG."
00890PRINT
00900PRINT"     (1)  LET X1=R*B^2"
00910PRINT"                                    (TYPE THE NUMBER OF"
00920PRINT"     (2)  LET XY=A1+B*3              THE EXAMPLE AND RE-"
00930PRINT"                                     TURN THE CARRIAGE)"
00940PRINT"     (3)  LET X9=X^2+Y^3"
00950PRINT
00960PRINT"WHICH ONE IS WRONG";
                                                00970INPUTC
00980PRINT
00990IFC=2THEN 1080
01000IFC=1THEN 1040
01010IFC=3THEN 1060
01020PRINT"TRY AGAIN AND USE 1, 2, OR 3 FOR YOUR ANSWER. WHICH IS WRONG";
01030GOTO 970
01040PRINT"NO, THIS IS A VALID STATEMENT - TRY AGAIN. WHICH IS WRONG";
01050GOTO 970
01060PRINT"NOT QUITE - THIS STATEMENT IS LEGAL. TRY AGAIN; WHICH IS WRONG";
01070GOTO 970
01080PRINT"RIGHT. 'XY' IS AN ILLEGAL VARIABLE NAME. NO MORE THAN ONE"
01090PRINT"LETTER OR ONE LETTER AND ONE DIGIT ALLOWED. LET'S TRY SOME MORE"
01100	PRINT
01110PRINT"     (1)  LET X1=X1+Z^5"
01120PRINT"                                      (TYPE THE NUMBER OF"
01130PRINT"     (2)  LET T2=P+Q                   YOUR CHOICE AND RE-"
01140PRINT"                                       TURN THE CARRIAGE)"
01150PRINT"     (3)  LET Y=V11+1"
01160PRINT
01170PRINT"WHICH ONE IS WRONG THIS TIME";
01180INPUTC
01190PRINT
01200IFC=3THEN 1290
01210IFC=2THEN 1270
01220IFC=1THEN 1250
01230PRINT"PLEASE -- ONLY THE NUMBERS 1, 2, OR 3. WHICH";
01240GOTO 1180
01250PRINT"NO, THIS IS VALID - X1 WOULD BE INCREMENTED BY 'Z^5'. AGAIN....";
  01260GOTO 1180
01270PRINT"THIS ONE IS OK - LOOK A LITTLE CLOSER. IT SHOULD BE....";
01280GOTO 1180
01290PRINT"THAT'S GOOD. V11 IS ILLEGAL - YOU CAN'T HAVE MORE THAN ONE "
01300PRINT"DIGIT FOLLOWING A LETTER."
01310PRINT
01320  PRINT"SO FAR THE FOLLOWING KINDS OF STATEMENTS HAVE BEEN USED:"
01330PRINT"'PRINT', 'INPUT', 'LET', 'GO TO', AND 'END'. IF YOU ARE AT "
01340PRINT"ALL UNCERTAIN AS TO HOW ANY OF THESE ARE USED, LOOK ONCE MORE"
01350PRINT"AT THE PREVIOUS SAMPLE PROBLEM. WHEN YOU ARE POSITIVE YOU"
01360PRINT"UNDERSTAND, SWITCH TO THE PROGRAM CALLED 'TUTR04' TO CONTINUE"
       01370PRINT"THIS LESSON. I'LL TYPE THE TIME, AND IF YOU'RE READY TO CONTINUE"
01380PRINT"YOU TYPE 'OLD'. WHEN I TYPE 'OLD PROBLEM NAME--' YOU TYPE"
01390PRINT"'TUTR04*'. (BE SURE TO RETURN THE CARRIGE EACH TIME) WHEN I"
01400PRINT"TYPE '*' YOU TYPE 'RUN', RETURN THE CARRIAGE, AND BEGIN."
01410END