home *** CD-ROM | disk | FTP | other *** search
/ Capture the Power of the Internet / Capture the Power of the Internet.iso / mac / MacFiles / System / Calculators / mathpad.sit / MathPad 2.5.2 / Documentation / Programming < prev    next >
MacBinary  |  2000-02-27  |  6.8 KB  |  [TEXT/MPad]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: MacBinary (archive/macBinary).

ConfidenceProgramDetectionMatch TypeSupport
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, Sun Feb 27 13:18:34 2000, modified Sun Feb 27 13:18:34 2000, creator 'MPad', type ASCII, 6175 bytes "Programming" , at 0x189f 458 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[MPad]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0b 50 72 6f 67 72 61 | 6d 6d 69 6e 67 00 00 00 |..Progra|mming...|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4d 50 61 | 64 00 00 00 00 00 00 00 |.TEXTMPa|d.......|
|00000050| 00 00 00 00 00 18 1f 00 | 00 01 ca b4 df 1a fa b4 |........|........|
|00000060| df 1a fa 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 63 4f 00 00 |........|....cO..|
|00000080| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000090| 2d 2d 2d 2d 2d 2d 20 50 | 72 6f 67 72 61 6d 6d 69 |------ P|rogrammi|
|000000a0| 6e 67 20 69 6e 20 4d 61 | 74 68 50 61 64 0d 0d 2d |ng in Ma|thPad..-|
|000000b0| 2d 20 54 68 65 20 62 61 | 73 69 63 20 4d 61 74 68 |- The ba|sic Math|
|000000c0| 50 61 64 20 6c 61 6e 67 | 75 61 67 65 20 69 73 20 |Pad lang|uage is |
|000000d0| 69 6e 74 65 6e 64 65 64 | 20 74 6f 20 62 65 20 6d |intended| to be m|
|000000e0| 61 74 68 65 6d 61 74 69 | 63 61 6c 20 72 61 74 68 |athemati|cal rath|
|000000f0| 65 72 20 74 68 61 6e 20 | 70 72 6f 63 65 64 75 72 |er than |procedur|
|00000100| 61 6c 2e 20 45 71 75 61 | 74 69 6f 6e 73 20 63 61 |al. Equa|tions ca|
|00000110| 6e 20 62 65 20 77 72 69 | 74 74 65 6e 20 61 6e 64 |n be wri|tten and|
|00000120| 20 65 76 61 6c 75 61 74 | 65 64 20 69 6e 20 61 20 | evaluat|ed in a |
|00000130| 6e 61 74 75 72 61 6c 20 | 77 61 79 20 74 68 61 74 |natural |way that|
|00000140| 20 64 6f 65 73 20 6e 6f | 74 20 72 65 61 6c 6c 79 | does no|t really|
|00000150| 20 72 65 71 75 69 72 65 | 20 61 6e 79 20 70 72 6f | require| any pro|
|00000160| 67 72 61 6d 6d 69 6e 67 | 2e 20 54 68 65 72 65 20 |gramming|. There |
|00000170| 61 72 65 20 68 6f 77 65 | 76 65 72 20 73 6f 6d 65 |are howe|ver some|
|00000180| 20 68 61 6e 64 79 20 6e | 75 6d 65 72 69 63 61 6c | handy n|umerical|
|00000190| 20 61 6c 67 6f 72 69 74 | 68 6d 73 20 74 68 61 74 | algorit|hms that|
|000001a0| 20 64 6f 20 72 65 71 75 | 69 72 65 20 73 6f 6d 65 | do requ|ire some|
|000001b0| 20 70 72 6f 63 65 64 75 | 72 61 6c 20 6f 70 65 72 | procedu|ral oper|
|000001c0| 61 74 69 6f 6e 73 2e 0d | 0d 2d 2d 20 4d 61 74 68 |ations..|.-- Math|
|000001d0| 50 61 64 20 64 6f 65 73 | 20 6e 6f 74 20 68 61 76 |Pad does| not hav|
|000001e0| 65 20 61 6c 6c 20 74 68 | 65 20 68 61 6e 64 79 20 |e all th|e handy |
|000001f0| 66 65 61 74 75 72 65 73 | 20 6f 66 20 61 20 70 72 |features| of a pr|
|00000200| 6f 67 72 61 6d 6d 69 6e | 67 20 6c 61 6e 67 75 61 |ogrammin|g langua|
|00000210| 67 65 20 6c 69 6b 65 20 | 43 20 6f 72 20 50 61 73 |ge like |C or Pas|
|00000220| 63 61 6c 20 62 75 74 20 | 69 74 20 64 6f 65 73 20 |cal but |it does |
|00000230| 68 61 76 65 20 61 6c 6c | 20 74 68 65 20 65 73 73 |have all| the ess|
|00000240| 65 6e 74 69 61 6c 20 65 | 6c 65 6d 65 6e 74 73 20 |ential e|lements |
|00000250| 6e 65 65 64 65 64 20 74 | 6f 20 64 6f 20 70 72 6f |needed t|o do pro|
|00000260| 67 72 61 6d 6d 69 6e 67 | 2e 0d 0d 2d 2d 20 54 68 |gramming|...-- Th|
|00000270| 65 20 61 73 73 69 67 6e | 6d 65 6e 74 20 6f 70 65 |e assign|ment ope|
|00000280| 72 61 74 6f 72 2e 0d 2d | 2d 20 49 74 20 69 73 20 |rator..-|- It is |
|00000290| 76 65 72 79 20 69 6d 70 | 6f 72 74 61 6e 74 20 74 |very imp|ortant t|
|000002a0| 6f 20 75 6e 64 65 72 73 | 74 61 6e 64 20 74 68 65 |o unders|tand the|
|000002b0| 20 64 69 66 66 65 72 65 | 6e 63 65 20 62 65 74 77 | differe|nce betw|
|000002c0| 65 65 6e 20 3d 20 61 6e | 64 20 3a 3d 2e 20 54 68 |een = an|d :=. Th|
|000002d0| 65 20 3d 20 73 74 61 74 | 65 6d 65 6e 74 20 67 69 |e = stat|ement gi|
|000002e0| 76 65 73 20 61 20 64 65 | 66 69 6e 69 74 69 6f 6e |ves a de|finition|
|000002f0| 20 61 6e 64 20 64 6f 65 | 73 20 6e 6f 74 20 70 65 | and doe|s not pe|
|00000300| 72 66 6f 72 6d 20 61 6e | 79 20 63 61 6c 63 75 6c |rform an|y calcul|
|00000310| 61 74 69 6f 6e 2e 20 49 | 74 20 69 73 20 61 6e 61 |ation. I|t is ana|
|00000320| 6c 6f 67 6f 75 73 20 74 | 6f 20 61 20 66 75 6e 63 |logous t|o a func|
|00000330| 74 69 6f 6e 20 64 65 66 | 69 6e 69 74 69 6f 6e 20 |tion def|inition |
|00000340| 69 6e 20 43 20 6f 72 20 | 50 61 73 63 61 6c 2e 0d |in C or |Pascal..|
|00000350| 0d 2d 2d 20 4d 61 74 68 | 50 61 64 20 6d 61 6b 65 |.-- Math|Pad make|
|00000360| 73 20 74 77 6f 20 70 61 | 73 73 65 73 20 6f 76 65 |s two pa|sses ove|
|00000370| 72 20 74 68 65 20 74 65 | 78 74 2e 20 54 68 65 20 |r the te|xt. The |
|00000380| 66 69 72 73 74 20 70 61 | 73 73 20 73 61 76 65 73 |first pa|ss saves|
|00000390| 20 61 6c 6c 20 74 68 65 | 20 64 65 66 69 6e 69 74 | all the| definit|
|000003a0| 69 6f 6e 73 2e 20 54 68 | 65 20 73 65 63 6f 6e 64 |ions. Th|e second|
|000003b0| 20 70 61 73 73 20 65 76 | 61 6c 75 61 74 65 73 20 | pass ev|aluates |
|000003c0| 73 74 61 74 65 6d 65 6e | 74 73 20 69 6e 20 6f 72 |statemen|ts in or|
|000003d0| 64 65 72 2e 0d 0d 20 20 | 61 3a 37 2e 30 30 3b 20 |der... |a:7.00; |
|000003e0| 20 20 20 2d 2d 20 6c 6f | 6f 6b 20 61 74 20 64 65 | -- lo|ok at de|
|000003f0| 66 69 6e 69 74 69 6f 6e | 20 6f 66 20 22 61 22 20 |finition| of "a" |
|00000400| 61 6e 64 20 70 65 72 66 | 6f 72 6d 20 63 61 6c 63 |and perf|orm calc|
|00000410| 75 6c 61 74 69 6f 6e 2e | 0d 20 20 61 20 3d 20 62 |ulation.|. a = b|
|00000420| 2b 32 20 20 20 20 2d 2d | 20 64 65 66 69 6e 65 20 |+2 --| define |
|00000430| 22 61 22 20 28 6f 6e 20 | 70 61 73 73 20 31 29 0d |"a" (on |pass 1).|
|00000440| 20 20 62 20 3d 20 35 20 | 20 20 20 20 20 2d 2d 20 | b = 5 | -- |
|00000450| 64 65 66 69 6e 65 20 22 | 62 22 20 28 6f 6e 20 70 |define "|b" (on p|
|00000460| 61 73 73 20 31 29 0d 0d | 2d 2d 20 54 68 65 20 3a |ass 1)..|-- The :|
|00000470| 3d 20 6f 70 65 72 61 74 | 6f 72 20 72 65 70 6c 61 |= operat|or repla|
|00000480| 63 65 73 20 61 6e 79 20 | 64 65 66 69 6e 69 74 69 |ces any |definiti|
|00000490| 6f 6e 20 6f 66 20 74 68 | 65 20 6c 65 66 74 20 68 |on of th|e left h|
|000004a0| 61 6e 64 20 76 61 72 69 | 61 62 6c 65 20 77 69 74 |and vari|able wit|
|000004b0| 68 20 74 68 65 20 63 61 | 6c 63 75 6c 61 74 65 64 |h the ca|lculated|
|000004c0| 20 76 61 6c 75 65 20 6f | 66 20 74 68 65 20 72 69 | value o|f the ri|
|000004d0| 67 68 74 20 68 61 6e 64 | 20 73 69 64 65 2e 0d 0d |ght hand| side...|
|000004e0| 20 20 63 3a 3f 3b 20 20 | 20 20 20 20 20 2d 2d 20 | c:?; | -- |
|000004f0| 74 68 65 72 65 20 69 73 | 20 6e 6f 20 64 65 66 69 |there is| no defi|
|00000500| 6e 69 74 69 6f 6e 20 66 | 6f 72 20 22 63 22 0d 20 |nition f|or "c". |
|00000510| 20 63 3a 3d 20 62 2b 32 | 3a 3b 20 20 2d 2d 20 70 | c:= b+2|:; -- p|
|00000520| 65 72 66 6f 72 6d 20 63 | 61 6c 63 75 6c 61 74 69 |erform c|alculati|
|00000530| 6f 6e 2e 20 73 61 76 65 | 20 72 65 73 75 6c 74 20 |on. save| result |
|00000540| 69 6e 20 22 63 22 0d 20 | 20 63 3a 37 2e 30 30 3b |in "c". | c:7.00;|
|00000550| 20 20 20 20 2d 2d 20 61 | 63 63 65 73 73 20 74 68 | -- a|ccess th|
|00000560| 65 20 73 61 76 65 64 20 | 76 61 6c 75 65 2e 20 6e |e saved |value. n|
|00000570| 6f 20 63 61 6c 63 75 6c | 61 74 69 6f 6e 20 70 65 |o calcul|ation pe|
|00000580| 72 66 6f 72 6d 65 64 0d | 20 20 62 3a 3d 31 30 3a |rformed.| b:=10:|
|00000590| 3b 20 20 20 20 2d 2d 20 | 63 68 61 6e 67 65 20 76 |; -- |change v|
|000005a0| 61 6c 75 65 20 6f 66 20 | 22 62 22 0d 20 20 61 3a |alue of |"b". a:|
|000005b0| 31 32 2e 30 30 3b 20 20 | 20 2d 2d 20 63 61 6c 63 |12.00; | -- calc|
|000005c0| 75 6c 61 74 65 20 22 61 | 22 20 75 73 69 6e 67 20 |ulate "a|" using |
|000005d0| 6e 65 77 20 76 61 6c 75 | 65 20 6f 66 20 22 62 22 |new valu|e of "b"|
|000005e0| 0d 20 20 63 3a 37 2e 30 | 30 3b 20 20 20 20 2d 2d |. c:7.0|0; --|
|000005f0| 20 76 61 6c 75 65 20 6f | 66 20 22 63 22 20 64 6f | value o|f "c" do|
|00000600| 65 73 20 6e 6f 74 20 63 | 68 61 6e 67 65 0d 0d 2d |es not c|hange..-|
|00000610| 2d 20 4e 6f 72 6d 61 6c | 6c 79 20 74 68 65 20 64 |- Normal|ly the d|
|00000620| 65 73 74 69 6e 61 74 69 | 6f 6e 20 6f 66 20 3a 3d |estinati|on of :=|
|00000630| 20 69 73 20 61 20 73 79 | 6d 62 6f 6c 20 74 68 61 | is a sy|mbol tha|
|00000640| 74 20 64 6f 65 73 20 6e | 6f 74 20 68 61 76 65 20 |t does n|ot have |
|00000650| 61 6e 79 20 3d 20 64 65 | 66 69 6e 69 74 69 6f 6e |any = de|finition|
|00000660| 2e 20 49 74 20 69 73 20 | 73 6f 6d 65 74 69 6d 65 |. It is |sometime|
|00000670| 73 20 75 73 65 66 75 6c | 20 74 6f 20 68 61 76 65 |s useful| to have|
|00000680| 20 61 6e 20 3d 20 64 65 | 66 69 6e 69 74 69 6f 6e | an = de|finition|
|00000690| 20 63 61 6c 63 75 6c 61 | 74 65 20 61 6e 20 69 6e | calcula|te an in|
|000006a0| 69 74 69 61 6c 20 76 61 | 6c 75 65 20 62 75 74 20 |itial va|lue but |
|000006b0| 72 65 6d 65 6d 62 65 72 | 20 74 68 61 74 20 6f 6e |remember| that on|
|000006c0| 63 65 20 3a 3d 20 69 73 | 20 75 73 65 64 20 74 68 |ce := is| used th|
|000006d0| 65 20 64 65 66 69 6e 69 | 74 69 6f 6e 20 77 69 6c |e defini|tion wil|
|000006e0| 6c 20 62 65 20 65 72 61 | 73 65 64 2e 0d 2d 2d 20 |l be era|sed..-- |
|000006f0| 53 69 6e 63 65 20 3a 3d | 20 69 73 20 73 65 71 75 |Since :=| is sequ|
|00000700| 65 6e 74 69 61 6c 20 61 | 6e 64 20 3d 20 69 73 20 |ential a|nd = is |
|00000710| 6e 6f 74 2c 20 69 74 20 | 69 73 20 70 6f 73 73 69 |not, it |is possi|
|00000720| 62 6c 65 20 28 62 75 74 | 20 6e 6f 74 20 72 65 63 |ble (but| not rec|
|00000730| 6f 6d 6d 65 6e 64 65 64 | 29 20 74 6f 20 77 72 69 |ommended|) to wri|
|00000740| 74 65 20 74 68 69 6e 67 | 73 20 74 68 61 74 20 6c |te thing|s that l|
|00000750| 6f 6f 6b 20 72 61 74 68 | 65 72 20 63 6f 6e 66 75 |ook rath|er confu|
|00000760| 73 69 6e 67 2e 0d 0d 20 | 20 64 3a 3d 64 2b 31 3a |sing... | d:=d+1:|
|00000770| 0d 20 20 64 20 3d 20 33 | 0d 20 20 64 3a 34 2e 30 |. d = 3|. d:4.0|
|00000780| 30 0d 0d 2d 2d 20 45 6e | 74 69 72 65 20 61 72 72 |0..-- En|tire arr|
|00000790| 61 79 73 20 63 61 6e 20 | 62 65 20 61 73 73 69 67 |ays can |be assig|
|000007a0| 6e 65 64 20 69 66 20 74 | 68 65 79 20 61 72 65 20 |ned if t|hey are |
|000007b0| 66 69 6e 69 74 65 20 28 | 61 6e 64 20 74 68 65 72 |finite (|and ther|
|000007c0| 65 20 69 73 20 65 6e 6f | 75 67 68 20 6d 65 6d 6f |e is eno|ugh memo|
|000007d0| 72 79 29 2e 20 49 6e 64 | 69 76 69 64 75 61 6c 20 |ry). Ind|ividual |
|000007e0| 61 72 72 61 79 20 65 6c | 65 6d 65 6e 74 73 20 63 |array el|ements c|
|000007f0| 61 6e 20 62 65 20 61 73 | 73 69 67 6e 65 64 20 69 |an be as|signed i|
|00000800| 6e 20 6c 69 6d 69 74 65 | 64 20 63 61 73 65 73 2e |n limite|d cases.|
|00000810| 20 41 20 73 69 6e 67 6c | 65 20 6e 75 6d 65 72 69 | A singl|e numeri|
|00000820| 63 20 76 61 6c 75 65 20 | 63 61 6e 20 62 65 20 61 |c value |can be a|
|00000830| 73 73 69 67 6e 65 64 20 | 74 6f 20 61 6e 20 65 6c |ssigned |to an el|
|00000840| 65 6d 65 6e 74 20 6f 66 | 20 61 6e 20 61 72 72 61 |ement of| an arra|
|00000850| 79 20 74 68 61 74 20 68 | 61 73 20 70 72 65 76 69 |y that h|as previ|
|00000860| 6f 75 73 6c 79 20 62 65 | 65 6e 20 69 6e 69 74 69 |ously be|en initi|
|00000870| 61 6c 69 7a 65 64 20 62 | 79 20 61 73 73 69 67 6e |alized b|y assign|
|00000880| 6d 65 6e 74 2e 0d 0d 20 | 41 20 3a 3d 20 7b 7b 31 |ment... |A := {{1|
|00000890| 2c 32 2c 33 2c 34 7d 2c | 7b 35 2c 36 2c 37 2c 38 |,2,3,4},|{5,6,7,8|
|000008a0| 7d 7d 3a 0d 20 41 5b 31 | 2c 32 5d 20 3a 3d 20 30 |}}:. A[1|,2] := 0|
|000008b0| 3a 0d 20 41 3a 7b 7b 31 | 2e 30 30 2c 30 2e 30 30 |:. A:{{1|.00,0.00|
|000008c0| 2c 33 2e 30 30 2c 34 2e | 30 30 7d 2c 7b 35 2e 30 |,3.00,4.|00},{5.0|
|000008d0| 30 2c 36 2e 30 30 2c 37 | 2e 30 30 2c 38 2e 30 30 |0,6.00,7|.00,8.00|
|000008e0| 7d 7d 0d 0d 2d 2d 20 53 | 6f 6d 65 20 73 79 6d 62 |}}..-- S|ome symb|
|000008f0| 6f 6c 73 20 61 72 65 20 | 6e 6f 74 20 61 6c 6c 6f |ols are |not allo|
|00000900| 77 65 64 20 61 73 20 3a | 3d 20 64 65 73 74 69 6e |wed as :|= destin|
|00000910| 61 74 69 6f 6e 73 2e 20 | 41 72 72 61 79 20 64 65 |ations. |Array de|
|00000920| 66 69 6e 69 74 69 6f 6e | 73 20 77 69 74 68 20 65 |finition|s with e|
|00000930| 78 70 6c 69 63 69 74 20 | 69 6e 64 65 78 65 73 20 |xplicit |indexes |
|00000940| 63 61 6e 20 6e 6f 74 20 | 62 65 20 61 73 73 69 67 |can not |be assig|
|00000950| 6e 65 64 20 74 6f 2e 20 | 41 6c 73 6f 20 73 70 65 |ned to. |Also spe|
|00000960| 63 69 61 6c 20 73 79 6d | 62 6f 6c 73 20 73 75 63 |cial sym|bols suc|
|00000970| 68 20 61 73 20 74 68 65 | 20 70 6c 6f 74 20 76 61 |h as the| plot va|
|00000980| 72 69 61 62 6c 65 20 58 | 20 6f 72 20 73 75 6d 28 |riable X| or sum(|
|00000990| 29 20 76 61 72 69 61 62 | 6c 65 73 20 63 61 6e 20 |) variab|les can |
|000009a0| 6e 6f 74 20 62 65 20 61 | 73 73 69 67 6e 65 64 20 |not be a|ssigned |
|000009b0| 74 6f 2e 0d 0d 20 20 20 | 42 5b 69 5d 3d 69 0d 2d |to... |B[i]=i.-|
|000009c0| 2d 20 42 3a 3d 33 3a 20 | 20 20 2d 2d 20 69 73 20 |- B:=3: | -- is |
|000009d0| 6e 6f 74 20 61 6c 6c 6f | 77 65 64 0d 0d 0d 2d 2d |not allo|wed...--|
|000009e0| 2d 2d 2d 2d 2d 2d 2d 2d | 20 54 68 65 20 63 6f 6d |--------| The com|
|000009f0| 6d 61 20 6f 70 65 72 61 | 74 6f 72 0d 2d 2d 20 4d |ma opera|tor.-- M|
|00000a00| 61 74 68 50 61 64 27 73 | 20 66 75 6e 63 74 69 6f |athPad's| functio|
|00000a10| 6e 61 6c 20 61 70 70 72 | 6f 61 63 68 20 64 65 61 |nal appr|oach dea|
|00000a20| 6c 73 20 77 69 74 68 20 | 65 78 70 72 65 73 73 69 |ls with |expressi|
|00000a30| 6f 6e 73 20 61 6e 64 20 | 64 6f 65 73 20 6e 6f 74 |ons and |does not|
|00000a40| 20 75 73 65 20 62 6c 6f | 63 6b 73 20 63 6f 6e 74 | use blo|cks cont|
|00000a50| 61 69 6e 69 6e 67 20 73 | 65 71 75 65 6e 63 65 73 |aining s|equences|
|00000a60| 20 6f 66 20 73 74 61 74 | 65 6d 65 6e 74 73 2e 20 | of stat|ements. |
|00000a70| 48 6f 77 65 76 65 72 2c | 20 74 68 65 20 63 6f 6d |However,| the com|
|00000a80| 6d 61 20 6f 70 65 72 61 | 74 6f 72 20 63 61 6e 20 |ma opera|tor can |
|00000a90| 62 65 20 75 73 65 64 20 | 74 6f 20 70 65 72 66 6f |be used |to perfo|
|00000aa0| 72 6d 20 61 20 73 65 71 | 75 65 6e 63 65 20 6f 66 |rm a seq|uence of|
|00000ab0| 20 6f 70 65 72 61 74 69 | 6f 6e 73 2e 20 50 61 72 | operati|ons. Par|
|00000ac0| 65 6e 74 68 65 73 69 73 | 20 67 72 6f 75 70 20 74 |enthesis| group t|
|00000ad0| 68 65 20 73 65 71 75 65 | 6e 63 65 20 69 6e 74 6f |he seque|nce into|
|00000ae0| 20 61 20 73 69 6e 67 6c | 65 20 65 78 70 72 65 73 | a singl|e expres|
|00000af0| 73 69 6f 6e 2e 0d 2d 2d | 20 54 68 65 20 66 69 72 |sion..--| The fir|
|00000b00| 73 74 20 70 75 72 70 6f | 73 65 20 6f 66 20 74 68 |st purpo|se of th|
|00000b10| 65 20 63 6f 6d 6d 61 20 | 6f 70 65 72 61 74 6f 72 |e comma |operator|
|00000b20| 20 69 73 20 74 6f 20 73 | 65 70 61 72 61 74 65 20 | is to s|eparate |
|00000b30| 63 6f 6e 64 69 74 69 6f | 6e 61 6c 20 22 77 68 65 |conditio|nal "whe|
|00000b40| 6e 22 20 63 6c 61 75 73 | 65 73 2e 20 54 68 65 20 |n" claus|es. The |
|00000b50| 72 65 73 75 6c 74 20 77 | 69 6c 6c 20 62 65 20 74 |result w|ill be t|
|00000b60| 68 65 20 76 61 6c 75 65 | 20 63 6f 72 72 65 73 70 |he value| corresp|
|00000b70| 6f 6e 64 69 6e 67 20 74 | 6f 20 66 69 72 73 74 20 |onding t|o first |
|00000b80| 63 6f 6e 64 69 74 69 6f | 6e 20 69 6e 20 74 68 65 |conditio|n in the|
|00000b90| 20 6c 69 73 74 20 74 68 | 61 74 20 65 76 61 6c 75 | list th|at evalu|
|00000ba0| 61 74 65 73 20 74 72 75 | 65 2e 0d 0d 20 20 73 65 |ates tru|e... se|
|00000bb0| 6c 65 63 74 28 73 29 20 | 3d 20 61 20 77 68 65 6e |lect(s) |= a when|
|00000bc0| 20 73 3d 31 2c 20 62 20 | 77 68 65 6e 20 73 3d 32 | s=1, b |when s=2|
|00000bd0| 2c 20 63 20 77 68 65 6e | 20 73 3d 33 0d 20 20 73 |, c when| s=3. s|
|00000be0| 65 6c 65 63 74 28 31 29 | 3a 31 32 2e 30 30 3b 20 |elect(1)|:12.00; |
|00000bf0| 20 73 65 6c 65 63 74 28 | 32 29 3a 31 30 2e 30 30 | select(|2):10.00|
|00000c00| 3b 0d 0d 2d 2d 20 54 68 | 65 20 6d 65 61 6e 69 6e |;..-- Th|e meanin|
|00000c10| 67 20 6f 66 20 74 68 65 | 20 63 6f 6d 6d 61 20 6f |g of the| comma o|
|00000c20| 70 65 72 61 74 6f 72 20 | 69 73 20 65 78 74 65 6e |perator |is exten|
|00000c30| 64 65 64 20 74 6f 20 61 | 6c 6c 6f 77 20 61 6e 79 |ded to a|llow any|
|00000c40| 20 65 78 70 72 65 73 73 | 69 6f 6e 20 28 6e 6f 74 | express|ion (not|
|00000c50| 20 6a 75 73 74 20 77 68 | 65 6e 20 63 6c 61 75 73 | just wh|en claus|
|00000c60| 65 73 29 2e 20 54 68 65 | 20 72 65 73 75 6c 74 20 |es). The| result |
|00000c70| 77 69 6c 6c 20 62 65 20 | 74 68 65 20 66 69 72 73 |will be |the firs|
|00000c80| 74 20 69 74 65 6d 20 69 | 6e 20 74 68 65 20 6c 69 |t item i|n the li|
|00000c90| 73 74 20 77 69 74 68 20 | 61 20 74 72 75 65 20 22 |st with |a true "|
|00000ca0| 77 68 65 6e 22 20 63 6c | 61 75 73 65 20 6f 72 20 |when" cl|ause or |
|00000cb0| 74 68 65 20 66 69 72 73 | 74 20 65 78 70 72 65 73 |the firs|t expres|
|00000cc0| 73 69 6f 6e 20 74 68 61 | 74 20 65 76 61 6c 75 61 |sion tha|t evalua|
|00000cd0| 74 65 73 20 74 6f 20 61 | 20 6b 6e 6f 77 6e 20 76 |tes to a| known v|
|00000ce0| 61 6c 75 65 2e 20 45 76 | 61 6c 75 61 74 69 6f 6e |alue. Ev|aluation|
|00000cf0| 20 6f 66 20 61 6e 20 61 | 73 73 69 67 6e 6d 65 6e | of an a|ssignmen|
|00000d00| 74 20 70 65 72 66 6f 72 | 6d 73 20 74 68 65 20 73 |t perfor|ms the s|
|00000d10| 69 64 65 20 65 66 66 65 | 63 74 20 6f 6e 6c 79 20 |ide effe|ct only |
|00000d20| 61 6e 64 20 64 6f 65 73 | 20 6e 6f 74 20 72 65 73 |and does| not res|
|00000d30| 75 6c 74 20 69 6e 20 61 | 20 6b 6e 6f 77 6e 20 76 |ult in a| known v|
|00000d40| 61 6c 75 65 2e 20 54 68 | 69 73 20 61 6c 6c 6f 77 |alue. Th|is allow|
|00000d50| 73 20 61 20 73 65 71 75 | 65 6e 63 65 20 6f 66 20 |s a sequ|ence of |
|00000d60| 61 73 73 69 67 6e 6d 65 | 6e 74 73 20 74 6f 20 62 |assignme|nts to b|
|00000d70| 65 20 64 6f 6e 65 20 73 | 69 6d 70 6c 79 20 62 79 |e done s|imply by|
|00000d80| 20 73 65 70 61 72 61 74 | 69 6e 67 20 74 68 65 6d | separat|ing them|
|00000d90| 20 77 69 74 68 20 63 6f | 6d 6d 61 73 2e 0d 0d 20 | with co|mmas... |
|00000da0| 20 62 3a 3d 62 2b 31 2c | 20 63 3a 3d 62 2c 20 61 | b:=b+1,| c:=b, a|
|00000db0| 3a 31 33 2e 30 30 0d 20 | 20 62 3a 31 31 2e 30 30 |:13.00. | b:11.00|
|00000dc0| 3b 20 20 63 3a 31 31 2e | 30 30 0d 0d 2d 2d 20 54 |; c:11.|00..-- T|
|00000dd0| 68 65 20 64 6f 75 62 6c | 65 20 63 6f 6d 6d 61 20 |he doubl|e comma |
|00000de0| 6f 70 65 72 61 74 6f 72 | 0d 2d 2d 20 49 6e 20 63 |operator|.-- In c|
|00000df0| 61 73 65 73 20 69 6e 76 | 6f 6c 76 69 6e 67 20 61 |ases inv|olving a|
|00000e00| 73 73 69 67 6e 6d 65 6e | 74 73 20 69 74 20 69 73 |ssignmen|ts it is|
|00000e10| 20 73 6f 6d 65 74 69 6d | 65 73 20 64 65 73 69 72 | sometim|es desir|
|00000e20| 61 62 6c 65 20 74 6f 20 | 68 61 76 65 20 65 76 61 |able to |have eva|
|00000e30| 6c 75 61 74 69 6f 6e 20 | 6f 66 20 61 20 73 65 71 |luation |of a seq|
|00000e40| 75 65 6e 63 65 20 63 6f | 6e 74 69 6e 75 65 20 65 |uence co|ntinue e|
|00000e50| 76 65 6e 20 69 66 20 61 | 20 74 72 75 65 20 77 68 |ven if a| true wh|
|00000e60| 65 6e 20 63 6c 61 75 73 | 65 20 69 73 20 65 6e 63 |en claus|e is enc|
|00000e70| 6f 75 6e 74 65 72 65 64 | 2e 20 46 6f 72 20 74 68 |ountered|. For th|
|00000e80| 65 20 64 6f 75 62 6c 65 | 20 63 6f 6d 6d 61 2c 20 |e double| comma, |
|00000e90| 65 61 63 68 20 65 78 70 | 72 65 73 73 69 6f 6e 20 |each exp|ression |
|00000ea0| 69 73 20 65 76 61 6c 75 | 61 74 65 64 20 72 65 67 |is evalu|ated reg|
|00000eb0| 61 72 64 6c 65 73 73 20 | 6f 66 20 77 68 65 6e 20 |ardless |of when |
|00000ec0| 63 6c 61 75 73 65 73 20 | 6f 72 20 6b 6e 6f 77 6e |clauses |or known|
|00000ed0| 20 72 65 73 75 6c 74 73 | 2e 20 54 68 65 20 72 65 | results|. The re|
|00000ee0| 73 75 6c 74 20 6f 66 20 | 61 20 64 6f 75 62 6c 65 |sult of |a double|
|00000ef0| 20 63 6f 6d 6d 61 20 6c | 69 73 74 20 69 73 20 74 | comma l|ist is t|
|00000f00| 68 65 20 6c 61 73 74 20 | 65 78 70 72 65 73 73 69 |he last |expressi|
|00000f10| 6f 6e 20 69 6e 20 74 68 | 65 20 6c 69 73 74 2e 20 |on in th|e list. |
|00000f20| 53 69 6e 67 6c 65 20 61 | 6e 64 20 64 6f 75 62 6c |Single a|nd doubl|
|00000f30| 65 20 63 6f 6d 6d 61 73 | 20 63 61 6e 20 62 65 20 |e commas| can be |
|00000f40| 6d 69 78 65 64 20 69 6e | 20 74 68 65 20 73 61 6d |mixed in| the sam|
|00000f50| 65 20 6c 69 73 74 2e 0d | 0d 20 20 61 62 73 62 28 |e list..|. absb(|
|00000f60| 78 29 20 3d 20 62 3a 3d | 78 2c 0d 20 20 20 20 20 |x) = b:=|x,. |
|00000f70| 20 20 20 20 20 20 62 3a | 3d 2d 62 20 77 68 65 6e | b:|=-b when|
|00000f80| 20 62 3c 30 2c 2c 20 20 | 2d 2d 20 63 6f 6e 74 69 | b<0,, |-- conti|
|00000f90| 6e 75 65 20 65 76 65 6e | 20 69 66 20 62 3c 30 0d |nue even| if b<0.|
|00000fa0| 20 20 20 20 20 20 20 20 | 20 20 20 62 20 20 20 20 | | b |
|00000fb0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 2d 2d 20 | | -- |
|00000fc0| 72 65 74 75 72 6e 20 76 | 61 6c 75 65 20 6f 66 20 |return v|alue of |
|00000fd0| 62 0d 0d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 20 49 74 |b..-----|----- It|
|00000fe0| 65 72 61 74 69 6f 6e 0d | 2d 2d 20 54 68 65 20 27 |eration.|-- The '|
|00000ff0| 77 68 69 6c 65 27 20 6f | 70 65 72 61 74 6f 72 20 |while' o|perator |
|00001000| 63 61 6e 20 62 65 20 75 | 73 65 64 20 74 6f 20 65 |can be u|sed to e|
|00001010| 76 61 6c 75 61 74 65 20 | 61 6e 20 65 78 70 72 65 |valuate |an expre|
|00001020| 73 73 69 6f 6e 20 72 65 | 70 65 61 74 65 64 6c 79 |ssion re|peatedly|
|00001030| 2e 20 54 68 65 20 77 68 | 69 6c 65 20 6b 65 79 77 |. The wh|ile keyw|
|00001040| 6f 72 64 20 66 6f 6c 6c | 6f 77 73 20 74 68 65 20 |ord foll|ows the |
|00001050| 65 78 70 72 65 73 73 69 | 6f 6e 20 62 75 74 20 74 |expressi|on but t|
|00001060| 68 65 20 63 6f 6e 64 69 | 74 69 6f 6e 20 69 73 20 |he condi|tion is |
|00001070| 63 68 65 63 6b 65 64 20 | 62 65 66 6f 72 65 20 65 |checked |before e|
|00001080| 61 63 68 20 65 76 61 6c | 75 61 74 69 6f 6e 2e 0d |ach eval|uation..|
|00001090| 0d 20 20 66 61 63 74 6f | 72 69 61 6c 28 6e 29 20 |. facto|rial(n) |
|000010a0| 3d 20 69 3a 3d 31 2c 0d | 20 20 20 20 20 20 20 20 |= i:=1,.| |
|000010b0| 20 20 20 20 20 20 20 20 | 20 6d 3a 3d 31 2c 20 20 | | m:=1, |
|000010c0| 2d 2d 20 73 65 74 20 75 | 70 20 62 65 66 6f 72 65 |-- set u|p before|
|000010d0| 20 73 74 61 72 74 69 6e | 67 20 6c 6f 6f 70 0d 20 | startin|g loop. |
|000010e0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000010f0| 28 69 3a 3d 69 2b 31 2c | 6d 3a 3d 6d 2a 69 29 20 |(i:=i+1,|m:=m*i) |
|00001100| 77 68 69 6c 65 20 69 3c | 6e 2c 20 2d 2d 20 64 6f |while i<|n, -- do|
|00001110| 65 73 20 6e 6f 74 68 69 | 6e 67 20 69 66 20 6e 3c |es nothi|ng if n<|
|00001120| 3d 31 0d 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |=1. | |
|00001130| 20 20 20 20 6d 20 20 20 | 20 20 20 2d 2d 20 72 65 | m | -- re|
|00001140| 74 75 72 6e 20 66 69 6e | 61 6c 20 76 61 6c 75 65 |turn fin|al value|
|00001150| 20 66 6f 72 20 6d 0d 0d | 20 20 66 61 63 74 6f 72 | for m..| factor|
|00001160| 69 61 6c 28 31 29 3a 31 | 2e 30 30 3b 20 20 69 3a |ial(1):1|.00; i:|
|00001170| 31 2e 30 30 3b 20 20 6d | 3a 31 2e 30 30 0d 20 20 |1.00; m|:1.00. |
|00001180| 66 61 63 74 6f 72 69 61 | 6c 28 32 29 3a 32 2e 30 |factoria|l(2):2.0|
|00001190| 30 3b 20 20 69 3a 32 2e | 30 30 3b 20 20 6d 3a 32 |0; i:2.|00; m:2|
|000011a0| 2e 30 30 0d 0d 2d 2d 20 | 4e 65 73 74 65 64 20 77 |.00..-- |Nested w|
|000011b0| 68 69 6c 65 20 6c 6f 6f | 70 73 20 61 72 65 20 66 |hile loo|ps are f|
|000011c0| 69 6e 65 20 62 75 74 20 | 72 65 6d 65 6d 62 65 72 |ine but |remember|
|000011d0| 20 74 68 61 74 20 61 6c | 6c 20 3a 3d 20 76 61 72 | that al|l := var|
|000011e0| 69 61 62 6c 65 73 20 61 | 72 65 20 67 6c 6f 62 61 |iables a|re globa|
|000011f0| 6c 20 73 6f 20 64 6f 6e | 27 74 20 74 72 79 20 75 |l so don|'t try u|
|00001200| 73 69 6e 67 20 27 69 27 | 20 61 73 20 74 68 65 20 |sing 'i'| as the |
|00001210| 69 6e 64 65 78 20 66 6f | 72 20 62 6f 74 68 20 61 |index fo|r both a|
|00001220| 6e 20 69 6e 6e 65 72 20 | 61 6e 64 20 6f 75 74 65 |n inner |and oute|
|00001230| 72 20 6c 6f 6f 70 2e 0d | 0d 2d 2d 20 73 75 6d 28 |r loop..|.-- sum(|
|00001240| 29 2c 20 70 6c 6f 74 20 | 61 6e 64 20 74 61 62 6c |), plot |and tabl|
|00001250| 65 20 63 61 6e 20 61 6c | 73 6f 20 62 65 20 75 73 |e can al|so be us|
|00001260| 65 64 20 74 6f 20 70 65 | 72 66 6f 72 6d 20 69 74 |ed to pe|rform it|
|00001270| 65 72 61 74 69 6f 6e 2e | 20 54 68 65 20 66 6f 6c |eration.| The fol|
|00001280| 6c 6f 77 69 6e 67 20 65 | 78 61 6d 70 6c 65 73 20 |lowing e|xamples |
|00001290| 61 6c 6c 20 65 76 61 6c | 75 61 74 65 20 64 6f 73 |all eval|uate dos|
|000012a0| 74 75 66 66 28 29 20 6e | 20 74 69 6d 65 73 20 77 |tuff() n| times w|
|000012b0| 68 69 6c 65 20 73 74 65 | 70 70 69 6e 67 20 69 74 |hile ste|pping it|
|000012c0| 73 20 70 61 72 61 6d 65 | 74 65 72 20 66 72 6f 6d |s parame|ter from|
|000012d0| 20 31 20 74 6f 20 6e 2e | 20 64 6f 73 74 75 66 66 | 1 to n.| dostuff|
|000012e0| 28 29 20 63 61 6e 20 62 | 65 20 61 6e 79 20 65 78 |() can b|e any ex|
|000012f0| 70 72 65 73 73 69 6f 6e | 20 61 6e 64 20 63 61 6e |pression| and can|
|00001300| 20 63 6f 6e 74 61 69 6e | 20 61 6e 79 74 68 69 6e | contain| anythin|
|00001310| 67 20 69 6e 63 6c 75 64 | 69 6e 67 20 3a 3d 2e 0d |g includ|ing :=..|
|00001320| 0d 20 20 64 6f 73 74 75 | 66 66 28 78 29 20 3d 20 |. dostu|ff(x) = |
|00001330| 28 63 74 3a 3d 31 2c 31 | 29 20 77 68 65 6e 20 78 |(ct:=1,1|) when x|
|00001340| 3d 31 2c 0d 20 20 20 20 | 20 20 20 20 20 20 20 20 |=1,. | |
|00001350| 20 20 20 63 74 3a 3d 63 | 74 2b 78 2c 20 63 74 0d | ct:=c|t+x, ct.|
|00001360| 20 20 6e 3d 35 0d 0d 20 | 20 73 75 6d 28 64 6f 73 | n=5.. | sum(dos|
|00001370| 74 75 66 66 28 78 29 2c | 78 2c 31 2c 6e 29 3a 33 |tuff(x),|x,1,n):3|
|00001380| 35 2e 30 30 3b 20 20 2d | 2d 20 4e 6f 74 65 3a 20 |5.00; -|- Note: |
|00001390| 73 75 6d 28 29 20 77 69 | 6c 6c 20 73 74 6f 70 20 |sum() wi|ll stop |
|000013a0| 6f 6e 20 75 6e 6b 6e 6f | 77 6e 0d 0d 20 20 58 6d |on unkno|wn.. Xm|
|000013b0| 69 6e 3d 31 3b 20 58 6d | 61 78 3d 6e 3b 20 58 73 |in=1; Xm|ax=n; Xs|
|000013c0| 74 65 70 73 3d 6e 0d 20 | 20 70 6c 6f 74 20 64 6f |teps=n. | plot do|
|000013d0| 73 74 75 66 66 28 58 29 | 0d 0d 20 20 4e 6d 69 6e |stuff(X)|.. Nmin|
|000013e0| 3d 31 3b 20 4e 6d 61 78 | 3d 6e 3b 20 4e 73 74 65 |=1; Nmax|=n; Nste|
|000013f0| 70 73 3d 6e 0d 20 20 74 | 61 62 6c 65 20 64 6f 73 |ps=n. t|able dos|
|00001400| 74 75 66 66 28 4e 29 0d | 20 20 20 20 20 20 20 31 |tuff(N).| 1|
|00001410| 2e 30 30 0d 20 20 20 20 | 20 20 20 33 2e 30 30 0d |.00. | 3.00.|
|00001420| 20 20 20 20 20 20 20 36 | 2e 30 30 0d 20 20 20 20 | 6|.00. |
|00001430| 20 20 31 30 2e 30 30 0d | 20 20 20 20 20 20 31 35 | 10.00.| 15|
|00001440| 2e 30 30 0d 0d 2d 2d 20 | 42 6f 74 68 20 70 6c 6f |.00..-- |Both plo|
|00001450| 74 20 61 6e 64 20 74 61 | 62 6c 65 20 65 76 61 6c |t and ta|ble eval|
|00001460| 75 61 74 65 20 74 68 65 | 69 72 20 65 78 70 72 65 |uate the|ir expre|
|00001470| 73 73 69 6f 6e 20 65 78 | 74 72 61 20 74 69 6d 65 |ssion ex|tra time|
|00001480| 73 20 61 74 20 74 68 65 | 20 31 73 74 20 76 61 6c |s at the| 1st val|
|00001490| 75 65 20 69 6e 20 6f 72 | 64 65 72 20 74 6f 20 64 |ue in or|der to d|
|000014a0| 65 74 65 72 6d 69 6e 65 | 20 61 72 72 61 79 20 64 |etermine| array d|
|000014b0| 69 6d 65 6e 73 69 6f 6e | 73 2e 20 54 6f 20 77 6f |imension|s. To wo|
|000014c0| 72 6b 20 70 72 6f 70 65 | 72 6c 79 20 64 6f 73 74 |rk prope|rly dost|
|000014d0| 75 66 66 28 29 20 6d 75 | 73 74 20 72 65 73 65 74 |uff() mu|st reset|
|000014e0| 20 69 74 73 20 69 6e 69 | 74 69 61 6c 20 73 74 61 | its ini|tial sta|
|000014f0| 74 65 20 62 61 73 65 64 | 20 6f 6e 20 69 74 73 20 |te based| on its |
|00001500| 70 61 72 61 6d 65 74 65 | 72 2e 0d 2d 2d 20 55 73 |paramete|r..-- Us|
|00001510| 69 6e 67 20 70 6c 6f 74 | 20 77 69 74 68 20 65 78 |ing plot| with ex|
|00001520| 70 72 65 73 73 69 6f 6e | 73 20 74 68 61 74 20 68 |pression|s that h|
|00001530| 61 76 65 20 73 69 64 65 | 20 65 66 66 65 63 74 73 |ave side| effects|
|00001540| 20 63 61 6e 20 62 65 20 | 74 72 69 63 6b 79 2e 20 | can be |tricky. |
|00001550| 49 66 20 74 68 65 20 70 | 6c 6f 74 20 65 78 70 72 |If the p|lot expr|
|00001560| 65 73 73 69 6f 6e 20 69 | 73 20 61 6e 20 7b 78 2c |ession i|s an {x,|
|00001570| 79 7d 20 61 72 72 61 79 | 20 69 74 20 67 65 74 73 |y} array| it gets|
|00001580| 20 65 76 61 6c 75 61 74 | 65 64 20 74 77 69 63 65 | evaluat|ed twice|
|00001590| 20 70 65 72 20 70 6c 6f | 74 74 65 64 20 70 6f 69 | per plo|tted poi|
|000015a0| 6e 74 20 28 6f 6e 63 65 | 20 66 6f 72 20 74 68 65 |nt (once| for the|
|000015b0| 20 78 20 63 6f 6f 72 64 | 2c 20 6f 6e 63 65 20 66 | x coord|, once f|
|000015c0| 6f 72 20 74 68 65 20 79 | 20 63 6f 6f 72 64 29 2e |or the y| coord).|
|000015d0| 20 49 74 20 69 73 20 62 | 65 73 74 20 74 6f 20 67 | It is b|est to g|
|000015e0| 65 6e 65 72 61 74 65 20 | 76 61 6c 75 65 73 20 62 |enerate |values b|
|000015f0| 61 73 65 64 20 6f 6e 20 | 74 68 65 20 69 6e 64 65 |ased on |the inde|
|00001600| 70 65 6e 64 65 6e 74 20 | 76 61 72 69 61 62 6c 65 |pendent |variable|
|00001610| 20 72 61 74 68 65 72 20 | 74 68 61 6e 20 62 61 73 | rather |than bas|
|00001620| 65 64 20 6f 6e 20 6f 6e | 6c 79 20 6f 6e 20 70 72 |ed on on|ly on pr|
|00001630| 65 76 69 6f 75 73 20 76 | 61 6c 75 65 73 2e 0d 0d |evious v|alues...|
|00001640| 0d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 20 44 65 62 75 |.-------|--- Debu|
|00001650| 67 67 69 6e 67 0d 2d 2d | 20 49 74 20 6d 61 79 20 |gging.--| It may |
|00001660| 62 65 20 68 65 6c 70 66 | 75 6c 20 74 6f 20 63 72 |be helpf|ul to cr|
|00001670| 65 61 74 65 20 61 20 64 | 65 62 75 67 67 69 6e 67 |eate a d|ebugging|
|00001680| 20 66 75 6e 63 74 69 6f | 6e 20 74 6f 20 73 61 76 | functio|n to sav|
|00001690| 65 20 76 61 6c 75 65 73 | 20 64 75 72 69 6e 67 20 |e values| during |
|000016a0| 65 76 61 6c 75 61 74 69 | 6f 6e 2e 20 54 68 65 20 |evaluati|on. The |
|000016b0| 66 6f 6c 6c 6f 77 69 6e | 67 20 72 6f 75 74 69 6e |followin|g routin|
|000016c0| 65 73 20 77 69 6c 6c 20 | 73 61 76 65 20 61 20 73 |es will |save a s|
|000016d0| 65 71 75 65 6e 63 65 20 | 6f 66 20 75 70 20 74 6f |equence |of up to|
|000016e0| 20 6e 6d 61 78 20 76 61 | 6c 75 65 73 20 69 6e 20 | nmax va|lues in |
|000016f0| 74 68 65 20 61 72 72 61 | 79 20 64 62 67 64 61 74 |the arra|y dbgdat|
|00001700| 61 2e 0d 0d 20 20 73 74 | 61 72 74 64 62 67 28 6e |a... st|artdbg(n|
|00001710| 6d 61 78 29 20 3d 20 64 | 62 67 64 61 74 61 3a 3d |max) = d|bgdata:=|
|00001720| 20 30 2f 30 5b 3a 6e 6d | 61 78 5d 2c 2d 2d 20 69 | 0/0[:nm|ax],-- i|
|00001730| 6e 69 74 69 61 6c 69 7a | 65 20 61 72 72 61 79 0d |nitializ|e array.|
|00001740| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001750| 20 20 20 6e 64 62 67 3a | 3d 30 0d 0d 20 20 64 62 | ndbg:|=0.. db|
|00001760| 67 28 76 61 6c 29 20 3d | 20 6e 64 62 67 3a 3d 6e |g(val) =| ndbg:=n|
|00001770| 64 62 67 2b 31 2c 0d 20 | 20 20 20 20 20 20 20 20 |dbg+1,. | |
|00001780| 20 20 20 20 64 62 67 64 | 61 74 61 5b 6e 64 62 67 | dbgd|ata[ndbg|
|00001790| 5d 3a 3d 76 61 6c 20 0d | 0d 0d 2d 2d 20 74 72 79 |]:=val .|..-- try|
|000017a0| 20 6c 6f 6f 6b 69 6e 67 | 20 61 74 20 74 68 65 20 | looking| at the |
|000017b0| 76 61 6c 75 65 73 20 6f | 66 20 74 68 65 20 22 63 |values o|f the "c|
|000017c0| 74 22 20 67 6c 6f 62 61 | 6c 20 64 75 72 69 6e 67 |t" globa|l during|
|000017d0| 20 64 6f 73 74 75 66 66 | 28 29 20 73 75 6d 6d 61 | dostuff|() summa|
|000017e0| 74 69 6f 6e 2e 0d 0d 20 | 20 73 74 61 72 74 64 62 |tion... | startdb|
|000017f0| 67 28 31 30 29 3a 0d 20 | 20 73 75 6d 28 28 64 62 |g(10):. | sum((db|
|00001800| 67 28 63 74 29 2c 64 6f | 73 74 75 66 66 28 78 29 |g(ct),do|stuff(x)|
|00001810| 29 2c 78 2c 31 2c 6e 29 | 3a 33 35 2e 30 30 3b 0d |),x,1,n)|:35.00;.|
|00001820| 0d 20 20 6e 64 62 67 3a | 35 2e 30 30 3b 20 20 20 |. ndbg:|5.00; |
|00001830| 20 20 20 2d 2d 20 35 20 | 76 61 6c 75 65 73 20 77 | -- 5 |values w|
|00001840| 65 72 65 20 73 61 76 65 | 64 0d 0d 20 20 74 61 62 |ere save|d.. tab|
|00001850| 6c 65 20 64 62 67 64 61 | 74 61 5b 3a 6e 64 62 67 |le dbgda|ta[:ndbg|
|00001860| 5d 0d 20 20 20 20 20 20 | 31 35 2e 30 30 0d 20 20 |]. |15.00. |
|00001870| 20 20 20 20 20 31 2e 30 | 30 0d 20 20 20 20 20 20 | 1.0|0. |
|00001880| 20 33 2e 30 30 0d 20 20 | 20 20 20 20 20 36 2e 30 | 3.00. | 6.0|
|00001890| 30 0d 20 20 20 20 20 20 | 31 30 2e 30 30 0d 0d 00 |0. |10.00...|
|000018a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000018b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000018c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000018d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000018e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000018f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001900| 00 00 01 00 00 00 01 64 | 00 00 00 64 00 00 00 66 |.......d|...d...f|
|00001910| a2 76 11 fe 8c 11 42 10 | 01 10 2d 11 fe 02 03 65 |.v....B.|..-....e|
|00001920| 00 03 9a 0c 00 e8 02 62 | 00 03 92 8b 06 12 00 d2 |.......b|........|
|00001930| 0b 50 72 6f 67 72 61 6d | 6d 69 6e 67 02 00 00 00 |.Program|ming....|
|00001940| 54 45 58 54 4d 50 61 64 | 01 00 00 68 00 c0 00 00 |TEXTMPad|...h....|
|00001950| 00 00 54 45 58 54 4d 50 | 61 64 01 00 00 68 00 c0 |..TEXTMP|ad...h..|
|00001960| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001970| 00 00 aa 0a 85 dc 00 00 | 18 2b 00 00 01 56 da 2d |........|.+...V.-|
|00001980| 40 01 fe 88 68 54 80 01 | 03 2e 86 12 43 62 20 6e |@...hT..|....Cb n|
|00001990| 01 fe 88 14 2f 08 20 50 | 20 50 22 68 4f 13 4e 91 |..../. P| P"hO.N.|
|000019a0| 4a 00 50 8f 80 01 03 12 | 7f f9 11 80 00 69 13 1b |J.P.....|.....i..|
|000019b0| 7c 00 02 fe 02 99 02 70 | 72 6e 74 99 6c 2d 50 01 ||......p|rnt.l-P.|
|000019c0| 12 72 11 2b 40 11 fd fe | c2 01 b0 ad 30 6d 80 01 |.r.+@...|....0m..|
|000019d0| 02 e4 55 2f 11 fd fa 2f | 11 fd f6 02 72 ff 2b 41 |..U/.../|....r.+A|
|000019e0| 11 fd f2 13 1b 7c 00 03 | fe 02 76 17 fe 84 20 b8 |.....|..|..v... .|
|000019f0| 02 0c 20 2d fd f2 b0 ae | fe 84 02 62 00 01 84 86 |.. -....|...b....|
|00001a00| 00 00 00 20 04 00 03 02 | 00 02 3f f9 8e fa 35 12 |... ....|..?...5.|
|00001a10| 94 e9 c8 ae 01 b6 01 2b | 00 03 00 28 01 06 01 2c |.......+|...(...,|
|00001a20| 00 ef 00 27 00 00 00 14 | 00 04 06 4d 6f 6e 61 63 |...'....|...Monac|
|00001a30| 6f 01 39 06 4d 6f 6e 61 | 63 6f 01 39 00 00 00 24 |o.9.Mona|co.9...$|
|00001a40| 00 01 00 ff 7f ff 80 e8 | 00 00 00 00 00 00 01 00 |........|........|
|00001a50| 00 00 00 00 00 00 00 00 | 7f ff 00 ff 7f ff 00 00 |........|........|
|00001a60| 00 00 80 e8 00 00 01 00 | 00 00 01 64 00 00 00 64 |........|...d...d|
|00001a70| 00 00 00 66 03 1b 4d 18 | 02 86 00 00 00 1c 00 5a |...f..M.|.......Z|
|00001a80| 00 02 50 52 65 66 00 00 | 00 1a 53 54 52 23 00 00 |..PRef..|..STR#..|
|00001a90| 00 26 53 50 52 46 00 00 | 00 32 00 80 ff ff 00 00 |.&SPRF..|.2......|
|00001aa0| 00 00 03 1c 3d 6c 00 81 | 00 00 00 00 00 24 03 1c |....=l..|.....$..|
|00001ab0| 39 80 00 80 ff ff 00 00 | 00 3c 03 1c 3d 7c 0b 66 |9.......|.<..=|.f|
|00001ac0| 6f 6e 74 20 26 20 73 69 | 7a 65 00 00 00 00 00 00 |ont & si|ze......|
|00001ad0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001ae0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001af0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+