home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
teach.zip
/
TEACH4A.ATF
< prev
next >
Wrap
Text File
|
1997-09-16
|
63KB
|
770 lines
XNÉIO 0 1 °
XNÉCT 0 1E²13 °
XCÉFC 1 6 .,*0_² °
XNÉRL 0 1190959745 °
XCÉPR 1 1 °
XCÉLX 1 5 TEACH °
XAA╜1-ÉIO-∞6 °
*(1996 4 6 15 59 48 592) °
FARABIC ÉFX 'ARABIC' 'Σ Origin of the arabic notation' °
'''The symbols representing numeric values (1234567890) can be traced' °
'' °
'''to a very old Hindu astronomical text called SINDHIND. In ancient'' °
' °
'''times there were many competing forms for representing numbers. In' °
'' °
'''the period from the 7th to 13th century, the Greek, Roman and Hindu °
''' °
'''notations were used extensively by different groups. The Hindu nota °
tion''' °
'''eventually proved superior because it was based on only 10 symbols, °
''' °
'''including the zero, and could be used to represent arbitrarily larg °
e''' '''numbers.'',r' °
'''Eventually the Hindu notation was adopted by Arabic scholars. When' °
'' °
'''the European translators of Arabic texts opened the doors to ancien °
t''' °
'''learning in the 13th and 14th centuries, the gradually evolving Hin °
du''' °
'''notation became known as Arabic. By the 16th century, the evolution °
''' °
'''was essentially complete as illustrated in the published works by'' °
' '''Durer.'',r' °
'''Interestingly enough, the Arabs continued to evolve their own''' °
'''notation, so that modern Arabic numerals are quite distinctive from °
X''' '''those used in the Western World.''' 'endd' °
XCB 1 4 TEXT °
XNB1 1 4 0 1 0 1 °
XNB2 1 4 0 0 1 1 °
XAC╜3 3µ('A')('B')(1)(2)(3)('A')('B')(1)(2) °
*(1997 9 14 12 30 44 504) °
XFDISCLAIMER ÉFX 'DISCLAIMER' 'Σ Copyright statement' 'disclaimer' °
*(1996 4 6 15 59 48 592) °
FDISPLAY ÉFX 'D╜S DISPLAY A;ÉIO;R;C;HL;HC;HT;HB;VL;VB;V;W;N;B' °
'Σ DISPLAY A GENERAL ARRAY IN PICTORIAL FORM' °
'Σ NORMAL CALL IS MONADIC. DYADIC CALL USED ONLY IN' °
'Σ RECURSION TO SPECIFY DISPLAY RANK, SHAPE, AND DEPTH.' 'ÉIO╜0' °
'»(0=ÉNC ''S'')/''S╜µA''' 'R╜╞µ,S Σ PSEUDO RANK.' °
'C╜''┐┌└┘'' Σ UR, UL, LL, AND LR CORNERS.' °
'HL╜''─'' Σ HORIZONTAL LINE.' °
'HC╜HL,''Θ╕'',HL,''~+ε'' Σ HORIZONTAL BORDERS.' °
'HT╜HC[(0<R)⌡1+0<╞²1╞,S]' 'ΣW╜,0╧■╞0µΓ(1⌐µA)╞A' °
'HB╜HC[3+3╛(''2⌡~A╧«A'' ÉEA ''1+╞ε0⌡(1⌐⌡/µA)╞,A'')+3⌡1<µµS]' °
'VL╜''│'' Σ VERTICAL LINE.' °
'VB╜VL,''Φ╟'' Σ VERTICAL BORDER.' °
'V╜VB[(1<R)⌡1+0<²1╞²1╟,S]' °
'»(0εµA)/''A╜(1⌐µA)µΓ╞A'' Σ SHOW PROTOTYPE OF EMPTIES.' °
'╕(1<╧A)/GEN' '╕(2<µµA)/D3' °
'D╜«A Σ SIMPLE ARRAYS.' 'W╜1╞µD╜(²2╞1 1,µD)µD' °
'N╜²1+1╟µD' '╕(0=µµA)/SS' °
'D╜(C[1],V,((W-1)µVL),C[2]),((HT,NµHL),[0]D,[0]HB,NµHL),C[0],(WµVL),C[ °
3]' '╕0' 'SS:HB╜((0 '' '')=╞0µΓA)/'' -''' °
'D╜'' '',('' '',[0]D,[0]HB,Nµ'' ''),'' ''' '╕0' °
'GEN:D╜«DISPLAY■A Σ ENCLOSED ...' 'N╜Dδ.⌠'' ''' °
'D╜(Nδ~1ΦN)≡D' 'D╜(δ≡~'' ''╤D)/D' 'D╜((1,µS)µS)DISPLAY D' °
'╕(2≥µ,S)╟D3E,0' 'D3:D╜0 ²1╟0 1╟«ΓA Σ MULT-DIMENSIONAL ...' °
'W╜1╞µD' 'N╜²1+1╟µD' °
'D╜(C[1],V,((W-1)µVL),C[2]),((HT,NµHL),[0]D,[0]HB,NµHL),C[0],(WµVL),C[ °
3]' 'D3E:N╜²2+µ,S' °
X 'V╜C[Nµ1],[0]VB[1+0<²2╟,S],[0](((²3+╞µD),N)µVL),[0]C[Nµ2]' 'D╜V,D' °
*(1996 4 6 15 59 48 592) °
FEXIT ÉFX 'EXIT' 'Σ Exit from function' '''To log off type: )OFF''' °
X '╕' °
*(1996 4 6 15 59 48 592) °
FGO ÉFX 'GO;T;E;B' 'Σ Expression driver' 'L0:B╜E╜''''' 'æ╜'' ''' °
'T╜æ' '╕(^/'' ''=T)/L0' '╕((^/'')OFF ''=5╞6╟T)doif ''EXIT'')/0' °
'╕(('':''εT)doif ''B╜evaldd (+/^\'''' ''''=T)╟T'')/L0' °
'''E╜ÉEM'' ÉEA T' '╕(0=µ,E)/L0' '╕B/L0' °
'''This is not a valid APL2 expression''' 'æ╜''*''' °
X '╕(''?''⌠╞1╟æ)/L0' 'E' '╕L0' °
*(1997 8 22 12 47 29 540) °
FHELP ÉFX 'HELP;N;I;T' 'Σ Help to student' '''WHAT TO DO'',r' °
''' ° To get out of the lesson''' ''' ENTER: EXIT''' °
''' ° To log off APL2''' °
''' FIRST, ENTER: EXIT THEN ENTER: )OFF''' °
''' ° To get help''' ''' ENTER: HELP''' °
''' ° When you see a prompt on a blank line''' °
''' ENTER AN APL2 EXPRESSION - OR JUST PRESS: ENTER''' 'do' °
''' ° If you get this line'',r' °
'''This is not a valid APL2 expression'',r,''*'',r' °
''' YOU CAN EITHER''' ''' A. PRESS: ENTER''' °
''' B. PRESS: ? and then ENTER to see what was incorrect''' °
''' in your expression causing that response'',r' 'do' °
'''HINTS'',r' °
'''This lesson is made up of '',(«N╜8),'' components named TEACHx, whe °
re''' '''the x stands for a digit:'',r' 'I╜0' °
'L0:T╜''TEACH'',(«I╜I+1)' 'T,'' '',1╟notb(ÉCR T)[2;]' '╕(N>I)/L0' °
'do' °
'''You may review either of these components separately. To do that,'' °
' °
'''first enter EXIT (and RETURN), then enter the name of the lesson.'' °
' '''component (e.g. TEACH4).'',r' °
'''To re-start the lesson, just enter TEACH'',r' °
'''When the screen fills up, it is a good idea to move the cursor to'' °
' '''the start of a convenient paragraph, and press ENTER'',r' °
'''You may also wish to press PAGE UP to review the prevous pages.''' °
'do' '''RESOURCES'',r' °
'''You may also enter ONE of the following words at a time'',r' °
X '''ARABIC Origin of the Arabic numerals''' 'endd' °
*(1997 9 16 12 37 49 560) °
FRI ÉFX 'u╜RI w;t;b' 'ΣDD' 'b╜(t╜w=4)/''u╜''''IV''''''' '╕(t doif b)/0' °
X 'u╜wµ''I''' °
*(1997 9 16 12 37 31 488) °
FRIX ÉFX 'u╜RIX w;t;b' 'ΣDD' 'b╜(t╜9=w)/''u╜''''IX''''''' °
X '╕(t doif b)/0' 'u╜RV w' °
*(1997 9 16 12 36 49 556) °
FROMAN ÉFX 'u╜a ROMAN w;t;b' 'ΣDD' °
'b╜(t╜39<w)/''u╜''''This number is too large''''''' '╕(t doif b)/0' °
X 'u╜RX w' °
*(1997 5 31 11 59 20 572) °
FRULE ÉFX 'V RULE W' 'Σ Display rules' '╕(2=ÉNC ''V'')/L0' °
X '2 rule W ╪ ╕0' 'L0:V rule W' °
*(1997 9 16 12 37 44 540) °
FRV ÉFX 'u╜RV w;t;b' 'ΣDD' 'b╜(t╜4<w)/''u╜''''V'''',RV w-5''' °
X '╕(t doif b)/0' 'u╜RI w' °
*(1997 9 16 12 37 13 416) °
FRX ÉFX 'u╜RX w;t;b' 'ΣDD' 'b╜(t╜9<w)/''u╜''''X'''',RX w-10''' °
X '╕(t doif b)/0' 'u╜RIX w' °
*(1997 8 11 12 43 22 452) °
FTEACH ÉFX 'TEACH' 'Σ Start fourth lesson in APL2 by Zdenek V JIZBA' °
'exit ''TEACH''' 'initialize' 'TEACH1 Σ Catenation and ravel' °
'TEACH2 Σ Compression' 'TEACH3 Σ Replication' °
'TEACH4 Σ N-wise reduction' 'TEACH5 Σ Logical primitive functions' °
'TEACH6 Σ Indexing; indexing function and bracket indexing' °
'TEACH7 Σ Vector specification and selective specification' °
X 'TEACH8 Σ From arabic to roman notation' 'problems' °
*(1997 5 31 11 48 47 636) °
FTEACH1 ÉFX 'TEACH1' 'Σ Review previous lesson' 'exit ''TEACH1''' °
'''In the previous lesson we learned about direct definition. Although °
''' °
'''this form of programming is not supported by APL2, it is a useful'' °
' °
'''tool in studying the language. Direct definition is supported here' °
'' °
'''by built in software, and we will use it to study primitive functio °
ns,''' '''operators, and other constructs of the language.'',r' 'do' °
'''In this lesson we will learn about those features of APL2 that are' °
'' °
'''most useful in development of algorithms. We will find out what can °
''' °
'''be done with CATENATION, BOOLEAN VECTORS, LOGICAL FUNCTIONS and''' °
'''INDEXING.'',r' °
'''Suppose we wanted to combine two words into one. Let us assume that °
''' °
'''the two words are IN and TENT. Let us try some experiments:'',r' °
'show ''''''IN'''' ''''TENT'''''' ''''''IN''''''''TENT''''''' °
'''If our goal was to generate the word INTENT, we have clearly failed °
.''' 'do' °
'''Let us see what these two expressions actually generate.''' °
'show ''DISPLAY ''''IN'''' ''''TENT'''''' ''DISPLAY ''''IN''''''''TENT °
''''''' °
'''In the first example we merely created a two element vector contain °
ing''' °
'''the two words ''''IN'''' and ''''TENT''''. In the second example, t °
he double''' °
'''quote between IN and TENT was merely converted to a single quote.'' °
' 'do' '''This provides us with a new rule:'',r' '0 RULE 9' °
'''The reason for this rule is to distinguish the end of a character'' °
' '''string quote from a quote that is PART of the string.''' 'do' °
'''But we still do not know how to combine strings into single strings °
.''' '''The comma (,) serves that purpose'',r' °
'show ''''''IN'''',''''TENT'''''' ''DISPLAY ''''IN'''',''''TENT''''''' °
'''The process of combining vectors with a comma is called CATENATION. °
''' '''It works with numbers as well'',r' °
'show ''V1╜?3µ10'' ''V2╜?3µ10'' ''DISPLAY V1 V2'' ''DISPLAY V1,V2''' °
'do' °
'''Is there a monadic version of the comma? Yes, and it is called RAVE °
L.''' °
'''We will study it in lesson 6, but right now we can state two''' °
'''properties of ravel:'',r' °
''' 1. The ravel of a scalar is a vector of length 1'',r' °
'show ''µ,5''' °
''' 2. The ravel of a vector leaves the vector unchanged'',r' °
X 'show ''µ3 4 5'' ''µ,3 4 5''' 'endd' °
*(1997 4 29 12 20 30 448) °
FTEACH2 ÉFX 'TEACH2;VECTOR;CONS' 'Σ Compression' 'exit ''TEACH2''' °
'''In lesson 2 (TEACH2) we learned about reduction, and about the''' °
'''special symbol called an OPERATOR. With the reduction operator''' °
'''we are able to do with a single keystroke what in other programming °
''' °
'''languages requires special constructs usually called DO loops.'',r' °
'''An operator certainly does not solve the problem any more efficient °
ly''' °
'''than a do loop. What it does, is to remove from you, the programmer °
''' °
'''the task of dealing with operational details that SHOULD be handled °
''' '''by the smart computer.''' 'do' °
'''Since the reduction operator provides such a NOTATIONAL advantage,' °
'' °
'''it should be no surprise that its versatility has been extended.'', °
r' °
'''We have already seen that BOOLEAN vectors contain only values zero' °
'' °
'''and one. The zero values stand for denial (no, false) while the one °
''' °
'''values stand for affirmation (yes, true). It therefore makes sense' °
'' '''to apply a boolean vector as a left argument to the reduction''' °
'''operator'',r' 'show ''1 0 0 1 0 0 0 0 1/''''REDUCTION''''''' °
'''The boolean vector has the same length as the character string. Onl °
y''' °
'''those letters are returned for which the corresponding boolean valu °
e''' °
'''is TRUE (1). This process of using boolean vectors as left argument °
''' °
'''to the reduction operator is called COMPRESSION. Unlike reduction,' °
'' '''compression does not reduce the rank of the result'',r' °
'show ''µµ''''COMPRESSION'''''' ''µµ1 1 1 0 0 0 0 0 0 1 1/''''COMPRESS °
ION''''''' '''It works just as well for numbers'',r' °
'show ''0 1 1/3 4 5'' ''(10µ1 0)/∞10''' °
'''Note that in the second example the left argument is an APL2 expres °
sion''' °
'''that returns a boolean vector. To see the great power that this giv °
es''' °
'''us, recall that we can use any primitive functions that produce a'' °
' '''boolean result.'',r' °
'show ''VECTOR╜?20µ10'' ''VECTOR'' ''(VECTOR<5)/VECTOR''' °
'''The last expression is an algorithm to extract only those elements' °
'' °
'''in the variable VECTOR, with a value less than 5. The next example' °
'' '''shows how we can use this feature with character vectors'',r' °
'show ''(''''MISSISSIPPI''''ε''''AEIOU'''')/''''MISSISSIPPI''''''' °
'''To extract consonants, we could proceed in the following way:'',r' °
'show ''CONS╜''''BCDFGHJKLMNPQRSTVWXZ''''''' °
'show ''(''''MISSISSIPPI''''εCONS)/''''MISSISSIPPI''''''' °
'''Of course one could always use'',r' °
'show ''(1-''''MISSISSIPPI''''ε''''AEIOU'''')/''''MISSISSIPPI''''''' °
'''Later in this lesson we will see yet another way to remove wowels'' °
X' '''without using CONS.''' 'endd' °
*(1997 5 31 11 50 39 612) °
FTEACH3 ÉFX 'TEACH3' 'Σ Replication' 'exit ''TEACH3''' °
'''The early versions of APL supported reduction, but it had been''' °
'''pointed out that the process could be generalized. After all,''' °
'''the boolean vector can be interpreted as saying: "Return the right' °
'' °
'''element the number of times indicated by the corresponding value''' °
'''in the left argument."'',r' °
'''Here we no longer think of the boolean vector as a YES NO switch,'' °
' °
'''but rather as a kind of multiplier or replicator. APL2 indeed does' °
'' '''support this more generalized notion of reduction, calling it''' °
'''REPLICATION'',r' °
'show ''1 1 2 0 0 0 0 1 0 0 2 0 0 1 2 0 1 0 0 0 0/''''MISER FINDS TIP °
IN IT''''''' '''Let us write the rule for replication:'',r' °
'0 RULE 10' °
'''Naturally, replication will also work on numeric vectors, and even' °
'' '''on mixed vectors'',r' °
'show ''+/(∞5)/∞5'' ''1 2 0 3/1 2,''''AB''''''' °
'''Why did we have to use a comma in the second example? Also explain °
why''' '''the first example produces the same result as'',r' °
X 'show ''+/(∞5)*2''' 'endd' °
*(1997 9 16 12 42 1 388) °
FTEACH4 ÉFX 'TEACH4;VECTOR;PRICE;VOLATILITY' 'Σ N-wise reduction' °
'exit ''TEACH4''' °
'''Since the reduction operator is so useful, can we improve on it?''' °
'''APL as a language is not static. As new demands for problem solving °
''' °
'''arise, the APL community continues to seek ever more powerful ways' °
'' '''to express complex processes with simple notation.'',r' °
'''In many fields of science as well as in economics and statistics''' °
'''there is frequent need to calculate what is called "moving ''' °
'''averages". This is a process where given some integer, say N''' °
'''we want to calculate the average for N consecutive values of a''' °
'''vector. So for a vector of length M (naturally M≥N) we want to''' °
'''produce a vector of (1+M-N) average values.''' 'do' °
''' N-WISE REDUCTION'',r' °
'''In older versions of APL this calculation required a fairly simple' °
'' °
'''but still somewhat inconvenient expression. For one, the APL progra °
mmer''' °
'''had to remember the expression, derive it, or remember the name of' °
'' °
'''a user defined function that produced the desired result. Such a''' °
'''mental effort distracts from the problem solving task at hand.'',r' °
'''In APL2 there is a form of the reduction operator that solves this' °
'' '''class of problems in a very simple way.'',r' 'show ''2+/∞10''' °
'''This is equivalent to doing the following:'',r' °
'(∞9),''+'',(1+∞9),''='',[1.1]2+/∞10' 'do' °
'''We could just as well have used other primitives. Consider ⌡ ⌐ and °
╛'',r' °
'show ''3⌡/∞10'' ''VECTOR╜?20µ10'' ''VECTOR'' ''5⌐/VECTOR'' ''5╛/VECTO °
R''' °
'''One might ask if the idioms N⌐/VECTOR and N╛/VECTOR have any''' °
'''practical applications. Consider the stock broker who is intersted' °
'' °
'''in the volatility of a stock over a period of say 5 weeks. Then if' °
'' °
'''VECTOR represents the closing price of a stock at the end of a''' °
'''week for a period of 20 weeks, we can define volatility in the''' °
'''following way:'',r' °
'1 show ''PRICE╜20+VECTOR'' ''VOLATILITY:(α⌐/∙)-α╛/∙'' ''5 VOLATILITY °
PRICE''' °
'''The point of any generalized APL2 primitive is that it has many''' °
'''more application than those originally conceived. Consider the''' °
'''following, which is an algorithm for finding double letter pairs''' °
X '''in text'',r' 'show ''2=/''''MISSISSIPPI''''''' 'endd' °
*(1997 5 1 12 24 15 296) °
FTEACH5 ÉFX 'TEACH5' 'Σ Logical primitives' 'exit ''TEACH5''' °
'''As we have seen, boolean variables are useful in logical operations °
.''' °
'''If you have studied logic, you know of primitive logic functions''' °
'''called NOT, AND and OR. Suppose that we have the following two bool °
ean''' '''vectors'',r' 'show ''B1╜0 1 0 1'' ''B2╜0 0 1 1''' °
'''Now let us consider the primitive logical operations on these vecto °
rs.''' °
'''A logical NOT means negation so that what was true becomes false, a °
nd''' °
'''what was false becomes true. We certainly can do that with'',r' °
'show ''1-B1'' ''1-B2''' °
'''There is, however, a simpler way with the logical primitive NOT (~) °
'',r' 'show ''~B1'' ''~B2''' °
'''For simple expressions this may not seem as much of an advantage, b °
ut''' °
'''as logical expressions become more complex, the special symbol ~ is °
''' °
'''a big help. Furthermore, people working with logic are quite used t °
o''' '''this notation. (For an even better reason, see below.)''' 'do' °
'''In the same way we could use the primitives ⌐ and ╛ to simulate AND °
''' '''and OR'',r' 'show ''B1⌐B2'' ''B1╛B2''' °
'''The first expression will return true if either the left or the rig °
ht''' °
'''argument returns true. The second expression will return true only °
if''' °
'''both arguments are true. Despite this, APL2 supports the two logica °
l''' '''primitives AND ^, and OR δ'',r' 'show ''B1δB2'' ''B1^B2''' °
'''There is a good reason for having these special primitives. If ⌐ or °
╛''' °
'''are applied to arbitrary numeric vectors, APL2 will always produce °
a''' °
'''result. However ~, δ and ^ will work ONLY with boolean vectors. If °
you''' °
'''were to try an expression such as ^/∞5, you will get an ERROR MESSA °
GE.''' 'do' °
'''By using the logical primitives you allow APL2 to help you in the'' °
' °
'''development of logical algorithms. It is amazing how frequently one °
''' °
'''produces a "logical" vector and be dismayed to find it not to be''' °
'''boolean. (At least that is my experience.)''' 'do' °
'''Notice that ~ is monadic, while δ and ^ are dyadic. There are no''' °
'''monadic δ and monadic ^. There is a dyadic ~, but it is not related °
''' °
'''to simple logical operations. We will study dyadic ~ in a later''' °
'''session.'',r' °
'''We should, however mention two other logical primitives: NOR τ and' °
'' '''NAND σ.''' 'show ''B1τB2'' ''B1σB2''' °
'''You may have noticed that the four element vectors B1 and B2 show'' °
' °
'''all possible combinations for pairs of true-false. Yet, there is''' °
'''a total of 16 distinct patterns for a four character vector''' °
'''containing 0 or 1. As an exercise, generate all 16 patterns using'' °
' °
'''any primitive functions that you have studied so far, and the vecto °
Xrs''' '''B1 and B2. (Hint: start with 0^B1, B1^B2)''' 'endd' °
*(1997 5 31 11 50 5 476) °
FTEACH6 ÉFX 'TEACH6' 'Σ Indexing;VECTOR' 'exit ''TEACH6''' °
''' INDEXING'',r' °
'''We have been doing a lot with vectors as single entities. But suppo °
se''' '''we wish to study individual components of a vector'',r' °
'show ''VECTOR╜?10µ5'' ''VECTOR''' °
'''How do we access the second element of VECTOR? There is an APL2 pri °
mitive''' '''called the INDEXING FUNCTION. It uses the ╙ symbol.'',r' °
'show ''2╙VECTOR''' °
'''The ╙ symbol is sometimes also called "squad". The indexing functio °
n''' °
'''is new to APL2. Although we introduce it here, a more detailed''' °
'''discussion requires concepts not yet mentioned. The indexing functi °
on''' °
'''is meant to suplement an older notation called BRACKET INDEXING.'', °
r' °
'''Bracket indexing uses two symbols called square brackets. The left' °
'' °
'''square bracket [ and the right square bracket ]. To access the seco °
nd''' °
'''element of VECTOR, we would write the following expression'',r' °
'show ''VECTOR[2]''' °
'''Notice that we do not refer to the bracket notation as a function.' °
',r' '''To access more than one element of VECTOR, we would write'',r' °
'show ''VECTOR[1+∞4]''' °
'''The length of the result is equal to the length of the vector insid °
e''' '''brackets'',r' 'show ''VECTOR[5µ2]'' ''µVECTOR[123µ1]''' °
'''In lesson 2 we learned that vectors can have zero length. Let us''' °
'''see what happens if we place such a null vector inside brackets'',r °
' 'show ''VECTOR[∞0]'' ''µVECTOR[∞0]''' °
'''Now let us try to place NOTHING inside brackets.'',r' °
'show ''VECTOR[]''' °
'''Clearly NOTHING is not the same as NULL. Furthermore nothing behave °
s''' '''as if the brackets were not there.''' 'do' °
'''Since the numbers inside brackets point to specific elements of''' °
X '''the vector, we have the following rule'',r' '0 RULE 11' 'endd' °
*(1997 5 4 13 8 23 280) °
FTEACH7 ÉFX 'TEACH7;VECTOR;A;B;C' 'Σ Specification' 'exit ''TEACH7''' °
'''We have seen in lesson 1 that specification is the process of placi °
ng''' °
'''data into a VARIABLE by means of an assignment arrow. This process' °
'' °
'''has been extended in APL2. Many problems, that in the older version °
s''' °
'''of APL required complex expressions, can now be solved with a much' °
'' '''simpler notation.''' 'do' ''' VECTOR SPECIFICATION'',r' °
'''More than one variable can be assigned with a single specification' °
'' °
'''expression. The variables to the left of the assignment arrow shoul °
d''' °
'''be placed in parentheses. This is called VECTOR SPECIFICATION'',r' °
'show ''(A B C)╜(∞6) ''''TEXT'''' (3 3µ''''AB'''',∞3)'' ''A'' ''B'' '' °
C''' ''' SELECTIVE SPECIFICATION'',r' °
'''In older versions of APL, only bracket indexing was allowed. In APL °
2,''' °
'''the expressions allowed to the left of the assignment arrow have be °
en''' °
'''extended. The expanded process is called SELECTIVE SPECIFICATION. T °
he''' °
'''expression including the variable into which the right argument is °
to''' '''be placed must be in parentheses.''' °
'''Here are some examples'',r' °
'show ''VECTOR╜∞9'' ''(3╙VECTOR)╜0'' ''VECTOR''' °
'show ''(3╟VECTOR)╜∞6'' ''VECTOR'' ''((9µ1 0)/VECTOR)╜''''X'''''' ''VE °
XCTOR''' '''More examples will be shown in later lessons.''' 'endd' °
*(1997 8 11 13 12 58 476) °
FTEACH8 ÉFX 'TEACH8' 'Σ ROMAN exercise' 'exit ''TEACH7''' °
'''Earlier this lesson, we stated that the notation and primitive''' °
'''functions described here, can be used in APL2 programming. As you'' °
' °
'''learn about APL, try to think about specific problems of your own'' °
' °
'''knowledge. Then try to develop APL solutions to these problems.''' °
'do' °
'''To give you some idea on how one may proceed, the following example °
''' °
'''illustrates a very important feature of APL, namely its recursive'' °
' '''nature.'',r' °
'''The ancient Romans did not use what we now call the Arabic notation °
''' °
'''to describe numbers. The Roman notation consisted of the usage of'' °
' °
'''the capital letters I V X L C D and M. These letters represented th °
e''' °
'''numbers 1 5 10 50 100 500 and 1000. To display a number, the letter °
s''' °
'''were placed with decreasing value from left to right, but with nota °
ble''' °
'''exceptions. For example 4 was represented as IV, and 6 was represen °
ted''' °
'''as VI. Let us now develop an algorithm for converting integers into °
''' '''the Roman notation.''' 'do' °
'''To begin with, let us for simplicity go only as high as 39. (As we' °
'' '''learn new primitives we will eventually do much better).'',r' °
'1 show ''ROMAN:RX ∙:39<∙:''''This number is too large''''''' °
'''Function ROMAN will return the message if we try to convert a''' °
'''number greater than 39'',r' 'show ''ROMAN 40''' °
'''Next we define function RX'',r' °
'1 show ''RX:RIX ∙:9<∙:''''X'''',RX ∙-10''' °
'''Function RX calls on function RIX, so we have to define that one'', °
r' '1 show ''RIX:RV ∙:9=∙:''''IX''''''' °
'''Function RIX takes care of the special case when ∙ is 9'',r' °
'1 show ''RV:RI ∙:4<∙:''''V'''',RV ∙-5''' °
'''And finally we have to define RI'',r' °
'1 show ''RI:∙µ''''I'''':∙=4:''''IV''''''' °
'''Now we can test the ROMAN algorithm'',r' °
'show ''ROMAN 39'' ''ROMAN 17''' °
'''The method we have used to solve the conversion of Arabic numerals' °
'' °
'''to Roman is called a PRODUCTION SYSTEM. The algorithms in functions °
''' °
'''RX RV and RI are PRODUCTION RULES, and the set of possible branches °
''' °
'''is a TREE STRUCTURE called DISCRIMINATION NET. This terminology''' °
'''is not related in any way to APL. It comes from a discipline''' °
'''called Artificial Intelligence. This APL2 solution is an example of °
''' °
'''the RECURSIVE nature of the language, since both RX and RV may call °
''' '''on themselves with a reduced argument.''' 'do' °
'''As an exercise try to define functions in the same manner as ROMAN, °
''' °
'''to convert Roman notation to Arabic. (For the origin of Arabic nota °
tion''' '''enter ARABIC.'',r' °
'''In a later chapter we will re-define ROMAN to evaluate numbers up'' °
' °
'''to 3999. (Beyond that the Romans used a different notation with''' °
X '''special symbols Γ and π.)''' 'endd' °
XNV1 1 3 9 10 1 °
XNV2 1 3 10 6 6 °
XNVECTOR 1 10 1 1 3 5 1 3 3 5 4 3 °
XCa 1 6 °
*(1997 7 13 12 28 49 504) °
Faddquote ÉFX 'u╜addquote w' °
'Σ Put quotes around a string, and double existing quotes' °
X 'u╜ÉAV[40],((1+w=ÉAV[40])/w),ÉAV[40]' °
XCalpha 1 26 ABCDEFGHIJKLMNOPQRSTUVWXYZ °
*(1997 7 24 13 20 38 476) °
Fav ÉFX 'av;A;N;I;ÉIO' 'Σ Display characters in ÉAV' 'ÉIO╜0' °
'A╜22 78µ'' ''' 'N╜3 0«φ12 22µ1+∞356' 'A[;,(6⌡∞12)°.+2 3 4]╜N' °
'A[;6+6⌡∞12]╜φ12 22µÉAV' 'ΣA[8 10 13;6]╜'' ''' 'A[13;6]╜'' ''' °
X 'A[14+∞8;68 69 70 72]╜'' ''' 'A' °
XCb 1 6 u╜'IV' °
Ac╜('R0')('(∙[1]µ''M''),(''CDM'' R1 ∙[2]),(''XLC'' R1 ∙[3]),''IVX'' R1 °
X∙[4]')('ΣDD ') °
XCd 0 ½ °
*(1991 11 11 8 25 13 316) °
Fdate ÉFX 'u╜date w' 'Σ Format date and time of day' 'u╜«6╞w' °
X 'u╜('' ''⌠u)Γu' 'u╜εu,■''-- .. ''' °
XCdig 1 10 1234567890 °
*(1997 9 9 13 0 45 372) °
Fdisclaimer ÉFX 'disclaimer' 'Σ Copyright statement' °
'(10µ'' ''),''Copyright, Z. V. Jizba, 1995,1996,1997'',r' °
''' This and subsequent workspaces labelled TEACHxx are made available °
''' °
'''at no cost to anyone who desires to learn how to use effectively''' °
'''the IBM/OS2 version of APL2.'',r' °
'''This software is provided "AS IS" with no WARRANTY of any kind, eit °
her''' °
'''express or implied. Any risk in its use resides with you, the user °
of''' '''these tutorials.'',r' ''' ACKNOWLEDGEMENTS'',r' °
''' In writing these tutorials, I am greatly indebted to Roy Sykes, wh °
ose''' °
'''excellent lectures increased my understanding of the language.''' °
'''Discussions with the late Harry Bertucelli clarified a number of''' °
'''concepts and caused me to change some improper terminology that was °
''' °
'''used in previous versions of these tutorials. Mr. Benjamin Archer'' °
' °
'''kindly checked out a nearly final version, bringing to my attention °
''' '''some ommisions, misspellings, and invalid terminology.'',r' °
X '''(PRESS ENTER to continue)''' °
*(1997 7 13 12 28 50 508) °
Fdo ÉFX 'do;T;E' 'Σ Expression driver' 'E╜''''' 'æ╜'' ''' 'T╜æ' °
'╕(^/'' ''=T)/0' °
'╕(('':''εT)doif ''B╜evaldd (+/^\'''' ''''=T)╟T'')/2' °
'''E╜ÉEM'' ÉEA T' '╕(0=µ,E)/2' °
'''This is not a valid APL2 expression''' 'æ╜''*''' '╕(''?''⌠╞1╟æ)/2' °
X 'E' '╕2' °
*(1997 7 13 12 28 50 508) °
Fdoif ÉFX 'U╢╜V╢ doif W╢;t╢' 'Σ Rule' '╕(^/~U╢╜V╢)/0' °
X '''U╢╜V╢ doif■ W╢'' ÉEA ''»V╢/W╢''' °
*(1997 9 9 12 50 14 444) °
Fendd ÉFX 'endd' 'Σ end of special feature' '20µ''²'' ╪ ╕(4<µÉLC)/0' °
X 'do' °
*(1997 8 11 13 14 21 336) °
Ferase ÉFX 'erase;T;EXIT;GO;HELP;DISPLAY;ARABIC;RULE;DISCLAIMER' °
'Σ Erase all global functions and variables' 'T╜ÉNL 3' °
'T╜(~T^.εlc,'' '')≡T' 'T╜ÉEX(~T[;∞5]^.=''TEACH'')≡T' 'T╜ÉNL 2' °
X 'T╜(~T^.εlc,'' '')≡T' °
*(1997 7 27 13 47 41 608) °
Fevaldd ÉFX 'u╜evaldd w;c;n' 'Σ Evaluate direct definition' 'u╜0' °
'n╜(w∞''Σ'')-1' 'c╜(((n╞w)⌠'':'')Γn╞w),Γ''ΣDD '',(n+1)╟w' °
'╕((1 label╞c)doif ''''''Invalid label'''''')/0' °
'╕((2=µc)doif ''u╜showdd 1╙c'')/0' °
'╕((3=ÉNC╞c)doif ''u╜⌡µÉ╜(╞c),'''' is already defined.'''''')/0' °
'╕((3=µc)doif ''u╜simdd c'')/0' 'c╜(Γ''α∙ aw'')replace■c' °
'u╜ε''u╜'',((''a''εεc[2 3 4])/''a ''),(╞c),'' w;t;b''' °
'u╜u(5πc)(''b╜(t╜'',(3πc),'')/'',addquote ''u╜'',4πc)' °
X 'u╜u,''╕(t doif b)/0''(''u╜'',2πc)' 'u╜╧ÉFX u' °
*(1997 7 25 13 27 52 564) °
Fexit ÉFX 'V exit W;T' 'Σ Exit if too many suspended functions' °
'╕(0⌠ÉNC ''V'')/L0 ╪ V╜10' 'L0:╕(V>µÉLC)/0' °
'''There are too many suspended functions''' '''Please enter '',W' °
X '╕' °
*(1997 7 26 12 33 39 536) °
Fget ÉFX 'U╜V get W;t;T;ÉPR' 'Σ Prompt for response from keyboard' °
'ÉPR╜T╜ÉAV[ÉIO+255] ╪ ╕(0⌠ÉNC ''V'')/L0 ╪ V╜1' 'L0:V╜V╧1' 'æ╜W ╪ t╜æ' °
'U╜(+/^\t=T)╟t' '╕(''╕''⌠╞U)/L1 ╪ ╕' 'L1:╕V/0' 't╜(U⌠'' '')ΓU' °
X 'U╜(µt),(ΓU),t' °
*(1997 7 28 13 33 8 424) °
Fglobals ÉFX 'globals' 'Σ Initialize useful global variables' °
'uc╜''ABCDEFGHIJKLMNOPQRSTUVWXYZ''' °
'lc╜''abcdefghijklmnopqrstuvwxyz''' 'dig╜''1234567890''' °
X 'r╜ÉAV[13+ÉIO]' 'q╜''''''''' °
*(1997 7 3 12 47 6 368) °
Finitialize ÉFX 'initialize;T' 'Σ Initialize workspace' °
'''AT ALL TIMES, TO CONTINUE, PRESS RETURN!'',r' °
'''To see disclaimers enter:'',r,'' disclaimer''' 'do' 'erase' °
'globals' °
'''Make sure the CAP LOCK light on your keyboard (upper right) is ON!' °
X'' 'endd' °
*(1997 7 27 13 14 33 444) °
Flabel ÉFX 'u╜v label w' °
'Σ Return 1 if label w does not begin with a cap' °
'╕(0⌠ÉNC ''v'')/L0 ╪ v╜0' 'L0:v╜v╧1 ╪ w╜εw ╪ ╕v/L1 ╪ ╕(u╜0⌠ÉNC w)/0' °
X 'L1:╕(u╜~^/wεlc,uc,dig)/0' 'u╜w[1]εlc,dig' °
XClc 1 26 abcdefghijklmnopqrstuvwxyz °
XNn 0 59 °
*(1997 7 13 12 28 55 528) °
Fnon ÉFX 'non;T;RC;ET;R' 'Σ Ignore keyboard entry' 'æ╜'' ''' 'T╜æ' °
'╕(0=µ(T⌠'' '')/T)/0' '(RC ET R)╜ÉEC T' '╕(0=RC)/2' °
X '╕((1=RC)doif ''R'')/2' '╕2' °
*(1997 7 13 12 28 55 528) °
Fnotb ÉFX 'u╜notb w' 'Σ Remove trailing blanks' °
'╕((1<╧w)doif ''u╜notb■ w'')/0' '╕((1<µµw)doif ''u╜πnotb Γ[2]w'')/0' °
X 'u╜(1-(,'' ''⌠Φw)∞1)╟w' °
XCp 1 2 " °
*(1997 7 27 12 55 6 496) °
Fproblems ÉFX 'problems' 'Σ Problems' °
'''That is all for this lesson. Remember, if you want to practice,''' °
'''and plan to use direct definitions, be sure to first enter GO.''' °
'''Direct definitions will then be accepted. To exit GO, enter EXIT.'' °
,r' °
'''To erase a previously defined DIRECT DEFINITION FUNCTION, enter'',r °
' ''' )ERASE functionname'',r' °
X '''WARNING! do not use )ERASE on other labels.'',r' °
XCq 0 ' °
XCr 0 °
*(1997 7 13 12 28 56 532) °
Freplace ÉFX 'u╜v replace u;i;r;s' 'Σ Replace elements in v in u' °
'i╜Γ∞µu' 's╜2πv╜(v⌠'' '')Γv' 'i╜⌡r╜i⌡■Γ[1]u°.=╞v' °
X 'u[(εi)/εr]╜s[(εi)/εi⌡■∞µs]' °
*(1997 7 13 12 28 56 532) °
Fround ÉFX 'U╜V round W' 'Σ Half adjust to V th decimal' °
X 'U╜(╛0.5+W⌡10*V)÷10*V' °
*(1997 5 31 12 3 40 432) °
Frule ÉFX 'V rule W' 'Σ Additional remarks on rules' °
'╕(2=ÉNC ''V'')/L ╪ V╜0' 'L:╕(~(╞W)ε∞8)/LA ╪ V rulea╞W ╪ ╕L0' °
'LA:╕((╞W)=8+∞3)/L9,L10,L11' '''This rule number is undefined'' ╪ ╕' °
'L9:╕(V>1)/L9X' °
''' RULE 9: To produce a quote inside a character string, enter''' °
''' the quote twice.'',2µr' '╕(0=V)/L0' °
'L9X:''This is used in most other programming languages.''' '╕L0' °
'L10:╕(V>1)/L10X' °
''' RULE 10: In replication the left argument must contain only''' °
''' integers. The length of the left argument must be''' °
''' the same as the length of the right argument.'',2µr' °
'╕(0=V)/L0' °
'L10X:''The left argument may also have negative integers. Only the nu °
mber''' °
'''of positive integers and zeros must add up to the length of the rig °
ht''' °
'''argument. Replicate with negative integers is not discussed here be °
cause''' °
'''the explanation requires concepts that have not yet been mentioned. °
'',r' 'show ''1 1 2 ²1 0 1 1 1 ²1 1 0 1 1/''''CALIFORNIAN''''''' '╕L0' °
'L11:╕(V>1)/L11X' °
''' RULE 11: The expression inside square brackets must return''' °
''' positive integers in the range of the length of''' °
''' the indexed vector. If the expression is MISSING,''' °
''' the result is as if the brackets were missing.'',2µr' °
'╕(0=V)/L0' °
'L11X:''The expression in brackets need not be a vector. It could be a °
n''' '''array as in the next example'',r' °
'show ''''''CALIFORNIA''''[3 3µ?9µ10]'' ''(∞4)[3 3µ∞4]''' °
'''For rules not described in this lesson, see workspace INDEX''' °
X 'L0:do' '╕(0=µW╜1╟W)/0' '╕L' °
*(1997 5 31 11 58 30 608) °
Frulea ÉFX 'V rulea W' 'Σ Additional remarks on rules' °
'╕(2=ÉNC ''V'')/L ╪ V╜0' 'L:╕(W=∞8)/L1,L2,L3,L4,L5,L6,L7,L8' °
'''For rules not described in this lesson, see workspace INDEX''' °
'╕0' 'L1:╕(V>1)/L1X' °
'''RULE 1. For arithmetic operations a vector must be matched with a'' °
' ''' scalar, or another vector of the same length.'',2µr' °
'╕(0=V)/0' °
'L1X:''This is the first of many rules dealing with the concept of''' °
'''CONFORMABILITY. This means that elements to be processed by APL2''' °
'''must in some ways match.''' '╕L0' 'L2:╕(V>1)/L1X' °
'''RULE 2. The reduction operator places the function, (specified to'' °
' °
''' its left), between all pairs of the vector. It then evaluat °
es''' ''' the resulting expression.'',2µr' '╕(0=V)/0' °
'L2X:''There is more to this, but at this stage the rule is essentiall °
y''' '''correct.''' '╕L0' 'L3:╕(V>1)/L1X' °
'''RULE 3. All APL2 expressions are evaluated from right to left'',2µr °
' '╕(0=V)/0' °
'L3X:''This rule is valid in APL, which is the earlier version of APL2 °
.''' °
'''For APL2, the rule has been restated in a totally different way.''' °
'''However until we introduce some concepts that are new to APL2, the' °
'' '''newer form reduces to RULE 3 as stated.''' '╕L0' 'L4:╕(V>1)/L1X' °
'''RULE 4. Vectors in APL2 can have lengths of zero and one.'',2µr' °
'╕(0=V)/0' °
'L4X:''This is the first concept that begins to introduce the idea tha °
t no''' °
'''matter what the APL expression, if it is valid, it must produce a'' °
' °
'''valid APL2 object. (Shades of which came first, the chicken or the °
egg)''' '╕L0' 'L5:╕(V>1)/L1X' °
'''RULE 5. The shape of a variable is a vector. The shape of a vector' °
'' ''' is a vector of length 1. The shape of a scalar is a''' °
''' vector of length zero.'',2µr' '╕(0=V)/0' °
'L5X:''The left argument of RESHAPE is by definition a vector. If APL2 °
is''' °
'''to be internally consistent, the inverse operation to RESHAPE (whic °
h''' '''is indeed SHAPE) MUST return the same type of object.''' '╕L0' °
'L6:╕(V>1)/L1X' °
'''RULE 6. Reduction of a scalar returns that scalar REGARDLESS of''' °
''' the function to the left of the reduction operator.'',2µr' °
'╕(0=V)/0' °
'L6X:''Reduction BY DEFINITION reduces the RANK by one. The exception °
is''' °
'''for objects whose rank is zero. Since there is no such thing as''' °
'''negative rank, reduction is undefined for scalars, and therefore''' °
'''the result is to leave the APL2 object unchanged.''' '╕L0' °
'L7:╕(V>1)/L1X' °
'''RULE 7. The reduction of a null vector produces the identity''' °
''' element of the function.'',2µr' '╕(0=V)/0' °
'L7X:''A null vector may be empty, but it still has rank equal to one. °
''' °
'''Therefore its reduction MUST be a scalar. Since there is no data''' °
'''in a null vector, the scalar must be such that it has no effect''' °
'''on the operation performed by the function: Zero added to anything' °
'' °
'''has no effect in addition; one multiplied by anything has no effect °
''' '''in multiplication; and so on.''' '╕L0' 'L8:╕(V>1)/L1X' °
'''RULE 8. Parentheses can (and should) be used to modify the right''' °
''' to left rule to improve efficiency'',2µr' '╕(0=V)/0' °
'L8X:''Parentheses are used in APL2 for other purposes as well, but fo °
r''' °
'''now, we will use them just to modify the right to left rule (RULE 3 °
).''' °
'''If you place parentheses where they are not needed, APL2 will ignor °
Xe''' '''them.''' 'L0:do' '╕(0=µW╜1╟W)/0' '╕L' °
XCs 1 2 " °
*(1997 7 13 12 28 57 536) °
Fshow ÉFX '╢V show ╢W;╢T;╢B' 'Σ Display and execute ╢W' °
'╢T╜(0=ÉNC ''╢V'')doif ''╢V╜0''' °
'╕((0=╧╢W)doif ''show ╢W,'''' '''''')/0' °
'╕((1<╧╢W)doif ''╢V show ■╢W'')/0' ''' '',╢W' °
X '╕((╢V^'':''ε╢W)doif ''╢T╜evaldd ╢W'')/L0' '''ÉEM'' ÉEA ╢W' 'L0:do' °
*(1997 7 13 12 28 57 536) °
Fshowdd ÉFX 'u╜showdd w;a;b;c;r' °
'Σ Display a direct definition function' °
'╕((1=╧w)doif ''u╜showdd Γw'')/u╜0' °
'╕((3⌠ÉNC╞w)doif ''(ε╞w),'''' is not a function'''''')/0' °
'c╜Γ[2]ÉCR╞w' 'c╜notb(2╞c),(Γ''aw α∙'')replace■2╟c' °
'╕((~''ΣDD''╧3╞2πc)doif ''''''Not a direct definition function'''''')/ °
0' 'u╜1' 'b╜('' ''⌠╞c)Γ╞c' 'a╜'' ''' 'r╜2╟3πc' °
'╕((3=µc)doif ''a,(╞w),'''':'''',r,(3<µ2πc)/'''' Σ'''',3╟2πc'')/0' °
'a╜a,(╞w),'':'',(2╟5πc),'':''' 'b╜(+\r=''('')-+\r='')''' 'b╜b∞0' °
X 'a╜a,(²3╟(b-1)╞3╟r),'':'',2╟»(b+2)╟r' 'a,(3<µ2πc)/'' Σ'',3╟2πc' °
*(1997 7 13 12 28 57 536) °
Fshowfn ÉFX 'U╜V showfn W;F;N;T;ÉIO' 'Σ Simulate ╖W[É]' °
'T╜(0=ÉNC ''V'')doif ''V╜0''' 'ÉIO╜0' °
'U╜r,'' '',''╖'',W,''[É]'',(╞V)╞''╖''' 'N╜1╞µF╜ÉCR W' 'N╜«∞N' °
'N╜(N⌠'' '')ΓN' 'F╜(π''['',■N,■Γ''] ''),F' °
'T╜(1<µ,V)doif ''F╜F[1╟V;]'' ''U╜''''''''''' 'U╜²1╟U,r,,F,r' °
X 'U╜((-+/^\'' ''=ΦU)╟U),('' ╖'')[╞V],r' °
*(1997 7 13 12 28 58 540) °
Fsimdd ÉFX 'u╜simdd w;e' 'Σ Direct definition mode' 'u╜0' °
'╕((0⌠ÉNC╞w)doif ''''''Already defined'''''')/0' 'e╜''α''ε2πw' °
'w[2]╜Γ''u╜'',''α∙ aw'' replace 2πw' 'w╜w[1 3 2]' °
X 'w[1]╜Γε''u╜'',(e/''a ''),w[1],'' w''' 'u╜╧ÉFX w' °
XNt 0 1 °
*(1992 6 3 9 59 17 424) °
Ftab ÉFX 'U╜V tab W;T;A;B;C;D;E;F;G;M;ÉPW' 'Σ Tabulate list W' °
'T╜(0=ÉNC ''V'')doif ''V╜0''' 'M╜''Invalid data for tabulation''' °
'V╜4╞V' 'ÉPW╜130╛30⌐G╜V[2]+79⌡V[2]=0' °
'L1:╕((1<╧W)doif ''''''W╜∞0'''' ÉEA ''''W╜πW'''''')/L1' °
'╕(((0=µεW)δ2<µµW)doif ''U╜(~V╧4╞0)/M'')/0' °
'T╜(1≥µµU╜«W)doif ''U╜πW╜(U⌠'''' '''')ΓU''' °
'T╜(0<V[1])doif ''U╜(«(Φ1,╞µW)µ(V[3]µ'''' ''''),∞(╞µW)-V[3]),'''' '''' °
,U''' '╕(G<30)/0' 'T╜(F╜µεV[4])+C╜1╟B╜µA╜(V[3],0)╟U' °
'T╜⌐(1╞B)÷1⌐╛(ÉPW+F)÷T' 'U╜(E╜(V[3],C)╞U),[1](B╜T,1╟B)╞A' °
'''D╜εV[4]'' ÉEA ''D╜ÉAV[εV[4]+33⌡V[4]=0]''' 'L0:A╜(T,0)╟A' °
X '╕(0=1╞µA)/0' 'U╜U,(((T+V[3]),µD)µD),E,[1]B╞A' '╕L0' °
*(1997 7 13 12 28 59 544) °
Ftest ÉFX 'U╜V test W;P' °
'Σ Describe problem in W, (correct answer in V)' 'U╜2' 'L1:W' °
'É╜'' ''' 'P╜æ' '''╕L0'' ÉEA ''P╜»P''' '╕(V╧P)/0' °
X 'L0:╕(0=U╜U-1)/0' '''Incorrect. Try again''' '╕L1' °
XCu 1 2 IV °
XCuc 1 26 ABCDEFGHIJKLMNOPQRSTUVWXYZ °
XNw 0 4 °
XCx 0 ! °