home *** CD-ROM | disk | FTP | other *** search
open in:
MacOS 8.1
|
Win98
|
DOS
view JSON data
|
view as text
This file was processed as: ArcFS Archive
(archive/arcFS).
You can browse this item here: _diddly
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| dexvert
| ArcFS Archive (archive/arcFS)
| magic
| Supported |
100%
| file
| RISC OS archive (ArcFS format)
| default
| |
99%
| file
| data
| default
| |
100%
| TrID
| Acorn ArcFS Archive
| default
| |
100%
| gt2
| Kopftext: 'Archive'
| default (weak)
| |
100%
| detectItEasy
| Archive: ArcFS
| default
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 41 72 63 68 69 76 65 00 | c4 05 00 00 24 06 00 00 |Archive.|....$...|
|00000010| 28 00 00 00 64 00 00 00 | 00 00 00 00 00 00 00 00 |(...d...|........|
|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 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000050| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000060| 82 21 44 69 64 64 6c 79 | 00 00 00 00 ff ff ff ff |.!Diddly|........|
|00000070| 45 ff ff ff ab 51 d2 98 | 00 00 00 00 ff ff ff ff |E....Q..|........|
|00000080| ac 02 00 80 82 21 48 65 | 6c 70 00 00 72 20 66 65 |.....!He|lp..r fe|
|00000090| 42 07 00 00 45 ff ff ff | a5 7d 76 47 03 00 be cc |B...E...|.}vG....|
|000000a0| 42 07 00 00 24 00 00 00 | 82 21 52 75 6e 00 08 00 |B...$...|.!Run...|
|000000b0| 72 20 66 65 68 00 00 00 | 45 eb ff ff d2 89 7f 47 |r feh...|E......G|
|000000c0| 03 00 57 a2 68 00 00 00 | 8a 07 00 00 82 21 53 70 |..W.h...|.....!Sp|
|000000d0| 72 69 74 65 73 00 66 65 | b0 03 00 00 45 f9 ff ff |rites.fe|....E...|
|000000e0| 71 8e 77 47 03 00 7c 11 | b0 03 00 00 16 08 00 00 |q.wG..|.|........|
|000000f0| 82 63 00 00 40 25 08 00 | 72 20 66 65 ff ff ff ff |.c..@%..|r fe....|
|00000100| 45 ff ff ff 37 52 d2 98 | 00 00 00 00 ff ff ff ff |E...7R..|........|
|00000110| 40 02 00 80 82 44 44 4c | 49 00 00 00 00 00 00 00 |@....DDL|I.......|
|00000120| 6a 26 00 00 45 ff ff ff | 8b df cf 41 03 00 99 90 |j&..E...|...A....|
|00000130| 6a 26 00 00 ea 0b 00 00 | 82 46 50 44 49 4f 00 00 |j&......|.FPDIO..|
|00000140| 00 00 00 00 c8 0c 00 00 | 45 ff ff ff 00 a5 0c 13 |........|E.......|
|00000150| 03 00 5a 2a c8 0c 00 00 | 78 32 00 00 82 4f 72 69 |..Z*....|x2...Ori|
|00000160| 67 69 6f 6e 61 6c 00 00 | ff ff ff ff 45 ff ff ff |gional..|....E...|
|00000170| a1 52 d2 98 00 00 00 00 | ff ff ff ff d4 01 00 80 |.R......|........|
|00000180| 82 44 44 4c 49 2f 43 00 | 72 20 66 65 61 26 00 00 |.DDLI/C.|r fea&..|
|00000190| 45 e4 ff ff 98 38 5e 13 | 03 00 ee 5d 61 26 00 00 |E....8^.|...]a&..|
|000001a0| 64 3f 00 00 82 46 50 44 | 49 4f 00 00 72 20 66 65 |d?...FPD|IO..r fe|
|000001b0| c8 0c 00 00 45 ff ff ff | 00 a5 0c 13 03 00 5a 2a |....E...|......Z*|
|000001c0| c8 0c 00 00 e9 65 00 00 | 82 51 53 54 00 25 08 00 |.....e..|.QST.%..|
|000001d0| 72 20 66 65 7e 11 00 00 | 45 ff ff ff 00 a5 0c 13 |r fe~...|E.......|
|000001e0| 03 00 ec 25 7e 11 00 00 | d5 72 00 00 82 53 54 52 |...%~...|.r...STR|
|000001f0| 44 55 50 00 72 20 66 65 | ac 01 00 00 45 ff ff ff |DUP.r fe|....E...|
|00000200| e8 1e bd 41 03 00 b7 88 | ac 01 00 00 77 84 00 00 |...A....|....w...|
|00000210| 00 00 00 00 40 25 08 00 | 72 20 66 65 65 64 62 61 |....@%..|r feedba|
|00000220| 63 6b 20 77 69 6c 6c 20 | 62 65 20 6d 6f 73 74 20 |ck will |be most |
|00000230| 22 5e 6c 75 82 51 53 54 | 00 00 00 00 00 00 00 00 |"^lu.QST|........|
|00000240| 82 11 00 00 45 ff ff ff | 94 ec 4f 43 03 00 04 ef |....E...|..OC....|
|00000250| 82 11 00 00 47 86 00 00 | 82 53 54 52 44 55 50 00 |....G...|.STRDUP.|
|00000260| 00 00 00 00 ac 01 00 00 | 45 ff ff ff e8 1e bd 41 |........|E......A|
|00000270| 03 00 b7 88 ac 01 00 00 | ed 97 00 00 00 00 00 00 |........|........|
|00000280| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000290| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002a0| 82 44 44 4c 49 00 08 00 | 72 20 66 65 8c 43 00 00 |.DDLI...|r fe.C..|
|000002b0| 45 f8 ff ff 5d d4 75 47 | 03 00 f6 92 8c 43 00 00 |E...].uG|.....C..|
|000002c0| bd 99 00 00 82 44 44 4c | 49 2f 51 53 54 00 66 65 |.....DDL|I/QST.fe|
|000002d0| e3 2d 00 00 45 ff ff ff | 80 93 09 0c 03 00 14 d5 |.-..E...|........|
|000002e0| e3 2d 00 00 6d dd 00 00 | 00 00 00 00 40 25 08 00 |.-..m...|....@%..|
|000002f0| 72 20 66 65 65 64 62 61 | 63 6b 20 77 69 6c 6c 20 |r feedba|ck will |
|00000300| 62 65 20 6d 6f 73 74 20 | 22 5e 6c 75 82 44 6f 63 |be most |"^lu.Doc|
|00000310| 73 00 00 00 00 00 00 00 | ff ff ff ff 45 ff ff ff |s.......|....E...|
|00000320| ff 53 d2 98 00 00 00 00 | ff ff ff ff a0 05 00 80 |.S......|........|
|00000330| 82 44 44 4c 49 2f 44 4f | 43 00 20 69 63 7a 00 00 |.DDLI/DO|C. icz..|
|00000340| 45 ff ff ff 48 6a 63 13 | 03 00 8c d3 63 7a 00 00 |E...Hjc.|....cz..|
|00000350| 74 0b 01 00 82 45 4e 46 | 4a 00 65 6c 70 22 20 69 |t....ENF|J.elp" i|
|00000360| 39 0a 00 00 45 ff ff ff | d0 80 0b 13 03 00 04 2c |9...E...|.......,|
|00000370| 39 0a 00 00 fb 85 01 00 | 82 45 4e 46 50 00 65 6c |9.......|.ENFP.el|
|00000380| 70 22 20 69 b2 12 00 00 | 45 ff ff ff 40 b1 0b 13 |p" i....|E...@...|
|00000390| 03 00 88 20 b2 12 00 00 | 58 90 01 00 82 45 4e 54 |... ....|X....ENT|
|000003a0| 4a 00 65 6c 70 22 20 69 | 5d 08 00 00 45 ff ff ff |J.elp" i|]...E...|
|000003b0| 48 b8 0b 13 03 00 a6 1e | 5d 08 00 00 2e a3 01 00 |H.......|].......|
|000003c0| 82 45 4e 54 50 00 65 6c | 70 22 20 69 01 23 00 00 |.ENTP.el|p" i.#..|
|000003d0| 45 ff ff ff 20 c7 0b 13 | 03 00 a8 84 01 23 00 00 |E... ...|.....#..|
|000003e0| af ab 01 00 82 45 53 46 | 4a 00 65 6c 70 22 20 69 |.....ESF|J.elp" i|
|000003f0| b7 0b 00 00 45 ff ff ff | 10 d2 0b 13 03 00 e2 24 |....E...|.......$|
|00000400| b7 0b 00 00 d4 ce 01 00 | 82 45 53 46 50 00 65 6c |........|.ESFP.el|
|00000410| 70 22 20 69 7f 07 00 00 | 45 ff ff ff 20 e0 0b 13 |p" i....|E... ...|
|00000420| 03 00 e0 d5 7f 07 00 00 | af da 01 00 82 45 53 54 |........|.....EST|
|00000430| 4a 00 65 6c 70 22 20 69 | e4 0d 00 00 45 ff ff ff |J.elp" i|....E...|
|00000440| 88 f0 0b 13 03 00 f9 1b | e4 0d 00 00 52 e2 01 00 |........|....R...|
|00000450| 82 45 53 54 50 00 65 6c | 70 22 20 69 6e 07 00 00 |.ESTP.el|p" in...|
|00000460| 45 ff ff ff 80 02 0c 13 | 03 00 c3 bd 6e 07 00 00 |E.......|....n...|
|00000470| 5a f0 01 00 82 49 4e 46 | 4a 00 65 6c 70 22 20 69 |Z....INF|J.elp" i|
|00000480| ef 12 00 00 45 ff ff ff | 78 2d 0c 13 03 00 ea 91 |....E...|x-......|
|00000490| ef 12 00 00 ec f7 01 00 | 82 49 4e 46 50 00 65 6c |........|.INFP.el|
|000004a0| 70 22 20 69 a9 12 00 00 | 45 ff ff ff 18 3d 0c 13 |p" i....|E....=..|
|000004b0| 03 00 ad 42 a9 12 00 00 | ff 0a 02 00 82 49 4e 54 |...B....|.....INT|
|000004c0| 4a 00 65 6c 70 22 20 69 | ec 10 00 00 45 ff ff ff |J.elp" i|....E...|
|000004d0| 60 4a 0c 13 03 00 7c 37 | ec 10 00 00 cc 1d 02 00 |`J....|7|........|
|000004e0| 82 49 4e 54 50 00 65 6c | 70 22 20 69 96 10 00 00 |.INTP.el|p" i....|
|000004f0| 45 ff ff ff 50 55 0c 13 | 03 00 38 45 96 10 00 00 |E...PU..|..8E....|
|00000500| dc 2e 02 00 82 49 53 46 | 4a 00 65 6c 70 22 20 69 |.....ISF|J.elp" i|
|00000510| e6 17 00 00 45 ff ff ff | 40 60 0c 13 03 00 a6 40 |....E...|@`.....@|
|00000520| e6 17 00 00 96 3f 02 00 | 82 49 53 46 50 00 65 6c |.....?..|.ISFP.el|
|00000530| 70 22 20 69 af 0b 00 00 | 45 ff ff ff 30 6b 0c 13 |p" i....|E...0k..|
|00000540| 03 00 72 71 af 0b 00 00 | a0 57 02 00 82 49 53 54 |..rq....|.W...IST|
|00000550| 4a 00 65 6c 70 22 20 69 | 28 09 00 00 45 ff ff ff |J.elp" i|(...E...|
|00000560| c8 73 0c 13 03 00 b2 93 | 28 09 00 00 73 63 02 00 |.s......|(...sc..|
|00000570| 82 49 53 54 50 00 65 6c | 70 22 20 69 e1 0e 00 00 |.ISTP.el|p" i....|
|00000580| 45 ff ff ff 80 7f 0c 13 | 03 00 bc d6 e1 0e 00 00 |E.......|........|
|00000590| bf 6c 02 00 82 50 54 53 | 00 48 65 6c 70 22 20 69 |.l...PTS|.Help" i|
|000005a0| 75 b0 00 00 45 ff ff ff | 08 5b 0d 13 03 00 c3 88 |u...E...|.[......|
|000005b0| 75 b0 00 00 c4 7b 02 00 | 82 52 45 41 44 4d 45 2f |u....{..|.README/|
|000005c0| 31 53 54 00 31 06 00 00 | 45 ff ff ff 88 4f 09 0c |1ST.1...|E....O..|
|000005d0| 03 00 78 c7 31 06 00 00 | 5d 2c 03 00 00 43 61 6e |..x.1...|],...Can|
|000005e0| 20 48 65 6c 70 22 20 69 | 6e 20 74 68 65 20 64 6f | Help" i|n the do|
|000005f0| 63 75 6d 65 6e 74 61 74 | 69 6f 6e 2e e6 4c 54 50 |cumentat|ion..LTP|
|00000600| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000610| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000620| 00 00 00 00 46 69 6c 65 | 44 61 74 61 82 21 48 65 |....File|Data.!He|
|00000630| 6c 70 00 00 72 20 66 65 | 42 07 00 00 45 ff ff ff |lp..r fe|B...E...|
|00000640| a5 7d 76 47 03 00 be cc | 44 49 44 44 4c 59 0a 44 |.}vG....|DIDDLY.D|
|00000650| 75 6e 69 68 6f 20 61 6e | 64 20 44 75 6e 69 68 6f |uniho an|d Duniho|
|00000660| 20 4c 69 66 65 20 50 61 | 74 74 65 72 6e 20 49 6e | Life Pa|ttern In|
|00000670| 64 69 63 61 74 6f 72 0a | 0a 41 62 6f 75 74 20 74 |dicator.|.About t|
|00000680| 68 69 73 20 70 72 6f 67 | 72 61 6d 3a 0a 20 20 20 |his prog|ram:. |
|00000690| 20 20 20 20 20 20 54 68 | 69 73 20 70 72 6f 67 72 | Th|is progr|
|000006a0| 61 6d 20 61 73 6b 73 20 | 79 6f 75 20 71 75 65 73 |am asks |you ques|
|000006b0| 74 69 6f 6e 73 20 69 6e | 20 6f 72 64 65 72 20 74 |tions in| order t|
|000006c0| 6f 20 64 65 74 65 72 6d | 69 6e 65 20 79 6f 75 72 |o determ|ine your|
|000006d0| 0a 70 73 79 63 68 6f 6c | 6f 67 69 63 61 6c 20 74 |.psychol|ogical t|
|000006e0| 79 70 65 2e 20 20 54 6f | 20 66 75 6c 6c 79 20 75 |ype. To| fully u|
|000006f0| 6e 64 65 72 73 74 61 6e | 64 20 74 68 65 20 72 65 |nderstan|d the re|
|00000700| 73 75 6c 74 73 20 61 6e | 64 20 74 6f 20 67 65 74 |sults an|d to get|
|00000710| 20 74 68 65 20 6d 6f 73 | 74 20 66 72 6f 6d 0a 74 | the mos|t from.t|
|00000720| 68 69 73 20 70 72 6f 67 | 72 61 6d 2c 20 79 6f 75 |his prog|ram, you|
|00000730| 20 73 68 6f 75 6c 64 20 | 72 65 61 64 20 74 68 65 | should |read the|
|00000740| 20 61 63 63 6f 6d 70 61 | 6e 79 69 6e 67 20 74 65 | accompa|nying te|
|00000750| 78 74 20 66 69 6c 65 73 | 20 3a 20 44 44 4c 49 2f |xt files| : DDLI/|
|00000760| 44 4f 43 20 61 6e 64 20 | 50 54 53 2e 0a 20 20 20 |DOC and |PTS.. |
|00000770| 20 20 20 20 20 54 68 65 | 72 65 20 61 72 65 20 61 | The|re are a|
|00000780| 6c 73 6f 20 73 69 78 74 | 65 65 6e 20 64 65 73 63 |lso sixt|een desc|
|00000790| 72 69 70 74 69 6f 6e 73 | 20 6f 66 20 74 68 65 20 |riptions| of the |
|000007a0| 70 65 72 73 6f 6e 61 6c | 69 74 79 20 74 79 70 65 |personal|ity type|
|000007b0| 73 2c 28 69 6e 20 74 68 | 65 0a 66 69 6c 65 73 20 |s,(in th|e.files |
|000007c0| 45 4e 54 50 2c 20 45 53 | 46 4a 2c 20 45 53 46 50 |ENTP, ES|FJ, ESFP|
|000007d0| 20 65 74 63 2e 29 20 73 | 6f 20 74 68 61 74 20 79 | etc.) s|o that y|
|000007e0| 6f 75 20 63 61 6e 20 71 | 75 69 63 6b 6c 79 20 72 |ou can q|uickly r|
|000007f0| 65 61 64 20 61 62 6f 75 | 74 20 79 6f 75 72 20 74 |ead abou|t your t|
|00000800| 79 70 65 2e 0a 20 20 20 | 20 20 20 20 20 41 6c 74 |ype.. | Alt|
|00000810| 68 6f 75 67 68 20 69 74 | 20 69 73 20 66 75 6e 20 |hough it| is fun |
|00000820| 74 6f 20 75 73 65 2c 20 | 69 74 20 69 73 20 62 61 |to use, |it is ba|
|00000830| 73 65 64 20 6f 6e 20 52 | 45 41 4c 20 70 73 79 63 |sed on R|EAL psyc|
|00000840| 68 6f 6c 6f 67 79 20 61 | 6e 64 20 69 6e 20 6d 79 |hology a|nd in my|
|00000850| 0a 65 78 65 72 69 65 6e | 63 65 20 69 73 20 72 61 |.exerien|ce is ra|
|00000860| 74 68 65 72 20 61 63 63 | 75 72 61 74 65 2e 20 20 |ther acc|urate. |
|00000870| 54 68 65 72 65 20 61 72 | 65 20 6e 6f 20 27 62 61 |There ar|e no 'ba|
|00000880| 64 27 20 6f 72 20 27 77 | 72 6f 6e 67 27 20 61 6e |d' or 'w|rong' an|
|00000890| 73 77 65 72 73 20 61 6e | 64 20 74 68 65 0a 70 65 |swers an|d the.pe|
|000008a0| 72 73 6f 6e 61 6c 69 74 | 79 20 74 79 70 65 73 20 |rsonalit|y types |
|000008b0| 72 65 70 72 65 73 65 6e | 74 20 27 6e 6f 72 6d 61 |represen|t 'norma|
|000008c0| 6c 27 20 70 65 6f 70 6c | 65 2e 20 20 53 6f 20 69 |l' peopl|e. So i|
|000008d0| 74 27 73 20 6e 6f 74 20 | 67 6f 69 6e 67 20 74 6f |t's not |going to|
|000008e0| 20 74 65 6c 6c 20 79 6f | 75 0a 74 68 61 74 20 79 | tell yo|u.that y|
|000008f0| 6f 75 20 61 72 65 20 69 | 6e 73 61 6e 65 20 28 65 |ou are i|nsane (e|
|00000900| 76 65 6e 20 69 66 20 79 | 6f 75 20 61 72 65 20 3a |ven if y|ou are :|
|00000910| 2d 29 29 2e 0a 20 20 20 | 20 20 20 20 20 54 68 65 |-)).. | The|
|00000920| 20 61 75 74 68 6f 72 73 | 20 6f 66 20 74 68 69 73 | authors| of this|
|00000930| 20 73 6f 66 74 77 61 72 | 65 20 61 72 65 20 63 72 | softwar|e are cr|
|00000940| 65 64 69 74 65 64 20 69 | 6e 20 74 68 65 20 6f 74 |edited i|n the ot|
|00000950| 68 65 72 20 73 75 70 6f | 72 74 20 66 69 6c 65 73 |her supo|rt files|
|00000960| 2e 0a 20 20 20 20 20 20 | 20 20 49 74 20 77 61 73 |.. | It was|
|00000970| 20 70 75 74 20 69 6e 74 | 6f 20 41 72 63 68 69 6d | put int|o Archim|
|00000980| 65 64 65 73 20 70 75 62 | 6c 69 63 20 64 6f 6d 61 |edes pub|lic doma|
|00000990| 69 6e 20 62 79 20 41 6e | 64 72 65 77 20 42 65 6e |in by An|drew Ben|
|000009a0| 6e 65 74 74 20 61 6e 64 | 20 69 73 0a 66 72 65 65 |nett and| is.free|
|000009b0| 77 61 72 65 20 28 49 20 | 68 61 76 6e 27 74 20 61 |ware (I |havn't a|
|000009c0| 6c 74 65 72 65 64 20 69 | 74 20 6d 75 63 68 20 66 |ltered i|t much f|
|000009d0| 72 6f 6d 20 69 74 27 73 | 20 41 4e 53 49 20 43 20 |rom it's| ANSI C |
|000009e0| 66 6f 72 6d 2c 20 6d 61 | 79 62 65 20 49 27 6c 6c |form, ma|ybe I'll|
|000009f0| 20 67 65 74 0a 61 72 6f | 75 6e 64 20 74 6f 20 64 | get.aro|und to d|
|00000a00| 6f 69 6e 67 20 61 20 64 | 65 73 6b 74 6f 70 20 69 |oing a d|esktop i|
|00000a10| 6e 74 65 72 66 61 63 65 | 2e 29 0a 20 20 20 20 20 |nterface|.). |
|00000a20| 20 20 20 20 0a 51 75 69 | 63 6b 20 69 6e 73 74 72 | .Qui|ck instr|
|00000a30| 75 63 74 69 6f 6e 73 3a | 0a 20 20 20 20 20 20 20 |uctions:|. |
|00000a40| 20 54 68 65 20 70 72 6f | 67 72 61 6d 20 61 73 6b | The pro|gram ask|
|00000a50| 73 20 31 31 30 20 71 75 | 65 73 74 69 6f 6e 73 2c |s 110 qu|estions,|
|00000a60| 20 77 69 74 68 20 61 6e | 20 41 20 6f 72 20 42 20 | with an| A or B |
|00000a70| 61 6e 73 77 65 72 20 28 | 79 6f 75 20 6d 61 79 20 |answer (|you may |
|00000a80| 61 6c 73 6f 0a 74 79 70 | 65 20 22 51 22 20 66 6f |also.typ|e "Q" fo|
|00000a90| 72 20 71 75 69 74 2c 20 | 22 50 22 20 66 6f 72 20 |r quit, |"P" for |
|00000aa0| 70 72 65 76 69 6f 75 73 | 20 71 75 65 73 74 69 6f |previous| questio|
|00000ab0| 6e 20 61 6e 64 20 22 53 | 22 20 66 6f 72 20 73 6b |n and "S|" for sk|
|00000ac0| 69 70 20 61 20 71 75 65 | 73 74 69 6f 6e 0a 75 6e |ip a que|stion.un|
|00000ad0| 74 69 6c 20 6c 61 74 65 | 72 29 2e 20 20 41 66 74 |til late|r). Aft|
|00000ae0| 65 72 20 65 61 63 68 20 | 6f 6e 65 20 79 6f 75 20 |er each |one you |
|00000af0| 77 69 6c 6c 20 62 65 20 | 61 73 6b 65 64 20 74 6f |will be |asked to|
|00000b00| 20 72 61 74 65 20 79 6f | 75 72 20 70 72 65 66 65 | rate yo|ur prefe|
|00000b10| 72 65 63 65 20 6f 66 20 | 74 68 65 0a 6c 65 74 74 |rece of |the.lett|
|00000b20| 65 72 20 74 68 61 74 20 | 79 6f 75 20 63 68 6f 73 |er that |you chos|
|00000b30| 65 20 6f 76 65 72 20 74 | 68 65 20 6f 74 68 65 72 |e over t|he other|
|00000b40| 20 6c 65 74 74 65 72 20 | 6f 6e 20 61 20 73 63 61 | letter |on a sca|
|00000b50| 6c 65 20 6f 66 20 6f 6e | 65 20 74 6f 20 73 65 76 |le of on|e to sev|
|00000b60| 65 6e 2e 0a 09 0a 20 20 | 20 20 20 20 20 20 20 41 |en.... | A|
|00000b70| 66 74 65 72 20 74 68 65 | 20 71 75 65 73 74 69 6f |fter the| questio|
|00000b80| 6e 73 20 79 6f 75 20 77 | 69 6c 6c 20 62 65 20 61 |ns you w|ill be a|
|00000b90| 73 6b 65 64 20 69 66 20 | 79 6f 75 20 77 61 6e 74 |sked if |you want|
|00000ba0| 20 74 68 65 20 6f 75 74 | 70 75 74 20 74 6f 0a 73 | the out|put to.s|
|00000bb0| 63 72 65 65 6e 2c 20 66 | 69 6c 65 20 6f 72 20 70 |creen, f|ile or p|
|00000bc0| 72 69 6e 74 65 72 2e 20 | 20 49 66 20 79 6f 75 20 |rinter. | If you |
|00000bd0| 63 68 6f 6f 73 65 20 27 | 66 69 6c 65 27 2c 20 74 |choose '|file', t|
|00000be0| 79 70 65 20 69 6e 20 61 | 20 66 69 6c 65 20 6e 61 |ype in a| file na|
|00000bf0| 6d 65 20 61 6e 64 20 69 | 74 0a 77 69 6c 6c 20 62 |me and i|t.will b|
|00000c00| 65 20 73 61 76 65 64 20 | 74 6f 20 74 68 65 20 72 |e saved |to the r|
|00000c10| 6f 6f 74 20 6f 66 20 79 | 6f 75 72 20 64 65 66 61 |oot of y|our defa|
|00000c20| 75 6c 74 20 66 69 6c 65 | 20 73 79 73 74 65 6d 20 |ult file| system |
|00000c30| 28 49 20 6b 6e 6f 77 20 | 69 74 27 73 20 61 20 62 |(I know |it's a b|
|00000c40| 69 74 0a 70 72 69 6d 69 | 74 69 76 65 20 61 74 20 |it.primi|tive at |
|00000c50| 74 68 65 20 6d 6f 6d 65 | 6e 74 29 2e 0a 09 20 46 |the mome|nt)... F|
|00000c60| 69 6e 61 6c 6c 79 20 79 | 6f 75 20 77 69 6c 6c 20 |inally y|ou will |
|00000c70| 62 65 20 61 73 6b 65 64 | 20 69 66 20 79 6f 75 20 |be asked| if you |
|00000c80| 77 61 6e 74 20 74 6f 20 | 73 61 76 65 20 74 68 65 |want to |save the|
|00000c90| 20 72 61 77 20 64 61 74 | 61 2c 20 74 68 69 73 20 | raw dat|a, this |
|00000ca0| 69 73 0a 66 6f 72 20 73 | 65 6e 64 69 6e 67 20 20 |is.for s|ending |
|00000cb0| 79 6f 75 72 20 64 61 74 | 61 20 74 6f 20 74 68 65 |your dat|a to the|
|00000cc0| 20 61 75 74 68 6f 72 73 | 20 73 6f 20 74 68 61 74 | authors| so that|
|00000cd0| 20 74 68 65 79 20 63 61 | 6e 20 69 6d 70 72 6f 76 | they ca|n improv|
|00000ce0| 65 20 74 68 65 20 73 6f | 66 74 77 61 72 65 2e 20 |e the so|ftware. |
|00000cf0| 0a 53 6f 20 61 6e 73 77 | 65 72 20 6e 6f 20 69 66 |.So answ|er no if|
|00000d00| 20 79 6f 75 20 64 6f 6e | 27 74 20 69 6e 74 65 6e | you don|'t inten|
|00000d10| 64 20 74 6f 20 64 6f 20 | 74 68 69 73 2e 0a 0a 09 |d to do |this....|
|00000d20| 41 6e 64 20 74 68 61 74 | 27 73 20 69 74 2c 20 61 |And that|'s it, a|
|00000d30| 6c 6c 20 79 6f 75 20 6e | 65 65 64 20 74 6f 20 64 |ll you n|eed to d|
|00000d40| 6f 20 6e 6f 77 20 69 73 | 20 6c 6f 6f 6b 20 75 70 |o now is| look up|
|00000d50| 20 79 6f 75 72 20 74 79 | 70 65 73 20 69 6e 20 74 | your ty|pes in t|
|00000d60| 68 65 0a 44 6f 63 73 20 | 64 69 72 65 63 74 6f 72 |he.Docs |director|
|00000d70| 79 2e 0a 0a 09 53 6f 75 | 72 63 65 73 20 61 72 65 |y....Sou|rces are|
|00000d80| 20 69 6e 63 6c 75 64 65 | 64 2e 46 69 6c 65 44 61 | include|d.FileDa|
|00000d90| 74 61 82 21 52 75 6e 00 | 08 00 72 20 66 65 68 00 |ta.!Run.|..r feh.|
|00000da0| 00 00 45 eb ff ff d2 89 | 7f 47 03 00 57 a2 49 63 |..E.....|.G..W.Ic|
|00000db0| 6f 6e 53 70 72 69 74 65 | 73 20 3c 4f 62 65 79 24 |onSprite|s <Obey$|
|00000dc0| 44 69 72 3e 2e 21 53 70 | 72 69 74 65 73 0a 73 65 |Dir>.!Sp|rites.se|
|00000dd0| 74 20 44 69 64 64 6c 79 | 24 44 69 72 20 3c 4f 62 |t Diddly|$Dir <Ob|
|00000de0| 65 79 24 44 69 72 3e 0a | 77 69 6d 70 73 6c 6f 74 |ey$Dir>.|wimpslot|
|00000df0| 20 2d 6d 69 6e 20 34 38 | 6b 20 2d 6d 61 78 20 34 | -min 48|k -max 4|
|00000e00| 38 6b 0a 3c 44 69 64 64 | 6c 79 24 44 69 72 3e 2e |8k.<Didd|ly$Dir>.|
|00000e10| 44 44 4c 49 0a 0a 46 69 | 6c 65 44 61 74 61 82 21 |DDLI..Fi|leData.!|
|00000e20| 53 70 72 69 74 65 73 00 | 66 65 b0 03 00 00 45 f9 |Sprites.|fe....E.|
|00000e30| ff ff 71 8e 77 47 03 00 | 7c 11 01 00 00 00 10 00 |..q.wG..||.......|
|00000e40| 00 00 b4 03 00 00 a4 03 | 00 00 21 64 69 64 64 6c |........|..!diddl|
|00000e50| 79 00 00 00 00 00 04 00 | 00 00 12 00 00 00 00 00 |y.......|........|
|00000e60| 00 00 07 00 00 00 ac 00 | 00 00 28 02 00 00 0c 00 |........|..(.....|
|00000e70| 00 00 00 ff ff ff 00 ff | ff ff 00 dd dd dd 00 dd |........|........|
|00000e80| dd dd 00 bb bb bb 00 bb | bb bb 00 99 99 99 00 99 |........|........|
|00000e90| 99 99 00 77 77 77 00 77 | 77 77 00 55 55 55 00 55 |...www.w|ww.UUU.U|
|00000ea0| 55 55 00 33 33 33 00 33 | 33 33 00 00 00 00 00 00 |UU.333.3|33......|
|00000eb0| 00 00 00 00 44 99 00 00 | 44 99 00 ee ee 00 00 ee |....D...|D.......|
|00000ec0| ee 00 00 00 cc 00 00 00 | cc 00 00 dd 00 00 00 dd |........|........|
|00000ed0| 00 00 00 ee ee bb 00 ee | ee bb 00 55 88 00 00 55 |........|...U...U|
|00000ee0| 88 00 00 ff bb 00 00 ff | bb 00 00 00 bb ff 00 00 |........|........|
|00000ef0| bb ff 00 00 00 00 00 00 | 10 31 33 13 01 00 00 00 |........|.13.....|
|00000f00| 00 00 00 44 44 04 00 00 | 00 00 00 52 66 55 75 77 |...DD...|...RfUuw|
|00000f10| 77 35 01 00 00 00 00 44 | 44 04 00 00 00 00 41 77 |w5.....D|D.....Aw|
|00000f20| 01 00 00 73 77 77 47 00 | 00 00 00 44 44 04 00 00 |...swwG.|...DD...|
|00000f30| 00 00 75 77 15 00 00 40 | 77 77 77 03 00 00 00 44 |..uw...@|www....D|
|00000f40| 44 04 00 00 00 10 77 77 | 67 01 00 20 77 77 77 05 |D.....ww|g.. www.|
|00000f50| 00 00 00 44 44 04 00 00 | 00 10 75 77 57 00 00 20 |...DD...|..uwW.. |
|00000f60| 77 77 77 05 00 00 00 44 | 44 04 00 00 00 00 20 55 |www....D|D..... U|
|00000f70| 13 00 00 40 77 77 77 03 | 00 00 00 44 44 04 00 00 |...@www.|...DD...|
|00000f80| 00 00 00 00 00 00 00 73 | 77 77 47 00 00 00 00 44 |.......s|wwG....D|
|00000f90| 44 04 00 00 00 00 00 00 | 00 00 10 77 77 36 01 00 |D.......|...ww6..|
|00000fa0| 00 00 00 44 44 04 00 00 | 00 00 00 00 00 00 51 77 |...DD...|......Qw|
|00000fb0| 14 00 00 00 00 00 00 44 | 44 04 00 00 00 00 00 00 |.......D|D.......|
|00000fc0| 00 00 73 14 00 00 00 00 | 00 00 00 44 44 04 00 00 |..s.....|...DD...|
|00000fd0| 00 00 00 00 00 00 76 00 | 00 00 00 00 00 00 00 44 |......v.|.......D|
|00000fe0| 44 04 00 00 00 00 00 00 | 00 00 22 00 00 00 00 00 |D.......|..".....|
|00000ff0| 00 00 00 44 44 04 00 00 | 00 00 00 00 00 00 00 00 |...DD...|........|
|00001000| 00 00 00 00 00 00 00 44 | 44 04 00 00 00 00 00 00 |.......D|D.......|
|00001010| 10 64 77 25 00 00 00 00 | 00 00 00 44 44 04 00 00 |.dw%....|...DD...|
|00001020| 00 00 00 00 71 77 77 77 | 04 00 00 00 00 00 00 44 |....qwww|.......D|
|00001030| 44 04 00 00 00 00 00 00 | 73 77 77 77 06 00 00 00 |D.......|swww....|
|00001040| 00 00 00 44 44 04 00 00 | 00 00 00 00 40 77 77 67 |...DD...|....@wwg|
|00001050| 02 00 00 00 00 00 00 44 | 44 04 00 00 00 00 00 00 |.......D|D.......|
|00001060| 00 21 33 01 00 00 00 00 | 00 00 00 44 44 04 00 00 |.!3.....|...DD...|
|00001070| 00 00 00 00 f0 ff ff ff | 0f 00 00 00 00 00 00 ff |........|........|
|00001080| ff ff 00 00 00 00 00 ff | ff ff ff ff ff ff 0f 00 |........|........|
|00001090| 00 00 00 ff ff ff 00 00 | 00 00 ff ff 0f 00 00 ff |........|........|
|000010a0| ff ff ff 00 00 00 00 ff | ff ff 00 00 00 00 ff ff |........|........|
|000010b0| ff 00 00 f0 ff ff ff 0f | 00 00 00 ff ff ff 00 00 |........|........|
|000010c0| 00 f0 ff ff ff 0f 00 f0 | ff ff ff 0f 00 00 00 ff |........|........|
|000010d0| ff ff 00 00 00 f0 ff ff | ff 00 00 f0 ff ff ff 0f |........|........|
|000010e0| 00 00 00 ff ff ff 00 00 | 00 00 f0 ff ff 00 00 f0 |........|........|
|000010f0| ff ff ff 0f 00 00 00 ff | ff ff 00 00 00 00 00 00 |........|........|
|00001100| 00 00 00 ff ff ff ff 00 | 00 00 00 ff ff ff 00 00 |........|........|
|00001110| 00 00 00 00 00 00 f0 ff | ff ff 0f 00 00 00 00 ff |........|........|
|00001120| ff ff 00 00 00 00 00 00 | 00 00 ff ff ff 00 00 00 |........|........|
|00001130| 00 00 00 ff ff ff 00 00 | 00 00 00 00 00 00 ff ff |........|........|
|00001140| 00 00 00 00 00 00 00 ff | ff ff 00 00 00 00 00 00 |........|........|
|00001150| 00 00 ff 00 00 00 00 00 | 00 00 00 ff ff ff 00 00 |........|........|
|00001160| 00 00 00 00 00 00 ff 00 | 00 00 00 00 00 00 00 ff |........|........|
|00001170| ff ff 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001180| 00 00 00 ff ff ff 00 00 | 00 00 00 00 f0 ff ff ff |........|........|
|00001190| 00 00 00 00 00 00 00 ff | ff ff 00 00 00 00 00 00 |........|........|
|000011a0| ff ff ff ff 0f 00 00 00 | 00 00 00 ff ff ff 00 00 |........|........|
|000011b0| 00 00 00 00 ff ff ff ff | 0f 00 00 00 00 00 00 ff |........|........|
|000011c0| ff ff 00 00 00 00 00 00 | f0 ff ff ff 0f 00 00 00 |........|........|
|000011d0| 00 00 00 ff ff ff 00 00 | 00 00 00 00 00 ff ff 0f |........|........|
|000011e0| 00 00 00 00 00 00 00 ff | ff ff 46 69 6c 65 44 61 |........|..FileDa|
|000011f0| 74 61 82 44 44 4c 49 00 | 00 00 00 00 00 00 6a 26 |ta.DDLI.|......j&|
|00001200| 00 00 45 fd ff ff 4b 52 | d2 98 03 00 99 90 2f 2a |..E...KR|....../*|
|00001210| 0a 20 2a 20 20 64 64 6c | 69 2e 63 0a 20 2a 20 20 |. * ddl|i.c. * |
|00001220| 54 68 65 20 44 75 6e 69 | 68 6f 20 61 6e 64 20 44 |The Duni|ho and D|
|00001230| 75 6e 69 68 6f 20 4c 69 | 66 65 20 50 61 74 74 65 |uniho Li|fe Patte|
|00001240| 72 6e 20 49 6e 64 69 63 | 61 74 6f 72 0a 20 2a 20 |rn Indic|ator. * |
|00001250| 20 62 79 20 46 65 72 67 | 75 73 20 44 75 6e 69 68 | by Ferg|us Dunih|
|00001260| 6f 0a 20 2a 20 20 43 6f | 70 79 72 69 67 68 74 20 |o. * Co|pyright |
|00001270| 28 63 29 20 31 39 39 32 | 2d 31 39 39 34 20 46 65 |(c) 1992|-1994 Fe|
|00001280| 72 67 75 73 20 44 75 6e | 69 68 6f 0a 20 2a 2f 0a |rgus Dun|iho. */.|
|00001290| 0a 23 64 65 66 69 6e 65 | 20 56 45 52 20 22 56 33 |.#define| VER "V3|
|000012a0| 2e 31 30 22 0a 23 64 65 | 66 69 6e 65 20 45 4d 41 |.10".#de|fine EMA|
|000012b0| 49 4c 20 22 66 64 6e 68 | 40 74 72 6f 69 2e 63 63 |IL "fdnh|@troi.cc|
|000012c0| 2e 72 6f 63 68 65 73 74 | 65 72 2e 65 64 75 22 0a |.rochest|er.edu".|
|000012d0| 0a 23 64 65 66 69 6e 65 | 20 44 49 43 45 20 30 0a |.#define| DICE 0.|
|000012e0| 0a 23 64 65 66 69 6e 65 | 20 41 4d 49 47 41 20 31 |.#define| AMIGA 1|
|000012f0| 0a 23 64 65 66 69 6e 65 | 20 4d 53 44 4f 53 20 32 |.#define| MSDOS 2|
|00001300| 0a 23 64 65 66 69 6e 65 | 20 4f 54 48 45 52 20 33 |.#define| OTHER 3|
|00001310| 0a 23 64 65 66 69 6e 65 | 20 52 49 53 43 4f 53 20 |.#define| RISCOS |
|00001320| 34 0a 0a 23 64 65 66 69 | 6e 65 20 4f 50 53 59 53 |4..#defi|ne OPSYS|
|00001330| 20 41 4d 49 47 41 0a 0a | 23 69 66 20 4f 50 53 59 | AMIGA..|#if OPSY|
|00001340| 53 20 3d 3d 20 41 4d 49 | 47 41 0a 20 20 20 20 23 |S == AMI|GA. #|
|00001350| 64 65 66 69 6e 65 20 70 | 72 74 64 65 76 20 22 50 |define p|rtdev "P|
|00001360| 52 54 3a 22 0a 20 20 20 | 20 23 64 65 66 69 6e 65 |RT:". | #define|
|00001370| 20 46 49 4c 45 5f 4e 41 | 4d 45 5f 4d 41 58 20 33 | FILE_NA|ME_MAX 3|
|00001380| 32 0a 23 65 6c 69 66 20 | 4f 50 53 59 53 20 3d 3d |2.#elif |OPSYS ==|
|00001390| 20 4d 53 44 4f 53 0a 20 | 20 20 20 23 64 65 66 69 | MSDOS. | #defi|
|000013a0| 6e 65 20 70 72 74 64 65 | 76 20 22 50 52 4e 22 0a |ne prtde|v "PRN".|
|000013b0| 20 20 20 20 23 64 65 66 | 69 6e 65 20 46 49 4c 45 | #def|ine FILE|
|000013c0| 5f 4e 41 4d 45 5f 4d 41 | 58 20 38 0a 23 65 6c 69 |_NAME_MA|X 8.#eli|
|000013d0| 66 20 4f 50 53 59 53 20 | 3d 3d 20 52 49 53 43 4f |f OPSYS |== RISCO|
|000013e0| 53 0a 20 20 20 20 23 64 | 65 66 69 6e 65 20 70 72 |S. #d|efine pr|
|000013f0| 74 64 65 76 20 22 70 72 | 69 6e 74 65 72 3a 22 0a |tdev "pr|inter:".|
|00001400| 20 20 20 20 23 64 65 66 | 69 6e 65 20 46 49 4c 45 | #def|ine FILE|
|00001410| 5f 4e 41 4d 45 5f 4d 41 | 58 20 31 30 0a 23 65 6c |_NAME_MA|X 10.#el|
|00001420| 69 66 20 4f 50 53 59 53 | 20 3d 3d 20 4f 54 48 45 |if OPSYS| == OTHE|
|00001430| 52 0a 20 20 20 20 23 64 | 65 66 69 6e 65 20 70 72 |R. #d|efine pr|
|00001440| 74 64 65 76 20 22 22 0a | 20 20 20 20 23 64 65 66 |tdev "".| #def|
|00001450| 69 6e 65 20 46 49 4c 45 | 5f 4e 41 4d 45 5f 4d 41 |ine FILE|_NAME_MA|
|00001460| 58 20 31 36 0a 23 65 6c | 73 65 0a 20 20 20 20 23 |X 16.#el|se. #|
|00001470| 65 72 72 6f 72 20 4f 50 | 45 52 41 54 49 4e 47 20 |error OP|ERATING |
|00001480| 53 59 53 54 45 4d 20 55 | 4e 4b 4e 4f 57 4e 0a 23 |SYSTEM U|NKNOWN.#|
|00001490| 65 6e 64 69 66 0a 0a 2f | 2a 0a 20 2a 20 49 66 20 |endif../|*. * If |
|000014a0| 79 6f 75 72 20 63 6f 6d | 70 69 6c 65 72 20 64 6f |your com|piler do|
|000014b0| 65 73 20 6e 6f 74 20 68 | 61 76 65 20 74 68 65 20 |es not h|ave the |
|000014c0| 63 6f 6d 6d 61 6e 64 20 | 22 73 74 72 64 75 70 22 |command |"strdup"|
|000014d0| 2c 0a 20 2a 20 77 68 69 | 63 68 20 69 73 20 63 6f |,. * whi|ch is co|
|000014e0| 6d 6d 6f 6e 20 69 6e 20 | 43 20 63 6f 6d 70 69 6c |mmon in |C compil|
|000014f0| 65 72 73 20 62 75 74 20 | 6e 6f 74 20 70 61 72 74 |ers but |not part|
|00001500| 20 6f 66 20 41 4e 53 49 | 0a 20 2a 20 43 2c 20 75 | of ANSI|. * C, u|
|00001510| 6e 63 6f 6d 6d 65 6e 74 | 20 74 68 65 20 6e 65 78 |ncomment| the nex|
|00001520| 74 20 23 69 6e 63 6c 75 | 64 65 20 73 74 61 74 65 |t #inclu|de state|
|00001530| 6d 65 6e 74 2e 0a 20 2a | 2f 0a 23 69 6e 63 6c 75 |ment.. *|/.#inclu|
|00001540| 64 65 20 22 73 74 72 64 | 75 70 2e 63 22 0a 0a 23 |de "strd|up.c"..#|
|00001550| 69 6e 63 6c 75 64 65 20 | 22 66 70 64 69 6f 2e 63 |include |"fpdio.c|
|00001560| 22 0a 23 69 6e 63 6c 75 | 64 65 20 22 71 73 74 2e |".#inclu|de "qst.|
|00001570| 63 22 0a 23 69 6e 63 6c | 75 64 65 20 22 62 62 63 |c".#incl|ude "bbc|
|00001580| 2e 68 22 0a 23 69 6e 63 | 6c 75 64 65 20 3c 74 69 |.h".#inc|lude <ti|
|00001590| 6d 65 2e 68 3e 0a 0a 23 | 64 65 66 69 6e 65 20 58 |me.h>..#|define X|
|000015a0| 4e 20 45 20 3f 20 22 45 | 78 74 72 61 76 65 72 74 |N E ? "E|xtravert|
|000015b0| 65 64 22 20 3a 20 22 49 | 6e 74 72 6f 76 65 72 74 |ed" : "I|ntrovert|
|000015c0| 65 64 22 0a 23 64 65 66 | 69 6e 65 20 51 46 49 4c |ed".#def|ine QFIL|
|000015d0| 45 20 22 3c 44 69 64 64 | 6c 79 24 44 69 72 3e 2e |E "<Didd|ly$Dir>.|
|000015e0| 44 44 4c 49 2f 51 53 54 | 22 0a 0a 69 6e 74 20 70 |DDLI/QST|"..int p|
|000015f0| 6f 77 61 20 28 69 6e 74 | 20 78 2c 20 69 6e 74 20 |owa (int| x, int |
|00001600| 79 29 3b 0a 0a 6d 61 69 | 6e 20 28 69 6e 74 20 61 |y);..mai|n (int a|
|00001610| 72 67 63 2c 20 63 68 61 | 72 20 2a 2a 61 72 67 76 |rgc, cha|r **argv|
|00001620| 29 20 7b 0a 20 20 20 20 | 69 6e 74 20 69 2c 20 63 |) {. |int i, c|
|00001630| 6f 6c 2c 20 73 69 7a 65 | 2c 20 41 2c 20 70 72 5b |ol, size|, A, pr[|
|00001640| 31 34 5d 2c 20 78 2c 0a | 20 20 20 20 20 20 20 20 |14], x,.| |
|00001650| 45 2c 20 49 2c 20 53 2c | 20 4e 2c 20 54 2c 20 46 |E, I, S,| N, T, F|
|00001660| 2c 20 4a 2c 20 50 2c 20 | 45 53 2c 20 45 4e 2c 20 |, J, P, |ES, EN, |
|00001670| 45 54 2c 20 45 46 2c 20 | 52 3b 0a 20 20 20 20 63 |ET, EF, |R;. c|
|00001680| 68 61 72 20 6c 69 6e 65 | 5b 32 35 36 5d 2c 20 6e |har line|[256], n|
|00001690| 6c 69 6e 65 5b 35 31 32 | 5d 2c 20 2a 74 79 70 65 |line[512|], *type|
|000016a0| 2c 20 2a 6e 61 6d 65 2c | 20 2a 66 6e 61 6d 65 2c |, *name,| *fname,|
|000016b0| 20 2a 56 65 72 73 69 6f | 6e 2c 0a 20 20 20 20 20 | *Versio|n,. |
|000016c0| 20 20 20 20 4c 50 5b 35 | 5d 2c 20 4c 50 45 5b 35 | LP[5|], LPE[5|
|000016d0| 5d 2c 20 4c 50 49 5b 35 | 5d 2c 0a 20 20 20 20 20 |], LPI[5|],. |
|000016e0| 20 20 20 20 2a 50 46 5b | 32 5d 20 3d 20 7b 22 49 | *PF[|2] = {"I|
|000016f0| 6e 74 75 69 74 69 6f 6e | 22 2c 20 22 53 65 6e 73 |ntuition|", "Sens|
|00001700| 69 6e 67 22 7d 2c 0a 20 | 20 20 20 20 20 20 20 20 |ing"},. | |
|00001710| 2a 4a 46 5b 32 5d 20 3d | 20 7b 22 54 68 69 6e 6b |*JF[2] =| {"Think|
|00001720| 69 6e 67 22 2c 20 22 46 | 65 65 6c 69 6e 67 22 7d |ing", "F|eeling"}|
|00001730| 2c 0a 20 20 20 20 20 20 | 20 20 20 2a 74 65 78 74 |,. | *text|
|00001740| 31 20 3d 20 22 59 6f 75 | 72 20 25 73 20 66 75 6e |1 = "You|r %s fun|
|00001750| 63 74 69 6f 6e 20 69 73 | 20 25 73 20 25 73 2e 22 |ction is| %s %s."|
|00001760| 3b 0a 20 20 20 20 46 49 | 4c 45 20 2a 66 70 74 72 |;. FI|LE *fptr|
|00001770| 3b 0a 20 20 20 20 71 73 | 74 20 2a 51 3b 0a 0a 20 |;. qs|t *Q;.. |
|00001780| 20 20 20 63 6f 6c 20 3d | 20 38 30 3b 0a 0a 20 20 | col =| 80;.. |
|00001790| 20 20 62 62 63 5f 6d 6f | 64 65 28 31 32 29 3b 0a | bbc_mo|de(12);.|
|000017a0| 0a 20 20 20 20 77 72 61 | 70 77 72 69 74 65 20 28 |. wra|pwrite (|
|000017b0| 73 74 64 6f 75 74 2c 20 | 30 2c 20 30 2c 20 63 6f |stdout, |0, 0, co|
|000017c0| 6c 2c 0a 20 20 20 20 20 | 20 20 20 22 5c 6e 5c 22 |l,. | "\n\"|
|000017d0| 54 68 65 20 44 75 6e 69 | 68 6f 20 61 6e 64 20 44 |The Duni|ho and D|
|000017e0| 75 6e 69 68 6f 20 4c 69 | 66 65 20 50 61 74 74 65 |uniho Li|fe Patte|
|000017f0| 72 6e 20 49 6e 64 69 63 | 61 74 6f 72 5c 22 22 2c |rn Indic|ator\"",|
|00001800| 0a 20 20 20 20 20 20 20 | 20 56 45 52 2c 20 22 5c |. | VER, "\|
|00001810| 6e 42 79 20 46 65 72 67 | 75 73 20 44 75 6e 69 68 |nBy Ferg|us Dunih|
|00001820| 6f 2e 20 43 6f 70 79 72 | 69 67 68 74 20 28 63 29 |o. Copyr|ight (c)|
|00001830| 20 31 39 39 32 2c 20 31 | 39 39 33 22 2c 0a 20 20 | 1992, 1|993",. |
|00001840| 20 20 20 20 20 20 22 46 | 65 72 67 75 73 20 44 75 | "F|ergus Du|
|00001850| 6e 69 68 6f 2e 5c 6e 5c | 6e 4d 6f 73 74 20 6f 66 |niho.\n\|nMost of|
|00001860| 20 74 68 65 20 71 75 65 | 73 74 69 6f 6e 73 20 61 | the que|stions a|
|00001870| 72 65 20 64 72 61 77 6e | 20 66 72 6f 6d 22 2c 0a |re drawn| from",.|
|00001880| 20 20 20 20 20 20 20 20 | 22 61 6e 64 20 62 61 73 | |"and bas|
|00001890| 65 64 20 6f 6e 20 74 68 | 6f 73 65 20 69 6e 20 54 |ed on th|ose in T|
|000018a0| 65 72 65 6e 63 65 20 44 | 75 6e 69 68 6f 27 73 20 |erence D|uniho's |
|000018b0| 5c 22 50 72 65 66 65 72 | 65 6e 63 65 22 2c 0a 20 |\"Prefer|ence",. |
|000018c0| 20 20 20 20 20 20 20 22 | 50 61 74 74 65 72 6e 73 | "|Patterns|
|000018d0| 20 51 75 65 73 74 69 6f | 6e 61 69 72 65 5c 22 20 | Questio|naire\" |
|000018e0| 61 6e 64 20 68 69 73 20 | 62 6f 6f 6b 20 5f 57 68 |and his |book _Wh|
|000018f0| 6f 6c 65 6e 65 73 73 20 | 4c 69 65 73 22 2c 0a 20 |oleness |Lies",. |
|00001900| 20 20 20 20 20 20 20 22 | 57 69 74 68 69 6e 5f 2e | "|Within_.|
|00001910| 20 46 65 72 67 75 73 20 | 69 73 20 72 65 73 70 6f | Fergus |is respo|
|00001920| 6e 73 69 62 6c 65 20 66 | 6f 72 20 74 68 65 20 63 |nsible f|or the c|
|00001930| 68 6f 69 63 65 20 6f 66 | 20 71 75 65 73 74 69 6f |hoice of| questio|
|00001940| 6e 73 2e 22 2c 0a 20 20 | 20 20 20 20 20 20 22 5c |ns.",. | "\|
|00001950| 6e 5c 6e 54 68 69 73 20 | 70 72 6f 64 75 63 74 20 |n\nThis |product |
|00001960| 69 73 20 66 72 65 65 77 | 61 72 65 2e 20 53 65 6e |is freew|are. Sen|
|00001970| 64 20 63 6f 6d 6d 65 6e | 74 73 2c 20 62 75 67 20 |d commen|ts, bug |
|00001980| 72 65 70 6f 72 74 73 2c | 22 2c 0a 20 20 20 20 20 |reports,|",. |
|00001990| 20 20 20 22 72 65 70 6f | 72 74 73 20 6f 6e 20 61 | "repo|rts on a|
|000019a0| 63 63 75 72 61 63 79 2c | 20 61 6e 64 20 73 75 67 |ccuracy,| and sug|
|000019b0| 67 65 73 74 69 6f 6e 73 | 20 66 6f 72 20 69 6d 70 |gestions| for imp|
|000019c0| 72 6f 76 65 6d 65 6e 74 | 20 74 6f 22 2c 0a 20 20 |rovement| to",. |
|000019d0| 20 20 20 20 20 20 22 46 | 65 72 67 75 73 20 44 75 | "F|ergus Du|
|000019e0| 6e 69 68 6f 20 61 74 20 | 74 68 65 20 66 6f 6c 6c |niho at |the foll|
|000019f0| 6f 77 69 6e 67 20 61 64 | 64 72 65 73 73 3a 5c 6e |owing ad|dress:\n|
|00001a00| 5c 6e 22 2c 20 45 4d 41 | 49 4c 2c 20 30 29 3b 0a |\n", EMA|IL, 0);.|
|00001a10| 0a 20 20 20 20 73 69 7a | 65 20 3d 20 4c 69 6e 65 |. siz|e = Line|
|00001a20| 66 65 65 64 73 28 51 46 | 49 4c 45 29 20 2f 20 33 |feeds(QF|ILE) / 3|
|00001a30| 3b 0a 20 20 20 20 51 20 | 3d 20 6e 65 77 5f 71 6e |;. Q |= new_qn|
|00001a40| 6f 64 65 28 30 29 3b 0a | 20 20 20 20 51 2d 3e 70 |ode(0);.| Q->p|
|00001a50| 76 20 3d 20 51 2d 3e 6e | 78 20 3d 20 51 3b 0a 20 |v = Q->n|x = Q;. |
|00001a60| 20 20 20 56 65 72 73 69 | 6f 6e 20 3d 20 47 65 74 | Versi|on = Get|
|00001a70| 5f 51 4c 69 73 74 20 28 | 51 46 49 4c 45 2c 20 51 |_QList (|QFILE, Q|
|00001a80| 2c 20 73 69 7a 65 29 3b | 0a 0a 20 20 20 20 77 72 |, size);|.. wr|
|00001a90| 61 70 77 72 69 74 65 20 | 28 73 74 64 6f 75 74 2c |apwrite |(stdout,|
|00001aa0| 20 30 2c 20 30 2c 20 63 | 6f 6c 2c 20 22 5c 6e 57 | 0, 0, c|ol, "\nW|
|00001ab0| 68 61 74 20 69 73 20 79 | 6f 75 72 20 6e 61 6d 65 |hat is y|our name|
|00001ac0| 3f 22 2c 20 30 29 3b 0a | 20 20 20 20 6e 61 6d 65 |?", 0);.| name|
|00001ad0| 20 3d 20 63 6c 6f 6e 65 | 5f 6c 69 6e 65 28 73 74 | = clone|_line(st|
|00001ae0| 64 69 6e 2c 20 38 30 29 | 3b 0a 0a 23 69 66 64 65 |din, 80)|;..#ifde|
|00001af0| 66 20 44 45 42 55 47 0a | 20 20 20 20 77 72 61 70 |f DEBUG.| wrap|
|00001b00| 77 72 69 74 65 20 28 73 | 74 64 6f 75 74 2c 20 30 |write (s|tdout, 0|
|00001b10| 2c 20 30 2c 20 63 6f 6c | 2c 0a 20 20 20 20 20 20 |, 0, col|,. |
|00001b20| 20 20 22 45 6e 74 65 72 | 20 61 6e 20 69 6e 74 65 | "Enter| an inte|
|00001b30| 67 65 72 20 61 73 20 61 | 20 73 65 65 64 20 76 61 |ger as a| seed va|
|00001b40| 6c 75 65 20 66 6f 72 20 | 74 68 65 20 72 61 6e 64 |lue for |the rand|
|00001b50| 6f 6d 20 23 20 67 65 6e | 65 72 61 74 6f 72 22 2c |om # gen|erator",|
|00001b60| 20 30 29 3b 0a 20 20 20 | 20 73 72 61 6e 64 20 28 | 0);. | srand (|
|00001b70| 66 67 65 74 70 28 73 74 | 64 69 6e 29 29 3b 0a 23 |fgetp(st|din));.#|
|00001b80| 65 6c 73 65 0a 20 20 20 | 20 73 72 61 6e 64 20 28 |else. | srand (|
|00001b90| 63 6c 6f 63 6b 28 29 29 | 3b 0a 23 65 6e 64 69 66 |clock())|;.#endif|
|00001ba0| 0a 0a 20 20 20 20 66 6f | 72 20 28 69 20 3d 20 30 |.. fo|r (i = 0|
|00001bb0| 3b 20 69 20 3c 20 31 34 | 3b 20 69 2b 2b 29 20 2f |; i < 14|; i++) /|
|00001bc0| 2a 20 49 6e 69 74 69 61 | 6c 69 7a 65 73 20 50 72 |* Initia|lizes Pr|
|00001bd0| 65 66 65 72 65 6e 63 65 | 20 53 63 6f 72 65 73 20 |eference| Scores |
|00001be0| 74 6f 20 5a 65 72 6f 20 | 2a 2f 0a 20 20 20 20 20 |to Zero |*/. |
|00001bf0| 20 20 20 70 72 5b 69 5d | 20 3d 20 30 3b 0a 0a 20 | pr[i]| = 0;.. |
|00001c00| 20 20 20 69 66 20 28 61 | 72 67 63 20 3d 3d 20 31 | if (a|rgc == 1|
|00001c10| 29 20 7b 0a 20 20 20 20 | 20 20 20 20 51 20 3d 20 |) {. | Q = |
|00001c20| 52 4e 44 5f 51 4c 69 73 | 74 20 28 51 2c 20 73 69 |RND_QLis|t (Q, si|
|00001c30| 7a 65 29 3b 0a 20 20 20 | 20 20 20 20 20 41 73 6b |ze);. | Ask|
|00001c40| 51 75 65 73 74 69 6f 6e | 73 20 28 51 2c 20 63 6f |Question|s (Q, co|
|00001c50| 6c 29 3b 0a 20 20 20 20 | 20 20 20 20 66 6f 72 20 |l);. | for |
|00001c60| 28 51 20 3d 20 51 2d 3e | 6e 78 3b 20 51 2d 3e 6e |(Q = Q->|nx; Q->n|
|00001c70| 75 6d 20 3e 20 30 3b 20 | 51 20 3d 20 51 2d 3e 6e |um > 0; |Q = Q->n|
|00001c80| 78 29 20 2f 2a 20 43 61 | 6c 63 75 6c 61 74 65 73 |x) /* Ca|lculates|
|00001c90| 20 53 63 6f 72 65 73 20 | 2a 2f 0a 20 20 20 20 20 | Scores |*/. |
|00001ca0| 20 20 20 20 20 20 20 70 | 72 5b 51 2d 3e 61 6e 73 | p|r[Q->ans|
|00001cb0| 5d 20 2b 3d 20 51 2d 3e | 73 74 72 65 6e 67 74 68 |] += Q->|strength|
|00001cc0| 3b 0a 20 20 20 20 7d 0a | 20 20 20 20 65 6c 73 65 |;. }.| else|
|00001cd0| 20 7b 0a 20 20 20 20 20 | 20 20 20 52 64 4f 70 65 | {. | RdOpe|
|00001ce0| 6e 20 28 66 70 74 72 2c | 20 61 72 67 76 5b 31 5d |n (fptr,| argv[1]|
|00001cf0| 29 3b 0a 20 20 20 20 20 | 20 20 20 77 68 69 6c 65 |);. | while|
|00001d00| 20 28 66 67 65 74 63 28 | 66 70 74 72 29 20 21 3d | (fgetc(|fptr) !=|
|00001d10| 20 27 5c 6e 27 29 3b 0a | 20 20 20 20 20 20 20 20 | '\n');.| |
|00001d20| 77 68 69 6c 65 20 28 66 | 67 65 74 63 28 66 70 74 |while (f|getc(fpt|
|00001d30| 72 29 20 21 3d 20 27 5c | 6e 27 29 3b 0a 20 20 20 |r) != '\|n');. |
|00001d40| 20 20 20 20 20 77 68 69 | 6c 65 20 28 66 67 65 74 | whi|le (fget|
|00001d50| 70 28 66 70 74 72 29 20 | 21 3d 20 45 4f 46 29 20 |p(fptr) |!= EOF) |
|00001d60| 7b 0a 20 20 20 20 20 20 | 20 20 20 20 20 20 69 20 |{. | i |
|00001d70| 3d 20 66 67 65 74 70 28 | 66 70 74 72 29 3b 0a 20 |= fgetp(|fptr);. |
|00001d80| 20 20 20 20 20 20 20 20 | 20 20 20 70 72 5b 69 5d | | pr[i]|
|00001d90| 20 2b 3d 20 66 67 65 74 | 70 28 66 70 74 72 29 3b | += fget|p(fptr);|
|00001da0| 0a 20 20 20 20 20 20 20 | 20 7d 0a 20 20 20 20 7d |. | }. }|
|00001db0| 0a 0a 23 69 66 20 4f 50 | 53 59 53 20 3d 3d 20 4f |..#if OP|SYS == O|
|00001dc0| 54 48 45 52 0a 20 20 20 | 20 77 72 61 70 77 72 69 |THER. | wrapwri|
|00001dd0| 74 65 20 28 73 74 64 6f | 75 74 2c 20 30 2c 20 30 |te (stdo|ut, 0, 0|
|00001de0| 2c 20 63 6f 6c 2c 0a 20 | 20 20 20 20 20 20 20 22 |, col,. | "|
|00001df0| 53 65 6e 64 20 6f 75 74 | 70 75 74 20 74 6f 20 28 |Send out|put to (|
|00001e00| 31 29 20 53 63 72 65 65 | 6e 20 6f 72 20 28 32 29 |1) Scree|n or (2)|
|00001e10| 20 46 69 6c 65 3f 22 2c | 20 30 29 3b 0a 23 65 6c | File?",| 0);.#el|
|00001e20| 73 65 0a 20 20 20 20 77 | 72 61 70 77 72 69 74 65 |se. w|rapwrite|
|00001e30| 20 28 73 74 64 6f 75 74 | 2c 20 30 2c 20 30 2c 20 | (stdout|, 0, 0, |
|00001e40| 63 6f 6c 2c 0a 20 20 20 | 20 20 20 20 20 22 53 65 |col,. | "Se|
|00001e50| 6e 64 20 6f 75 74 70 75 | 74 20 74 6f 20 28 31 29 |nd outpu|t to (1)|
|00001e60| 20 53 63 72 65 65 6e 2c | 20 28 32 29 20 46 69 6c | Screen,| (2) Fil|
|00001e70| 65 20 6f 72 20 28 33 29 | 20 50 72 69 6e 74 65 72 |e or (3)| Printer|
|00001e80| 3f 22 2c 20 30 29 3b 0a | 23 65 6e 64 69 66 0a 20 |?", 0);.|#endif. |
|00001e90| 20 20 20 64 6f 20 7b 0a | 20 20 20 20 20 20 20 20 | do {.| |
|00001ea0| 41 20 3d 20 66 67 65 74 | 70 28 73 74 64 69 6e 29 |A = fget|p(stdin)|
|00001eb0| 3b 0a 20 20 20 20 20 20 | 20 20 69 66 20 28 41 20 |;. | if (A |
|00001ec0| 3d 3d 20 31 29 0a 20 20 | 20 20 20 20 20 20 20 20 |== 1). | |
|00001ed0| 20 20 66 70 74 72 20 3d | 20 73 74 64 6f 75 74 3b | fptr =| stdout;|
|00001ee0| 0a 20 20 20 20 20 20 20 | 20 65 6c 73 65 20 69 66 |. | else if|
|00001ef0| 20 28 41 20 3d 3d 20 32 | 29 20 7b 0a 20 20 20 20 | (A == 2|) {. |
|00001f00| 20 20 20 20 20 20 20 20 | 77 72 61 70 77 72 69 74 | |wrapwrit|
|00001f10| 65 20 28 73 74 64 6f 75 | 74 2c 20 30 2c 20 30 2c |e (stdou|t, 0, 0,|
|00001f20| 20 63 6f 6c 2c 20 22 50 | 6c 65 61 73 65 20 65 6e | col, "P|lease en|
|00001f30| 74 65 72 20 61 20 66 69 | 6c 65 20 6e 61 6d 65 2e |ter a fi|le name.|
|00001f40| 22 2c 20 30 29 3b 0a 20 | 20 20 20 20 20 20 20 20 |", 0);. | |
|00001f50| 20 20 20 66 6e 61 6d 65 | 20 3d 20 63 6c 6f 6e 65 | fname| = clone|
|00001f60| 5f 6c 69 6e 65 28 73 74 | 64 69 6e 2c 20 46 49 4c |_line(st|din, FIL|
|00001f70| 45 5f 4e 41 4d 45 5f 4d | 41 58 29 3b 0a 20 20 20 |E_NAME_M|AX);. |
|00001f80| 20 20 20 20 20 20 20 20 | 20 57 72 4f 70 65 6e 20 | | WrOpen |
|00001f90| 28 66 70 74 72 2c 20 66 | 6e 61 6d 65 29 3b 0a 20 |(fptr, f|name);. |
|00001fa0| 20 20 20 20 20 20 20 7d | 0a 23 69 66 20 4f 50 53 | }|.#if OPS|
|00001fb0| 59 53 20 21 3d 20 4f 54 | 48 45 52 0a 20 20 20 20 |YS != OT|HER. |
|00001fc0| 20 20 20 20 65 6c 73 65 | 20 69 66 20 28 41 20 3d | else| if (A =|
|00001fd0| 3d 20 33 29 20 7b 0a 20 | 20 20 20 20 20 20 20 20 |= 3) {. | |
|00001fe0| 20 20 20 57 72 4f 70 65 | 6e 20 28 66 70 74 72 2c | WrOpe|n (fptr,|
|00001ff0| 20 70 72 74 64 65 76 29 | 3b 0a 20 20 20 20 20 20 | prtdev)|;. |
|00002000| 20 20 20 20 20 20 63 6f | 6c 20 3d 20 37 35 3b 0a | co|l = 75;.|
|00002010| 20 20 20 20 20 20 20 20 | 7d 0a 23 65 6e 64 69 66 | |}.#endif|
|00002020| 0a 20 20 20 20 20 20 20 | 20 65 6c 73 65 0a 23 69 |. | else.#i|
|00002030| 66 20 4f 50 53 59 53 20 | 3d 3d 20 4f 54 48 45 52 |f OPSYS |== OTHER|
|00002040| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 77 72 61 |. | wra|
|00002050| 70 77 72 69 74 65 20 28 | 73 74 64 6f 75 74 2c 20 |pwrite (|stdout, |
|00002060| 30 2c 20 30 2c 20 63 6f | 6c 2c 20 22 50 6c 65 61 |0, 0, co|l, "Plea|
|00002070| 73 65 20 65 6e 74 65 72 | 20 61 20 31 20 6f 72 20 |se enter| a 1 or |
|00002080| 61 20 32 2e 22 2c 20 30 | 29 3b 0a 23 65 6c 73 65 |a 2.", 0|);.#else|
|00002090| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 77 72 61 |. | wra|
|000020a0| 70 77 72 69 74 65 20 28 | 73 74 64 6f 75 74 2c 20 |pwrite (|stdout, |
|000020b0| 30 2c 20 30 2c 20 63 6f | 6c 2c 0a 20 20 20 20 20 |0, 0, co|l,. |
|000020c0| 20 20 20 20 20 20 20 20 | 20 20 20 22 50 6c 65 61 | | "Plea|
|000020d0| 73 65 20 65 6e 74 65 72 | 20 61 20 31 2c 20 61 20 |se enter| a 1, a |
|000020e0| 32 2c 20 6f 72 20 61 20 | 33 2e 22 2c 20 30 29 3b |2, or a |3.", 0);|
|000020f0| 0a 23 65 6e 64 69 66 0a | 20 20 20 20 7d 20 77 68 |.#endif.| } wh|
|00002100| 69 6c 65 20 28 41 20 3c | 20 31 20 7c 7c 20 41 20 |ile (A <| 1 || A |
|00002110| 3e 20 33 29 3b 0a 0a 20 | 20 20 20 45 20 3d 20 70 |> 3);.. | E = p|
|00002120| 72 5b 31 5d 3b 20 49 20 | 3d 20 70 72 5b 32 5d 3b |r[1]; I |= pr[2];|
|00002130| 20 53 20 3d 20 70 72 5b | 33 5d 3b 20 4e 20 3d 20 | S = pr[|3]; N = |
|00002140| 70 72 5b 34 5d 3b 0a 20 | 20 20 20 54 20 3d 20 70 |pr[4];. | T = p|
|00002150| 72 5b 35 5d 3b 20 46 20 | 3d 20 70 72 5b 36 5d 3b |r[5]; F |= pr[6];|
|00002160| 20 4a 20 3d 20 70 72 5b | 37 5d 3b 20 50 20 3d 20 | J = pr[|7]; P = |
|00002170| 70 72 5b 38 5d 3b 0a 20 | 20 20 20 45 53 20 3d 20 |pr[8];. | ES = |
|00002180| 70 72 5b 31 32 5d 3b 20 | 45 4e 20 3d 20 70 72 5b |pr[12]; |EN = pr[|
|00002190| 31 33 5d 3b 20 45 54 20 | 3d 20 70 72 5b 31 31 5d |13]; ET |= pr[11]|
|000021a0| 3b 20 45 46 20 3d 20 70 | 72 5b 31 30 5d 3b 0a 20 |; EF = p|r[10];. |
|000021b0| 20 20 20 73 70 72 69 6e | 74 66 20 28 6e 6c 69 6e | sprin|tf (nlin|
|000021c0| 65 2c 20 22 25 73 27 73 | 20 73 63 6f 72 65 73 20 |e, "%s's| scores |
|000021d0| 6f 6e 20 74 68 65 20 6d | 61 69 6e 20 73 65 74 20 |on the m|ain set |
|000021e0| 6f 66 20 71 75 65 73 74 | 69 6f 6e 73 3a 5c 6e 22 |of quest|ions:\n"|
|000021f0| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. | |
|00002200| 20 20 20 20 20 22 5c 6e | 45 78 74 72 61 76 65 72 | "\n|Extraver|
|00002210| 73 69 6f 6e 20 28 45 29 | 3a 20 25 33 64 20 20 20 |sion (E)|: %3d |
|00002220| 20 25 33 64 20 3a 28 49 | 29 20 49 6e 74 72 6f 76 | %3d :(I|) Introv|
|00002230| 65 72 73 69 6f 6e 22 0a | 20 20 20 20 20 20 20 20 |ersion".| |
|00002240| 20 20 20 20 20 20 20 20 | 20 20 20 20 22 5c 6e 53 | | "\nS|
|00002250| 65 6e 73 69 6e 67 20 20 | 20 20 20 20 28 53 29 3a |ensing | (S):|
|00002260| 20 25 33 64 20 20 20 20 | 25 33 64 20 3a 28 4e 29 | %3d |%3d :(N)|
|00002270| 20 69 4e 74 75 69 74 69 | 6f 6e 22 0a 20 20 20 20 | iNtuiti|on". |
|00002280| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002290| 22 5c 6e 54 68 69 6e 6b | 69 6e 67 20 20 20 20 20 |"\nThink|ing |
|000022a0| 28 54 29 3a 20 25 33 64 | 20 20 20 20 25 33 64 20 |(T): %3d| %3d |
|000022b0| 3a 28 46 29 20 46 65 65 | 6c 69 6e 67 22 0a 20 20 |:(F) Fee|ling". |
|000022c0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000022d0| 20 20 22 5c 6e 4a 75 64 | 67 69 6e 67 20 20 20 20 | "\nJud|ging |
|000022e0| 20 20 28 4a 29 3a 20 25 | 33 64 20 20 20 20 25 33 | (J): %|3d %3|
|000022f0| 64 20 3a 28 50 29 20 50 | 65 72 63 65 69 76 69 6e |d :(P) P|erceivin|
|00002300| 67 5c 6e 22 2c 0a 20 20 | 20 20 20 20 20 20 20 20 |g\n",. | |
|00002310| 20 20 20 20 20 20 20 20 | 20 20 6e 61 6d 65 2c 20 | | name, |
|00002320| 45 2c 20 49 2c 20 53 2c | 20 4e 2c 20 54 2c 20 46 |E, I, S,| N, T, F|
|00002330| 2c 20 4a 2c 20 50 29 3b | 0a 20 20 20 20 77 72 61 |, J, P);|. wra|
|00002340| 70 77 72 69 74 65 20 28 | 66 70 74 72 2c 20 30 2c |pwrite (|fptr, 0,|
|00002350| 20 30 2c 20 63 6f 6c 2c | 20 6e 6c 69 6e 65 2c 20 | 0, col,| nline, |
|00002360| 30 29 3b 0a 0a 20 20 20 | 20 2f 2a 20 43 61 6c 63 |0);.. | /* Calc|
|00002370| 75 6c 61 74 65 73 20 70 | 6f 73 73 69 62 6c 65 20 |ulates p|ossible |
|00002380| 6c 69 66 65 20 70 61 74 | 74 65 72 6e 20 62 61 73 |life pat|tern bas|
|00002390| 65 64 20 6f 6e 20 70 72 | 69 6d 61 72 79 20 73 63 |ed on pr|imary sc|
|000023a0| 6f 72 65 73 2e 20 2a 2f | 0a 20 20 20 20 4c 50 5b |ores. */|. LP[|
|000023b0| 30 5d 20 3d 20 28 45 20 | 3e 20 49 29 20 3f 20 27 |0] = (E |> I) ? '|
|000023c0| 45 27 20 3a 20 28 45 20 | 3c 20 49 29 20 3f 20 27 |E' : (E |< I) ? '|
|000023d0| 49 27 20 3a 20 27 58 27 | 3b 0a 20 20 20 20 4c 50 |I' : 'X'|;. LP|
|000023e0| 5b 31 5d 20 3d 20 28 53 | 20 3e 20 4e 29 20 3f 20 |[1] = (S| > N) ? |
|000023f0| 27 53 27 20 3a 20 28 53 | 20 3c 20 4e 29 20 3f 20 |'S' : (S| < N) ? |
|00002400| 27 4e 27 20 3a 20 27 58 | 27 3b 0a 20 20 20 20 4c |'N' : 'X|';. L|
|00002410| 50 5b 32 5d 20 3d 20 28 | 54 20 3e 20 46 29 20 3f |P[2] = (|T > F) ?|
|00002420| 20 27 54 27 20 3a 20 28 | 54 20 3c 20 46 29 20 3f | 'T' : (|T < F) ?|
|00002430| 20 27 46 27 20 3a 20 27 | 58 27 3b 0a 20 20 20 20 | 'F' : '|X';. |
|00002440| 4c 50 5b 33 5d 20 3d 20 | 28 4a 20 3e 20 50 29 20 |LP[3] = |(J > P) |
|00002450| 3f 20 27 4a 27 20 3a 20 | 28 4a 20 3c 20 50 29 20 |? 'J' : |(J < P) |
|00002460| 3f 20 27 50 27 20 3a 20 | 27 58 27 3b 0a 20 20 20 |? 'P' : |'X';. |
|00002470| 20 4c 50 5b 34 5d 20 3d | 20 30 3b 0a 0a 20 20 20 | LP[4] =| 0;.. |
|00002480| 20 66 70 72 69 6e 74 66 | 20 28 66 70 74 72 2c 20 | fprintf| (fptr, |
|00002490| 22 59 6f 75 20 73 63 6f | 72 65 64 20 61 73 20 61 |"You sco|red as a|
|000024a0| 6e 20 25 73 2e 5c 6e 22 | 2c 20 4c 50 29 3b 0a 20 |n %s.\n"|, LP);. |
|000024b0| 20 20 20 78 20 3d 20 30 | 3b 0a 20 20 20 20 66 6f | x = 0|;. fo|
|000024c0| 72 20 28 69 20 3d 20 30 | 3b 20 69 20 3c 20 34 3b |r (i = 0|; i < 4;|
|000024d0| 20 69 2b 2b 29 0a 20 20 | 20 20 20 20 20 20 69 66 | i++). | if|
|000024e0| 20 28 4c 50 5b 69 5d 20 | 3d 3d 20 27 58 27 29 0a | (LP[i] |== 'X').|
|000024f0| 20 20 20 20 20 20 20 20 | 20 20 20 20 78 2b 2b 3b | | x++;|
|00002500| 0a 20 20 20 20 69 66 20 | 28 78 29 20 7b 0a 20 20 |. if |(x) {. |
|00002510| 20 20 20 20 20 20 73 70 | 72 69 6e 74 66 20 28 6c | sp|rintf (l|
|00002520| 69 6e 65 2c 20 22 54 68 | 69 73 20 69 73 20 6e 6f |ine, "Th|is is no|
|00002530| 74 20 61 20 72 65 61 6c | 20 74 79 70 65 2e 20 59 |t a real| type. Y|
|00002540| 6f 75 20 63 6f 75 6c 64 | 20 62 65 20 61 6e 79 20 |ou could| be any |
|00002550| 6f 66 22 0a 20 20 20 20 | 20 20 20 20 22 25 64 20 |of". | "%d |
|00002560| 64 69 66 66 65 72 65 6e | 74 20 74 79 70 65 73 2e |differen|t types.|
|00002570| 20 52 65 61 64 20 74 68 | 65 20 74 79 70 65 20 64 | Read th|e type d|
|00002580| 65 73 63 72 69 70 74 69 | 6f 6e 73 20 74 6f 20 64 |escripti|ons to d|
|00002590| 65 74 65 72 6d 69 6e 65 | 20 22 0a 20 20 20 20 20 |etermine| ". |
|000025a0| 20 20 20 22 77 68 69 63 | 68 20 79 6f 75 20 61 72 | "whic|h you ar|
|000025b0| 65 2e 22 2c 20 70 6f 77 | 61 28 32 2c 78 29 29 3b |e.", pow|a(2,x));|
|000025c0| 0a 20 20 20 20 20 20 20 | 20 77 72 61 70 77 72 69 |. | wrapwri|
|000025d0| 74 65 20 28 66 70 74 72 | 2c 20 30 2c 20 30 2c 20 |te (fptr|, 0, 0, |
|000025e0| 63 6f 6c 2c 20 6c 69 6e | 65 2c 20 30 29 3b 0a 20 |col, lin|e, 0);. |
|000025f0| 20 20 20 7d 0a 20 20 20 | 20 65 6c 73 65 20 7b 0a | }. | else {.|
|00002600| 20 20 20 20 20 20 20 20 | 45 20 3d 20 28 4c 50 5b | |E = (LP[|
|00002610| 30 5d 20 3d 3d 20 27 45 | 27 29 3b 20 52 20 3d 20 |0] == 'E|'); R = |
|00002620| 28 28 4c 50 5b 33 5d 20 | 3d 3d 20 27 4a 27 29 20 |((LP[3] |== 'J') |
|00002630| 3d 3d 20 45 29 3b 0a 20 | 20 20 20 20 20 20 20 73 |== E);. | s|
|00002640| 70 72 69 6e 74 66 20 28 | 6c 69 6e 65 2c 20 22 5c |printf (|line, "\|
|00002650| 6e 41 73 73 75 6d 69 6e | 67 20 74 68 61 74 20 79 |nAssumin|g that y|
|00002660| 6f 75 20 61 72 65 20 61 | 6e 20 25 73 2c 5c 6e 22 |ou are a|n %s,\n"|
|00002670| 2c 20 4c 50 29 3b 0a 20 | 20 20 20 20 20 20 20 77 |, LP);. | w|
|00002680| 72 61 70 77 72 69 74 65 | 20 28 66 70 74 72 2c 20 |rapwrite| (fptr, |
|00002690| 30 2c 20 35 2c 20 63 6f | 6c 2c 20 6c 69 6e 65 2c |0, 5, co|l, line,|
|000026a0| 20 30 29 3b 0a 20 20 20 | 20 20 20 20 20 73 70 72 | 0);. | spr|
|000026b0| 69 6e 74 66 20 28 6c 69 | 6e 65 2c 20 74 65 78 74 |intf (li|ne, text|
|000026c0| 31 2c 20 22 44 4f 4d 49 | 4e 41 4e 54 22 2c 20 58 |1, "DOMI|NANT", X|
|000026d0| 4e 2c 20 52 20 3f 20 4a | 46 5b 4c 50 5b 32 5d 20 |N, R ? J|F[LP[2] |
|000026e0| 3d 3d 20 27 46 27 5d 20 | 3a 20 50 46 5b 4c 50 5b |== 'F'] |: PF[LP[|
|000026f0| 31 5d 20 3d 3d 20 27 53 | 27 5d 29 3b 0a 20 20 20 |1] == 'S|']);. |
|00002700| 20 20 20 20 20 77 72 61 | 70 77 72 69 74 65 20 28 | wra|pwrite (|
|00002710| 66 70 74 72 2c 20 30 2c | 20 35 2c 20 63 6f 6c 2c |fptr, 0,| 5, col,|
|00002720| 20 6c 69 6e 65 2c 20 30 | 29 3b 0a 20 20 20 20 20 | line, 0|);. |
|00002730| 20 20 20 73 70 72 69 6e | 74 66 20 28 6c 69 6e 65 | sprin|tf (line|
|00002740| 2c 20 74 65 78 74 31 2c | 20 22 41 55 58 49 4c 49 |, text1,| "AUXILI|
|00002750| 41 52 59 22 2c 20 21 58 | 4e 2c 20 52 20 3f 20 50 |ARY", !X|N, R ? P|
|00002760| 46 5b 4c 50 5b 31 5d 20 | 3d 3d 20 27 53 27 5d 20 |F[LP[1] |== 'S'] |
|00002770| 3a 20 4a 46 5b 4c 50 5b | 32 5d 20 3d 3d 20 27 46 |: JF[LP[|2] == 'F|
|00002780| 27 5d 29 3b 0a 20 20 20 | 20 20 20 20 20 77 72 61 |']);. | wra|
|00002790| 70 77 72 69 74 65 20 28 | 66 70 74 72 2c 20 30 2c |pwrite (|fptr, 0,|
|000027a0| 20 35 2c 20 63 6f 6c 2c | 20 6c 69 6e 65 2c 20 30 | 5, col,| line, 0|
|000027b0| 29 3b 0a 20 20 20 20 20 | 20 20 20 73 70 72 69 6e |);. | sprin|
|000027c0| 74 66 20 28 6c 69 6e 65 | 2c 20 74 65 78 74 31 2c |tf (line|, text1,|
|000027d0| 20 22 54 45 52 54 49 41 | 52 59 22 2c 20 58 4e 2c | "TERTIA|RY", XN,|
|000027e0| 20 52 20 3f 20 50 46 5b | 4c 50 5b 31 5d 20 3d 3d | R ? PF[|LP[1] ==|
|000027f0| 20 27 4e 27 5d 20 3a 20 | 4a 46 5b 4c 50 5b 32 5d | 'N'] : |JF[LP[2]|
|00002800| 20 3d 3d 20 27 54 27 5d | 29 3b 0a 20 20 20 20 20 | == 'T']|);. |
|00002810| 20 20 20 77 72 61 70 77 | 72 69 74 65 20 28 66 70 | wrapw|rite (fp|
|00002820| 74 72 2c 20 30 2c 20 35 | 2c 20 63 6f 6c 2c 20 6c |tr, 0, 5|, col, l|
|00002830| 69 6e 65 2c 20 30 29 3b | 0a 20 20 20 20 20 20 20 |ine, 0);|. |
|00002840| 20 73 70 72 69 6e 74 66 | 20 28 6c 69 6e 65 2c 20 | sprintf| (line, |
|00002850| 74 65 78 74 31 2c 20 22 | 49 4e 46 45 52 49 4f 52 |text1, "|INFERIOR|
|00002860| 22 2c 20 21 58 4e 2c 20 | 52 20 3f 20 4a 46 5b 4c |", !XN, |R ? JF[L|
|00002870| 50 5b 32 5d 20 3d 3d 20 | 27 54 27 5d 20 3a 20 50 |P[2] == |'T'] : P|
|00002880| 46 5b 4c 50 5b 31 5d 20 | 3d 3d 20 27 4e 27 5d 29 |F[LP[1] |== 'N'])|
|00002890| 3b 0a 20 20 20 20 20 20 | 20 20 77 72 61 70 77 72 |;. | wrapwr|
|000028a0| 69 74 65 20 28 66 70 74 | 72 2c 20 30 2c 20 35 2c |ite (fpt|r, 0, 5,|
|000028b0| 20 63 6f 6c 2c 20 6c 69 | 6e 65 2c 20 30 29 3b 0a | col, li|ne, 0);.|
|000028c0| 20 20 20 20 7d 0a 20 20 | 20 20 69 66 20 28 41 20 | }. | if (A |
|000028d0| 3d 3d 20 31 29 20 7b 0a | 20 20 20 20 20 20 20 20 |== 1) {.| |
|000028e0| 77 72 61 70 77 72 69 74 | 65 20 28 73 74 64 6f 75 |wrapwrit|e (stdou|
|000028f0| 74 2c 20 30 2c 20 30 2c | 20 63 6f 6c 2c 20 22 48 |t, 0, 0,| col, "H|
|00002900| 69 74 20 3c 45 4e 54 45 | 52 3e 20 6f 72 20 3c 52 |it <ENTE|R> or <R|
|00002910| 45 54 55 52 4e 3e 20 74 | 6f 20 73 65 65 22 2c 0a |ETURN> t|o see",.|
|00002920| 20 20 20 20 20 20 20 20 | 20 20 20 20 22 79 6f 75 | | "you|
|00002930| 72 20 72 65 73 75 6c 74 | 73 20 6f 6e 20 74 68 65 |r result|s on the|
|00002940| 20 73 75 70 70 6c 65 6d | 65 6e 74 61 72 79 20 71 | supplem|entary q|
|00002950| 75 65 73 74 69 6f 6e 73 | 2e 22 2c 20 30 29 3b 0a |uestions|.", 0);.|
|00002960| 20 20 20 20 20 20 20 20 | 77 68 69 6c 65 20 28 66 | |while (f|
|00002970| 67 65 74 63 28 73 74 64 | 69 6e 29 20 21 3d 20 27 |getc(std|in) != '|
|00002980| 5c 6e 27 29 3b 0a 20 20 | 20 20 7d 0a 20 20 20 20 |\n');. | }. |
|00002990| 73 70 72 69 6e 74 66 20 | 28 6e 6c 69 6e 65 2c 20 |sprintf |(nline, |
|000029a0| 22 5c 6e 25 73 27 73 20 | 73 63 6f 72 65 73 20 6f |"\n%s's |scores o|
|000029b0| 6e 20 74 68 65 20 73 75 | 70 70 6c 65 6d 65 6e 74 |n the su|pplement|
|000029c0| 61 72 79 20 71 75 65 73 | 74 69 6f 6e 73 3a 5c 6e |ary ques|tions:\n|
|000029d0| 5c 6e 22 0a 20 20 20 20 | 22 45 78 74 72 61 76 65 |\n". |"Extrave|
|000029e0| 72 74 65 64 20 54 68 69 | 6e 6b 69 6e 67 20 2f 20 |rted Thi|nking / |
|000029f0| 49 6e 74 72 6f 76 65 72 | 74 65 64 20 46 65 65 6c |Introver|ted Feel|
|00002a00| 69 6e 67 20 20 20 3a 20 | 25 64 5c 6e 22 0a 20 20 |ing : |%d\n". |
|00002a10| 20 20 22 45 78 74 72 61 | 76 65 72 74 65 64 20 46 | "Extra|verted F|
|00002a20| 65 65 6c 69 6e 67 20 2f | 20 49 6e 74 72 6f 76 65 |eeling /| Introve|
|00002a30| 72 74 65 64 20 54 68 69 | 6e 6b 69 6e 67 20 20 20 |rted Thi|nking |
|00002a40| 3a 20 25 64 5c 6e 5c 6e | 22 0a 20 20 20 20 22 45 |: %d\n\n|". "E|
|00002a50| 78 74 72 61 76 65 72 74 | 65 64 20 49 6e 74 75 69 |xtravert|ed Intui|
|00002a60| 74 69 6f 6e 20 2f 20 49 | 6e 74 72 6f 76 65 72 74 |tion / I|ntrovert|
|00002a70| 65 64 20 53 65 6e 73 69 | 6e 67 20 20 3a 20 25 64 |ed Sensi|ng : %d|
|00002a80| 5c 6e 22 0a 20 20 20 20 | 22 45 78 74 72 61 76 65 |\n". |"Extrave|
|00002a90| 72 74 65 64 20 53 65 6e | 73 69 6e 67 20 2f 20 49 |rted Sen|sing / I|
|00002aa0| 6e 74 72 6f 76 65 72 74 | 65 64 20 49 6e 74 75 69 |ntrovert|ed Intui|
|00002ab0| 74 69 6f 6e 20 20 3a 20 | 25 64 5c 6e 5c 6e 22 0a |tion : |%d\n\n".|
|00002ac0| 20 20 20 20 22 52 61 74 | 69 6f 6e 61 6c 69 74 79 | "Rat|ionality|
|00002ad0| 20 28 44 6f 6d 69 6e 61 | 6e 74 20 4a 75 64 67 69 | (Domina|nt Judgi|
|00002ae0| 6e 67 20 46 75 6e 63 74 | 69 6f 6e 29 20 20 20 20 |ng Funct|ion) |
|00002af0| 20 20 3a 20 25 64 5c 6e | 22 0a 20 20 20 20 22 41 | : %d\n|". "A|
|00002b00| 2d 72 61 74 69 6f 6e 61 | 6c 69 74 79 20 28 44 6f |-rationa|lity (Do|
|00002b10| 6d 69 6e 61 6e 74 20 50 | 65 72 63 65 69 76 69 6e |minant P|erceivin|
|00002b20| 67 20 46 75 6e 63 74 69 | 6f 6e 29 20 3a 20 25 64 |g Functi|on) : %d|
|00002b30| 5c 6e 5c 6e 22 2c 0a 20 | 20 20 20 20 20 20 20 6e |\n\n",. | n|
|00002b40| 61 6d 65 2c 20 45 54 2c | 20 45 46 2c 20 45 4e 2c |ame, ET,| EF, EN,|
|00002b50| 20 45 53 2c 20 70 72 5b | 39 5d 2c 20 70 72 5b 30 | ES, pr[|9], pr[0|
|00002b60| 5d 29 3b 0a 20 20 20 20 | 77 72 61 70 77 72 69 74 |]);. |wrapwrit|
|00002b70| 65 20 28 66 70 74 72 2c | 20 30 2c 20 30 2c 20 63 |e (fptr,| 0, 0, c|
|00002b80| 6f 6c 2c 20 6e 6c 69 6e | 65 2c 20 30 29 3b 0a 0a |ol, nlin|e, 0);..|
|00002b90| 20 20 20 20 2f 2a 20 43 | 61 6c 63 75 6c 61 74 65 | /* C|alculate|
|00002ba0| 73 20 70 6f 73 73 69 62 | 6c 65 20 6c 69 66 65 20 |s possib|le life |
|00002bb0| 70 61 74 74 65 72 6e 73 | 20 62 61 73 65 64 20 6f |patterns| based o|
|00002bc0| 6e 20 73 75 70 70 6c 65 | 6d 65 6e 74 61 6c 20 73 |n supple|mental s|
|00002bd0| 63 6f 72 65 73 2e 20 2a | 2f 0a 20 20 20 20 4c 50 |cores. *|/. LP|
|00002be0| 45 5b 30 5d 20 3d 20 27 | 45 27 3b 20 4c 50 49 5b |E[0] = '|E'; LPI[|
|00002bf0| 30 5d 20 3d 20 27 49 27 | 3b 0a 20 20 20 20 69 66 |0] = 'I'|;. if|
|00002c00| 20 28 70 72 5b 39 5d 20 | 3e 20 70 72 5b 30 5d 29 | (pr[9] |> pr[0])|
|00002c10| 20 7b 0a 20 20 20 20 20 | 20 20 20 4c 50 45 5b 33 | {. | LPE[3|
|00002c20| 5d 20 3d 20 27 4a 27 3b | 0a 20 20 20 20 20 20 20 |] = 'J';|. |
|00002c30| 20 4c 50 49 5b 33 5d 20 | 3d 20 27 50 27 3b 0a 20 | LPI[3] |= 'P';. |
|00002c40| 20 20 20 7d 0a 20 20 20 | 20 65 6c 73 65 20 69 66 | }. | else if|
|00002c50| 20 28 70 72 5b 39 5d 20 | 3c 20 70 72 5b 30 5d 29 | (pr[9] |< pr[0])|
|00002c60| 20 7b 0a 20 20 20 20 20 | 20 20 20 4c 50 45 5b 33 | {. | LPE[3|
|00002c70| 5d 20 3d 20 27 50 27 3b | 0a 20 20 20 20 20 20 20 |] = 'P';|. |
|00002c80| 20 4c 50 49 5b 33 5d 20 | 3d 20 27 4a 27 3b 0a 20 | LPI[3] |= 'J';. |
|00002c90| 20 20 20 7d 0a 20 20 20 | 20 65 6c 73 65 20 7b 0a | }. | else {.|
|00002ca0| 20 20 20 20 20 20 20 20 | 4c 50 45 5b 33 5d 20 3d | |LPE[3] =|
|00002cb0| 20 27 58 27 3b 0a 20 20 | 20 20 20 20 20 20 4c 50 | 'X';. | LP|
|00002cc0| 49 5b 33 5d 20 3d 20 27 | 58 27 3b 0a 20 20 20 20 |I[3] = '|X';. |
|00002cd0| 7d 0a 20 20 20 20 69 66 | 20 28 4c 50 45 5b 33 5d |}. if| (LPE[3]|
|00002ce0| 20 3d 3d 20 27 50 27 29 | 20 7b 0a 20 20 20 20 20 | == 'P')| {. |
|00002cf0| 20 20 20 69 66 20 28 45 | 46 20 3e 20 45 54 29 20 | if (E|F > ET) |
|00002d00| 7b 0a 20 20 20 20 20 20 | 20 20 20 20 20 20 4c 50 |{. | LP|
|00002d10| 45 5b 32 5d 20 3d 20 27 | 54 27 3b 0a 20 20 20 20 |E[2] = '|T';. |
|00002d20| 20 20 20 20 20 20 20 20 | 4c 50 49 5b 32 5d 20 3d | |LPI[2] =|
|00002d30| 20 27 46 27 3b 0a 20 20 | 20 20 20 20 20 20 7d 0a | 'F';. | }.|
|00002d40| 20 20 20 20 20 20 20 20 | 65 6c 73 65 20 69 66 20 | |else if |
|00002d50| 28 45 46 20 3c 20 45 54 | 29 20 7b 0a 20 20 20 20 |(EF < ET|) {. |
|00002d60| 20 20 20 20 20 20 20 20 | 4c 50 45 5b 32 5d 20 3d | |LPE[2] =|
|00002d70| 20 27 46 27 3b 0a 20 20 | 20 20 20 20 20 20 20 20 | 'F';. | |
|00002d80| 20 20 4c 50 49 5b 32 5d | 20 3d 20 27 54 27 3b 0a | LPI[2]| = 'T';.|
|00002d90| 20 20 20 20 20 20 20 20 | 7d 0a 20 20 20 20 20 20 | |}. |
|00002da0| 20 20 65 6c 73 65 20 7b | 0a 20 20 20 20 20 20 20 | else {|. |
|00002db0| 20 20 20 20 20 4c 50 45 | 5b 32 5d 20 3d 20 27 58 | LPE|[2] = 'X|
|00002dc0| 27 3b 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 4c |';. | L|
|00002dd0| 50 49 5b 32 5d 20 3d 20 | 27 58 27 3b 0a 20 20 20 |PI[2] = |'X';. |
|00002de0| 20 20 20 20 20 7d 0a 20 | 20 20 20 20 20 20 20 69 | }. | i|
|00002df0| 66 20 28 45 53 20 3c 20 | 45 4e 29 20 7b 0a 20 20 |f (ES < |EN) {. |
|00002e00| 20 20 20 20 20 20 20 20 | 20 20 4c 50 45 5b 31 5d | | LPE[1]|
|00002e10| 20 3d 20 27 4e 27 3b 0a | 20 20 20 20 20 20 20 20 | = 'N';.| |
|00002e20| 20 20 20 20 4c 50 49 5b | 31 5d 20 3d 20 27 53 27 | LPI[|1] = 'S'|
|00002e30| 3b 0a 20 20 20 20 20 20 | 20 20 7d 0a 20 20 20 20 |;. | }. |
|00002e40| 20 20 20 20 65 6c 73 65 | 20 69 66 20 28 45 53 20 | else| if (ES |
|00002e50| 3e 20 45 4e 29 20 7b 0a | 20 20 20 20 20 20 20 20 |> EN) {.| |
|00002e60| 20 20 20 20 4c 50 45 5b | 31 5d 20 3d 20 27 53 27 | LPE[|1] = 'S'|
|00002e70| 3b 0a 20 20 20 20 20 20 | 20 20 20 20 20 20 4c 50 |;. | LP|
|00002e80| 49 5b 31 5d 20 3d 20 27 | 4e 27 3b 0a 20 20 20 20 |I[1] = '|N';. |
|00002e90| 20 20 20 20 7d 0a 20 20 | 20 20 20 20 20 20 65 6c | }. | el|
|00002ea0| 73 65 20 7b 0a 20 20 20 | 20 20 20 20 20 20 20 20 |se {. | |
|00002eb0| 20 4c 50 45 5b 31 5d 20 | 3d 20 27 58 27 3b 0a 20 | LPE[1] |= 'X';. |
|00002ec0| 20 20 20 20 20 20 20 20 | 20 20 20 4c 50 49 5b 31 | | LPI[1|
|00002ed0| 5d 20 3d 20 27 58 27 3b | 0a 20 20 20 20 20 20 20 |] = 'X';|. |
|00002ee0| 20 7d 0a 20 20 20 20 7d | 0a 20 20 20 20 65 6c 73 | }. }|. els|
|00002ef0| 65 20 69 66 20 28 4c 50 | 45 5b 33 5d 20 3d 3d 20 |e if (LP|E[3] == |
|00002f00| 27 4a 27 29 20 7b 0a 20 | 20 20 20 20 20 20 20 69 |'J') {. | i|
|00002f10| 66 20 28 45 46 20 3c 20 | 45 54 29 20 7b 0a 20 20 |f (EF < |ET) {. |
|00002f20| 20 20 20 20 20 20 20 20 | 20 20 4c 50 45 5b 32 5d | | LPE[2]|
|00002f30| 20 3d 20 27 54 27 3b 0a | 20 20 20 20 20 20 20 20 | = 'T';.| |
|00002f40| 20 20 20 20 4c 50 49 5b | 32 5d 20 3d 20 27 46 27 | LPI[|2] = 'F'|
|00002f50| 3b 0a 20 20 20 20 20 20 | 20 20 7d 0a 20 20 20 20 |;. | }. |
|00002f60| 20 20 20 20 65 6c 73 65 | 20 69 66 20 28 45 46 20 | else| if (EF |
|00002f70| 3e 20 45 54 29 20 7b 0a | 20 20 20 20 20 20 20 20 |> ET) {.| |
|00002f80| 20 20 20 20 4c 50 45 5b | 32 5d 20 3d 20 27 46 27 | LPE[|2] = 'F'|
|00002f90| 3b 0a 20 20 20 20 20 20 | 20 20 20 20 20 20 4c 50 |;. | LP|
|00002fa0| 49 5b 32 5d 20 3d 20 27 | 54 27 3b 0a 20 20 20 20 |I[2] = '|T';. |
|00002fb0| 20 20 20 20 7d 0a 20 20 | 20 20 20 20 20 20 65 6c | }. | el|
|00002fc0| 73 65 20 7b 0a 20 20 20 | 20 20 20 20 20 20 20 20 |se {. | |
|00002fd0| 20 4c 50 45 5b 32 5d 20 | 3d 20 27 58 27 3b 0a 20 | LPE[2] |= 'X';. |
|00002fe0| 20 20 20 20 20 20 20 20 | 20 20 20 4c 50 49 5b 32 | | LPI[2|
|00002ff0| 5d 20 3d 20 27 58 27 3b | 0a 20 20 20 20 20 20 20 |] = 'X';|. |
|00003000| 20 7d 0a 20 20 20 20 20 | 20 20 20 69 66 20 28 45 | }. | if (E|
|00003010| 53 20 3e 20 45 4e 29 20 | 7b 0a 20 20 20 20 20 20 |S > EN) |{. |
|00003020| 20 20 20 20 20 20 4c 50 | 45 5b 31 5d 20 3d 20 27 | LP|E[1] = '|
|00003030| 4e 27 3b 0a 20 20 20 20 | 20 20 20 20 20 20 20 20 |N';. | |
|00003040| 4c 50 49 5b 31 5d 20 3d | 20 27 53 27 3b 0a 20 20 |LPI[1] =| 'S';. |
|00003050| 20 20 20 20 20 20 7d 0a | 20 20 20 20 20 20 20 20 | }.| |
|00003060| 65 6c 73 65 20 69 66 20 | 28 45 53 20 3c 20 45 4e |else if |(ES < EN|
|00003070| 29 20 7b 0a 20 20 20 20 | 20 20 20 20 20 20 20 20 |) {. | |
|00003080| 4c 50 45 5b 31 5d 20 3d | 20 27 53 27 3b 0a 20 20 |LPE[1] =| 'S';. |
|00003090| 20 20 20 20 20 20 20 20 | 20 20 4c 50 49 5b 31 5d | | LPI[1]|
|000030a0| 20 3d 20 27 4e 27 3b 0a | 20 20 20 20 20 20 20 20 | = 'N';.| |
|000030b0| 7d 0a 20 20 20 20 20 20 | 20 20 65 6c 73 65 20 7b |}. | else {|
|000030c0| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 4c 50 45 |. | LPE|
|000030d0| 5b 31 5d 20 3d 20 27 58 | 27 3b 0a 20 20 20 20 20 |[1] = 'X|';. |
|000030e0| 20 20 20 20 20 20 20 4c | 50 49 5b 31 5d 20 3d 20 | L|PI[1] = |
|000030f0| 27 58 27 3b 0a 20 20 20 | 20 20 20 20 20 7d 0a 20 |'X';. | }. |
|00003100| 20 20 20 7d 0a 20 20 20 | 20 65 6c 73 65 20 7b 0a | }. | else {.|
|00003110| 20 20 20 20 20 20 20 20 | 4c 50 45 5b 31 5d 20 3d | |LPE[1] =|
|00003120| 20 27 58 27 3b 0a 20 20 | 20 20 20 20 20 20 4c 50 | 'X';. | LP|
|00003130| 45 5b 32 5d 20 3d 20 27 | 58 27 3b 0a 20 20 20 20 |E[2] = '|X';. |
|00003140| 20 20 20 20 4c 50 49 5b | 31 5d 20 3d 20 27 58 27 | LPI[|1] = 'X'|
|00003150| 3b 0a 20 20 20 20 20 20 | 20 20 4c 50 49 5b 32 5d |;. | LPI[2]|
|00003160| 20 3d 20 27 58 27 3b 0a | 20 20 20 20 7d 0a 20 20 | = 'X';.| }. |
|00003170| 20 20 4c 50 45 5b 34 5d | 20 3d 20 4c 50 49 5b 34 | LPE[4]| = LPI[4|
|00003180| 5d 20 3d 20 30 3b 0a 0a | 20 20 20 20 73 70 72 69 |] = 0;..| spri|
|00003190| 6e 74 66 20 28 6c 69 6e | 65 2c 20 22 41 63 63 6f |ntf (lin|e, "Acco|
|000031a0| 72 64 69 6e 67 20 74 6f | 20 74 68 65 20 73 75 70 |rding to| the sup|
|000031b0| 70 6c 65 6d 65 6e 74 61 | 72 79 20 73 63 6f 72 65 |plementa|ry score|
|000031c0| 73 2c 20 25 73 20 63 6f | 75 6c 64 20 62 65 20 22 |s, %s co|uld be "|
|000031d0| 0a 20 20 20 20 22 61 6e | 20 25 73 20 6f 72 20 61 |. "an| %s or a|
|000031e0| 6e 20 25 73 2e 22 2c 20 | 6e 61 6d 65 2c 20 4c 50 |n %s.", |name, LP|
|000031f0| 45 2c 20 4c 50 49 29 3b | 0a 20 20 20 20 69 66 20 |E, LPI);|. if |
|00003200| 28 28 73 74 72 63 6d 70 | 28 4c 50 2c 20 4c 50 45 |((strcmp|(LP, LPE|
|00003210| 29 20 3d 3d 20 30 29 20 | 7c 7c 20 28 73 74 72 63 |) == 0) ||| (strc|
|00003220| 6d 70 28 4c 50 2c 20 4c | 50 49 29 20 3d 3d 20 30 |mp(LP, L|PI) == 0|
|00003230| 29 29 0a 20 20 20 20 20 | 20 20 20 73 70 72 69 6e |)). | sprin|
|00003240| 74 66 20 28 6e 6c 69 6e | 65 2c 20 22 25 73 20 54 |tf (nlin|e, "%s T|
|00003250| 68 65 73 65 20 72 65 73 | 75 6c 74 73 20 63 6f 72 |hese res|ults cor|
|00003260| 72 6f 62 6f 72 61 74 65 | 20 79 6f 75 72 20 73 63 |roborate| your sc|
|00003270| 6f 72 65 20 61 73 20 61 | 6e 20 25 73 2e 22 2c 20 |ore as a|n %s.", |
|00003280| 6c 69 6e 65 2c 20 4c 50 | 29 3b 0a 20 20 20 20 65 |line, LP|);. e|
|00003290| 6c 73 65 0a 20 20 20 20 | 20 20 20 20 73 70 72 69 |lse. | spri|
|000032a0| 6e 74 66 20 28 6e 6c 69 | 6e 65 2c 20 22 25 73 20 |ntf (nli|ne, "%s |
|000032b0| 54 68 65 73 65 20 72 65 | 73 75 6c 74 73 20 63 6f |These re|sults co|
|000032c0| 6e 66 6c 69 63 74 20 77 | 69 74 68 20 74 68 65 20 |nflict w|ith the |
|000032d0| 65 76 61 6c 75 61 74 69 | 6f 6e 20 6f 66 20 25 73 |evaluati|on of %s|
|000032e0| 20 61 73 20 61 6e 20 25 | 73 2e 22 2c 20 6c 69 6e | as an %|s.", lin|
|000032f0| 65 2c 20 6e 61 6d 65 2c | 20 4c 50 29 3b 0a 20 20 |e, name,| LP);. |
|00003300| 20 20 77 72 61 70 77 72 | 69 74 65 20 28 66 70 74 | wrapwr|ite (fpt|
|00003310| 72 2c 20 35 2c 20 30 2c | 20 63 6f 6c 2c 20 6e 6c |r, 5, 0,| col, nl|
|00003320| 69 6e 65 2c 20 22 5c 6e | 5c 6e 22 2c 20 30 29 3b |ine, "\n|\n", 0);|
|00003330| 0a 20 20 20 20 69 66 20 | 28 66 70 74 72 20 21 3d |. if |(fptr !=|
|00003340| 20 73 74 64 6f 75 74 29 | 0a 20 20 20 20 20 20 20 | stdout)|. |
|00003350| 20 66 63 6c 6f 73 65 20 | 28 66 70 74 72 29 3b 0a | fclose |(fptr);.|
|00003360| 20 20 20 20 69 66 20 28 | 61 72 67 63 20 3d 3d 20 | if (|argc == |
|00003370| 31 29 20 7b 0a 20 20 20 | 20 20 20 20 20 77 72 61 |1) {. | wra|
|00003380| 70 77 72 69 74 65 20 28 | 73 74 64 6f 75 74 2c 20 |pwrite (|stdout, |
|00003390| 35 2c 20 30 2c 20 63 6f | 6c 2c 20 22 57 69 74 68 |5, 0, co|l, "With|
|000033a0| 20 79 6f 75 72 20 70 65 | 72 6d 69 73 73 69 6f 6e | your pe|rmission|
|000033b0| 2c 20 74 68 69 73 20 70 | 72 6f 67 72 61 6d 22 2c |, this p|rogram",|
|000033c0| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 22 77 69 |. | "wi|
|000033d0| 6c 6c 20 6e 6f 77 20 72 | 65 63 6f 72 64 20 79 6f |ll now r|ecord yo|
|000033e0| 75 72 20 72 61 77 20 73 | 63 6f 72 65 73 20 69 6e |ur raw s|cores in|
|000033f0| 20 61 20 66 69 6c 65 2e | 20 54 6f 20 66 75 72 74 | a file.| To furt|
|00003400| 68 65 72 20 74 68 65 22 | 2c 0a 20 20 20 20 20 20 |her the"|,. |
|00003410| 20 20 20 20 20 20 22 72 | 65 6c 69 61 62 69 6c 69 | "r|eliabili|
|00003420| 74 79 20 6f 66 20 74 68 | 69 73 20 70 72 6f 67 72 |ty of th|is progr|
|00003430| 61 6d 2c 20 49 20 77 6f | 75 6c 64 20 6c 69 6b 65 |am, I wo|uld like|
|00003440| 20 79 6f 75 20 74 6f 20 | 73 61 76 65 20 61 20 63 | you to |save a c|
|00003450| 6f 70 79 22 2c 0a 20 20 | 20 20 20 20 20 20 20 20 |opy",. | |
|00003460| 20 20 22 6f 66 20 74 68 | 69 73 20 72 65 63 6f 72 | "of th|is recor|
|00003470| 64 20 61 6e 64 20 65 6d | 61 69 6c 20 69 74 20 74 |d and em|ail it t|
|00003480| 6f 20 6d 65 20 61 74 22 | 2c 20 45 4d 41 49 4c 2c |o me at"|, EMAIL,|
|00003490| 20 22 74 68 72 6f 75 67 | 68 20 22 0a 20 20 20 20 | "throug|h ". |
|000034a0| 20 20 20 20 20 20 20 20 | 22 74 68 65 20 49 6e 74 | |"the Int|
|000034b0| 65 72 6e 65 74 2c 20 6f | 72 20 74 68 72 6f 75 67 |ernet, o|r throug|
|000034c0| 68 20 6d 79 20 70 65 72 | 73 6f 6e 61 6c 20 65 6d |h my per|sonal em|
|000034d0| 61 69 6c 20 61 63 63 6f | 75 6e 74 20 6f 6e 20 74 |ail acco|unt on t|
|000034e0| 68 65 20 22 0a 20 20 20 | 20 20 20 20 20 20 20 20 |he ". | |
|000034f0| 20 22 46 69 6c 65 57 6f | 72 6b 73 20 42 42 53 20 | "FileWo|rks BBS |
|00003500| 69 6e 20 52 6f 63 68 65 | 73 74 65 72 2c 20 4e 59 |in Roche|ster, NY|
|00003510| 2e 20 44 6f 20 79 6f 75 | 20 67 69 76 65 20 74 68 |. Do you| give th|
|00003520| 69 73 20 70 72 6f 67 72 | 61 6d 20 79 6f 75 72 20 |is progr|am your |
|00003530| 22 0a 20 20 20 20 20 20 | 20 20 20 20 20 20 22 70 |". | "p|
|00003540| 65 72 6d 69 73 73 69 6f | 6e 20 74 6f 20 73 61 76 |ermissio|n to sav|
|00003550| 65 20 74 68 69 73 20 72 | 65 63 6f 72 64 3f 20 28 |e this r|ecord? (|
|00003560| 79 2f 6e 29 22 2c 20 30 | 29 3b 0a 0a 20 20 20 20 |y/n)", 0|);.. |
|00003570| 20 20 20 20 69 66 20 28 | 79 65 73 6e 6f 28 29 20 | if (|yesno() |
|00003580| 3d 3d 20 31 29 20 7b 0a | 20 20 20 20 20 20 20 20 |== 1) {.| |
|00003590| 20 20 20 20 77 72 61 70 | 77 72 69 74 65 20 28 73 | wrap|write (s|
|000035a0| 74 64 6f 75 74 2c 20 30 | 2c 20 30 2c 20 63 6f 6c |tdout, 0|, 0, col|
|000035b0| 2c 20 22 57 68 61 74 20 | 77 69 6c 6c 20 79 6f 75 |, "What |will you|
|000035c0| 20 6e 61 6d 65 20 74 68 | 69 73 20 66 69 6c 65 3f | name th|is file?|
|000035d0| 5c 6e 22 2c 20 30 29 3b | 0a 20 20 20 20 20 20 20 |\n", 0);|. |
|000035e0| 20 20 20 20 20 66 72 65 | 65 20 28 66 6e 61 6d 65 | fre|e (fname|
|000035f0| 29 3b 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 66 |);. | f|
|00003600| 6e 61 6d 65 20 3d 20 63 | 6c 6f 6e 65 5f 6c 69 6e |name = c|lone_lin|
|00003610| 65 28 73 74 64 69 6e 2c | 20 46 49 4c 45 5f 4e 41 |e(stdin,| FILE_NA|
|00003620| 4d 45 5f 4d 41 58 29 3b | 0a 20 20 20 20 20 20 20 |ME_MAX);|. |
|00003630| 20 20 20 20 20 77 72 61 | 70 77 72 69 74 65 20 28 | wra|pwrite (|
|00003640| 73 74 64 6f 75 74 2c 20 | 30 2c 20 30 2c 20 63 6f |stdout, |0, 0, co|
|00003650| 6c 2c 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |l,. | |
|00003660| 20 20 20 22 57 68 61 74 | 20 69 73 20 79 6f 75 72 | "What| is your|
|00003670| 20 70 73 79 63 68 6f 6c | 6f 67 69 63 61 6c 20 74 | psychol|ogical t|
|00003680| 79 70 65 3f 5c 6e 22 2c | 20 30 29 3b 0a 20 20 20 |ype?\n",| 0);. |
|00003690| 20 20 20 20 20 20 20 20 | 20 74 79 70 65 20 3d 20 | | type = |
|000036a0| 63 6c 6f 6e 65 5f 6c 69 | 6e 65 28 73 74 64 69 6e |clone_li|ne(stdin|
|000036b0| 2c 20 34 29 3b 0a 20 20 | 20 20 20 20 20 20 20 20 |, 4);. | |
|000036c0| 20 20 70 72 69 6e 74 66 | 20 28 22 5c 6e 53 65 6e | printf| ("\nSen|
|000036d0| 64 69 6e 67 20 72 61 77 | 20 73 63 6f 72 65 73 20 |ding raw| scores |
|000036e0| 74 6f 20 5c 22 25 73 5c | 22 2e 5c 6e 22 2c 20 66 |to \"%s\|".\n", f|
|000036f0| 6e 61 6d 65 29 3b 0a 20 | 20 20 20 20 20 20 20 20 |name);. | |
|00003700| 20 20 20 57 72 4f 70 65 | 6e 20 28 66 70 74 72 2c | WrOpe|n (fptr,|
|00003710| 20 66 6e 61 6d 65 29 3b | 0a 20 20 20 20 20 20 20 | fname);|. |
|00003720| 20 20 20 20 20 66 70 72 | 69 6e 74 66 20 28 66 70 | fpr|intf (fp|
|00003730| 74 72 2c 20 22 25 73 5c | 6e 25 73 5c 6e 22 2c 20 |tr, "%s\|n%s\n", |
|00003740| 56 65 72 73 69 6f 6e 2c | 20 74 79 70 65 29 3b 0a |Version,| type);.|
|00003750| 20 20 20 20 20 20 20 20 | 20 20 20 20 66 6f 72 20 | | for |
|00003760| 28 51 20 3d 20 51 2d 3e | 6e 78 3b 20 51 2d 3e 6e |(Q = Q->|nx; Q->n|
|00003770| 75 6d 20 3e 20 30 3b 20 | 51 20 3d 20 51 2d 3e 6e |um > 0; |Q = Q->n|
|00003780| 78 29 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |x). | |
|00003790| 20 20 20 66 70 72 69 6e | 74 66 20 28 66 70 74 72 | fprin|tf (fptr|
|000037a0| 2c 20 22 25 64 20 25 64 | 20 25 64 5c 6e 22 2c 20 |, "%d %d| %d\n", |
|000037b0| 51 2d 3e 6e 75 6d 2c 20 | 51 2d 3e 61 6e 73 2c 20 |Q->num, |Q->ans, |
|000037c0| 51 2d 3e 73 74 72 65 6e | 67 74 68 29 3b 0a 20 20 |Q->stren|gth);. |
|000037d0| 20 20 20 20 20 20 20 20 | 20 20 66 63 6c 6f 73 65 | | fclose|
|000037e0| 20 28 66 70 74 72 29 3b | 0a 20 20 20 20 20 20 20 | (fptr);|. |
|000037f0| 20 7d 0a 20 20 20 20 7d | 0a 7d 0a 0a 69 6e 74 20 | }. }|.}..int |
|00003800| 70 6f 77 61 20 28 69 6e | 74 20 78 2c 20 69 6e 74 |powa (in|t x, int|
|00003810| 20 79 29 20 7b 0a 20 20 | 20 20 69 66 20 28 79 20 | y) {. | if (y |
|00003820| 3c 20 31 29 0a 20 20 20 | 20 20 20 20 20 72 65 74 |< 1). | ret|
|00003830| 75 72 6e 20 31 3b 0a 20 | 20 20 20 69 66 20 28 79 |urn 1;. | if (y|
|00003840| 20 3d 3d 20 31 29 0a 20 | 20 20 20 20 20 20 20 72 | == 1). | r|
|00003850| 65 74 75 72 6e 20 78 3b | 0a 20 20 20 20 72 65 74 |eturn x;|. ret|
|00003860| 75 72 6e 20 78 20 2a 20 | 70 6f 77 61 28 78 2c 20 |urn x * |powa(x, |
|00003870| 79 2d 31 29 3b 0a 7d 0a | 46 69 6c 65 44 61 74 61 |y-1);.}.|FileData|
|00003880| 82 46 50 44 49 4f 00 00 | 00 00 00 00 c8 0c 00 00 |.FPDIO..|........|
|00003890| 45 ff ff ff 00 a5 0c 13 | 03 00 5a 2a 2f 2a 20 46 |E.......|..Z*/* F|
|000038a0| 50 44 49 4f 2e 43 20 43 | 6f 70 79 72 69 67 68 74 |PDIO.C C|opyright|
|000038b0| 20 28 43 29 20 31 39 39 | 33 20 46 65 72 67 75 73 | (C) 199|3 Fergus|
|000038c0| 20 50 61 74 72 69 63 6b | 20 44 75 6e 69 68 6f 20 | Patrick| Duniho |
|000038d0| 2a 2f 0a 0a 23 69 66 6e | 64 65 66 20 5f 46 50 44 |*/..#ifn|def _FPD|
|000038e0| 49 4f 5f 43 0a 23 64 65 | 66 69 6e 65 20 5f 46 50 |IO_C.#de|fine _FP|
|000038f0| 44 49 4f 5f 43 0a 0a 23 | 69 6e 63 6c 75 64 65 20 |DIO_C..#|include |
|00003900| 3c 63 74 79 70 65 2e 68 | 3e 0a 23 69 6e 63 6c 75 |<ctype.h|>.#inclu|
|00003910| 64 65 20 3c 73 74 64 69 | 6f 2e 68 3e 0a 23 69 6e |de <stdi|o.h>.#in|
|00003920| 63 6c 75 64 65 20 3c 73 | 74 64 6c 69 62 2e 68 3e |clude <s|tdlib.h>|
|00003930| 0a 23 69 6e 63 6c 75 64 | 65 20 3c 73 74 72 69 6e |.#includ|e <strin|
|00003940| 67 2e 68 3e 0a 23 69 6e | 63 6c 75 64 65 20 3c 73 |g.h>.#in|clude <s|
|00003950| 74 64 61 72 67 2e 68 3e | 0a 0a 23 64 65 66 69 6e |tdarg.h>|..#defin|
|00003960| 65 20 52 64 4f 70 65 6e | 28 58 2c 59 29 20 58 3d |e RdOpen|(X,Y) X=|
|00003970| 46 44 4f 70 65 6e 28 59 | 2c 20 22 72 22 29 0a 23 |FDOpen(Y|, "r").#|
|00003980| 64 65 66 69 6e 65 20 57 | 72 4f 70 65 6e 28 58 2c |define W|rOpen(X,|
|00003990| 59 29 20 58 3d 46 44 4f | 70 65 6e 28 59 2c 20 22 |Y) X=FDO|pen(Y, "|
|000039a0| 77 22 29 0a 23 64 65 66 | 69 6e 65 20 41 70 4f 70 |w").#def|ine ApOp|
|000039b0| 65 6e 28 58 2c 59 29 20 | 58 3d 46 44 4f 70 65 6e |en(X,Y) |X=FDOpen|
|000039c0| 28 59 2c 20 22 61 22 29 | 0a 0a 76 6f 69 64 20 77 |(Y, "a")|..void w|
|000039d0| 72 61 70 77 72 69 74 65 | 20 28 46 49 4c 45 20 2a |rapwrite| (FILE *|
|000039e0| 66 70 74 72 2c 20 69 6e | 74 20 69 6e 64 2c 20 69 |fptr, in|t ind, i|
|000039f0| 6e 74 20 6c 6d 2c 20 69 | 6e 74 20 72 6d 2c 20 63 |nt lm, i|nt rm, c|
|00003a00| 68 61 72 20 2a 73 2c 20 | 2e 2e 2e 29 3b 0a 69 6e |har *s, |...);.in|
|00003a10| 74 20 77 72 64 6c 65 6e | 28 63 68 61 72 20 2a 73 |t wrdlen|(char *s|
|00003a20| 29 3b 0a 69 6e 74 20 66 | 67 65 74 70 20 28 46 49 |);.int f|getp (FI|
|00003a30| 4c 45 20 2a 66 70 74 72 | 29 3b 0a 46 49 4c 45 20 |LE *fptr|);.FILE |
|00003a40| 2a 46 44 4f 70 65 6e 20 | 28 63 6f 6e 73 74 20 63 |*FDOpen |(const c|
|00003a50| 68 61 72 20 2a 66 6e 2c | 20 63 6f 6e 73 74 20 63 |har *fn,| const c|
|00003a60| 68 61 72 20 2a 6d 6f 64 | 65 29 3b 0a 69 6e 74 20 |har *mod|e);.int |
|00003a70| 4c 69 6e 65 66 65 65 64 | 73 20 28 63 68 61 72 20 |Linefeed|s (char |
|00003a80| 2a 66 6e 61 6d 65 29 3b | 0a 63 68 61 72 20 2a 63 |*fname);|.char *c|
|00003a90| 6c 6f 6e 65 5f 6c 69 6e | 65 20 28 46 49 4c 45 20 |lone_lin|e (FILE |
|00003aa0| 2a 66 70 74 72 2c 20 69 | 6e 74 20 6d 61 78 29 3b |*fptr, i|nt max);|
|00003ab0| 0a 69 6e 74 20 79 65 73 | 6e 6f 20 28 29 3b 0a 0a |.int yes|no ();..|
|00003ac0| 76 6f 69 64 20 77 72 61 | 70 77 72 69 74 65 20 28 |void wra|pwrite (|
|00003ad0| 46 49 4c 45 20 2a 66 70 | 74 72 2c 20 69 6e 74 20 |FILE *fp|tr, int |
|00003ae0| 69 6e 64 2c 20 69 6e 74 | 20 6c 6d 2c 20 69 6e 74 |ind, int| lm, int|
|00003af0| 20 72 6d 2c 20 63 68 61 | 72 20 2a 73 2c 20 2e 2e | rm, cha|r *s, ..|
|00003b00| 2e 29 20 7b 0a 20 20 20 | 20 76 61 5f 6c 69 73 74 |.) {. | va_list|
|00003b10| 20 61 70 3b 0a 20 20 20 | 20 69 6e 74 20 69 2c 20 | ap;. | int i, |
|00003b20| 6a 3b 0a 0a 20 20 20 20 | 76 61 5f 73 74 61 72 74 |j;.. |va_start|
|00003b30| 28 61 70 2c 20 73 29 3b | 0a 20 20 20 20 66 6f 72 |(ap, s);|. for|
|00003b40| 20 28 6a 20 3d 20 69 6e | 64 3b 20 3b 20 6a 20 3d | (j = in|d; ; j =|
|00003b50| 20 6c 6d 29 20 7b 0a 20 | 20 20 20 20 20 20 20 66 | lm) {. | f|
|00003b60| 6f 72 20 28 69 20 3d 20 | 30 3b 20 69 20 3c 20 6a |or (i = |0; i < j|
|00003b70| 3b 20 69 2b 2b 29 0a 20 | 20 20 20 20 20 20 20 20 |; i++). | |
|00003b80| 20 20 20 66 70 75 74 63 | 20 28 27 20 27 2c 20 66 | fputc| (' ', f|
|00003b90| 70 74 72 29 3b 0a 20 20 | 20 20 20 20 20 20 66 6f |ptr);. | fo|
|00003ba0| 72 20 28 69 20 3d 20 6a | 3b 20 69 20 3c 20 72 6d |r (i = j|; i < rm|
|00003bb0| 3b 20 69 2b 2b 29 0a 20 | 20 20 20 20 20 20 20 20 |; i++). | |
|00003bc0| 20 20 20 73 77 69 74 63 | 68 20 28 2a 73 29 20 7b | switc|h (*s) {|
|00003bd0| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. | |
|00003be0| 20 63 61 73 65 20 30 3a | 20 20 20 20 20 2f 2a 20 | case 0:| /* |
|00003bf0| 45 6e 64 20 6f 66 20 73 | 74 72 69 6e 67 20 72 65 |End of s|tring re|
|00003c00| 61 63 68 65 64 20 2a 2f | 0a 20 20 20 20 20 20 20 |ached */|. |
|00003c10| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 69 66 20 | | if |
|00003c20| 28 28 73 20 3d 20 76 61 | 5f 61 72 67 28 61 70 2c |((s = va|_arg(ap,|
|00003c30| 20 63 68 61 72 20 2a 29 | 29 20 3d 3d 20 30 29 20 | char *)|) == 0) |
|00003c40| 7b 0a 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |{. | |
|00003c50| 20 20 20 20 20 20 20 20 | 20 20 66 70 75 74 63 20 | | fputc |
|00003c60| 28 27 5c 6e 27 2c 20 66 | 70 74 72 29 3b 0a 20 20 |('\n', f|ptr);. |
|00003c70| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003c80| 20 20 20 20 20 20 76 61 | 5f 65 6e 64 28 61 70 29 | va|_end(ap)|
|00003c90| 3b 0a 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |;. | |
|00003ca0| 20 20 20 20 20 20 20 20 | 20 20 72 65 74 75 72 6e | | return|
|00003cb0| 3b 0a 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |;. | |
|00003cc0| 20 20 20 20 20 20 7d 0a | 20 20 20 20 20 20 20 20 | }.| |
|00003cd0| 20 20 20 20 20 20 20 20 | 20 20 20 20 69 66 20 28 | | if (|
|00003ce0| 28 69 20 2b 20 77 72 64 | 6c 65 6e 28 73 29 29 20 |(i + wrd|len(s)) |
|00003cf0| 3e 3d 20 72 6d 29 0a 20 | 20 20 20 20 20 20 20 20 |>= rm). | |
|00003d00| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 69 | | i|
|00003d10| 20 3d 20 72 6d 3b 0a 20 | 20 20 20 20 20 20 20 20 | = rm;. | |
|00003d20| 20 20 20 20 20 20 20 20 | 20 20 20 65 6c 73 65 20 | | else |
|00003d30| 69 66 20 28 69 20 3e 20 | 6a 29 0a 20 20 20 20 20 |if (i > |j). |
|00003d40| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003d50| 20 20 20 66 70 75 74 63 | 20 28 27 20 27 2c 20 66 | fputc| (' ', f|
|00003d60| 70 74 72 29 3b 0a 20 20 | 20 20 20 20 20 20 20 20 |ptr);. | |
|00003d70| 20 20 20 20 20 20 20 20 | 20 20 62 72 65 61 6b 3b | | break;|
|00003d80| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. | |
|00003d90| 20 63 61 73 65 20 27 20 | 27 3a 20 20 20 20 20 2f | case ' |': /|
|00003da0| 2a 20 45 6e 64 20 6f 66 | 20 77 6f 72 64 20 72 65 |* End of| word re|
|00003db0| 61 63 68 65 64 20 2a 2f | 0a 20 20 20 20 20 20 20 |ached */|. |
|00003dc0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 69 66 20 | | if |
|00003dd0| 28 28 69 20 2b 20 77 72 | 64 6c 65 6e 28 2b 2b 73 |((i + wr|dlen(++s|
|00003de0| 29 29 20 3e 3d 20 72 6d | 29 0a 20 20 20 20 20 20 |)) >= rm|). |
|00003df0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003e00| 20 20 69 20 3d 20 72 6d | 3b 0a 20 20 20 20 20 20 | i = rm|;. |
|00003e10| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 65 6c | | el|
|00003e20| 73 65 20 69 66 20 28 69 | 20 3e 20 6a 29 0a 20 20 |se if (i| > j). |
|00003e30| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003e40| 20 20 20 20 20 20 66 70 | 75 74 63 20 28 27 20 27 | fp|utc (' '|
|00003e50| 2c 20 66 70 74 72 29 3b | 0a 20 20 20 20 20 20 20 |, fptr);|. |
|00003e60| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 62 72 65 | | bre|
|00003e70| 61 6b 3b 0a 20 20 20 20 | 20 20 20 20 20 20 20 20 |ak;. | |
|00003e80| 20 20 20 20 63 61 73 65 | 20 27 5c 6e 27 3a 20 20 | case| '\n': |
|00003e90| 20 20 2f 2a 20 45 6e 64 | 20 6f 66 20 6c 69 6e 65 | /* End| of line|
|00003ea0| 20 72 65 61 63 68 65 64 | 20 2a 2f 0a 20 20 20 20 | reached| */. |
|00003eb0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003ec0| 69 20 3d 20 72 6d 3b 0a | 20 20 20 20 20 20 20 20 |i = rm;.| |
|00003ed0| 20 20 20 20 20 20 20 20 | 20 20 20 20 73 2b 2b 3b | | s++;|
|00003ee0| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. | |
|00003ef0| 20 20 20 20 20 62 72 65 | 61 6b 3b 0a 20 20 20 20 | bre|ak;. |
|00003f00| 20 20 20 20 20 20 20 20 | 20 20 20 20 64 65 66 61 | | defa|
|00003f10| 75 6c 74 3a 0a 20 20 20 | 20 20 20 20 20 20 20 20 |ult:. | |
|00003f20| 20 20 20 20 20 20 20 20 | 20 66 70 75 74 63 20 28 | | fputc (|
|00003f30| 2a 73 2b 2b 2c 20 66 70 | 74 72 29 3b 0a 20 20 20 |*s++, fp|tr);. |
|00003f40| 20 20 20 20 20 20 20 20 | 20 7d 0a 20 20 20 20 20 | | }. |
|00003f50| 20 20 20 66 70 75 74 63 | 20 28 27 5c 6e 27 2c 20 | fputc| ('\n', |
|00003f60| 66 70 74 72 29 3b 0a 20 | 20 20 20 20 20 20 20 69 |fptr);. | i|
|00003f70| 66 20 28 28 2a 73 20 3d | 3d 20 27 5c 30 27 29 20 |f ((*s =|= '\0') |
|00003f80| 26 26 20 28 28 73 20 3d | 20 76 61 5f 61 72 67 28 |&& ((s =| va_arg(|
|00003f90| 61 70 2c 20 63 68 61 72 | 20 2a 29 29 20 3d 3d 20 |ap, char| *)) == |
|00003fa0| 30 29 29 20 7b 0a 20 20 | 20 20 20 20 20 20 20 20 |0)) {. | |
|00003fb0| 20 20 76 61 5f 65 6e 64 | 28 61 70 29 3b 0a 20 20 | va_end|(ap);. |
|00003fc0| 20 20 20 20 20 20 20 20 | 20 20 72 65 74 75 72 6e | | return|
|00003fd0| 3b 0a 20 20 20 20 20 20 | 20 20 7d 0a 20 20 20 20 |;. | }. |
|00003fe0| 7d 0a 7d 0a 0a 69 6e 74 | 20 77 72 64 6c 65 6e 28 |}.}..int| wrdlen(|
|00003ff0| 63 68 61 72 20 2a 73 29 | 20 7b 0a 20 20 20 20 69 |char *s)| {. i|
|00004000| 6e 74 20 72 3b 0a 0a 20 | 20 20 20 66 6f 72 20 28 |nt r;.. | for (|
|00004010| 72 20 3d 20 30 3b 20 2a | 73 20 21 3d 20 27 20 27 |r = 0; *|s != ' '|
|00004020| 20 26 26 20 2a 73 20 21 | 3d 20 27 5c 6e 27 20 26 | && *s !|= '\n' &|
|00004030| 26 20 2a 73 20 21 3d 20 | 27 5c 30 27 3b 20 72 2b |& *s != |'\0'; r+|
|00004040| 2b 2c 20 73 2b 2b 29 3b | 0a 20 20 20 20 72 65 74 |+, s++);|. ret|
|00004050| 75 72 6e 20 72 3b 0a 7d | 0a 0a 69 6e 74 20 66 67 |urn r;.}|..int fg|
|00004060| 65 74 70 20 28 46 49 4c | 45 20 2a 66 70 74 72 29 |etp (FIL|E *fptr)|
|00004070| 20 7b 0a 20 20 20 20 69 | 6e 74 20 63 2c 20 74 6f | {. i|nt c, to|
|00004080| 74 20 3d 20 30 3b 0a 0a | 20 20 20 20 77 68 69 6c |t = 0;..| whil|
|00004090| 65 20 28 21 69 73 64 69 | 67 69 74 28 63 20 3d 20 |e (!isdi|git(c = |
|000040a0| 67 65 74 63 28 66 70 74 | 72 29 29 29 0a 20 20 20 |getc(fpt|r))). |
|000040b0| 20 20 20 20 20 69 66 20 | 28 63 20 3d 3d 20 45 4f | if |(c == EO|
|000040c0| 46 29 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 72 |F). | r|
|000040d0| 65 74 75 72 6e 20 45 4f | 46 3b 0a 20 20 20 20 64 |eturn EO|F;. d|
|000040e0| 6f 20 7b 0a 20 20 20 20 | 20 20 20 20 74 6f 74 20 |o {. | tot |
|000040f0| 2a 3d 20 31 30 3b 0a 20 | 20 20 20 20 20 20 20 74 |*= 10;. | t|
|00004100| 6f 74 20 2b 3d 20 28 63 | 20 2d 20 27 30 27 29 3b |ot += (c| - '0');|
|00004110| 0a 20 20 20 20 7d 20 77 | 68 69 6c 65 20 28 69 73 |. } w|hile (is|
|00004120| 64 69 67 69 74 28 63 20 | 3d 20 67 65 74 63 28 66 |digit(c |= getc(f|
|00004130| 70 74 72 29 29 29 3b 0a | 20 20 20 20 69 66 20 28 |ptr)));.| if (|
|00004140| 63 20 21 3d 20 27 5c 6e | 27 29 0a 20 20 20 20 20 |c != '\n|'). |
|00004150| 20 20 20 75 6e 67 65 74 | 63 20 28 63 2c 20 66 70 | unget|c (c, fp|
|00004160| 74 72 29 3b 0a 20 20 20 | 20 72 65 74 75 72 6e 20 |tr);. | return |
|00004170| 74 6f 74 3b 0a 7d 0a 0a | 46 49 4c 45 20 2a 46 44 |tot;.}..|FILE *FD|
|00004180| 4f 70 65 6e 20 28 63 6f | 6e 73 74 20 63 68 61 72 |Open (co|nst char|
|00004190| 20 2a 66 6e 2c 20 63 6f | 6e 73 74 20 63 68 61 72 | *fn, co|nst char|
|000041a0| 20 2a 6d 6f 64 65 29 20 | 7b 0a 20 20 20 20 46 49 | *mode) |{. FI|
|000041b0| 4c 45 20 2a 66 70 74 72 | 3b 0a 0a 20 20 20 20 69 |LE *fptr|;.. i|
|000041c0| 66 20 28 28 66 70 74 72 | 20 3d 20 66 6f 70 65 6e |f ((fptr| = fopen|
|000041d0| 28 66 6e 2c 20 6d 6f 64 | 65 29 29 20 3d 3d 20 4e |(fn, mod|e)) == N|
|000041e0| 55 4c 4c 29 20 7b 0a 20 | 20 20 20 20 20 20 20 66 |ULL) {. | f|
|000041f0| 70 72 69 6e 74 66 20 28 | 73 74 64 65 72 72 2c 20 |printf (|stderr, |
|00004200| 22 43 6f 75 6c 64 20 6e | 6f 74 20 6f 70 65 6e 20 |"Could n|ot open |
|00004210| 25 73 2e 22 2c 20 66 6e | 29 3b 0a 20 20 20 20 20 |%s.", fn|);. |
|00004220| 20 20 20 65 78 69 74 20 | 28 32 29 3b 0a 20 20 20 | exit |(2);. |
|00004230| 20 7d 0a 20 20 20 20 72 | 65 74 75 72 6e 20 66 70 | }. r|eturn fp|
|00004240| 74 72 3b 0a 7d 0a 0a 69 | 6e 74 20 4c 69 6e 65 66 |tr;.}..i|nt Linef|
|00004250| 65 65 64 73 20 28 63 68 | 61 72 20 2a 66 6e 61 6d |eeds (ch|ar *fnam|
|00004260| 65 29 20 7b 0a 20 20 20 | 20 46 49 4c 45 20 2a 66 |e) {. | FILE *f|
|00004270| 70 74 72 3b 0a 20 20 20 | 20 69 6e 74 20 63 2c 20 |ptr;. | int c, |
|00004280| 63 6e 74 20 3d 20 30 3b | 0a 0a 20 20 20 20 52 64 |cnt = 0;|.. Rd|
|00004290| 4f 70 65 6e 20 28 66 70 | 74 72 2c 20 66 6e 61 6d |Open (fp|tr, fnam|
|000042a0| 65 29 3b 0a 20 20 20 20 | 77 68 69 6c 65 20 28 28 |e);. |while ((|
|000042b0| 63 20 3d 20 67 65 74 63 | 28 66 70 74 72 29 29 20 |c = getc|(fptr)) |
|000042c0| 21 3d 20 45 4f 46 29 0a | 20 20 20 20 20 20 20 20 |!= EOF).| |
|000042d0| 69 66 20 28 63 20 3d 3d | 20 27 5c 6e 27 29 0a 20 |if (c ==| '\n'). |
|000042e0| 20 20 20 20 20 20 20 20 | 20 20 20 63 6e 74 2b 2b | | cnt++|
|000042f0| 3b 0a 20 20 20 20 66 63 | 6c 6f 73 65 20 28 66 70 |;. fc|lose (fp|
|00004300| 74 72 29 3b 0a 20 20 20 | 20 72 65 74 75 72 6e 20 |tr);. | return |
|00004310| 63 6e 74 3b 0a 7d 0a 0a | 63 68 61 72 20 2a 63 6c |cnt;.}..|char *cl|
|00004320| 6f 6e 65 5f 6c 69 6e 65 | 20 28 46 49 4c 45 20 2a |one_line| (FILE *|
|00004330| 66 70 74 72 2c 20 69 6e | 74 20 6d 61 78 29 20 7b |fptr, in|t max) {|
|00004340| 0a 20 20 20 20 63 68 61 | 72 20 2a 73 2c 20 2a 72 |. cha|r *s, *r|
|00004350| 2c 20 2a 74 3b 0a 20 20 | 20 20 69 6e 74 20 69 3b |, *t;. | int i;|
|00004360| 0a 0a 20 20 20 20 73 20 | 3d 20 28 63 68 61 72 20 |.. s |= (char |
|00004370| 2a 29 6d 61 6c 6c 6f 63 | 28 6d 61 78 20 2b 20 31 |*)malloc|(max + 1|
|00004380| 29 3b 0a 20 20 20 20 74 | 20 3d 20 73 3b 0a 20 20 |);. t| = s;. |
|00004390| 20 20 66 6f 72 20 28 69 | 20 3d 20 30 3b 20 28 69 | for (i| = 0; (i|
|000043a0| 20 3c 20 6d 61 78 29 20 | 26 26 20 28 28 2a 73 20 | < max) |&& ((*s |
|000043b0| 3d 20 66 67 65 74 63 28 | 66 70 74 72 29 29 20 21 |= fgetc(|fptr)) !|
|000043c0| 3d 20 27 5c 6e 27 29 3b | 20 69 2b 2b 2c 20 73 2b |= '\n');| i++, s+|
|000043d0| 2b 29 3b 0a 20 20 20 20 | 69 66 20 28 2a 73 20 21 |+);. |if (*s !|
|000043e0| 3d 20 27 5c 6e 27 29 0a | 20 20 20 20 20 20 20 20 |= '\n').| |
|000043f0| 75 6e 67 65 74 63 28 2a | 73 2c 20 66 70 74 72 29 |ungetc(*|s, fptr)|
|00004400| 3b 0a 20 20 20 20 2a 73 | 20 3d 20 27 5c 30 27 3b |;. *s| = '\0';|
|00004410| 0a 20 20 20 20 72 20 3d | 20 73 74 72 64 75 70 28 |. r =| strdup(|
|00004420| 74 29 3b 0a 20 20 20 20 | 66 72 65 65 20 28 74 29 |t);. |free (t)|
|00004430| 3b 0a 20 20 20 20 72 65 | 74 75 72 6e 20 72 3b 0a |;. re|turn r;.|
|00004440| 7d 0a 0a 69 6e 74 20 79 | 65 73 6e 6f 20 28 29 20 |}..int y|esno () |
|00004450| 7b 0a 20 20 20 20 69 6e | 74 20 63 3b 0a 0a 20 20 |{. in|t c;.. |
|00004460| 20 20 66 6f 72 20 28 3b | 3b 29 20 7b 0a 20 20 20 | for (;|;) {. |
|00004470| 20 20 20 20 20 63 20 3d | 20 66 67 65 74 63 28 73 | c =| fgetc(s|
|00004480| 74 64 69 6e 29 3b 0a 20 | 20 20 20 20 20 20 20 77 |tdin);. | w|
|00004490| 68 69 6c 65 20 28 66 67 | 65 74 63 28 73 74 64 69 |hile (fg|etc(stdi|
|000044a0| 6e 29 20 21 3d 20 27 5c | 6e 27 29 3b 0a 20 20 20 |n) != '\|n');. |
|000044b0| 20 20 20 20 20 69 66 20 | 28 63 20 3d 3d 20 27 79 | if |(c == 'y|
|000044c0| 27 20 7c 7c 20 63 20 3d | 3d 20 27 59 27 29 0a 20 |' || c =|= 'Y'). |
|000044d0| 20 20 20 20 20 20 20 20 | 20 20 20 72 65 74 75 72 | | retur|
|000044e0| 6e 20 31 3b 0a 20 20 20 | 20 20 20 20 20 69 66 20 |n 1;. | if |
|000044f0| 28 63 20 3d 3d 20 27 6e | 27 20 7c 7c 20 63 20 3d |(c == 'n|' || c =|
|00004500| 3d 20 27 4e 27 29 0a 20 | 20 20 20 20 20 20 20 20 |= 'N'). | |
|00004510| 20 20 20 72 65 74 75 72 | 6e 20 30 3b 0a 20 20 20 | retur|n 0;. |
|00004520| 20 20 20 20 20 70 75 74 | 73 20 28 22 50 6c 65 61 | put|s ("Plea|
|00004530| 73 65 20 61 6e 73 77 65 | 72 20 79 20 6f 72 20 6e |se answe|r y or n|
|00004540| 2e 22 29 3b 0a 20 20 20 | 20 7d 0a 7d 0a 0a 23 65 |.");. | }.}..#e|
|00004550| 6e 64 69 66 20 2f 2a 20 | 5f 46 50 44 49 4f 5f 43 |ndif /* |_FPDIO_C|
|00004560| 20 2a 2f 0a 46 69 6c 65 | 44 61 74 61 82 44 44 4c | */.File|Data.DDL|
|00004570| 49 2f 43 00 72 20 66 65 | 61 26 00 00 45 fd ff ff |I/C.r fe|a&..E...|
|00004580| c8 52 d2 98 03 00 ee 5d | 2f 2a 0a 20 2a 20 20 64 |.R.....]|/*. * d|
|00004590| 64 6c 69 2e 63 0a 20 2a | 20 20 54 68 65 20 44 75 |dli.c. *| The Du|
|000045a0| 6e 69 68 6f 20 61 6e 64 | 20 44 75 6e 69 68 6f 20 |niho and| Duniho |
|000045b0| 4c 69 66 65 20 50 61 74 | 74 65 72 6e 20 49 6e 64 |Life Pat|tern Ind|
|000045c0| 69 63 61 74 6f 72 0a 20 | 2a 20 20 62 79 20 46 65 |icator. |* by Fe|
|000045d0| 72 67 75 73 20 44 75 6e | 69 68 6f 0a 20 2a 20 20 |rgus Dun|iho. * |
|000045e0| 43 6f 70 79 72 69 67 68 | 74 20 28 63 29 20 31 39 |Copyrigh|t (c) 19|
|000045f0| 39 32 2d 31 39 39 34 20 | 46 65 72 67 75 73 20 44 |92-1994 |Fergus D|
|00004600| 75 6e 69 68 6f 0a 20 2a | 2f 0a 0a 23 64 65 66 69 |uniho. *|/..#defi|
|00004610| 6e 65 20 56 45 52 20 22 | 56 33 2e 31 30 22 0a 23 |ne VER "|V3.10".#|
|00004620| 64 65 66 69 6e 65 20 45 | 4d 41 49 4c 20 22 66 64 |define E|MAIL "fd|
|00004630| 6e 68 40 74 72 6f 69 2e | 63 63 2e 72 6f 63 68 65 |nh@troi.|cc.roche|
|00004640| 73 74 65 72 2e 65 64 75 | 22 0a 0a 23 64 65 66 69 |ster.edu|"..#defi|
|00004650| 6e 65 20 44 49 43 45 20 | 30 0a 0a 23 64 65 66 69 |ne DICE |0..#defi|
|00004660| 6e 65 20 41 4d 49 47 41 | 20 31 0a 23 64 65 66 69 |ne AMIGA| 1.#defi|
|00004670| 6e 65 20 4d 53 44 4f 53 | 20 32 0a 23 64 65 66 69 |ne MSDOS| 2.#defi|
|00004680| 6e 65 20 4f 54 48 45 52 | 20 33 0a 0a 23 64 65 66 |ne OTHER| 3..#def|
|00004690| 69 6e 65 20 4f 50 53 59 | 53 20 41 4d 49 47 41 0a |ine OPSY|S AMIGA.|
|000046a0| 0a 23 69 66 20 4f 50 53 | 59 53 20 3d 3d 20 41 4d |.#if OPS|YS == AM|
|000046b0| 49 47 41 0a 20 20 20 20 | 23 64 65 66 69 6e 65 20 |IGA. |#define |
|000046c0| 70 72 74 64 65 76 20 22 | 50 52 54 3a 22 0a 20 20 |prtdev "|PRT:". |
|000046d0| 20 20 23 64 65 66 69 6e | 65 20 46 49 4c 45 5f 4e | #defin|e FILE_N|
|000046e0| 41 4d 45 5f 4d 41 58 20 | 33 32 0a 23 65 6c 69 66 |AME_MAX |32.#elif|
|000046f0| 20 4f 50 53 59 53 20 3d | 3d 20 4d 53 44 4f 53 0a | OPSYS =|= MSDOS.|
|00004700| 20 20 20 20 23 64 65 66 | 69 6e 65 20 70 72 74 64 | #def|ine prtd|
|00004710| 65 76 20 22 50 52 4e 22 | 0a 20 20 20 20 23 64 65 |ev "PRN"|. #de|
|00004720| 66 69 6e 65 20 46 49 4c | 45 5f 4e 41 4d 45 5f 4d |fine FIL|E_NAME_M|
|00004730| 41 58 20 38 0a 23 65 6c | 69 66 20 4f 50 53 59 53 |AX 8.#el|if OPSYS|
|00004740| 20 3d 3d 20 4f 54 48 45 | 52 0a 20 20 20 20 23 64 | == OTHE|R. #d|
|00004750| 65 66 69 6e 65 20 70 72 | 74 64 65 76 20 22 22 0a |efine pr|tdev "".|
|00004760| 20 20 20 20 23 64 65 66 | 69 6e 65 20 46 49 4c 45 | #def|ine FILE|
|00004770| 5f 4e 41 4d 45 5f 4d 41 | 58 20 31 36 0a 23 65 6c |_NAME_MA|X 16.#el|
|00004780| 73 65 0a 20 20 20 20 23 | 65 72 72 6f 72 20 4f 50 |se. #|error OP|
|00004790| 45 52 41 54 49 4e 47 20 | 53 59 53 54 45 4d 20 55 |ERATING |SYSTEM U|
|000047a0| 4e 4b 4e 4f 57 4e 0a 23 | 65 6e 64 69 66 0a 0a 2f |NKNOWN.#|endif../|
|000047b0| 2a 0a 20 2a 20 49 66 20 | 79 6f 75 72 20 63 6f 6d |*. * If |your com|
|000047c0| 70 69 6c 65 72 20 64 6f | 65 73 20 6e 6f 74 20 68 |piler do|es not h|
|000047d0| 61 76 65 20 74 68 65 20 | 63 6f 6d 6d 61 6e 64 20 |ave the |command |
|000047e0| 22 73 74 72 64 75 70 22 | 2c 0a 20 2a 20 77 68 69 |"strdup"|,. * whi|
|000047f0| 63 68 20 69 73 20 63 6f | 6d 6d 6f 6e 20 69 6e 20 |ch is co|mmon in |
|00004800| 43 20 63 6f 6d 70 69 6c | 65 72 73 20 62 75 74 20 |C compil|ers but |
|00004810| 6e 6f 74 20 70 61 72 74 | 20 6f 66 20 41 4e 53 49 |not part| of ANSI|
|00004820| 0a 20 2a 20 43 2c 20 75 | 6e 63 6f 6d 6d 65 6e 74 |. * C, u|ncomment|
|00004830| 20 74 68 65 20 6e 65 78 | 74 20 23 69 6e 63 6c 75 | the nex|t #inclu|
|00004840| 64 65 20 73 74 61 74 65 | 6d 65 6e 74 2e 0a 20 2a |de state|ment.. *|
|00004850| 2f 0a 2f 2a 20 23 69 6e | 63 6c 75 64 65 20 22 73 |/./* #in|clude "s|
|00004860| 74 72 64 75 70 2e 63 22 | 20 2a 2f 0a 0a 23 69 6e |trdup.c"| */..#in|
|00004870| 63 6c 75 64 65 20 22 66 | 70 64 69 6f 2e 63 22 0a |clude "f|pdio.c".|
|00004880| 23 69 6e 63 6c 75 64 65 | 20 22 71 73 74 2e 63 22 |#include| "qst.c"|
|00004890| 0a 23 69 6e 63 6c 75 64 | 65 20 3c 74 69 6d 65 2e |.#includ|e <time.|
|000048a0| 68 3e 0a 0a 23 64 65 66 | 69 6e 65 20 58 4e 20 45 |h>..#def|ine XN E|
|000048b0| 20 3f 20 22 45 78 74 72 | 61 76 65 72 74 65 64 22 | ? "Extr|averted"|
|000048c0| 20 3a 20 22 49 6e 74 72 | 6f 76 65 72 74 65 64 22 | : "Intr|overted"|
|000048d0| 0a 23 64 65 66 69 6e 65 | 20 51 46 49 4c 45 20 22 |.#define| QFILE "|
|000048e0| 44 44 4c 49 2e 51 53 54 | 22 0a 0a 69 6e 74 20 70 |DDLI.QST|"..int p|
|000048f0| 6f 77 20 28 69 6e 74 20 | 78 2c 20 69 6e 74 20 79 |ow (int |x, int y|
|00004900| 29 3b 0a 0a 6d 61 69 6e | 20 28 69 6e 74 20 61 72 |);..main| (int ar|
|00004910| 67 63 2c 20 63 68 61 72 | 20 2a 2a 61 72 67 76 29 |gc, char| **argv)|
|00004920| 20 7b 0a 20 20 20 20 69 | 6e 74 20 69 2c 20 63 6f | {. i|nt i, co|
|00004930| 6c 2c 20 73 69 7a 65 2c | 20 41 2c 20 70 72 5b 31 |l, size,| A, pr[1|
|00004940| 34 5d 2c 20 78 2c 0a 20 | 20 20 20 20 20 20 20 45 |4], x,. | E|
|00004950| 2c 20 49 2c 20 53 2c 20 | 4e 2c 20 54 2c 20 46 2c |, I, S, |N, T, F,|
|00004960| 20 4a 2c 20 50 2c 20 45 | 53 2c 20 45 4e 2c 20 45 | J, P, E|S, EN, E|
|00004970| 54 2c 20 45 46 2c 20 52 | 3b 0a 20 20 20 20 63 68 |T, EF, R|;. ch|
|00004980| 61 72 20 6c 69 6e 65 5b | 32 35 36 5d 2c 20 6e 6c |ar line[|256], nl|
|00004990| 69 6e 65 5b 35 31 32 5d | 2c 20 2a 74 79 70 65 2c |ine[512]|, *type,|
|000049a0| 20 2a 6e 61 6d 65 2c 20 | 2a 66 6e 61 6d 65 2c 20 | *name, |*fname, |
|000049b0| 2a 56 65 72 73 69 6f 6e | 2c 0a 20 20 20 20 20 20 |*Version|,. |
|000049c0| 20 20 20 4c 50 5b 35 5d | 2c 20 4c 50 45 5b 35 5d | LP[5]|, LPE[5]|
|000049d0| 2c 20 4c 50 49 5b 35 5d | 2c 0a 20 20 20 20 20 20 |, LPI[5]|,. |
|000049e0| 20 20 20 2a 50 46 5b 32 | 5d 20 3d 20 7b 22 49 6e | *PF[2|] = {"In|
|000049f0| 74 75 69 74 69 6f 6e 22 | 2c 20 22 53 65 6e 73 69 |tuition"|, "Sensi|
|00004a00| 6e 67 22 7d 2c 0a 20 20 | 20 20 20 20 20 20 20 2a |ng"},. | *|
|00004a10| 4a 46 5b 32 5d 20 3d 20 | 7b 22 54 68 69 6e 6b 69 |JF[2] = |{"Thinki|
|00004a20| 6e 67 22 2c 20 22 46 65 | 65 6c 69 6e 67 22 7d 2c |ng", "Fe|eling"},|
|00004a30| 0a 20 20 20 20 20 20 20 | 20 20 2a 74 65 78 74 31 |. | *text1|
|00004a40| 20 3d 20 22 59 6f 75 72 | 20 25 73 20 66 75 6e 63 | = "Your| %s func|
|00004a50| 74 69 6f 6e 20 69 73 20 | 25 73 20 25 73 2e 22 3b |tion is |%s %s.";|
|00004a60| 0a 20 20 20 20 46 49 4c | 45 20 2a 66 70 74 72 3b |. FIL|E *fptr;|
|00004a70| 0a 20 20 20 20 71 73 74 | 20 2a 51 3b 0a 0a 23 69 |. qst| *Q;..#i|
|00004a80| 66 20 4f 50 53 59 53 20 | 3d 3d 20 4d 53 44 4f 53 |f OPSYS |== MSDOS|
|00004a90| 0a 20 20 20 20 63 6f 6c | 20 3d 20 37 35 3b 0a 23 |. col| = 75;.#|
|00004aa0| 65 6c 73 65 0a 20 20 20 | 20 77 72 61 70 77 72 69 |else. | wrapwri|
|00004ab0| 74 65 20 28 73 74 64 6f | 75 74 2c 20 30 2c 20 30 |te (stdo|ut, 0, 0|
|00004ac0| 2c 20 32 30 2c 20 22 48 | 6f 77 20 6d 61 6e 79 20 |, 20, "H|ow many |
|00004ad0| 63 6f 6c 75 6d 6e 73 20 | 64 6f 65 73 20 79 6f 75 |columns |does you|
|00004ae0| 72 20 73 63 72 65 65 6e | 20 68 61 76 65 3f 22 2c |r screen| have?",|
|00004af0| 20 30 29 3b 0a 20 20 20 | 20 63 6f 6c 20 3d 20 66 | 0);. | col = f|
|00004b00| 67 65 74 70 28 73 74 64 | 69 6e 29 3b 0a 23 65 6e |getp(std|in);.#en|
|00004b10| 64 69 66 0a 0a 20 20 20 | 20 77 72 61 70 77 72 69 |dif.. | wrapwri|
|00004b20| 74 65 20 28 73 74 64 6f | 75 74 2c 20 30 2c 20 30 |te (stdo|ut, 0, 0|
|00004b30| 2c 20 63 6f 6c 2c 0a 20 | 20 20 20 20 20 20 20 22 |, col,. | "|
|00004b40| 5c 6e 5c 22 54 68 65 20 | 44 75 6e 69 68 6f 20 61 |\n\"The |Duniho a|
|00004b50| 6e 64 20 44 75 6e 69 68 | 6f 20 4c 69 66 65 20 50 |nd Dunih|o Life P|
|00004b60| 61 74 74 65 72 6e 20 49 | 6e 64 69 63 61 74 6f 72 |attern I|ndicator|
|00004b70| 5c 22 22 2c 0a 20 20 20 | 20 20 20 20 20 56 45 52 |\"",. | VER|
|00004b80| 2c 20 22 5c 6e 42 79 20 | 46 65 72 67 75 73 20 44 |, "\nBy |Fergus D|
|00004b90| 75 6e 69 68 6f 2e 20 43 | 6f 70 79 72 69 67 68 74 |uniho. C|opyright|
|00004ba0| 20 28 63 29 20 31 39 39 | 32 2c 20 31 39 39 33 22 | (c) 199|2, 1993"|
|00004bb0| 2c 0a 20 20 20 20 20 20 | 20 20 22 46 65 72 67 75 |,. | "Fergu|
|00004bc0| 73 20 44 75 6e 69 68 6f | 2e 5c 6e 5c 6e 4d 6f 73 |s Duniho|.\n\nMos|
|00004bd0| 74 20 6f 66 20 74 68 65 | 20 71 75 65 73 74 69 6f |t of the| questio|
|00004be0| 6e 73 20 61 72 65 20 64 | 72 61 77 6e 20 66 72 6f |ns are d|rawn fro|
|00004bf0| 6d 22 2c 0a 20 20 20 20 | 20 20 20 20 22 61 6e 64 |m",. | "and|
|00004c00| 20 62 61 73 65 64 20 6f | 6e 20 74 68 6f 73 65 20 | based o|n those |
|00004c10| 69 6e 20 54 65 72 65 6e | 63 65 20 44 75 6e 69 68 |in Teren|ce Dunih|
|00004c20| 6f 27 73 20 5c 22 50 72 | 65 66 65 72 65 6e 63 65 |o's \"Pr|eference|
|00004c30| 22 2c 0a 20 20 20 20 20 | 20 20 20 22 50 61 74 74 |",. | "Patt|
|00004c40| 65 72 6e 73 20 51 75 65 | 73 74 69 6f 6e 61 69 72 |erns Que|stionair|
|00004c50| 65 5c 22 20 61 6e 64 20 | 68 69 73 20 62 6f 6f 6b |e\" and |his book|
|00004c60| 20 5f 57 68 6f 6c 65 6e | 65 73 73 20 4c 69 65 73 | _Wholen|ess Lies|
|00004c70| 22 2c 0a 20 20 20 20 20 | 20 20 20 22 57 69 74 68 |",. | "With|
|00004c80| 69 6e 5f 2e 20 46 65 72 | 67 75 73 20 69 73 20 72 |in_. Fer|gus is r|
|00004c90| 65 73 70 6f 6e 73 69 62 | 6c 65 20 66 6f 72 20 74 |esponsib|le for t|
|00004ca0| 68 65 20 63 68 6f 69 63 | 65 20 6f 66 20 71 75 65 |he choic|e of que|
|00004cb0| 73 74 69 6f 6e 73 2e 22 | 2c 0a 20 20 20 20 20 20 |stions."|,. |
|00004cc0| 20 20 22 5c 6e 5c 6e 54 | 68 69 73 20 70 72 6f 64 | "\n\nT|his prod|
|00004cd0| 75 63 74 20 69 73 20 66 | 72 65 65 77 61 72 65 2e |uct is f|reeware.|
|00004ce0| 20 53 65 6e 64 20 63 6f | 6d 6d 65 6e 74 73 2c 20 | Send co|mments, |
|00004cf0| 62 75 67 20 72 65 70 6f | 72 74 73 2c 22 2c 0a 20 |bug repo|rts,",. |
|00004d00| 20 20 20 20 20 20 20 22 | 72 65 70 6f 72 74 73 20 | "|reports |
|00004d10| 6f 6e 20 61 63 63 75 72 | 61 63 79 2c 20 61 6e 64 |on accur|acy, and|
|00004d20| 20 73 75 67 67 65 73 74 | 69 6f 6e 73 20 66 6f 72 | suggest|ions for|
|00004d30| 20 69 6d 70 72 6f 76 65 | 6d 65 6e 74 20 74 6f 22 | improve|ment to"|
|00004d40| 2c 0a 20 20 20 20 20 20 | 20 20 22 46 65 72 67 75 |,. | "Fergu|
|00004d50| 73 20 44 75 6e 69 68 6f | 20 61 74 20 74 68 65 20 |s Duniho| at the |
|00004d60| 66 6f 6c 6c 6f 77 69 6e | 67 20 61 64 64 72 65 73 |followin|g addres|
|00004d70| 73 3a 5c 6e 5c 6e 22 2c | 20 45 4d 41 49 4c 2c 20 |s:\n\n",| EMAIL, |
|00004d80| 30 29 3b 0a 0a 20 20 20 | 20 73 69 7a 65 20 3d 20 |0);.. | size = |
|00004d90| 4c 69 6e 65 66 65 65 64 | 73 28 51 46 49 4c 45 29 |Linefeed|s(QFILE)|
|00004da0| 20 2f 20 33 3b 0a 20 20 | 20 20 51 20 3d 20 6e 65 | / 3;. | Q = ne|
|00004db0| 77 5f 71 6e 6f 64 65 28 | 30 29 3b 0a 20 20 20 20 |w_qnode(|0);. |
|00004dc0| 51 2d 3e 70 76 20 3d 20 | 51 2d 3e 6e 78 20 3d 20 |Q->pv = |Q->nx = |
|00004dd0| 51 3b 0a 20 20 20 20 56 | 65 72 73 69 6f 6e 20 3d |Q;. V|ersion =|
|00004de0| 20 47 65 74 5f 51 4c 69 | 73 74 20 28 51 46 49 4c | Get_QLi|st (QFIL|
|00004df0| 45 2c 20 51 2c 20 73 69 | 7a 65 29 3b 0a 0a 20 20 |E, Q, si|ze);.. |
|00004e00| 20 20 77 72 61 70 77 72 | 69 74 65 20 28 73 74 64 | wrapwr|ite (std|
|00004e10| 6f 75 74 2c 20 30 2c 20 | 30 2c 20 63 6f 6c 2c 20 |out, 0, |0, col, |
|00004e20| 22 5c 6e 57 68 61 74 20 | 69 73 20 79 6f 75 72 20 |"\nWhat |is your |
|00004e30| 6e 61 6d 65 3f 22 2c 20 | 30 29 3b 0a 20 20 20 20 |name?", |0);. |
|00004e40| 6e 61 6d 65 20 3d 20 63 | 6c 6f 6e 65 5f 6c 69 6e |name = c|lone_lin|
|00004e50| 65 28 73 74 64 69 6e 2c | 20 38 30 29 3b 0a 0a 23 |e(stdin,| 80);..#|
|00004e60| 69 66 64 65 66 20 44 45 | 42 55 47 0a 20 20 20 20 |ifdef DE|BUG. |
|00004e70| 77 72 61 70 77 72 69 74 | 65 20 28 73 74 64 6f 75 |wrapwrit|e (stdou|
|00004e80| 74 2c 20 30 2c 20 30 2c | 20 63 6f 6c 2c 0a 20 20 |t, 0, 0,| col,. |
|00004e90| 20 20 20 20 20 20 22 45 | 6e 74 65 72 20 61 6e 20 | "E|nter an |
|00004ea0| 69 6e 74 65 67 65 72 20 | 61 73 20 61 20 73 65 65 |integer |as a see|
|00004eb0| 64 20 76 61 6c 75 65 20 | 66 6f 72 20 74 68 65 20 |d value |for the |
|00004ec0| 72 61 6e 64 6f 6d 20 23 | 20 67 65 6e 65 72 61 74 |random #| generat|
|00004ed0| 6f 72 22 2c 20 30 29 3b | 0a 20 20 20 20 73 72 61 |or", 0);|. sra|
|00004ee0| 6e 64 20 28 66 67 65 74 | 70 28 73 74 64 69 6e 29 |nd (fget|p(stdin)|
|00004ef0| 29 3b 0a 23 65 6c 73 65 | 0a 20 20 20 20 73 72 61 |);.#else|. sra|
|00004f00| 6e 64 20 28 63 6c 6f 63 | 6b 28 29 29 3b 0a 23 65 |nd (cloc|k());.#e|
|00004f10| 6e 64 69 66 0a 0a 20 20 | 20 20 66 6f 72 20 28 69 |ndif.. | for (i|
|00004f20| 20 3d 20 30 3b 20 69 20 | 3c 20 31 34 3b 20 69 2b | = 0; i |< 14; i+|
|00004f30| 2b 29 20 2f 2a 20 49 6e | 69 74 69 61 6c 69 7a 65 |+) /* In|itialize|
|00004f40| 73 20 50 72 65 66 65 72 | 65 6e 63 65 20 53 63 6f |s Prefer|ence Sco|
|00004f50| 72 65 73 20 74 6f 20 5a | 65 72 6f 20 2a 2f 0a 20 |res to Z|ero */. |
|00004f60| 20 20 20 20 20 20 20 70 | 72 5b 69 5d 20 3d 20 30 | p|r[i] = 0|
|00004f70| 3b 0a 0a 20 20 20 20 69 | 66 20 28 61 72 67 63 20 |;.. i|f (argc |
|00004f80| 3d 3d 20 31 29 20 7b 0a | 20 20 20 20 20 20 20 20 |== 1) {.| |
|00004f90| 51 20 3d 20 52 4e 44 5f | 51 4c 69 73 74 20 28 51 |Q = RND_|QList (Q|
|00004fa0| 2c 20 73 69 7a 65 29 3b | 0a 20 20 20 20 20 20 20 |, size);|. |
|00004fb0| 20 41 73 6b 51 75 65 73 | 74 69 6f 6e 73 20 28 51 | AskQues|tions (Q|
|00004fc0| 2c 20 63 6f 6c 29 3b 0a | 20 20 20 20 20 20 20 20 |, col);.| |
|00004fd0| 66 6f 72 20 28 51 20 3d | 20 51 2d 3e 6e 78 3b 20 |for (Q =| Q->nx; |
|00004fe0| 51 2d 3e 6e 75 6d 20 3e | 20 30 3b 20 51 20 3d 20 |Q->num >| 0; Q = |
|00004ff0| 51 2d 3e 6e 78 29 20 2f | 2a 20 43 61 6c 63 75 6c |Q->nx) /|* Calcul|
|00005000| 61 74 65 73 20 53 63 6f | 72 65 73 20 2a 2f 0a 20 |ates Sco|res */. |
|00005010| 20 20 20 20 20 20 20 20 | 20 20 20 70 72 5b 51 2d | | pr[Q-|
|00005020| 3e 61 6e 73 5d 20 2b 3d | 20 51 2d 3e 73 74 72 65 |>ans] +=| Q->stre|
|00005030| 6e 67 74 68 3b 0a 20 20 | 20 20 7d 0a 20 20 20 20 |ngth;. | }. |
|00005040| 65 6c 73 65 20 7b 0a 20 | 20 20 20 20 20 20 20 52 |else {. | R|
|00005050| 64 4f 70 65 6e 20 28 66 | 70 74 72 2c 20 61 72 67 |dOpen (f|ptr, arg|
|00005060| 76 5b 31 5d 29 3b 0a 20 | 20 20 20 20 20 20 20 77 |v[1]);. | w|
|00005070| 68 69 6c 65 20 28 66 67 | 65 74 63 28 66 70 74 72 |hile (fg|etc(fptr|
|00005080| 29 20 21 3d 20 27 5c 6e | 27 29 3b 0a 20 20 20 20 |) != '\n|');. |
|00005090| 20 20 20 20 77 68 69 6c | 65 20 28 66 67 65 74 63 | whil|e (fgetc|
|000050a0| 28 66 70 74 72 29 20 21 | 3d 20 27 5c 6e 27 29 3b |(fptr) !|= '\n');|
|000050b0| 0a 20 20 20 20 20 20 20 | 20 77 68 69 6c 65 20 28 |. | while (|
|000050c0| 66 67 65 74 70 28 66 70 | 74 72 29 20 21 3d 20 45 |fgetp(fp|tr) != E|
|000050d0| 4f 46 29 20 7b 0a 20 20 | 20 20 20 20 20 20 20 20 |OF) {. | |
|000050e0| 20 20 69 20 3d 20 66 67 | 65 74 70 28 66 70 74 72 | i = fg|etp(fptr|
|000050f0| 29 3b 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 70 |);. | p|
|00005100| 72 5b 69 5d 20 2b 3d 20 | 66 67 65 74 70 28 66 70 |r[i] += |fgetp(fp|
|00005110| 74 72 29 3b 0a 20 20 20 | 20 20 20 20 20 7d 0a 20 |tr);. | }. |
|00005120| 20 20 20 7d 0a 0a 23 69 | 66 20 4f 50 53 59 53 20 | }..#i|f OPSYS |
|00005130| 3d 3d 20 4f 54 48 45 52 | 0a 20 20 20 20 77 72 61 |== OTHER|. wra|
|00005140| 70 77 72 69 74 65 20 28 | 73 74 64 6f 75 74 2c 20 |pwrite (|stdout, |
|00005150| 30 2c 20 30 2c 20 63 6f | 6c 2c 0a 20 20 20 20 20 |0, 0, co|l,. |
|00005160| 20 20 20 22 53 65 6e 64 | 20 6f 75 74 70 75 74 20 | "Send| output |
|00005170| 74 6f 20 28 31 29 20 53 | 63 72 65 65 6e 20 6f 72 |to (1) S|creen or|
|00005180| 20 28 32 29 20 46 69 6c | 65 3f 22 2c 20 30 29 3b | (2) Fil|e?", 0);|
|00005190| 0a 23 65 6c 73 65 0a 20 | 20 20 20 77 72 61 70 77 |.#else. | wrapw|
|000051a0| 72 69 74 65 20 28 73 74 | 64 6f 75 74 2c 20 30 2c |rite (st|dout, 0,|
|000051b0| 20 30 2c 20 63 6f 6c 2c | 0a 20 20 20 20 20 20 20 | 0, col,|. |
|000051c0| 20 22 53 65 6e 64 20 6f | 75 74 70 75 74 20 74 6f | "Send o|utput to|
|000051d0| 20 28 31 29 20 53 63 72 | 65 65 6e 2c 20 28 32 29 | (1) Scr|een, (2)|
|000051e0| 20 46 69 6c 65 20 6f 72 | 20 28 33 29 20 50 72 69 | File or| (3) Pri|
|000051f0| 6e 74 65 72 3f 22 2c 20 | 30 29 3b 0a 23 65 6e 64 |nter?", |0);.#end|
|00005200| 69 66 0a 20 20 20 20 64 | 6f 20 7b 0a 20 20 20 20 |if. d|o {. |
|00005210| 20 20 20 20 41 20 3d 20 | 66 67 65 74 70 28 73 74 | A = |fgetp(st|
|00005220| 64 69 6e 29 3b 0a 20 20 | 20 20 20 20 20 20 69 66 |din);. | if|
|00005230| 20 28 41 20 3d 3d 20 31 | 29 0a 20 20 20 20 20 20 | (A == 1|). |
|00005240| 20 20 20 20 20 20 66 70 | 74 72 20 3d 20 73 74 64 | fp|tr = std|
|00005250| 6f 75 74 3b 0a 20 20 20 | 20 20 20 20 20 65 6c 73 |out;. | els|
|00005260| 65 20 69 66 20 28 41 20 | 3d 3d 20 32 29 20 7b 0a |e if (A |== 2) {.|
|00005270| 20 20 20 20 20 20 20 20 | 20 20 20 20 77 72 61 70 | | wrap|
|00005280| 77 72 69 74 65 20 28 73 | 74 64 6f 75 74 2c 20 30 |write (s|tdout, 0|
|00005290| 2c 20 30 2c 20 63 6f 6c | 2c 20 22 50 6c 65 61 73 |, 0, col|, "Pleas|
|000052a0| 65 20 65 6e 74 65 72 20 | 61 20 66 69 6c 65 20 6e |e enter |a file n|
|000052b0| 61 6d 65 2e 22 2c 20 30 | 29 3b 0a 20 20 20 20 20 |ame.", 0|);. |
|000052c0| 20 20 20 20 20 20 20 66 | 6e 61 6d 65 20 3d 20 63 | f|name = c|
|000052d0| 6c 6f 6e 65 5f 6c 69 6e | 65 28 73 74 64 69 6e 2c |lone_lin|e(stdin,|
|000052e0| 20 46 49 4c 45 5f 4e 41 | 4d 45 5f 4d 41 58 29 3b | FILE_NA|ME_MAX);|
|000052f0| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 57 72 4f |. | WrO|
|00005300| 70 65 6e 20 28 66 70 74 | 72 2c 20 66 6e 61 6d 65 |pen (fpt|r, fname|
|00005310| 29 3b 0a 20 20 20 20 20 | 20 20 20 7d 0a 23 69 66 |);. | }.#if|
|00005320| 20 4f 50 53 59 53 20 21 | 3d 20 4f 54 48 45 52 0a | OPSYS !|= OTHER.|
|00005330| 20 20 20 20 20 20 20 20 | 65 6c 73 65 20 69 66 20 | |else if |
|00005340| 28 41 20 3d 3d 20 33 29 | 20 7b 0a 20 20 20 20 20 |(A == 3)| {. |
|00005350| 20 20 20 20 20 20 20 57 | 72 4f 70 65 6e 20 28 66 | W|rOpen (f|
|00005360| 70 74 72 2c 20 70 72 74 | 64 65 76 29 3b 0a 20 20 |ptr, prt|dev);. |
|00005370| 20 20 20 20 20 20 20 20 | 20 20 63 6f 6c 20 3d 20 | | col = |
|00005380| 37 35 3b 0a 20 20 20 20 | 20 20 20 20 7d 0a 23 65 |75;. | }.#e|
|00005390| 6e 64 69 66 0a 20 20 20 | 20 20 20 20 20 65 6c 73 |ndif. | els|
|000053a0| 65 0a 23 69 66 20 4f 50 | 53 59 53 20 3d 3d 20 4f |e.#if OP|SYS == O|
|000053b0| 54 48 45 52 0a 20 20 20 | 20 20 20 20 20 20 20 20 |THER. | |
|000053c0| 20 77 72 61 70 77 72 69 | 74 65 20 28 73 74 64 6f | wrapwri|te (stdo|
|000053d0| 75 74 2c 20 30 2c 20 30 | 2c 20 63 6f 6c 2c 20 22 |ut, 0, 0|, col, "|
|000053e0| 50 6c 65 61 73 65 20 65 | 6e 74 65 72 20 61 20 31 |Please e|nter a 1|
|000053f0| 20 6f 72 20 61 20 32 2e | 22 2c 20 30 29 3b 0a 23 | or a 2.|", 0);.#|
|00005400| 65 6c 73 65 0a 20 20 20 | 20 20 20 20 20 20 20 20 |else. | |
|00005410| 20 77 72 61 70 77 72 69 | 74 65 20 28 73 74 64 6f | wrapwri|te (stdo|
|00005420| 75 74 2c 20 30 2c 20 30 | 2c 20 63 6f 6c 2c 0a 20 |ut, 0, 0|, col,. |
|00005430| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 22 | | "|
|00005440| 50 6c 65 61 73 65 20 65 | 6e 74 65 72 20 61 20 31 |Please e|nter a 1|
|00005450| 2c 20 61 20 32 2c 20 6f | 72 20 61 20 33 2e 22 2c |, a 2, o|r a 3.",|
|00005460| 20 30 29 3b 0a 23 65 6e | 64 69 66 0a 20 20 20 20 | 0);.#en|dif. |
|00005470| 7d 20 77 68 69 6c 65 20 | 28 41 20 3c 20 31 20 7c |} while |(A < 1 ||
|00005480| 7c 20 41 20 3e 20 33 29 | 3b 0a 0a 20 20 20 20 45 || A > 3)|;.. E|
|00005490| 20 3d 20 70 72 5b 31 5d | 3b 20 49 20 3d 20 70 72 | = pr[1]|; I = pr|
|000054a0| 5b 32 5d 3b 20 53 20 3d | 20 70 72 5b 33 5d 3b 20 |[2]; S =| pr[3]; |
|000054b0| 4e 20 3d 20 70 72 5b 34 | 5d 3b 0a 20 20 20 20 54 |N = pr[4|];. T|
|000054c0| 20 3d 20 70 72 5b 35 5d | 3b 20 46 20 3d 20 70 72 | = pr[5]|; F = pr|
|000054d0| 5b 36 5d 3b 20 4a 20 3d | 20 70 72 5b 37 5d 3b 20 |[6]; J =| pr[7]; |
|000054e0| 50 20 3d 20 70 72 5b 38 | 5d 3b 0a 20 20 20 20 45 |P = pr[8|];. E|
|000054f0| 53 20 3d 20 70 72 5b 31 | 32 5d 3b 20 45 4e 20 3d |S = pr[1|2]; EN =|
|00005500| 20 70 72 5b 31 33 5d 3b | 20 45 54 20 3d 20 70 72 | pr[13];| ET = pr|
|00005510| 5b 31 31 5d 3b 20 45 46 | 20 3d 20 70 72 5b 31 30 |[11]; EF| = pr[10|
|00005520| 5d 3b 0a 20 20 20 20 73 | 70 72 69 6e 74 66 20 28 |];. s|printf (|
|00005530| 6e 6c 69 6e 65 2c 20 22 | 25 73 27 73 20 73 63 6f |nline, "|%s's sco|
|00005540| 72 65 73 20 6f 6e 20 74 | 68 65 20 6d 61 69 6e 20 |res on t|he main |
|00005550| 73 65 74 20 6f 66 20 71 | 75 65 73 74 69 6f 6e 73 |set of q|uestions|
|00005560| 3a 5c 6e 22 0a 20 20 20 | 20 20 20 20 20 20 20 20 |:\n". | |
|00005570| 20 20 20 20 20 20 20 20 | 20 22 5c 6e 45 78 74 72 | | "\nExtr|
|00005580| 61 76 65 72 73 69 6f 6e | 20 28 45 29 3a 20 25 33 |aversion| (E): %3|
|00005590| 64 20 20 20 20 25 33 64 | 20 3a 28 49 29 20 49 6e |d %3d| :(I) In|
|000055a0| 74 72 6f 76 65 72 73 69 | 6f 6e 22 0a 20 20 20 20 |troversi|on". |
|000055b0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000055c0| 22 5c 6e 53 65 6e 73 69 | 6e 67 20 20 20 20 20 20 |"\nSensi|ng |
|000055d0| 28 53 29 3a 20 25 33 64 | 20 20 20 20 25 33 64 20 |(S): %3d| %3d |
|000055e0| 3a 28 4e 29 20 69 4e 74 | 75 69 74 69 6f 6e 22 0a |:(N) iNt|uition".|
|000055f0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00005600| 20 20 20 20 22 5c 6e 54 | 68 69 6e 6b 69 6e 67 20 | "\nT|hinking |
|00005610| 20 20 20 20 28 54 29 3a | 20 25 33 64 20 20 20 20 | (T):| %3d |
|00005620| 25 33 64 20 3a 28 46 29 | 20 46 65 65 6c 69 6e 67 |%3d :(F)| Feeling|
|00005630| 22 0a 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |". | |
|00005640| 20 20 20 20 20 20 22 5c | 6e 4a 75 64 67 69 6e 67 | "\|nJudging|
|00005650| 20 20 20 20 20 20 28 4a | 29 3a 20 25 33 64 20 20 | (J|): %3d |
|00005660| 20 20 25 33 64 20 3a 28 | 50 29 20 50 65 72 63 65 | %3d :(|P) Perce|
|00005670| 69 76 69 6e 67 5c 6e 22 | 2c 0a 20 20 20 20 20 20 |iving\n"|,. |
|00005680| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 6e 61 | | na|
|00005690| 6d 65 2c 20 45 2c 20 49 | 2c 20 53 2c 20 4e 2c 20 |me, E, I|, S, N, |
|000056a0| 54 2c 20 46 2c 20 4a 2c | 20 50 29 3b 0a 20 20 20 |T, F, J,| P);. |
|000056b0| 20 77 72 61 70 77 72 69 | 74 65 20 28 66 70 74 72 | wrapwri|te (fptr|
|000056c0| 2c 20 30 2c 20 30 2c 20 | 63 6f 6c 2c 20 6e 6c 69 |, 0, 0, |col, nli|
|000056d0| 6e 65 2c 20 30 29 3b 0a | 0a 20 20 20 20 2f 2a 20 |ne, 0);.|. /* |
|000056e0| 43 61 6c 63 75 6c 61 74 | 65 73 20 70 6f 73 73 69 |Calculat|es possi|
|000056f0| 62 6c 65 20 6c 69 66 65 | 20 70 61 74 74 65 72 6e |ble life| pattern|
|00005700| 20 62 61 73 65 64 20 6f | 6e 20 70 72 69 6d 61 72 | based o|n primar|
|00005710| 79 20 73 63 6f 72 65 73 | 2e 20 2a 2f 0a 20 20 20 |y scores|. */. |
|00005720| 20 4c 50 5b 30 5d 20 3d | 20 28 45 20 3e 20 49 29 | LP[0] =| (E > I)|
|00005730| 20 3f 20 27 45 27 20 3a | 20 28 45 20 3c 20 49 29 | ? 'E' :| (E < I)|
|00005740| 20 3f 20 27 49 27 20 3a | 20 27 58 27 3b 0a 20 20 | ? 'I' :| 'X';. |
|00005750| 20 20 4c 50 5b 31 5d 20 | 3d 20 28 53 20 3e 20 4e | LP[1] |= (S > N|
|00005760| 29 20 3f 20 27 53 27 20 | 3a 20 28 53 20 3c 20 4e |) ? 'S' |: (S < N|
|00005770| 29 20 3f 20 27 4e 27 20 | 3a 20 27 58 27 3b 0a 20 |) ? 'N' |: 'X';. |
|00005780| 20 20 20 4c 50 5b 32 5d | 20 3d 20 28 54 20 3e 20 | LP[2]| = (T > |
|00005790| 46 29 20 3f 20 27 54 27 | 20 3a 20 28 54 20 3c 20 |F) ? 'T'| : (T < |
|000057a0| 46 29 20 3f 20 27 46 27 | 20 3a 20 27 58 27 3b 0a |F) ? 'F'| : 'X';.|
|000057b0| 20 20 20 20 4c 50 5b 33 | 5d 20 3d 20 28 4a 20 3e | LP[3|] = (J >|
|000057c0| 20 50 29 20 3f 20 27 4a | 27 20 3a 20 28 4a 20 3c | P) ? 'J|' : (J <|
|000057d0| 20 50 29 20 3f 20 27 50 | 27 20 3a 20 27 58 27 3b | P) ? 'P|' : 'X';|
|000057e0| 0a 20 20 20 20 4c 50 5b | 34 5d 20 3d 20 30 3b 0a |. LP[|4] = 0;.|
|000057f0| 0a 20 20 20 20 66 70 72 | 69 6e 74 66 20 28 66 70 |. fpr|intf (fp|
|00005800| 74 72 2c 20 22 59 6f 75 | 20 73 63 6f 72 65 64 20 |tr, "You| scored |
|00005810| 61 73 20 61 6e 20 25 73 | 2e 5c 6e 22 2c 20 4c 50 |as an %s|.\n", LP|
|00005820| 29 3b 0a 20 20 20 20 78 | 20 3d 20 30 3b 0a 20 20 |);. x| = 0;. |
|00005830| 20 20 66 6f 72 20 28 69 | 20 3d 20 30 3b 20 69 20 | for (i| = 0; i |
|00005840| 3c 20 34 3b 20 69 2b 2b | 29 0a 20 20 20 20 20 20 |< 4; i++|). |
|00005850| 20 20 69 66 20 28 4c 50 | 5b 69 5d 20 3d 3d 20 27 | if (LP|[i] == '|
|00005860| 58 27 29 0a 20 20 20 20 | 20 20 20 20 20 20 20 20 |X'). | |
|00005870| 78 2b 2b 3b 0a 20 20 20 | 20 69 66 20 28 78 29 20 |x++;. | if (x) |
|00005880| 7b 0a 20 20 20 20 20 20 | 20 20 73 70 72 69 6e 74 |{. | sprint|
|00005890| 66 20 28 6c 69 6e 65 2c | 20 22 54 68 69 73 20 69 |f (line,| "This i|
|000058a0| 73 20 6e 6f 74 20 61 20 | 72 65 61 6c 20 74 79 70 |s not a |real typ|
|000058b0| 65 2e 20 59 6f 75 20 63 | 6f 75 6c 64 20 62 65 20 |e. You c|ould be |
|000058c0| 61 6e 79 20 6f 66 22 0a | 20 20 20 20 20 20 20 20 |any of".| |
|000058d0| 22 25 64 20 64 69 66 66 | 65 72 65 6e 74 20 74 79 |"%d diff|erent ty|
|000058e0| 70 65 73 2e 20 52 65 61 | 64 20 74 68 65 20 74 79 |pes. Rea|d the ty|
|000058f0| 70 65 20 64 65 73 63 72 | 69 70 74 69 6f 6e 73 20 |pe descr|iptions |
|00005900| 74 6f 20 64 65 74 65 72 | 6d 69 6e 65 20 22 0a 20 |to deter|mine ". |
|00005910| 20 20 20 20 20 20 20 22 | 77 68 69 63 68 20 79 6f | "|which yo|
|00005920| 75 20 61 72 65 2e 22 2c | 20 70 6f 77 28 32 2c 78 |u are.",| pow(2,x|
|00005930| 29 29 3b 0a 20 20 20 20 | 20 20 20 20 77 72 61 70 |));. | wrap|
|00005940| 77 72 69 74 65 20 28 66 | 70 74 72 2c 20 30 2c 20 |write (f|ptr, 0, |
|00005950| 30 2c 20 63 6f 6c 2c 20 | 6c 69 6e 65 2c 20 30 29 |0, col, |line, 0)|
|00005960| 3b 0a 20 20 20 20 7d 0a | 20 20 20 20 65 6c 73 65 |;. }.| else|
|00005970| 20 7b 0a 20 20 20 20 20 | 20 20 20 45 20 3d 20 28 | {. | E = (|
|00005980| 4c 50 5b 30 5d 20 3d 3d | 20 27 45 27 29 3b 20 52 |LP[0] ==| 'E'); R|
|00005990| 20 3d 20 28 28 4c 50 5b | 33 5d 20 3d 3d 20 27 4a | = ((LP[|3] == 'J|
|000059a0| 27 29 20 3d 3d 20 45 29 | 3b 0a 20 20 20 20 20 20 |') == E)|;. |
|000059b0| 20 20 73 70 72 69 6e 74 | 66 20 28 6c 69 6e 65 2c | sprint|f (line,|
|000059c0| 20 22 5c 6e 41 73 73 75 | 6d 69 6e 67 20 74 68 61 | "\nAssu|ming tha|
|000059d0| 74 20 79 6f 75 20 61 72 | 65 20 61 6e 20 25 73 2c |t you ar|e an %s,|
|000059e0| 5c 6e 22 2c 20 4c 50 29 | 3b 0a 20 20 20 20 20 20 |\n", LP)|;. |
|000059f0| 20 20 77 72 61 70 77 72 | 69 74 65 20 28 66 70 74 | wrapwr|ite (fpt|
|00005a00| 72 2c 20 30 2c 20 35 2c | 20 63 6f 6c 2c 20 6c 69 |r, 0, 5,| col, li|
|00005a10| 6e 65 2c 20 30 29 3b 0a | 20 20 20 20 20 20 20 20 |ne, 0);.| |
|00005a20| 73 70 72 69 6e 74 66 20 | 28 6c 69 6e 65 2c 20 74 |sprintf |(line, t|
|00005a30| 65 78 74 31 2c 20 22 44 | 4f 4d 49 4e 41 4e 54 22 |ext1, "D|OMINANT"|
|00005a40| 2c 20 58 4e 2c 20 52 20 | 3f 20 4a 46 5b 4c 50 5b |, XN, R |? JF[LP[|
|00005a50| 32 5d 20 3d 3d 20 27 46 | 27 5d 20 3a 20 50 46 5b |2] == 'F|'] : PF[|
|00005a60| 4c 50 5b 31 5d 20 3d 3d | 20 27 53 27 5d 29 3b 0a |LP[1] ==| 'S']);.|
|00005a70| 20 20 20 20 20 20 20 20 | 77 72 61 70 77 72 69 74 | |wrapwrit|
|00005a80| 65 20 28 66 70 74 72 2c | 20 30 2c 20 35 2c 20 63 |e (fptr,| 0, 5, c|
|00005a90| 6f 6c 2c 20 6c 69 6e 65 | 2c 20 30 29 3b 0a 20 20 |ol, line|, 0);. |
|00005aa0| 20 20 20 20 20 20 73 70 | 72 69 6e 74 66 20 28 6c | sp|rintf (l|
|00005ab0| 69 6e 65 2c 20 74 65 78 | 74 31 2c 20 22 41 55 58 |ine, tex|t1, "AUX|
|00005ac0| 49 4c 49 41 52 59 22 2c | 20 21 58 4e 2c 20 52 20 |ILIARY",| !XN, R |
|00005ad0| 3f 20 50 46 5b 4c 50 5b | 31 5d 20 3d 3d 20 27 53 |? PF[LP[|1] == 'S|
|00005ae0| 27 5d 20 3a 20 4a 46 5b | 4c 50 5b 32 5d 20 3d 3d |'] : JF[|LP[2] ==|
|00005af0| 20 27 46 27 5d 29 3b 0a | 20 20 20 20 20 20 20 20 | 'F']);.| |
|00005b00| 77 72 61 70 77 72 69 74 | 65 20 28 66 70 74 72 2c |wrapwrit|e (fptr,|
|00005b10| 20 30 2c 20 35 2c 20 63 | 6f 6c 2c 20 6c 69 6e 65 | 0, 5, c|ol, line|
|00005b20| 2c 20 30 29 3b 0a 20 20 | 20 20 20 20 20 20 73 70 |, 0);. | sp|
|00005b30| 72 69 6e 74 66 20 28 6c | 69 6e 65 2c 20 74 65 78 |rintf (l|ine, tex|
|00005b40| 74 31 2c 20 22 54 45 52 | 54 49 41 52 59 22 2c 20 |t1, "TER|TIARY", |
|00005b50| 58 4e 2c 20 52 20 3f 20 | 50 46 5b 4c 50 5b 31 5d |XN, R ? |PF[LP[1]|
|00005b60| 20 3d 3d 20 27 4e 27 5d | 20 3a 20 4a 46 5b 4c 50 | == 'N']| : JF[LP|
|00005b70| 5b 32 5d 20 3d 3d 20 27 | 54 27 5d 29 3b 0a 20 20 |[2] == '|T']);. |
|00005b80| 20 20 20 20 20 20 77 72 | 61 70 77 72 69 74 65 20 | wr|apwrite |
|00005b90| 28 66 70 74 72 2c 20 30 | 2c 20 35 2c 20 63 6f 6c |(fptr, 0|, 5, col|
|00005ba0| 2c 20 6c 69 6e 65 2c 20 | 30 29 3b 0a 20 20 20 20 |, line, |0);. |
|00005bb0| 20 20 20 20 73 70 72 69 | 6e 74 66 20 28 6c 69 6e | spri|ntf (lin|
|00005bc0| 65 2c 20 74 65 78 74 31 | 2c 20 22 49 4e 46 45 52 |e, text1|, "INFER|
|00005bd0| 49 4f 52 22 2c 20 21 58 | 4e 2c 20 52 20 3f 20 4a |IOR", !X|N, R ? J|
|00005be0| 46 5b 4c 50 5b 32 5d 20 | 3d 3d 20 27 54 27 5d 20 |F[LP[2] |== 'T'] |
|00005bf0| 3a 20 50 46 5b 4c 50 5b | 31 5d 20 3d 3d 20 27 4e |: PF[LP[|1] == 'N|
|00005c00| 27 5d 29 3b 0a 20 20 20 | 20 20 20 20 20 77 72 61 |']);. | wra|
|00005c10| 70 77 72 69 74 65 20 28 | 66 70 74 72 2c 20 30 2c |pwrite (|fptr, 0,|
|00005c20| 20 35 2c 20 63 6f 6c 2c | 20 6c 69 6e 65 2c 20 30 | 5, col,| line, 0|
|00005c30| 29 3b 0a 20 20 20 20 7d | 0a 20 20 20 20 69 66 20 |);. }|. if |
|00005c40| 28 41 20 3d 3d 20 31 29 | 20 7b 0a 20 20 20 20 20 |(A == 1)| {. |
|00005c50| 20 20 20 77 72 61 70 77 | 72 69 74 65 20 28 73 74 | wrapw|rite (st|
|00005c60| 64 6f 75 74 2c 20 30 2c | 20 30 2c 20 63 6f 6c 2c |dout, 0,| 0, col,|
|00005c70| 20 22 48 69 74 20 3c 45 | 4e 54 45 52 3e 20 6f 72 | "Hit <E|NTER> or|
|00005c80| 20 3c 52 45 54 55 52 4e | 3e 20 74 6f 20 73 65 65 | <RETURN|> to see|
|00005c90| 22 2c 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 22 |",. | "|
|00005ca0| 79 6f 75 72 20 72 65 73 | 75 6c 74 73 20 6f 6e 20 |your res|ults on |
|00005cb0| 74 68 65 20 73 75 70 70 | 6c 65 6d 65 6e 74 61 72 |the supp|lementar|
|00005cc0| 79 20 71 75 65 73 74 69 | 6f 6e 73 2e 22 2c 20 30 |y questi|ons.", 0|
|00005cd0| 29 3b 0a 20 20 20 20 20 | 20 20 20 77 68 69 6c 65 |);. | while|
|00005ce0| 20 28 66 67 65 74 63 28 | 73 74 64 69 6e 29 20 21 | (fgetc(|stdin) !|
|00005cf0| 3d 20 27 5c 6e 27 29 3b | 0a 20 20 20 20 7d 0a 20 |= '\n');|. }. |
|00005d00| 20 20 20 73 70 72 69 6e | 74 66 20 28 6e 6c 69 6e | sprin|tf (nlin|
|00005d10| 65 2c 20 22 5c 6e 25 73 | 27 73 20 73 63 6f 72 65 |e, "\n%s|'s score|
|00005d20| 73 20 6f 6e 20 74 68 65 | 20 73 75 70 70 6c 65 6d |s on the| supplem|
|00005d30| 65 6e 74 61 72 79 20 71 | 75 65 73 74 69 6f 6e 73 |entary q|uestions|
|00005d40| 3a 5c 6e 5c 6e 22 0a 20 | 20 20 20 22 45 78 74 72 |:\n\n". | "Extr|
|00005d50| 61 76 65 72 74 65 64 20 | 54 68 69 6e 6b 69 6e 67 |averted |Thinking|
|00005d60| 20 2f 20 49 6e 74 72 6f | 76 65 72 74 65 64 20 46 | / Intro|verted F|
|00005d70| 65 65 6c 69 6e 67 20 20 | 20 3a 20 25 64 5c 6e 22 |eeling | : %d\n"|
|00005d80| 0a 20 20 20 20 22 45 78 | 74 72 61 76 65 72 74 65 |. "Ex|traverte|
|00005d90| 64 20 46 65 65 6c 69 6e | 67 20 2f 20 49 6e 74 72 |d Feelin|g / Intr|
|00005da0| 6f 76 65 72 74 65 64 20 | 54 68 69 6e 6b 69 6e 67 |overted |Thinking|
|00005db0| 20 20 20 3a 20 25 64 5c | 6e 5c 6e 22 0a 20 20 20 | : %d\|n\n". |
|00005dc0| 20 22 45 78 74 72 61 76 | 65 72 74 65 64 20 49 6e | "Extrav|erted In|
|00005dd0| 74 75 69 74 69 6f 6e 20 | 2f 20 49 6e 74 72 6f 76 |tuition |/ Introv|
|00005de0| 65 72 74 65 64 20 53 65 | 6e 73 69 6e 67 20 20 3a |erted Se|nsing :|
|00005df0| 20 25 64 5c 6e 22 0a 20 | 20 20 20 22 45 78 74 72 | %d\n". | "Extr|
|00005e00| 61 76 65 72 74 65 64 20 | 53 65 6e 73 69 6e 67 20 |averted |Sensing |
|00005e10| 2f 20 49 6e 74 72 6f 76 | 65 72 74 65 64 20 49 6e |/ Introv|erted In|
|00005e20| 74 75 69 74 69 6f 6e 20 | 20 3a 20 25 64 5c 6e 5c |tuition | : %d\n\|
|00005e30| 6e 22 0a 20 20 20 20 22 | 52 61 74 69 6f 6e 61 6c |n". "|Rational|
|00005e40| 69 74 79 20 28 44 6f 6d | 69 6e 61 6e 74 20 4a 75 |ity (Dom|inant Ju|
|00005e50| 64 67 69 6e 67 20 46 75 | 6e 63 74 69 6f 6e 29 20 |dging Fu|nction) |
|00005e60| 20 20 20 20 20 3a 20 25 | 64 5c 6e 22 0a 20 20 20 | : %|d\n". |
|00005e70| 20 22 41 2d 72 61 74 69 | 6f 6e 61 6c 69 74 79 20 | "A-rati|onality |
|00005e80| 28 44 6f 6d 69 6e 61 6e | 74 20 50 65 72 63 65 69 |(Dominan|t Percei|
|00005e90| 76 69 6e 67 20 46 75 6e | 63 74 69 6f 6e 29 20 3a |ving Fun|ction) :|
|00005ea0| 20 25 64 5c 6e 5c 6e 22 | 2c 0a 20 20 20 20 20 20 | %d\n\n"|,. |
|00005eb0| 20 20 6e 61 6d 65 2c 20 | 45 54 2c 20 45 46 2c 20 | name, |ET, EF, |
|00005ec0| 45 4e 2c 20 45 53 2c 20 | 70 72 5b 39 5d 2c 20 70 |EN, ES, |pr[9], p|
|00005ed0| 72 5b 30 5d 29 3b 0a 20 | 20 20 20 77 72 61 70 77 |r[0]);. | wrapw|
|00005ee0| 72 69 74 65 20 28 66 70 | 74 72 2c 20 30 2c 20 30 |rite (fp|tr, 0, 0|
|00005ef0| 2c 20 63 6f 6c 2c 20 6e | 6c 69 6e 65 2c 20 30 29 |, col, n|line, 0)|
|00005f00| 3b 0a 0a 20 20 20 20 2f | 2a 20 43 61 6c 63 75 6c |;.. /|* Calcul|
|00005f10| 61 74 65 73 20 70 6f 73 | 73 69 62 6c 65 20 6c 69 |ates pos|sible li|
|00005f20| 66 65 20 70 61 74 74 65 | 72 6e 73 20 62 61 73 65 |fe patte|rns base|
|00005f30| 64 20 6f 6e 20 73 75 70 | 70 6c 65 6d 65 6e 74 61 |d on sup|plementa|
|00005f40| 6c 20 73 63 6f 72 65 73 | 2e 20 2a 2f 0a 20 20 20 |l scores|. */. |
|00005f50| 20 4c 50 45 5b 30 5d 20 | 3d 20 27 45 27 3b 20 4c | LPE[0] |= 'E'; L|
|00005f60| 50 49 5b 30 5d 20 3d 20 | 27 49 27 3b 0a 20 20 20 |PI[0] = |'I';. |
|00005f70| 20 69 66 20 28 70 72 5b | 39 5d 20 3e 20 70 72 5b | if (pr[|9] > pr[|
|00005f80| 30 5d 29 20 7b 0a 20 20 | 20 20 20 20 20 20 4c 50 |0]) {. | LP|
|00005f90| 45 5b 33 5d 20 3d 20 27 | 4a 27 3b 0a 20 20 20 20 |E[3] = '|J';. |
|00005fa0| 20 20 20 20 4c 50 49 5b | 33 5d 20 3d 20 27 50 27 | LPI[|3] = 'P'|
|00005fb0| 3b 0a 20 20 20 20 7d 0a | 20 20 20 20 65 6c 73 65 |;. }.| else|
|00005fc0| 20 69 66 20 28 70 72 5b | 39 5d 20 3c 20 70 72 5b | if (pr[|9] < pr[|
|00005fd0| 30 5d 29 20 7b 0a 20 20 | 20 20 20 20 20 20 4c 50 |0]) {. | LP|
|00005fe0| 45 5b 33 5d 20 3d 20 27 | 50 27 3b 0a 20 20 20 20 |E[3] = '|P';. |
|00005ff0| 20 20 20 20 4c 50 49 5b | 33 5d 20 3d 20 27 4a 27 | LPI[|3] = 'J'|
|00006000| 3b 0a 20 20 20 20 7d 0a | 20 20 20 20 65 6c 73 65 |;. }.| else|
|00006010| 20 7b 0a 20 20 20 20 20 | 20 20 20 4c 50 45 5b 33 | {. | LPE[3|
|00006020| 5d 20 3d 20 27 58 27 3b | 0a 20 20 20 20 20 20 20 |] = 'X';|. |
|00006030| 20 4c 50 49 5b 33 5d 20 | 3d 20 27 58 27 3b 0a 20 | LPI[3] |= 'X';. |
|00006040| 20 20 20 7d 0a 20 20 20 | 20 69 66 20 28 4c 50 45 | }. | if (LPE|
|00006050| 5b 33 5d 20 3d 3d 20 27 | 50 27 29 20 7b 0a 20 20 |[3] == '|P') {. |
|00006060| 20 20 20 20 20 20 69 66 | 20 28 45 46 20 3e 20 45 | if| (EF > E|
|00006070| 54 29 20 7b 0a 20 20 20 | 20 20 20 20 20 20 20 20 |T) {. | |
|00006080| 20 4c 50 45 5b 32 5d 20 | 3d 20 27 54 27 3b 0a 20 | LPE[2] |= 'T';. |
|00006090| 20 20 20 20 20 20 20 20 | 20 20 20 4c 50 49 5b 32 | | LPI[2|
|000060a0| 5d 20 3d 20 27 46 27 3b | 0a 20 20 20 20 20 20 20 |] = 'F';|. |
|000060b0| 20 7d 0a 20 20 20 20 20 | 20 20 20 65 6c 73 65 20 | }. | else |
|000060c0| 69 66 20 28 45 46 20 3c | 20 45 54 29 20 7b 0a 20 |if (EF <| ET) {. |
|000060d0| 20 20 20 20 20 20 20 20 | 20 20 20 4c 50 45 5b 32 | | LPE[2|
|000060e0| 5d 20 3d 20 27 46 27 3b | 0a 20 20 20 20 20 20 20 |] = 'F';|. |
|000060f0| 20 20 20 20 20 4c 50 49 | 5b 32 5d 20 3d 20 27 54 | LPI|[2] = 'T|
|00006100| 27 3b 0a 20 20 20 20 20 | 20 20 20 7d 0a 20 20 20 |';. | }. |
|00006110| 20 20 20 20 20 65 6c 73 | 65 20 7b 0a 20 20 20 20 | els|e {. |
|00006120| 20 20 20 20 20 20 20 20 | 4c 50 45 5b 32 5d 20 3d | |LPE[2] =|
|00006130| 20 27 58 27 3b 0a 20 20 | 20 20 20 20 20 20 20 20 | 'X';. | |
|00006140| 20 20 4c 50 49 5b 32 5d | 20 3d 20 27 58 27 3b 0a | LPI[2]| = 'X';.|
|00006150| 20 20 20 20 20 20 20 20 | 7d 0a 20 20 20 20 20 20 | |}. |
|00006160| 20 20 69 66 20 28 45 53 | 20 3c 20 45 4e 29 20 7b | if (ES| < EN) {|
|00006170| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 4c 50 45 |. | LPE|
|00006180| 5b 31 5d 20 3d 20 27 4e | 27 3b 0a 20 20 20 20 20 |[1] = 'N|';. |
|00006190| 20 20 20 20 20 20 20 4c | 50 49 5b 31 5d 20 3d 20 | L|PI[1] = |
|000061a0| 27 53 27 3b 0a 20 20 20 | 20 20 20 20 20 7d 0a 20 |'S';. | }. |
|000061b0| 20 20 20 20 20 20 20 65 | 6c 73 65 20 69 66 20 28 | e|lse if (|
|000061c0| 45 53 20 3e 20 45 4e 29 | 20 7b 0a 20 20 20 20 20 |ES > EN)| {. |
|000061d0| 20 20 20 20 20 20 20 4c | 50 45 5b 31 5d 20 3d 20 | L|PE[1] = |
|000061e0| 27 53 27 3b 0a 20 20 20 | 20 20 20 20 20 20 20 20 |'S';. | |
|000061f0| 20 4c 50 49 5b 31 5d 20 | 3d 20 27 4e 27 3b 0a 20 | LPI[1] |= 'N';. |
|00006200| 20 20 20 20 20 20 20 7d | 0a 20 20 20 20 20 20 20 | }|. |
|00006210| 20 65 6c 73 65 20 7b 0a | 20 20 20 20 20 20 20 20 | else {.| |
|00006220| 20 20 20 20 4c 50 45 5b | 31 5d 20 3d 20 27 58 27 | LPE[|1] = 'X'|
|00006230| 3b 0a 20 20 20 20 20 20 | 20 20 20 20 20 20 4c 50 |;. | LP|
|00006240| 49 5b 31 5d 20 3d 20 27 | 58 27 3b 0a 20 20 20 20 |I[1] = '|X';. |
|00006250| 20 20 20 20 7d 0a 20 20 | 20 20 7d 0a 20 20 20 20 | }. | }. |
|00006260| 65 6c 73 65 20 69 66 20 | 28 4c 50 45 5b 33 5d 20 |else if |(LPE[3] |
|00006270| 3d 3d 20 27 4a 27 29 20 | 7b 0a 20 20 20 20 20 20 |== 'J') |{. |
|00006280| 20 20 69 66 20 28 45 46 | 20 3c 20 45 54 29 20 7b | if (EF| < ET) {|
|00006290| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 4c 50 45 |. | LPE|
|000062a0| 5b 32 5d 20 3d 20 27 54 | 27 3b 0a 20 20 20 20 20 |[2] = 'T|';. |
|000062b0| 20 20 20 20 20 20 20 4c | 50 49 5b 32 5d 20 3d 20 | L|PI[2] = |
|000062c0| 27 46 27 3b 0a 20 20 20 | 20 20 20 20 20 7d 0a 20 |'F';. | }. |
|000062d0| 20 20 20 20 20 20 20 65 | 6c 73 65 20 69 66 20 28 | e|lse if (|
|000062e0| 45 46 20 3e 20 45 54 29 | 20 7b 0a 20 20 20 20 20 |EF > ET)| {. |
|000062f0| 20 20 20 20 20 20 20 4c | 50 45 5b 32 5d 20 3d 20 | L|PE[2] = |
|00006300| 27 46 27 3b 0a 20 20 20 | 20 20 20 20 20 20 20 20 |'F';. | |
|00006310| 20 4c 50 49 5b 32 5d 20 | 3d 20 27 54 27 3b 0a 20 | LPI[2] |= 'T';. |
|00006320| 20 20 20 20 20 20 20 7d | 0a 20 20 20 20 20 20 20 | }|. |
|00006330| 20 65 6c 73 65 20 7b 0a | 20 20 20 20 20 20 20 20 | else {.| |
|00006340| 20 20 20 20 4c 50 45 5b | 32 5d 20 3d 20 27 58 27 | LPE[|2] = 'X'|
|00006350| 3b 0a 20 20 20 20 20 20 | 20 20 20 20 20 20 4c 50 |;. | LP|
|00006360| 49 5b 32 5d 20 3d 20 27 | 58 27 3b 0a 20 20 20 20 |I[2] = '|X';. |
|00006370| 20 20 20 20 7d 0a 20 20 | 20 20 20 20 20 20 69 66 | }. | if|
|00006380| 20 28 45 53 20 3e 20 45 | 4e 29 20 7b 0a 20 20 20 | (ES > E|N) {. |
|00006390| 20 20 20 20 20 20 20 20 | 20 4c 50 45 5b 31 5d 20 | | LPE[1] |
|000063a0| 3d 20 27 4e 27 3b 0a 20 | 20 20 20 20 20 20 20 20 |= 'N';. | |
|000063b0| 20 20 20 4c 50 49 5b 31 | 5d 20 3d 20 27 53 27 3b | LPI[1|] = 'S';|
|000063c0| 0a 20 20 20 20 20 20 20 | 20 7d 0a 20 20 20 20 20 |. | }. |
|000063d0| 20 20 20 65 6c 73 65 20 | 69 66 20 28 45 53 20 3c | else |if (ES <|
|000063e0| 20 45 4e 29 20 7b 0a 20 | 20 20 20 20 20 20 20 20 | EN) {. | |
|000063f0| 20 20 20 4c 50 45 5b 31 | 5d 20 3d 20 27 53 27 3b | LPE[1|] = 'S';|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.