home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / teach.zip / TEACH1A.ATF < prev    next >
Text File  |  1997-09-14  |  66KB  |  805 lines

  1. XNÉIO 0 1                                                                      °
  2. XNÉCT 0 1E²13                                                                  °
  3. XCÉFC 1 6 .,*0_²                                                               °
  4. XNÉRL 0 16807                                                                  °
  5. XCÉPR 1 1                                                                      °
  6. XCÉLX 1 5 TEACH                                                                °
  7. XCALPHA 1 26 ABCDEFGHIJKLMNOPQRSTUVWXYZ                                        °
  8. XNARRAY 2 2 2 1 2 3 4                                                          °
  9. XAAS╜23-33⌡ÉIO-∞10                                                             °
  10. XCBOX 2 2 3 CATDOG                                                             °
  11. *(1997 9 14 12 30 44 504)                                                      °
  12. XFDISCLAIMER ÉFX 'DISCLAIMER' 'Σ Copyright statement' 'disclaimer'             °
  13. *(1996 4 6 15 55 23 476)                                                       °
  14.  FDISPLAY ÉFX 'D╜S DISPLAY A;ÉIO;R;C;HL;HC;HT;HB;VL;VB;V;W;N;B'                °
  15.   'Σ DISPLAY A GENERAL ARRAY IN PICTORIAL FORM'                                °
  16.   'Σ  NORMAL CALL IS MONADIC.  DYADIC CALL USED ONLY IN'                       °
  17.   'Σ    RECURSION TO SPECIFY DISPLAY RANK, SHAPE, AND DEPTH.' 'ÉIO╜0'          °
  18.   '»(0=ÉNC ''S'')/''S╜µA''' 'R╜╞µ,S                   Σ PSEUDO RANK.'          °
  19.   'C╜''┐┌└┘''                 Σ UR, UL, LL, AND LR CORNERS.'                   °
  20.   'HL╜''─''                   Σ HORIZONTAL LINE.'                              °
  21.   'HC╜HL,''Θ╕'',HL,''~+ε''      Σ HORIZONTAL BORDERS.'                         °
  22.   'HT╜HC[(0<R)⌡1+0<╞²1╞,S]' 'ΣW╜,0╧■╞0µΓ(1⌐µA)╞A'                              °
  23.   'HB╜HC[3+3╛(''2⌡~A╧«A'' ÉEA ''1+╞ε0⌡(1⌐⌡/µA)╞,A'')+3⌡1<µµS]'                 °
  24.   'VL╜''│''                   Σ VERTICAL LINE.'                                °
  25.   'VB╜VL,''Φ╟''               Σ VERTICAL BORDER.'                              °
  26.   'V╜VB[(1<R)⌡1+0<²1╞²1╟,S]'                                                   °
  27.   '»(0εµA)/''A╜(1⌐µA)µΓ╞A''   Σ SHOW PROTOTYPE OF EMPTIES.'                    °
  28.   '╕(1<╧A)/GEN' '╕(2<µµA)/D3'                                                  °
  29.   'D╜«A                     Σ SIMPLE ARRAYS.' 'W╜1╞µD╜(²2╞1 1,µD)µD'           °
  30.   'N╜²1+1╟µD' '╕(0=µµA)/SS'                                                    °
  31.   'D╜(C[1],V,((W-1)µVL),C[2]),((HT,NµHL),[0]D,[0]HB,NµHL),C[0],(WµVL),C[       °
  32.  3]' '╕0' 'SS:HB╜((0 '' '')=╞0µΓA)/'' -'''                                     °
  33.   'D╜'' '',('' '',[0]D,[0]HB,Nµ'' ''),'' ''' '╕0'                              °
  34.   'GEN:D╜«DISPLAY■A          Σ ENCLOSED ...' 'N╜Dδ.⌠'' '''                     °
  35.   'D╜(Nδ~1ΦN)≡D' 'D╜(δ≡~''  ''╤D)/D' 'D╜((1,µS)µS)DISPLAY D'                   °
  36.   '╕(2≥µ,S)╟D3E,0' 'D3:D╜0 ²1╟0 1╟«ΓA         Σ MULT-DIMENSIONAL ...'          °
  37.   'W╜1╞µD' 'N╜²1+1╟µD'                                                         °
  38.   'D╜(C[1],V,((W-1)µVL),C[2]),((HT,NµHL),[0]D,[0]HB,NµHL),C[0],(WµVL),C[       °
  39.  3]' 'D3E:N╜²2+µ,S'                                                            °
  40. X 'V╜C[Nµ1],[0]VB[1+0<²2╟,S],[0](((²3+╞µD),N)µVL),[0]C[Nµ2]' 'D╜V,D'           °
  41. *(1996 4 6 15 55 23 476)                                                       °
  42.  FEXIT ÉFX 'EXIT' 'Σ Exit from function' '''To log off type:   )OFF'''         °
  43. X '╕'                                                                          °
  44. *(1996 4 6 15 55 23 476)                                                       °
  45.  FGAUSS ÉFX 'GAUSS' 'Σ Story of Gauss as 11 year old'                          °
  46.   '''When the great mathematician, Karl Friedrich Gauss was about 11 yea       °
  47.  rs'''                                                                         °
  48.   '''old, his teacher, Herr Buttner, liked to assign arithmetic progress       °
  49.  ions'''                                                                       °
  50.   '''to his students to practice addition. It would take them at least''       °
  51.  '                                                                             °
  52.   '''one hour to add one hundred such numbers. But Gauss surprised his''       °
  53.  '                                                                             °
  54.   '''teacher by coming up with the correct answer in just a few minutes'       °
  55.  '' '''by deducing the right formula. Can you work out this formula?'''        °
  56.   '''Try to apply your formula to the sequence in AS. In the next'''           °
  57.   '''lesson we will find an even easier way to solve that problem.'',r'        °
  58. X 'endd'                                                                       °
  59. *(1996 4 6 15 59 48 592)                                                       °
  60.  FGO ÉFX 'GO;T;E;B' 'Σ Expression driver' 'L0:B╜E╜''''' 'æ╜''      '''         °
  61.   'T╜æ' '╕(^/'' ''=T)/L0' '╕((^/'')OFF ''=5╞6╟T)doif ''EXIT'')/0'              °
  62.   '╕(('':''εT)doif ''B╜evaldd (+/^\'''' ''''=T)╟T'')/L0'                       °
  63.   '''E╜ÉEM'' ÉEA T' '╕(0=µ,E)/L0' '╕B/L0'                                      °
  64.   '''This is not a valid APL2 expression''' 'æ╜''*'''                          °
  65. X '╕(''?''⌠╞1╟æ)/L0' 'E' '╕L0'                                                 °
  66. *(1997 8 12 12 22 17 352)                                                      °
  67.  FHELP ÉFX 'HELP;N;I;T' 'Σ Help to student' '''WHAT TO DO'',r'                 °
  68.   '''  ° To get out of the lesson''' '''       ENTER: EXIT'''                  °
  69.   '''  ° To log off APL2'''                                                    °
  70.   '''       FIRST, ENTER: EXIT  THEN ENTER: )OFF'''                            °
  71.   '''  ° To get help''' '''       ENTER: HELP'''                               °
  72.   '''  ° When you see the cursor on a blank line'''                            °
  73.   '''       ENTER AN APL2 EXPRESSION - OR JUST PRESS: ENTER''' 'do'            °
  74.   '''  ° If you get this line'',r'                                             °
  75.   '''This is not a valid APL2 expression'',r,''*'',r'                          °
  76.   '''        YOU CAN EITHER''' '''           A. PRESS: ENTER'''                °
  77.   '''           B. PRESS: ? and then ENTER to see what was incorrect'''        °
  78.   '''              in your expression causing that response'',r' 'do'          °
  79.   '''HINTS'',r'                                                                °
  80.   '''This lesson is made up of '',(«N╜9),'' components named TEACHx, whe       °
  81.  re''' '''the x stands for a digit:'',r' 'I╜0'                                 °
  82.   'L0:T╜''TEACH'',(«I╜I+1)' 'notb T,'' '',1╟notb(ÉCR T)[2;]'                   °
  83.   '╕(N>I)/L0' 'do'                                                             °
  84.   '''You may review either of these components separately. To do that,''       °
  85.  '                                                                             °
  86.   '''first enter EXIT (and RETURN), then enter the name of the lesson.''       °
  87.  ' '''component (e.g. TEACH4).'',r'                                            °
  88.   '''To re-start the lesson, just enter TEACH'',r'                             °
  89.   '''You may press PAGE UP to review previous pages.''' 'do'                   °
  90.   '''RESOURCES'',r'                                                            °
  91.   '''You may also enter ONE of the following words'',r'                        °
  92.   '''GAUSS    A historical footnote on the early life of Gauss'''              °
  93.   '''TEACHER  To explain this tutorial to those planning to teach APL2''       °
  94. X' 'endd'                                                                      °
  95. *(1997 8 1 13 1 35 300)                                                        °
  96.  FKEYBOARD ÉFX 'KEYBOARD' 'Σ Explain keyboard' '''    APL2 SYMBOLS'',r'        °
  97.   '''The first lesson (TEACH0) described among other things how you can'       °
  98.  ''                                                                            °
  99.   '''select a font using the OPTIONS pull down menu. Before we begin, it       °
  100.  '''                                                                           °
  101.   '''is useful to review how you can find out what keys to press to obta       °
  102.  in'''                                                                         °
  103.   '''any one particular symbol. It is presumed here that you followed th       °
  104.  e'''                                                                          °
  105.   '''instructions of the first lesson (TEACH0) to install the "APL2 Unio       °
  106.  n'''                                                                          °
  107.   '''with Box Characters" font. As this lesson proceeds, symbols will be       °
  108.  '''                                                                           °
  109.   '''introduced that you will not find on your keyboard. These "new"'''        °
  110.   '''symbols will require you to press TWO keys: A gray key SHIFT, CTRL        °
  111.  or'''                                                                         °
  112.   '''ALT, and a white key. Here is how you can find out what keys to pre       °
  113.  ss''' '''to obtain a specific symbol:'',r'                                    °
  114.   '''1. Select the OPTIONS pull down menu'''                                   °
  115.   '''2. Click on the "Modify keyboard ..." option'''                           °
  116.   '''3. A keyboard layout will appear'',r'                                     °
  117.   '''      Click in turn the 4 buttons in the STATE box. For each button       °
  118.  '''                                                                           °
  119.   '''      the keyboard layout will display the symbols represented by t       °
  120.  he'''                                                                         °
  121.   '''      keyboard keys (note however that CAPS and lower case are reve       °
  122.  rsed)'',r'                                                                    °
  123.   '''DO THIS NOW. THEN CLOSE THE PULL DOWN MENU AND PRESS ENTER'',r'           °
  124.   'non'                                                                        °
  125.   '''Now try some combinations pressing either CTRL or ALT and some keys       °
  126.   on''' '''your keyboard.'',r'                                                 °
  127.   '''As the special symbols are introduced in the tutorial, you will wan       °
  128.  t''' '''to use the "Modify Keyboard ..." procedure to find them.'',r'         °
  129.   '''TO CONTINUE THE LESSON, PRESS ENTER-- ONCE occasionally even TWICE)       °
  130. X'',r' 'non' 'endd'                                                            °
  131. XCNAME 1 6 GEORGE                                                              °
  132. XNSUPERCALIFRAGILISTICEXPIADOCIOUS 0 1234.56789                                °
  133. *(1997 8 3 13 4 12 228)                                                        °
  134.  FTEACH ÉFX 'TEACH' 'Σ Start first lesson in APL2 by Zdenek V JIZBA'           °
  135.   'exit ''TEACH''' 'initialize'                                                °
  136.   'TEACH1 Σ Introduction; setting up the keyboard'                             °
  137.   'TEACH2 Σ APL2 as calculator; character strings'                             °
  138.   'TEACH3 Σ numbers, characters and scalars'                                   °
  139.   'TEACH4 Σ vectors; primitive functions'                                      °
  140.   'TEACH5 Σ negative numbers; the concepts MONADIC and DYADIC'                 °
  141.   'TEACH6 Σ equal, not equal and membership'                                   °
  142.   'TEACH7 Σ re-execution, assignment and muliple specification'                °
  143.   'TEACH8 Σ shape and reshape' 'TEACH9 Σ index generator and index of'         °
  144.   '''That is all for this lesson. Feel free to scroll up the screen to r       °
  145.  eview'''                                                                      °
  146.   '''the text. If you want to try out some additional exercises, enter f       °
  147.  irst:''' '''      GO'',r'                                                     °
  148.   '''(This will avoid certain error messages should you enter invalid'''       °
  149.   ''' expressions. We will discuss these error messages in a later lesso       °
  150. Xn.)'''                                                                        °
  151. *(1997 8 25 13 4 58 500)                                                       °
  152.  FTEACH1 ÉFX 'TEACH1;T' 'Σ Explain keyboard, initialize lesson'                °
  153.   'exit ''TEACH1'''                                                            °
  154.   '''APL2 is more than a programming language; it is a way of thinking.'       °
  155.  ''                                                                            °
  156.   '''As you proceed, you will feel as if entering a totally new landscap       °
  157.  e'''                                                                          °
  158.   '''You will be able to solve problems quicky and easily. But even more       °
  159.  '''                                                                           °
  160.   '''important, you will gradually change the way you approach solving''       °
  161.  '                                                                             °
  162.   '''problems on a computer. Even if you never again use APL2, this lear       °
  163.  ning''' '''experience will make a better programmer out of you.'',r'          °
  164.   '''(To continue press Enter)''' 'do'                                         °
  165.   '''But first, there are some ground rules for this lesson:'''                °
  166.   ''' 1. When you finish reading the text on the screen, check that the'       °
  167.  ''                                                                            °
  168.   '''    cursor is on a blank line. You may enter an APL2 expression at'       °
  169.  '' '''    this point. Pressing ENTER will display more text.'''               °
  170.   ''' 2. APL2 uses special symbols to describe the task to be done.'''         °
  171.   '''    As the lessons proceed, you will get acquainted with all of'''        °
  172.   '''    these symbols. For now do not worry about it.'''                      °
  173.   ''' 3. If you want to quit this lesson, simply enter: EXIT, and'''           °
  174.   '''    then enter: )OFF'''                                                   °
  175.   ''' 4. To move the contents of the screen, you can use the PAGE UP'''        °
  176.   '''    and PAGE DOWN keys. Moving the cursor up from the top line or''       °
  177.  ' '''    down from the bottom line will scroll the screen.'''                 °
  178.   ''' 5. Whenever a new term is introduced, it will be in CAPS. You are'       °
  179.  ''                                                                            °
  180.   '''    not expected to memorize these terms, but with frequent usage''       °
  181.  '                                                                             °
  182.   '''    you will become familiar with them. On occasion the name of the       °
  183.  '''                                                                           °
  184.   '''    term will be a common word. Whenever there is a possibility to'       °
  185.  ''                                                                            °
  186.   '''    confuse such name with the word usage, we will continue to'''         °
  187.   '''    capitalize the APL2 name.'''                                          °
  188.   ''' 6. To enter any expression, start in any column on a BLANK line.''       °
  189.  '                                                                             °
  190.   ''' 7. From time to time the text will suggest you to enter a word'''        °
  191.   '''    in caps. This will produce additional explanation on the subjec       °
  192.  t'''                                                                          °
  193.   '''    under discussion. For a first reading, it is suggested you'''         °
  194.   '''    ignore this (the explanation may interfere with the normal flow       °
  195.  ''' '''    of the tutorial.)'''                                               °
  196.   ''' 8. These lessons have been developped for APL2OS2, but should be''       °
  197.  '                                                                             °
  198.   '''    valid for any version of APL2. For non-PC versions of APL2,'''        °
  199.   '''    there may be minor differences regarding some OS options.'',r'        °
  200.   '''(You may wish to print this screen or copy it for reference)'',2µr'       °
  201.   'do'                                                                         °
  202.   '''P.S. If you are a teacher of APL2, type TEACHER for more info.'',r'       °
  203.   'do' '''You may also at any time enter:  HELP'',r' 'show ''HELP'''           °
  204.   '''(Function HELP was a kind of a detour. The dashed lines:'''               °
  205.   '''_________________'''                                                      °
  206.   '''indicate the end of that detour, in this case the end of HELP.)'''        °
  207. X 'do' '''OK now, are you ready?''' 'endd'                                     °
  208. *(1997 8 1 13 12 7 232)                                                        °
  209.  FTEACH2 ÉFX 'TEACH2' 'Σ Immediate execution mode' 'exit ''TEACH2'''           °
  210.   'KEYBOARD' '''    APL2 AS A HAND CALCULATOR'',r'                             °
  211.   '''You can use APL2 much the same as a hand held calculator.'',r'            °
  212.   '''Here is a sample (remember to press RETURN after each example):'',r       °
  213.  ' 'show ''5+3'' ''6-12'' ''4⌡2'' ''25÷5''' 'do'                               °
  214.   '''Now try to use the keyboard as if it were a hand calculator.'''           °
  215.   '''Enter as many problems (i.e. samples of addition division etc) as''       °
  216.  ' '''you wish, but when you press ENTER on a blank line, the lesson'''        °
  217.   '''will continue. If you press the wrong key, backspace and re enter.'       °
  218.  '' 'do'                                                                       °
  219.   '''You may have entered an expression that could not be evaluated.'''        °
  220.   '''If you have not, then do it now: Enter some meaningless text,'''          °
  221.   '''and then press ENTER. (Press enter again after reading the message)       °
  222.  ''' 'do'                                                                      °
  223.   '''There is a way to enter text: It must be in (SINGLE) quotes.'',r'         °
  224.   'show ''''''THIS IS SAMPLE TEXT'''''''                                       °
  225.   '''When APL2 evaluates text, it merely strips off the quotes, and'''         °
  226.   '''"echoes"  the text on the screen.'',r' '''Now you try it:''' 'do'         °
  227. X 'endd'                                                                       °
  228. *(1997 8 22 12 37 29 500)                                                      °
  229.  FTEACH3 ÉFX 'TEACH3' 'Σ Describe APL2 data types' 'exit ''TEACH3'''           °
  230.   '''You have just seen how APL2 handles numbers and characters.'',r'          °
  231.   '''In APL2, these are the only DATA TYPES.''' 'do'                           °
  232.   '''A number can be an INTEGER (a whole number like 12) or it can be'''       °
  233.   '''a REAL number (a number with a decimal point like 12., 3.45).'''          °
  234.   '''A real number can also be represented in SCIENTIFIC NOTATION'''           °
  235.   '''(3.45 can be written as 0.345E1).'',r' 'show ''12 3.45 0.345E1'''         °
  236.   '''Notice that these numbers can be entered on a single line. Note'''        °
  237.   '''also that APL2 evaluated that line, and RETURNED the result.'',r'         °
  238.   '''A line of numbers as in the example above is called a VECTOR.'',r'        °
  239.   '''Write a vector containing four numbers:''' 'do'                           °
  240.   '''Actually a string of characters enclosed in quotes is also called''       °
  241.  ' '''a vector.'',r' 'show ''''''GEORGE'''''''                                 °
  242.   '''The string ''''GEORGE'''' is a CHARACTER VECTOR of length 6.'',r'         °
  243.   'do' '''In APL2 a vector is defined by two characteristics:'',r'             °
  244.   ''' 1. It''''s contents''' ''' 2. Its length'',r'                            °
  245.   '''You can even mix characters AND numbers:'',r'                             °
  246.   'show ''''''THIS VECTOR IS MIXED:'''' 2 3 4 5'''                             °
  247.   '''WARNING: A character vector may look like numeric:'',r'                   °
  248.   'show ''''''2.34 5.71 32 65'''''''                                           °
  249.   '''Before such a character vector can be processed numerically, it'''        °
  250.   '''must first be converted to NUMERIC. In a later lesson we will'''          °
  251.   '''learn how to do these things. For now do not worry about it.'',r'         °
  252.   'do'                                                                         °
  253.   '''There is one other term that you should note (and for the time'''         °
  254.   '''being, ignore!). It is a SCALAR. A single character, or a single'''       °
  255.   '''number are examples of simple SCALARs.'',r' 'do'                          °
  256.   '''In the following examples 23.5678 and the letter ''''K'''' are scal       °
  257.  ars'',r' 'show ''23.5678'' ''''''K'''''''                                     °
  258.   '''Why did we use the term ''''simple scalars''''? Because in a later'       °
  259.  '' '''lesson, we will learn about other more complex entities that'''         °
  260.   '''also have the scalar properties.'',r'                                     °
  261.   '''But now, let us proceed with the elementary aspects of APL2, and'''       °
  262. X '''take a look at simple arithmetic.'',r' 'endd'                             °
  263. *(1997 8 3 12 47 25 448)                                                       °
  264.  FTEACH4 ÉFX 'TEACH4' 'Σ Simple arithmetic' 'exit ''TEACH4'''                  °
  265.   '''In APL2, it is possible to do calculation on vectors. What do we'''       °
  266.   '''mean by that? Here is an example:'',r'                                    °
  267.   'show ''5⌡3 12.34 0.666E²2'''                                                °
  268.   '''Note that each of the three numbers was multiplied by 5, and the'''       °
  269.   '''result of that computation was displayed as the result.'',r' 'do'         °
  270.   '''In many other computer languages, this process requires setting'''        °
  271.   '''up what is called a DO LOOP, which calculates the answer one'''           °
  272.   '''product at a time. Indeed, in some languages, it is required that''       °
  273.  '                                                                             °
  274.   '''all numbers in the vector must be of the same type (integers or'''        °
  275.   '''reals). In APL2 this kind of housekeeping is done by APL2, and'''         °
  276.   '''gives you the freedom to concentrate just on your problem.'',r'           °
  277.   'do' '''There is another aspect of APL2 that helps:'',r'                     °
  278.   '''The symbols for addition, subtraction, multiplication and division'       °
  279.  '' '''are the same ones you learned in school:'',r'                           °
  280.   'show ''3⌡5'' ''12-6'' ''24÷6''' 'do'                                        °
  281.   '''Did you try to divide a number by zero? Try it now!''' 'do'               °
  282.   '''As you can tell that is invalid. Now try to divide zero by zero!'''       °
  283.   'do'                                                                         °
  284.   '''APL2 will on occasion surprise you. Do not be afraid to experiment.       °
  285.  ''' 'do'                                                                      °
  286.   '''APL2 has a special name for symbols like +-⌡÷. These, and many more       °
  287.  '''                                                                           °
  288.   '''that we will introduce in time, are called PRIMITIVE FUNCTIONS.'''        °
  289.   '''All primitive functions transform (or generate data) in some way. I       °
  290.  n'''                                                                          °
  291.   '''addition to the four arithmetic functions you have just learned abo       °
  292.  ut'''                                                                         °
  293.   '''there are over fifty others. In time we will study them all, but at       °
  294.   a'''                                                                         °
  295.   '''slow pace. You will get a chance to get thoroughly acquainted with'       °
  296.  '' '''each one of them.''' 'do'                                               °
  297.   '''We will also learn about other aspects of this language. We will se       °
  298.  e'''                                                                          °
  299.   '''how to go about defining new functions by combining one or more APL       °
  300.  2'''                                                                          °
  301.   '''expressions. These are the so called USER DEFINED FUNCTIONS. They a       °
  302.  re'''                                                                         °
  303.   '''roughly equivalent to programs in other programming languages.'''         °
  304. X 'endd'                                                                       °
  305. *(1997 8 22 12 40 51 600)                                                      °
  306.  FTEACH5 ÉFX 'TEACH5' 'Σ Discuss negative numbers' 'exit ''TEACH5'''           °
  307.   '''Earlier we did some simple arithmetic calculations.You may have not       °
  308.  iced'''                                                                       °
  309.   '''a curious effect when subtracting a large number from a smaller one       °
  310.  :'',r' 'show ''5-12'''                                                        °
  311.   '''APL2 makes a distinction between the PROCESS of changing the sign''       °
  312.  '                                                                             °
  313.   '''of a number, and the PROPERTY of numbers being less than zero.'',r'       °
  314.   'show ''-2'''                                                                °
  315.   '''In this example we apply a primitive FUNCTION to the scalar 2. The'       °
  316.  ''                                                                            °
  317.   '''name of the function is NEGATION and its symbol - is called the MIN       °
  318.  US'''                                                                         °
  319.   '''sign. The result of the evaluation is a number called NEGATIVE TWO.       °
  320.  ''' '''The special symbol (²) is called a HIGH MINUS.'',r'                    °
  321.   '''High minus is NOT a function. It describes the fact that the value        °
  322.  of'''                                                                         °
  323.   '''the number is less than zero. The high minus should be considered t       °
  324.  o'''                                                                          °
  325.   '''be part of numeric notation, much the same as the usage of the (.)'       °
  326.  ''                                                                            °
  327.   '''period to separate the integral portion of a number from its fracti       °
  328.  onal'''                                                                       °
  329.   '''part. (Another example of numeric notation is the usage of the lett       °
  330.  er'''                                                                         °
  331.   '''E in scientific notation. The E represents a power of 10, as in 1.2       °
  332.  E2.)''' 'do'                                                                  °
  333.   '''The minus symbol on the other hand IS a primitive function. It chan       °
  334.  ges''' '''the sign of ALL components to the right:'',r'                       °
  335.   'show ''-2 ²5 7'''                                                           °
  336.   '''When you think about it, changing the sign of any number is the sam       °
  337.  e''' '''as subtracting that number from zero.'',r' 'show ''0-2 ²5 7'''        °
  338.   '''Any function that can be applied to ONLY its right argument has a''       °
  339.  '                                                                             °
  340.   '''special name. It is called MONADIC. So what do we call functions'''       °
  341.   '''that need both a left AND a right argument? We call them DYADIC.'''       °
  342.   '''(Again, don''''t worry about the terminology; you will get used to        °
  343. Xit.)''' 'endd'                                                                °
  344. *(1997 5 4 11 52 32 484)                                                       °
  345.  FTEACH6 ÉFX 'TEACH6' 'Σ Introduction to character manipulation'               °
  346.   'exit ''TEACH6'''                                                            °
  347.   '''Earlier we said that there are only two types of data: numbers and'       °
  348.  ''                                                                            °
  349.   '''text (or more specifically characters). So far we have done some'''       °
  350.   '''elementary processing of numbers. Let us now take a look at text.''       °
  351.  '                                                                             °
  352.   '''Are there primitive functions to manipulate text, and if there are'       °
  353.  '' '''how useful are they?''' 'do'                                            °
  354.   '''Here is an example of a primitive function that can be used in the'       °
  355.  '' '''evaluation of an expression containing text only:'',r'                  °
  356.   'show ''''''MISSISSIPPI''''=''''S'''''''                                     °
  357.   '''We could just as well have written this as:'',r'                          °
  358.   'show ''''''S''''=''''MISSISSIPPI'''''''                                     °
  359.   '''The result is a string of zeros and ones. The length of this string       °
  360.  '''                                                                           °
  361.   '''is the same as the length of the word MISSISSIPPI, and the one''''s       °
  362.  ''' '''correspond to the location of the letter S.''' 'do'                    °
  363.   '''The vector of zeros and ones is a special type of numeric data'''         °
  364.   '''called BOOLEAN. A boolean zero is equivalent to the word ''''false'       °
  365.  ''','''                                                                       °
  366.   '''and a boolean one corresponds to the word ''''true''''. As we will        °
  367.  see'''                                                                        °
  368.   '''in later lessons, a boolean vector has many uses. But now, how coul       °
  369.  d'''                                                                          °
  370.   '''we find what letters in MISSISSIPPI are NOT S? One way would be to'       °
  371.  '' '''write'',r' 'show ''1-''''S''''=''''MISSISSIPPI'''''''                   °
  372.   '''But there is an easier way'',r'                                           °
  373.   'show ''''''S''''⌠''''MISSISSIPPI'''''''                                     °
  374.   '''As you learn APL2, you will discover that there is always more than       °
  375.  '''                                                                           °
  376.   '''one way to solve a problem. A good way of becomming truly profficie       °
  377.  nt'''                                                                         °
  378.   '''in the language is to try finding at least two DISTINCT ways to sol       °
  379.  ve''' '''a problem.'',r'                                                      °
  380.   '''The symbols = and ⌠ will work with numbers too'',r'                       °
  381.   'show ''4=1 2 3 4 5 6'' ''4⌠1 2 3 4 5 6'''                                   °
  382.   '''These symbols belong to a group of primitive functions called'''          °
  383.   '''RELATIONAL. These also include GREATER-THAN, LESS-THAN and others.'       °
  384.  ''                                                                            °
  385.   '''We will study these later. For now, we should point out that only t       °
  386.  he''' '''= and the ⌠ work with character strings.''' 'do'                     °
  387.   '''Before we leave this very brief introduction to character data'''         °
  388.   '''processing, let us take a look at yet another primitive function:''       °
  389.  ,r' 'show ''''''ABORIGINE''''ε''''AEIOU'''''''                                °
  390.   '''What do you suppose this function does? Go ahead, and try ε on some       °
  391.  ''' '''other examples.'''                                                     °
  392.   '''(REMEMBER: Use the OPTIONS menu bar -with MODIFY KEYBOARD- to find'       °
  393.  '' '''           out how to produce any given symbol!!)''' 'do'               °
  394.   '''You can also use this primitive in numeric data. Try it:''' 'do'          °
  395.   '''The function is called MEMBER OF, and produces a boolean vector of'       °
  396. X'' '''the same length as the LEFT argument.''' 'endd'                         °
  397. *(1997 5 4 11 59 53 596)                                                       °
  398.  FTEACH7 ÉFX 'TEACH7;NUMBERS;SUPERCALIFRAGILIST;A;B;C'                         °
  399.   'Σ Explain the assignement arrow' 'exit ''TEACH7'''                          °
  400.   '''So far we have used the keyboard as if it were that of a hand'''          °
  401.   '''calculator. The screen served us as a kind of memory. Indeed, it is       °
  402.  '''                                                                           °
  403.   '''possible to use the results of a previous calculation to continue''       °
  404.  '                                                                             °
  405.   '''solving a more complex problem. To see how this could be done, try'       °
  406.  '' '''the following:'',r' ''' 1. Multiply two numbers'''                      °
  407.   ''' 2. Move the cursor to the line with the result, and then move the'       °
  408.  '' '''    cursor just to the right of the last digit.'''                      °
  409.   ''' 3. use the divide symbol followed by another number, and press ENT       °
  410.  ER''' 'do'                                                                    °
  411.   '''If you followed these instructions, the second expression was displ       °
  412.  ayed'''                                                                       °
  413.   '''below the result of the first expression, and the result of the sec       °
  414.  ond'''                                                                        °
  415.   '''expression was displayed below that one. You can proceed in this ma       °
  416.  nner'''                                                                       °
  417.   '''indefinitely. We should point out that this thechnique IS NOT part        °
  418.  of'''                                                                         °
  419.   '''APL2. It can be done because APL2/OS2 supports this particular type       °
  420.   of''' '''editor.'',r' 'do'                                                   °
  421.   '''There is a special symbol, called the LEFT ARROW ╜ '''                    °
  422.   '''This symbol is not exactly a primitive function. It is part of APL2       °
  423.  ''' '''SYNTAX. This is a set of rules that describe how valid APL2'''         °
  424.   '''expressions are to be generated, and how they are evaluated.'',r'         °
  425.   '''When the LEFT ARROW is used, it is called an ASSIGNMENT ARROW. It i       °
  426.  s'''                                                                          °
  427.   '''used to send the result of an expression to a VARIABLE. The process       °
  428.  '''                                                                           °
  429.   '''of storing data in variables is called SPECIFICATION. Why the speci       °
  430.  al'''                                                                         °
  431.   '''terminology? Because there is more to this, as we will see in later       °
  432.  ''' '''lessons. But now let us see how it works'',r'                          °
  433.   'show ''NUMBERS╜1 2 3 4 5'''                                                 °
  434.   '''Note that the evaluation of this expression fails to echo the resul       °
  435.  t'''                                                                          °
  436.   '''on the screen. This is because the result is STORED elsewhere, name       °
  437.  ly'''                                                                         °
  438.   '''in a VARIABLE called NUMBERS. To obtain that result on the screen,        °
  439.  we''' '''merely enter NUMBERS, and press ENTER'',r' 'show ''NUMBERS'''        °
  440.   '''Data may be assigned to more than one variable (MULTIPLE SPECIFICAT       °
  441.  ION)'',r' 'show ''A╜B╜C╜2 3 4'' ''A'' ''B'' ''C'''                            °
  442.   '''In APL2 the name of a variable can be any character string starting       °
  443.  '''                                                                           °
  444.   '''with a letter, and containing letters, digits, or a few aditional''       °
  445.  '                                                                             °
  446.   '''special characters. (For the time being we will just stick to lette       °
  447.  rs).'''                                                                       °
  448.   '''There is a limit to the length of the name of a variable but it is        °
  449.  so''' '''large, you do not have to worry about it:'',r'                       °
  450.   'show ''SUPERCALIFRAGILISTICEXPIADOCIOUS╜1234.56789'''                       °
  451.   'show ''SUPERCALIFRAGILISTICEXPIADOCIOUS'''                                  °
  452.   '''The same name can be used over again, but when it is, the previousl       °
  453.  y''' '''stored data are lost'',r'                                             °
  454.   'show ''NUMBERS╜''''ONE TWO THREE FOUR FIVE'''''' ''NUMBERS'''               °
  455.   '''Why don''''t you get acquainted with the assignment arrow. Enter a        °
  456.  word,'''                                                                      °
  457.   '''followed by the ╜. Then, following the ╜ enter any expression of th       °
  458.  e''' '''kind that we have already explored.''' 'do'                           °
  459.   '''Now write another expression that includes your stored word.'''           °
  460. X 'endd'                                                                       °
  461. *(1997 8 22 12 43 29 524)                                                      °
  462.  FTEACH8 ÉFX 'TEACH8;NOS' 'Σ Introduce SHAPE and RESHAPE'                      °
  463.   'exit ''TEACH8'''                                                            °
  464.   '''Earlier we stated that a vector is composed of two parts. Do you'''       °
  465.   '''remember what those parts were?''' 'non'                                  °
  466.   '''One part was the length of the vector, and the other part was the''       °
  467.  '                                                                             °
  468.   '''data. Since the length of a vector is ''''known'''' by APL2, then i       °
  469.  t'''                                                                          °
  470.   '''should be possible to get that information from APL2. Indeed, there       °
  471.  '''                                                                           °
  472.   '''is a primitive function that returns the length of a vector. It is'       °
  473.  '' '''called SHAPE, and it uses the symbol µ.'',r'                            °
  474.   'show ''µ1 2 3 4'' ''µ''''TEXT'''''' ''NAME╜''''GEORGE'''''' ''µNAME''       °
  475.  '                                                                             °
  476.   '''Shape is a monadic primitive function. It is interesting to compare       °
  477.  '''                                                                           °
  478.   '''the assignment statement and function shape to usage of the same'''       °
  479.   '''concepts in other programming languages. In other languages it is''       °
  480.  '                                                                             °
  481.   '''customary to specify the size (DIMENSION) of data in advance, even'       °
  482.  ''                                                                            °
  483.   '''before a code is compiled. APL2 supports not only what is called'''       °
  484.   '''late binding (i.e. assigning data to a variable during execution)''       °
  485.  '                                                                             °
  486.   '''but also the amount of storage that is required to hold that data.'       °
  487.  '' 'do'                                                                       °
  488.   '''There is an upper limit to the length of a vector, but again, it is       °
  489.  '''                                                                           °
  490.   '''so large that you need not be concerned with it for the time being.       °
  491.  '''                                                                           °
  492.   '''There is, however, another question that you may ask. why call it''       °
  493.  '                                                                             °
  494.   '''shape, and not length? To answer that question, let us look at a'''       °
  495.   '''DYADIC usage of the symbol µ.'',r'                                        °
  496.   'show ''NOS╜1 2 3 4 5 6 7 8 9 10 11 12'' ''5µNOS'' ''3 4µNOS'''              °
  497.   '''We stored in NOS the first 12 integers. Then we asked to display'''       °
  498.   '''a vector containing the first five elements of NOS. Last, we'''           °
  499.   '''asked to display NOS in 3 rows of four columns each.'',r' 'do'            °
  500.   '''This dyadic usage of µ is called RESHAPE. In other words, the'''          °
  501.   '''monadic form of µ (called shape) tells us how the data is'''              °
  502.   '''organized in storage, and the dyadic form of µ (reshape) tells'''         °
  503.   '''how to organize data in storage. Incidentally, when data are stored       °
  504.  '''                                                                           °
  505.   '''in rows and columns, we no longer deal with vectors. We call such''       °
  506.  ' '''data ARRAYS.'',r' 'show ''µ3 4µNOS'''                                    °
  507.   '''Here we asked to shape the contents of NOS into an array of 3 rows'       °
  508.  ''                                                                            °
  509.   '''and four columns, and then we asked for the shape of that array.'',       °
  510.  r'                                                                            °
  511.   '''There is another aspect of this last example. Do you see what it is       °
  512.  ?''' 'non'                                                                    °
  513.   '''The evaluation proceeds from right to left! We will discuss that'''       °
  514.   '''in another lesson.''' 'do'                                                °
  515.   '''What do you suppose will happen if we ask to generate a vector, or'       °
  516.  ''                                                                            °
  517.   '''an array that needs more entries than what we supply in the right''       °
  518.  ' '''argument?''' 'do' 'show ''2 5µ''''ONE TWO '''''''                        °
  519.   '''Right, after the last element (scalar) is used up, the next one is'       °
  520.  '' '''taken from the front of the vector. What about this?'',r'               °
  521.   'show ''ARRAY╜2 2µ1 2 3 4'''                                                 °
  522.   '''What do you suppose will happen if we were to write: 4 4µARRAY'''         °
  523.   'do'                                                                         °
  524.   '''There is a lot to be said about arrays, but we will postpone that''       °
  525.  ' '''discussion for another lesson. Right now we will introduce one'''        °
  526.   '''final symbol, and the associated monadic and dyadic functions.'''         °
  527. X 'endd'                                                                       °
  528. *(1997 5 4 12 4 50 368)                                                        °
  529.  FTEACH9 ÉFX 'TEACH9;TEST' 'Σ Describe INDEX GENERATOR and INDEX OF'           °
  530.   'exit ''TEACH9'''                                                            °
  531.   '''We have used the ordinal sequence of numbers in several examples'''       °
  532.   '''so far. This sequence (counting numbers 1 2 3 4 5 ...) is so useful       °
  533.  '''                                                                           °
  534.   '''that there is a special primitive function for it. The symbol ∞,'''       °
  535.   '''is used with a scalar integer right argument. The function is'''          °
  536.   '''sometimes called INTERVAL, and sometimes INDEX GENERATOR. You may''       °
  537.  '                                                                             °
  538.   '''prefer to just call it IOTA, which is the name of the Greek letter        °
  539.  ∞.'',r' 'show ''∞10'''                                                        °
  540.   '''Although the sequence begins with a 1, it is possible to give a spe       °
  541.  cial'''                                                                       °
  542.   '''command (to be learned in a later lesson) so that it starts with a        °
  543.  zero.'''                                                                      °
  544.   '''But even now, we should be able to begin a sequence with an arbitra       °
  545.  ry''' '''value:'',r' 'show ''²1+∞5'' ''10.23+∞4'''                            °
  546.   '''You should even be able to generate an arbitrary arithmetic progres       °
  547.  sion'''                                                                       °
  548.   '''(To refresh your memory an arithmetic progression begins with some'       °
  549.  ''                                                                            °
  550.   '''arbitrary number, and each consecutive element equals the last one        °
  551.  plus'''                                                                       °
  552.   '''a constant. Here is an example: the sequence 3 7 11 15 19 ... begin       °
  553.  s''' '''with a 3, and each aditional term is increased by 4):'',r'            °
  554.   'show ''²1+4⌡∞5'''                                                           °
  555.   '''Just as an exercise, generate a sequence of ten numbers that begins       °
  556.  ''' '''with 23 and increments by 33 and store it in variable AS.'''           °
  557.   'do'                                                                         °
  558.   '''There is a well known story about arithmetic progressions. You may'       °
  559.  '' '''display it by entering GAUSS, and pressing Enter.'''                    °
  560.   'AS╜²10+33⌡∞10' 'do'                                                         °
  561.   '''The monadic iota is very useful, but so is its dyadic version. When       °
  562.  '''                                                                           °
  563.   '''∞ is preceeded by a left argument, the primitive function is called       °
  564.  ''' '''INDEX OF. The operation is best described by an example:'',r'          °
  565.   'show ''AS'' ''AS∞56'' ''AS∞122 188 56'''                                    °
  566.   '''The result is the location of the right argument in the left vector       °
  567.  .'''                                                                          °
  568.   '''The SCALAR 56 is the second element of AS. The fourth and sixth'''        °
  569.   '''values are 122 AND 188.'',r'                                              °
  570.   '''As you can see from the example, the left argument is a vector.'''        °
  571.   '''The right argument could be a scalar, a vector or even an array.'',       °
  572.  r'                                                                            °
  573.   'show ''ALPHA╜''''ABCDEFGHIJKLMNOPQRSTUVWXYZ'''''' ''ALPHA∞''''C''''''       °
  574.  '                                                                             °
  575.   'show ''ALPHA∞''''HOUSE'''''' ''BOX╜2 3µ''''CATDOG'''''' ''BOX'' ''ALP       °
  576.  HA∞BOX'''                                                                     °
  577.   '''The usage of dyadic iota can be summarized in the following APL2'''       °
  578.   '''terminology: The result has the same shape as the right argument,''       °
  579.  '                                                                             °
  580.   '''and contains integers at most equal to ONE PLUS the shape of the'''       °
  581.   '''left argument. One plus??? Where does this come from?''' 'do'             °
  582.   'show ''''''AEIOU''''∞''''MISSISSIPPII'''''''                                °
  583.   '''The right argument (MISSISSIPPI) contains 11 letters, as does the''       °
  584.  '                                                                             °
  585.   '''resulting integer vector. The left argument has five letters. The''       °
  586.  '                                                                             °
  587.   '''letters in MISSISSIPPI not found in the left argument, have been'''       °
  588. X '''assigned the interger 6 (one plus 5).''' 'endd'                           °
  589. *(1997 9 14 12 36 15 412)                                                      °
  590.  FTEACHER ÉFX 'TEACHER' 'Σ Instructions to teacher'                            °
  591.   '''The overall plan of this course is to start with simple concepts'''       °
  592.   '''so that students may begin solving problems almost from the'''            °
  593.   '''beginning.'',r'                                                           °
  594.   '''As lessons advance, new concepts, primitive functions, grammar and'       °
  595.  ''                                                                            °
  596.   '''operators are introduced. The particular sequence depends on the'''       °
  597.   '''needs of the current objective. The lessons are written in a'''           °
  598.   '''modular fashion. Whithin each lesson, there are functions named'''        °
  599.   '''TEACH1, TEACH2, ... and so on. These functions are controlled by a'       °
  600.  ''                                                                            °
  601.   '''DRIVER function called TEACH. TEACH is also the latent variable in'       °
  602.  '' '''the workspace.''' 'do'                                                  °
  603.   '''This modularity makes it easy to design alternate approaches to'''        °
  604.   '''teaching APL2. Merely develop a workspace that controls access to''       °
  605.  '                                                                             °
  606.   '''selected functions from the TEACH workspaces. Since all functions''       °
  607.  '                                                                             °
  608.   '''are named TEACHn, extraction of specific functions from different''       °
  609.  ' '''workspaces should be simplified.'',r'                                    °
  610.   '''Workspace INDEX contains information about the contents of individu       °
  611.  al'''                                                                         °
  612.   '''functions in different workspaces. You may use function FIND to fin       °
  613.  d'''                                                                          °
  614.   '''discussions on specific subjects. Function CONTENTS is a table of''       °
  615.  '                                                                             °
  616.   '''contents of all lessons. Function RULES summarizes rules given in t       °
  617.  he''' '''lessons.'',r'                                                        °
  618.   '''On that point, the concept of rules is designed to focus on importa       °
  619.  nt'''                                                                         °
  620.   '''aspects of APL2. The basic idea is much like highligting in a textb       °
  621.  ook.'''                                                                       °
  622.   '''Note also that some lessons contain functions with names other than       °
  623.  '''                                                                           °
  624.   '''TEACHn. These are not considered vital to the course, but may be'''       °
  625.   '''useful to some students in pursuing further detail. Some of these''       °
  626.  '                                                                             °
  627.   '''functions deal with historical evolution of mathematical concepts,'       °
  628.  ''                                                                            °
  629.   '''while others provide a more general background, or more specific'''       °
  630.   '''examples.'',r'                                                            °
  631.   '''NOTE: If you use the ")IN .. INDEX" command, follow this by enterin       °
  632.  g''' '''      lx''' 'do'                                                      °
  633.   '''Finally, each lesson begins with a brief review of the material'''        °
  634.   '''covered in the previous lesson. This course was designed primarily'       °
  635.  ''                                                                            °
  636.   '''for self study. In a course given to a large class, portions of'''        °
  637.   '''the material could be projected on the screen. Any feedback on the'       °
  638.  '' '''the effectiveness of the TEACHn workspaces would be greatly'''          °
  639.   '''appreciated. Please mail your comments to:'',r'                           °
  640.   '''                          Zdenek V. Jizba'''                              °
  641.   '''                          1341 Rebecca Drive'''                           °
  642.   '''                          La Habra, CA 90631'''                           °
  643. X '''e-mail: jizba@kaiwan.com''' 'endd'                                        °
  644. *(1997 7 13 12 28 49 504)                                                      °
  645.  Faddquote ÉFX 'u╜addquote w'                                                  °
  646.   'Σ Put quotes around a string, and double existing quotes'                   °
  647. X 'u╜ÉAV[40],((1+w=ÉAV[40])/w),ÉAV[40]'                                        °
  648. *(1996 4 6 15 55 24 480)                                                       °
  649. XFaq ÉFX 'U╜aq W' 'U╜Γaddquote W'                                              °
  650. *(1997 7 24 13 20 38 476)                                                      °
  651.  Fav ÉFX 'av;A;N;I;ÉIO' 'Σ Display characters in ÉAV' 'ÉIO╜0'                  °
  652.   'A╜22 78µ'' ''' 'N╜3 0«φ12 22µ1+∞356' 'A[;,(6⌡∞12)°.+2 3 4]╜N'               °
  653.   'A[;6+6⌡∞12]╜φ12 22µÉAV' 'ΣA[8 10 13;6]╜'' ''' 'A[13;6]╜'' '''               °
  654. X 'A[14+∞8;68 69 70 72]╜'' ''' 'A'                                             °
  655. *(1991 11 11 8 25 13 316)                                                      °
  656.  Fdate ÉFX 'u╜date w' 'Σ Format date and time of day' 'u╜«6╞w'                 °
  657. X 'u╜('' ''⌠u)Γu' 'u╜εu,■''-- .. '''                                           °
  658. XCdig 1 10 1234567890                                                          °
  659. *(1997 9 9 13 0 45 372)                                                        °
  660.  Fdisclaimer ÉFX 'disclaimer' 'Σ Copyright statement'                          °
  661.   '(10µ'' ''),''Copyright, Z. V. Jizba, 1995,1996,1997'',r'                    °
  662.   ''' This and subsequent workspaces labelled TEACHxx are made available       °
  663.  '''                                                                           °
  664.   '''at no cost to anyone who desires to learn how to use effectively'''       °
  665.   '''the IBM/OS2 version of APL2.'',r'                                         °
  666.   '''This software is provided "AS IS" with no WARRANTY of any kind, eit       °
  667.  her'''                                                                        °
  668.   '''express or implied. Any risk in its use resides with you, the user        °
  669.  of''' '''these tutorials.'',r' '''     ACKNOWLEDGEMENTS'',r'                  °
  670.   ''' In writing these tutorials, I am greatly indebted to Roy Sykes, wh       °
  671.  ose'''                                                                        °
  672.   '''excellent lectures increased my understanding of the language.'''         °
  673.   '''Discussions with the late Harry Bertucelli clarified a number of'''       °
  674.   '''concepts and caused me to change some improper terminology that was       °
  675.  '''                                                                           °
  676.   '''used in previous versions of these tutorials. Mr. Benjamin Archer''       °
  677.  '                                                                             °
  678.   '''kindly checked out a nearly final version, bringing to my attention       °
  679.  ''' '''some ommisions, misspellings, and invalid terminology.'',r'            °
  680. X '''(PRESS ENTER to continue)'''                                              °
  681. *(1997 7 13 12 28 50 508)                                                      °
  682.  Fdo ÉFX 'do;T;E' 'Σ Expression driver' 'E╜''''' 'æ╜''      ''' 'T╜æ'          °
  683.   '╕(^/'' ''=T)/0'                                                             °
  684.   '╕(('':''εT)doif ''B╜evaldd (+/^\'''' ''''=T)╟T'')/2'                        °
  685.   '''E╜ÉEM'' ÉEA T' '╕(0=µ,E)/2'                                               °
  686.   '''This is not a valid APL2 expression''' 'æ╜''*''' '╕(''?''⌠╞1╟æ)/2'        °
  687. X 'E' '╕2'                                                                     °
  688. *(1997 7 13 12 28 50 508)                                                      °
  689.  Fdoif ÉFX 'U╢╜V╢ doif W╢;t╢' 'Σ Rule' '╕(^/~U╢╜V╢)/0'                         °
  690. X '''U╢╜V╢ doif■ W╢'' ÉEA ''»V╢/W╢'''                                          °
  691. *(1997 9 9 12 50 14 444)                                                       °
  692.  Fendd ÉFX 'endd' 'Σ end of special feature' '20µ''²'' ╪ ╕(4<µÉLC)/0'          °
  693. X 'do'                                                                         °
  694. *(1997 9 14 12 59 18 516)                                                      °
  695.  Ferase ÉFX                                                                    °
  696.   'erase;t;EXIT;HELP;KEYS;DISPLAY;GAUSS;KEYBOARD;TEACHER;DISCLAIMER;GO'        °
  697.   'Σ Erase all global functions and variables' 't╜ÉNL 3'                       °
  698.   't╜(~t^.εlc,'' '')≡t' 't╜ÉEX(~t[;∞5]^.=''TEACH'')≡t' 't╜ÉNL 2'               °
  699. X 't╜ÉEX(~t^.εlc,'' '')≡t' 't╜ÉNL 4' 't╜ÉEX(~t^.εlc,'' '')≡t'                  °
  700. *(1997 7 27 13 47 41 608)                                                      °
  701.  Fevaldd ÉFX 'u╜evaldd w;c;n' 'Σ Evaluate direct definition' 'u╜0'             °
  702.   'n╜(w∞''Σ'')-1' 'c╜(((n╞w)⌠'':'')Γn╞w),Γ''ΣDD '',(n+1)╟w'                    °
  703.   '╕((1 label╞c)doif ''''''Invalid label'''''')/0'                             °
  704.   '╕((2=µc)doif ''u╜showdd 1╙c'')/0'                                           °
  705.   '╕((3=ÉNC╞c)doif ''u╜⌡µÉ╜(╞c),'''' is already defined.'''''')/0'             °
  706.   '╕((3=µc)doif ''u╜simdd c'')/0' 'c╜(Γ''α∙ aw'')replace■c'                    °
  707.   'u╜ε''u╜'',((''a''εεc[2 3 4])/''a ''),(╞c),'' w;t;b'''                       °
  708.   'u╜u(5πc)(''b╜(t╜'',(3πc),'')/'',addquote ''u╜'',4πc)'                       °
  709. X 'u╜u,''╕(t doif b)/0''(''u╜'',2πc)' 'u╜╧ÉFX u'                               °
  710. *(1997 7 25 13 27 52 564)                                                      °
  711.  Fexit ÉFX 'V exit W;T' 'Σ Exit if too many suspended functions'               °
  712.   '╕(0⌠ÉNC ''V'')/L0 ╪ V╜10' 'L0:╕(V>µÉLC)/0'                                  °
  713.   '''There are too many suspended functions''' '''Please enter '',W'           °
  714. X '╕'                                                                          °
  715. *(1997 7 26 12 33 39 536)                                                      °
  716.  Fget ÉFX 'U╜V get W;t;T;ÉPR' 'Σ Prompt for response from keyboard'            °
  717.   'ÉPR╜T╜ÉAV[ÉIO+255] ╪ ╕(0⌠ÉNC ''V'')/L0 ╪ V╜1' 'L0:V╜V╧1' 'æ╜W ╪ t╜æ'        °
  718.   'U╜(+/^\t=T)╟t' '╕(''╕''⌠╞U)/L1 ╪ ╕' 'L1:╕V/0' 't╜(U⌠'' '')ΓU'               °
  719. X 'U╜(µt),(ΓU),t'                                                              °
  720. *(1997 7 28 13 33 8 424)                                                       °
  721.  Fglobals ÉFX 'globals' 'Σ Initialize useful global variables'                 °
  722.   'uc╜''ABCDEFGHIJKLMNOPQRSTUVWXYZ'''                                          °
  723.   'lc╜''abcdefghijklmnopqrstuvwxyz''' 'dig╜''1234567890'''                     °
  724. X 'r╜ÉAV[13+ÉIO]' 'q╜'''''''''                                                 °
  725. *(1997 8 24 12 13 16 360)                                                      °
  726.  Finitialize ÉFX 'initialize;T' 'Σ Initialize workspace'                       °
  727.   '''AT ALL TIMES, TO CONTINUE, PRESS RETURN!'',r'                             °
  728.   '''To see disclaimers enter:'',r,''    disclaimer''' 'do' 'erase'            °
  729.   'globals'                                                                    °
  730.   '''Make sure the CAP LOCK light on your keyboard (upper right) is ON!'       °
  731.  ''                                                                            °
  732.   '''    (PRESS SEVERAL TIMES ON THE CAPS LOCK KEY AND NOTE THE CAPS LOC       °
  733.  K''' '''     LIGHT GO ON AND OFF. STOP WHEN THIS LIGHT IS ON.)'''             °
  734. X 'endd'                                                                       °
  735. *(1997 7 27 13 14 33 444)                                                      °
  736.  Flabel ÉFX 'u╜v label w'                                                      °
  737.   'Σ Return 1 if label w does not begin with a cap'                            °
  738.   '╕(0⌠ÉNC ''v'')/L0 ╪ v╜0' 'L0:v╜v╧1 ╪ w╜εw ╪ ╕v/L1 ╪ ╕(u╜0⌠ÉNC w)/0'         °
  739. X 'L1:╕(u╜~^/wεlc,uc,dig)/0' 'u╜w[1]εlc,dig'                                   °
  740. XClc 1 26 abcdefghijklmnopqrstuvwxyz                                           °
  741. *(1997 7 13 12 28 55 528)                                                      °
  742.  Fnon ÉFX 'non;T;RC;ET;R' 'Σ Ignore keyboard entry' 'æ╜''      ''' 'T╜æ'       °
  743.   '╕(0=µ(T⌠'' '')/T)/0' '(RC ET R)╜ÉEC T' '╕(0=RC)/2'                          °
  744. X '╕((1=RC)doif ''R'')/2' '╕2'                                                 °
  745. *(1997 7 13 12 28 55 528)                                                      °
  746.  Fnotb ÉFX 'u╜notb w' 'Σ Remove trailing blanks'                               °
  747.   '╕((1<╧w)doif ''u╜notb■ w'')/0' '╕((1<µµw)doif ''u╜πnotb Γ[2]w'')/0'         °
  748. X 'u╜(1-(,'' ''⌠Φw)∞1)╟w'                                                      °
  749. XCq 0 '                                                                        °
  750. XCr 0                                                                         °
  751. *(1997 7 13 12 28 56 532)                                                      °
  752.  Freplace ÉFX 'u╜v replace u;i;r;s' 'Σ Replace elements in v in u'             °
  753.   'i╜Γ∞µu' 's╜2πv╜(v⌠'' '')Γv' 'i╜⌡r╜i⌡■Γ[1]u°.=╞v'                            °
  754. X 'u[(εi)/εr]╜s[(εi)/εi⌡■∞µs]'                                                 °
  755. *(1997 7 13 12 28 56 532)                                                      °
  756.  Fround ÉFX 'U╜V round W' 'Σ Half adjust to V th decimal'                      °
  757. X 'U╜(╛0.5+W⌡10*V)÷10*V'                                                       °
  758. *(1997 7 13 12 28 57 536)                                                      °
  759.  Fshow ÉFX '╢V show ╢W;╢T;╢B' 'Σ Display and execute ╢W'                       °
  760.   '╢T╜(0=ÉNC ''╢V'')doif ''╢V╜0'''                                             °
  761.   '╕((0=╧╢W)doif ''show ╢W,'''' '''''')/0'                                     °
  762.   '╕((1<╧╢W)doif ''╢V show ■╢W'')/0' '''      '',╢W'                           °
  763. X '╕((╢V^'':''ε╢W)doif ''╢T╜evaldd ╢W'')/L0' '''ÉEM'' ÉEA ╢W' 'L0:do'          °
  764. *(1997 7 13 12 28 57 536)                                                      °
  765.  Fshowdd ÉFX 'u╜showdd w;a;b;c;r'                                              °
  766.   'Σ Display a direct definition function'                                     °
  767.   '╕((1=╧w)doif ''u╜showdd Γw'')/u╜0'                                          °
  768.   '╕((3⌠ÉNC╞w)doif ''(ε╞w),'''' is not a function'''''')/0'                    °
  769.   'c╜Γ[2]ÉCR╞w' 'c╜notb(2╞c),(Γ''aw α∙'')replace■2╟c'                          °
  770.   '╕((~''ΣDD''╧3╞2πc)doif ''''''Not a direct definition function'''''')/       °
  771.  0' 'u╜1' 'b╜('' ''⌠╞c)Γ╞c' 'a╜''      ''' 'r╜2╟3πc'                           °
  772.   '╕((3=µc)doif ''a,(╞w),'''':'''',r,(3<µ2πc)/''''   Σ'''',3╟2πc'')/0'         °
  773.   'a╜a,(╞w),'':'',(2╟5πc),'':''' 'b╜(+\r=''('')-+\r='')''' 'b╜b∞0'             °
  774. X 'a╜a,(²3╟(b-1)╞3╟r),'':'',2╟»(b+2)╟r' 'a,(3<µ2πc)/''  Σ'',3╟2πc'             °
  775. *(1997 7 13 12 28 57 536)                                                      °
  776.  Fshowfn ÉFX 'U╜V showfn W;F;N;T;ÉIO' 'Σ Simulate ╖W[É]'                       °
  777.   'T╜(0=ÉNC ''V'')doif ''V╜0''' 'ÉIO╜0'                                        °
  778.   'U╜r,''      '',''╖'',W,''[É]'',(╞V)╞''╖''' 'N╜1╞µF╜ÉCR W' 'N╜«∞N'           °
  779.   'N╜(N⌠'' '')ΓN' 'F╜(π''['',■N,■Γ''] ''),F'                                   °
  780.   'T╜(1<µ,V)doif ''F╜F[1╟V;]'' ''U╜''''''''''' 'U╜²1╟U,r,,F,r'                 °
  781. X 'U╜((-+/^\'' ''=ΦU)╟U),('' ╖'')[╞V],r'                                       °
  782. *(1997 7 13 12 28 58 540)                                                      °
  783.  Fsimdd ÉFX 'u╜simdd w;e' 'Σ Direct definition mode' 'u╜0'                     °
  784.   '╕((0⌠ÉNC╞w)doif ''''''Already defined'''''')/0' 'e╜''α''ε2πw'               °
  785.   'w[2]╜Γ''u╜'',''α∙ aw'' replace 2πw' 'w╜w[1 3 2]'                            °
  786. X 'w[1]╜Γε''u╜'',(e/''a ''),w[1],'' w''' 'u╜╧ÉFX w'                            °
  787. *(1992 6 3 9 59 17 424)                                                        °
  788.  Ftab ÉFX 'U╜V tab W;T;A;B;C;D;E;F;G;M;ÉPW' 'Σ Tabulate list W'                °
  789.   'T╜(0=ÉNC ''V'')doif ''V╜0''' 'M╜''Invalid data for tabulation'''            °
  790.   'V╜4╞V' 'ÉPW╜130╛30⌐G╜V[2]+79⌡V[2]=0'                                        °
  791.   'L1:╕((1<╧W)doif ''''''W╜∞0'''' ÉEA ''''W╜πW'''''')/L1'                      °
  792.   '╕(((0=µεW)δ2<µµW)doif ''U╜(~V╧4╞0)/M'')/0'                                  °
  793.   'T╜(1≥µµU╜«W)doif ''U╜πW╜(U⌠'''' '''')ΓU'''                                  °
  794.   'T╜(0<V[1])doif ''U╜(«(Φ1,╞µW)µ(V[3]µ'''' ''''),∞(╞µW)-V[3]),'''' ''''       °
  795.  ,U''' '╕(G<30)/0' 'T╜(F╜µεV[4])+C╜1╟B╜µA╜(V[3],0)╟U'                          °
  796.   'T╜⌐(1╞B)÷1⌐╛(ÉPW+F)÷T' 'U╜(E╜(V[3],C)╞U),[1](B╜T,1╟B)╞A'                    °
  797.   '''D╜εV[4]'' ÉEA ''D╜ÉAV[εV[4]+33⌡V[4]=0]''' 'L0:A╜(T,0)╟A'                  °
  798. X '╕(0=1╞µA)/0' 'U╜U,(((T+V[3]),µD)µD),E,[1]B╞A' '╕L0'                         °
  799. *(1997 7 13 12 28 59 544)                                                      °
  800.  Ftest ÉFX 'U╜V test W;P'                                                      °
  801.   'Σ Describe problem in W, (correct answer in V)' 'U╜2' 'L1:W'                °
  802.   'É╜''      ''' 'P╜æ' '''╕L0'' ÉEA ''P╜»P''' '╕(V╧P)/0'                       °
  803. X 'L0:╕(0=U╜U-1)/0' '''Incorrect. Try again''' '╕L1'                           °
  804. XCuc 1 26 ABCDEFGHIJKLMNOPQRSTUVWXYZ                                           °
  805.