home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 1 / 1890 < prev    next >
SHell self-extracting ARchive  |  1990-12-28  |  49.6 KB

open in: MacOS 8.1     |     Win98     |     DOS

view JSON data     |     view as text

This file was processed as: SHell self-extracting ARchive (archive/shar).

You can browse this item here: 1890

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert Newsgroup Content (archive/news) magic Supported
100% dexvert SHell self-extracting ARchive (archive/shar) magic Supported
100% dexvert Internet Message Format (text/imf) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file news or mail, ASCII text default
100% TrID E-Mail message (Var. 2) default
100% checkBytes Printable ASCII default
100% perlTextCheck Likely Text (Perl) default
100% siegfried fmt/329 Shell Archive Format default
100% detectItEasy Format: plain text[LF] default (weak)
100% xdgMime message/rfc822 default



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 46 72 6f 6d 3a 20 64 62 | 65 6c 6c 40 6e 65 63 63 |From: db|ell@necc|
|00000010| 61 6e 2e 6f 7a 20 28 44 | 61 76 69 64 20 49 2e 20 |an.oz (D|avid I. |
|00000020| 42 65 6c 6c 29 0a 4e 65 | 77 73 67 72 6f 75 70 73 |Bell).Ne|wsgroups|
|00000030| 3a 20 61 6c 74 2e 73 6f | 75 72 63 65 73 0a 53 75 |: alt.so|urces.Su|
|00000040| 62 6a 65 63 74 3a 20 4c | 69 66 65 20 73 65 61 72 |bject: L|ife sear|
|00000050| 63 68 20 70 72 6f 67 72 | 61 6d 20 28 70 61 72 74 |ch progr|am (part|
|00000060| 20 32 20 6f 66 20 32 29 | 0a 4d 65 73 73 61 67 65 | 2 of 2)|.Message|
|00000070| 2d 49 44 3a 20 3c 38 32 | 33 40 6e 65 63 63 61 6e |-ID: <82|3@neccan|
|00000080| 2e 6f 7a 3e 0a 44 61 74 | 65 3a 20 32 38 20 53 65 |.oz>.Dat|e: 28 Se|
|00000090| 70 20 39 30 20 30 32 3a | 33 37 3a 33 36 20 47 4d |p 90 02:|37:36 GM|
|000000a0| 54 0a 0a 0a 23 21 20 2f | 62 69 6e 2f 73 68 0a 23 |T...#! /|bin/sh.#|
|000000b0| 20 54 68 69 73 20 69 73 | 20 61 20 73 68 65 6c 6c | This is| a shell|
|000000c0| 20 61 72 63 68 69 76 65 | 2e 20 20 52 65 6d 6f 76 | archive|. Remov|
|000000d0| 65 20 61 6e 79 74 68 69 | 6e 67 20 62 65 66 6f 72 |e anythi|ng befor|
|000000e0| 65 20 74 68 69 73 20 6c | 69 6e 65 2c 20 74 68 65 |e this l|ine, the|
|000000f0| 6e 20 75 6e 70 61 63 6b | 0a 23 20 69 74 20 62 79 |n unpack|.# it by|
|00000100| 20 73 61 76 69 6e 67 20 | 69 74 20 69 6e 74 6f 20 | saving |it into |
|00000110| 61 20 66 69 6c 65 20 61 | 6e 64 20 74 79 70 69 6e |a file a|nd typin|
|00000120| 67 20 22 73 68 20 66 69 | 6c 65 22 2e 20 20 54 6f |g "sh fi|le". To|
|00000130| 20 6f 76 65 72 77 72 69 | 74 65 20 65 78 69 73 74 | overwri|te exist|
|00000140| 69 6e 67 0a 23 20 66 69 | 6c 65 73 2c 20 74 79 70 |ing.# fi|les, typ|
|00000150| 65 20 22 73 68 20 66 69 | 6c 65 20 2d 63 22 2e 20 |e "sh fi|le -c". |
|00000160| 20 59 6f 75 20 63 61 6e | 20 61 6c 73 6f 20 66 65 | You can| also fe|
|00000170| 65 64 20 74 68 69 73 20 | 61 73 20 73 74 61 6e 64 |ed this |as stand|
|00000180| 61 72 64 20 69 6e 70 75 | 74 20 76 69 61 0a 23 20 |ard inpu|t via.# |
|00000190| 75 6e 73 68 61 72 2c 20 | 6f 72 20 62 79 20 74 79 |unshar, |or by ty|
|000001a0| 70 69 6e 67 20 22 73 68 | 20 3c 66 69 6c 65 22 2c |ping "sh| <file",|
|000001b0| 20 65 2e 67 2e 2e 20 20 | 49 66 20 74 68 69 73 20 | e.g.. |If this |
|000001c0| 61 72 63 68 69 76 65 20 | 69 73 20 63 6f 6d 70 6c |archive |is compl|
|000001d0| 65 74 65 2c 20 79 6f 75 | 0a 23 20 77 69 6c 6c 20 |ete, you|.# will |
|000001e0| 73 65 65 20 74 68 65 20 | 66 6f 6c 6c 6f 77 69 6e |see the |followin|
|000001f0| 67 20 6d 65 73 73 61 67 | 65 20 61 74 20 74 68 65 |g messag|e at the|
|00000200| 20 65 6e 64 3a 0a 23 09 | 09 22 45 6e 64 20 6f 66 | end:.#.|."End of|
|00000210| 20 61 72 63 68 69 76 65 | 20 32 20 28 6f 66 20 32 | archive| 2 (of 2|
|00000220| 29 2e 22 0a 23 20 43 6f | 6e 74 65 6e 74 73 3a 20 |).".# Co|ntents: |
|00000230| 20 4f 52 49 47 49 4e 20 | 73 65 61 72 63 68 2e 63 | ORIGIN |search.c|
|00000240| 0a 23 20 57 72 61 70 70 | 65 64 20 62 79 20 64 62 |.# Wrapp|ed by db|
|00000250| 65 6c 6c 40 65 6c 6d 20 | 6f 6e 20 46 72 69 20 53 |ell@elm |on Fri S|
|00000260| 65 70 20 32 38 20 31 32 | 3a 31 34 3a 32 31 20 31 |ep 28 12|:14:21 1|
|00000270| 39 39 30 0a 50 41 54 48 | 3d 2f 62 69 6e 3a 2f 75 |990.PATH|=/bin:/u|
|00000280| 73 72 2f 62 69 6e 3a 2f | 75 73 72 2f 75 63 62 20 |sr/bin:/|usr/ucb |
|00000290| 3b 20 65 78 70 6f 72 74 | 20 50 41 54 48 0a 69 66 |; export| PATH.if|
|000002a0| 20 74 65 73 74 20 2d 66 | 20 27 4f 52 49 47 49 4e | test -f| 'ORIGIN|
|000002b0| 27 20 2d 61 20 22 24 7b | 31 7d 22 20 21 3d 20 22 |' -a "${|1}" != "|
|000002c0| 2d 63 22 20 3b 20 74 68 | 65 6e 20 0a 20 20 65 63 |-c" ; th|en . ec|
|000002d0| 68 6f 20 73 68 61 72 3a | 20 57 69 6c 6c 20 6e 6f |ho shar:| Will no|
|000002e0| 74 20 63 6c 6f 62 62 65 | 72 20 65 78 69 73 74 69 |t clobbe|r existi|
|000002f0| 6e 67 20 66 69 6c 65 20 | 5c 22 27 4f 52 49 47 49 |ng file |\"'ORIGI|
|00000300| 4e 27 5c 22 0a 65 6c 73 | 65 0a 65 63 68 6f 20 73 |N'\".els|e.echo s|
|00000310| 68 61 72 3a 20 45 78 74 | 72 61 63 74 69 6e 67 20 |har: Ext|racting |
|00000320| 5c 22 27 4f 52 49 47 49 | 4e 27 5c 22 20 5c 28 32 |\"'ORIGI|N'\" \(2|
|00000330| 32 39 30 33 20 63 68 61 | 72 61 63 74 65 72 73 5c |2903 cha|racters\|
|00000340| 29 0a 73 65 64 20 22 73 | 2f 5e 58 2f 2f 22 20 3e |).sed "s|/^X//" >|
|00000350| 27 4f 52 49 47 49 4e 27 | 20 3c 3c 27 45 4e 44 5f |'ORIGIN'| <<'END_|
|00000360| 4f 46 5f 46 49 4c 45 27 | 0a 58 3e 3e 20 43 6f 6d |OF_FILE'|.X>> Com|
|00000370| 6d 65 6e 74 61 72 79 20 | 62 79 20 64 62 65 6c 6c |mentary |by dbell|
|00000380| 0a 58 3e 3e 20 54 68 69 | 73 20 69 73 20 74 68 65 |.X>> Thi|s is the|
|00000390| 20 6f 72 69 67 69 6e 61 | 6c 20 61 72 74 69 63 6c | origina|l articl|
|000003a0| 65 20 69 6e 63 6c 75 64 | 65 64 20 77 69 74 68 20 |e includ|ed with |
|000003b0| 74 68 65 20 78 6c 69 66 | 65 20 32 2e 30 20 73 6f |the xlif|e 2.0 so|
|000003c0| 75 72 63 65 73 20 69 6e | 0a 58 3e 3e 20 77 68 69 |urces in|.X>> whi|
|000003d0| 63 68 20 44 65 61 6e 20 | 48 69 63 6b 65 72 73 6f |ch Dean |Hickerso|
|000003e0| 6e 20 64 65 73 63 72 69 | 62 65 64 20 68 6f 77 20 |n descri|bed how |
|000003f0| 68 69 73 20 6c 69 66 65 | 20 73 65 61 72 63 68 20 |his life| search |
|00000400| 70 72 6f 67 72 61 6d 20 | 77 6f 72 6b 73 2e 0a 58 |program |works..X|
|00000410| 3e 3e 20 4e 6f 74 65 3a | 20 48 69 73 20 6d 61 69 |>> Note:| His mai|
|00000420| 6c 20 61 64 64 72 65 73 | 73 20 69 73 20 6e 6f 20 |l addres|s is no |
|00000430| 6c 6f 6e 67 65 72 20 76 | 61 6c 69 64 20 28 61 6e |longer v|alid (an|
|00000440| 64 20 68 65 20 64 6f 65 | 73 6e 27 74 20 68 61 76 |d he doe|sn't hav|
|00000450| 65 20 6f 6e 65 29 2e 0a | 58 3e 3e 20 41 6c 73 6f |e one)..|X>> Also|
|00000460| 2c 20 74 68 65 20 32 35 | 20 62 69 74 20 70 65 72 |, the 25| bit per|
|00000470| 69 6f 64 20 33 20 73 70 | 61 63 65 73 68 69 70 20 |iod 3 sp|aceship |
|00000480| 72 65 66 65 72 72 65 64 | 20 74 6f 20 62 65 6c 6f |referred| to belo|
|00000490| 77 20 69 73 20 74 68 65 | 20 66 6f 6c 6c 6f 77 69 |w is the| followi|
|000004a0| 6e 67 3a 0a 58 3e 3e 20 | 2e 2e 2e 2e 2e 2e 2e 2e |ng:.X>> |........|
|000004b0| 2e 2e 2e 2e 2e 2a 2a 0a | 58 3e 3e 20 2e 2a 2a 2e |.....**.|X>> .**.|
|000004c0| 2e 2e 2a 2e 2e 2e 2a 2e | 2e 2e 2e 2a 0a 58 3e 3e |..*...*.|...*.X>>|
|000004d0| 20 2a 2e 2e 2e 2e 2e 2e | 2a 2a 2e 2e 2a 2a 2a 2a | *......|**..****|
|000004e0| 0a 58 3e 3e 20 2e 2a 2a | 2a 2e 2a 2a 2e 2a 2e 2a |.X>> .**|*.**.*.*|
|000004f0| 2a 0a 58 3e 3e 20 2e 2e | 2e 2e 2e 2a 2e 2a 2a 0a |*.X>> ..|...*.**.|
|00000500| 58 3e 3e 0a 58 52 65 74 | 75 72 6e 2d 70 61 74 68 |X>>.XRet|urn-path|
|00000510| 3a 20 3c 48 55 4c 40 50 | 53 55 56 4d 2e 50 53 55 |: <HUL@P|SUVM.PSU|
|00000520| 2e 45 44 55 3e 0a 58 58 | 2d 41 6e 64 72 65 77 2d |.EDU>.XX|-Andrew-|
|00000530| 41 75 74 68 65 6e 74 69 | 63 61 74 65 64 2d 61 73 |Authenti|cated-as|
|00000540| 3a 20 30 3b 61 6e 64 72 | 65 77 2e 63 6d 75 2e 65 |: 0;andr|ew.cmu.e|
|00000550| 64 75 3b 4e 65 74 77 6f | 72 6b 2d 4d 61 69 6c 0a |du;Netwo|rk-Mail.|
|00000560| 58 52 65 63 65 69 76 65 | 64 3a 20 66 72 6f 6d 20 |XReceive|d: from |
|00000570| 70 6f 33 2e 61 6e 64 72 | 65 77 2e 63 6d 75 2e 65 |po3.andr|ew.cmu.e|
|00000580| 64 75 20 76 69 61 20 74 | 72 79 6d 61 69 6c 0a 58 |du via t|rymail.X|
|00000590| 20 20 20 20 20 20 20 20 | 20 20 49 44 20 3c 2f 61 | | ID </a|
|000005a0| 66 73 2f 61 6e 64 72 65 | 77 2e 63 6d 75 2e 65 64 |fs/andre|w.cmu.ed|
|000005b0| 75 2f 75 73 72 31 34 2f | 6a 62 37 6d 2f 4d 61 69 |u/usr14/|jb7m/Mai|
|000005c0| 6c 62 6f 78 2f 30 5a 66 | 74 37 48 4b 30 30 55 6b |lbox/0Zf|t7HK00Uk|
|000005d0| 54 38 48 4a 55 38 46 3e | 3b 0a 58 20 20 20 20 20 |T8HJU8F>|;.X |
|000005e0| 20 20 20 20 20 53 61 74 | 2c 20 31 33 20 4a 61 6e | Sat|, 13 Jan|
|000005f0| 20 39 30 20 31 35 3a 33 | 38 3a 34 35 20 2d 30 35 | 90 15:3|8:45 -05|
|00000600| 30 30 20 28 45 53 54 29 | 0a 58 4d 65 73 73 61 67 |00 (EST)|.XMessag|
|00000610| 65 2d 49 44 3a 20 3c 41 | 64 64 65 64 2e 41 5a 66 |e-ID: <A|dded.AZf|
|00000620| 74 37 45 6d 30 30 55 6b | 54 51 48 4a 55 35 71 40 |t7Em00Uk|TQHJU5q@|
|00000630| 61 6e 64 72 65 77 2e 63 | 6d 75 2e 65 64 75 3e 0a |andrew.c|mu.edu>.|
|00000640| 58 52 65 63 65 69 76 65 | 64 3a 20 66 72 6f 6d 20 |XReceive|d: from |
|00000650| 50 53 55 56 4d 2e 50 53 | 55 2e 45 44 55 20 62 79 |PSUVM.PS|U.EDU by|
|00000660| 20 70 6f 33 2e 61 6e 64 | 72 65 77 2e 63 6d 75 2e | po3.and|rew.cmu.|
|00000670| 65 64 75 20 28 35 2e 35 | 34 2f 33 2e 31 35 29 20 |edu (5.5|4/3.15) |
|00000680| 69 64 20 3c 41 41 30 34 | 39 34 35 3e 20 66 6f 72 |id <AA04|945> for|
|00000690| 20 6a 62 37 6d 2b 3b 20 | 53 61 74 2c 20 31 33 20 | jb7m+; |Sat, 13 |
|000006a0| 4a 61 6e 20 39 30 20 31 | 35 3a 33 38 3a 31 30 20 |Jan 90 1|5:38:10 |
|000006b0| 45 53 54 0a 58 52 65 63 | 65 69 76 65 64 3a 20 66 |EST.XRec|eived: f|
|000006c0| 72 6f 6d 20 50 53 55 56 | 4d 2e 42 49 54 4e 45 54 |rom PSUV|M.BITNET|
|000006d0| 20 62 79 20 50 53 55 56 | 4d 2e 50 53 55 2e 45 44 | by PSUV|M.PSU.ED|
|000006e0| 55 20 28 49 42 4d 20 56 | 4d 20 53 4d 54 50 20 52 |U (IBM V|M SMTP R|
|000006f0| 31 2e 32 2e 31 4d 58 29 | 20 77 69 74 68 20 42 53 |1.2.1MX)| with BS|
|00000700| 4d 54 50 20 69 64 20 30 | 39 39 31 3b 20 53 61 74 |MTP id 0|991; Sat|
|00000710| 2c 20 31 33 20 4a 61 6e | 20 39 30 20 31 35 3a 33 |, 13 Jan| 90 15:3|
|00000720| 38 3a 35 35 20 45 53 54 | 0a 58 52 65 63 65 69 76 |8:55 EST|.XReceiv|
|00000730| 65 64 3a 20 62 79 20 50 | 53 55 56 4d 20 28 4d 61 |ed: by P|SUVM (Ma|
|00000740| 69 6c 65 72 20 52 32 2e | 30 33 42 29 20 69 64 20 |iler R2.|03B) id |
|00000750| 33 34 30 37 3b 20 53 61 | 74 2c 20 31 33 20 4a 61 |3407; Sa|t, 13 Ja|
|00000760| 6e 20 39 30 20 31 35 3a | 33 38 3a 35 34 20 45 53 |n 90 15:|38:54 ES|
|00000770| 54 0a 58 44 61 74 65 3a | 20 20 20 20 53 61 74 2c |T.XDate:| Sat,|
|00000780| 20 31 33 20 4a 61 6e 20 | 39 30 20 31 35 3a 33 38 | 13 Jan |90 15:38|
|00000790| 20 45 53 54 0a 58 46 72 | 6f 6d 3a 20 22 44 65 61 | EST.XFr|om: "Dea|
|000007a0| 6e 20 48 69 63 6b 65 72 | 73 6f 6e 22 20 3c 48 55 |n Hicker|son" <HU|
|000007b0| 4c 40 50 53 55 56 4d 2e | 50 53 55 2e 45 44 55 3e |L@PSUVM.|PSU.EDU>|
|000007c0| 0a 58 53 75 62 6a 65 63 | 74 3a 20 53 65 61 72 63 |.XSubjec|t: Searc|
|000007d0| 68 20 70 72 6f 67 72 61 | 6d 0a 58 54 6f 3a 20 6a |h progra|m.XTo: j|
|000007e0| 62 37 6d 2b 40 61 6e 64 | 72 65 77 2e 63 6d 75 2e |b7m+@and|rew.cmu.|
|000007f0| 65 64 75 0a 58 0a 58 3e | 20 20 41 20 6e 75 6d 62 |edu.X.X>| A numb|
|00000800| 65 72 20 6f 66 20 74 69 | 6d 65 20 79 6f 75 20 68 |er of ti|me you h|
|00000810| 61 76 65 20 73 61 69 64 | 20 74 68 61 74 20 74 68 |ave said| that th|
|00000820| 65 20 70 61 74 74 65 72 | 6e 73 20 79 6f 75 20 77 |e patter|ns you w|
|00000830| 65 72 65 20 73 65 6e 64 | 69 6e 67 20 68 61 64 20 |ere send|ing had |
|00000840| 62 65 65 6e 0a 58 3e 20 | 20 66 6f 75 6e 64 20 62 |been.X> | found b|
|00000850| 79 20 61 20 73 65 61 72 | 63 68 20 70 72 6f 67 72 |y a sear|ch progr|
|00000860| 61 6d 2e 20 49 20 77 61 | 73 20 77 6f 6e 64 65 72 |am. I wa|s wonder|
|00000870| 69 6e 67 20 69 66 20 79 | 6f 75 20 77 6f 75 6c 64 |ing if y|ou would|
|00000880| 20 6d 69 6e 64 20 73 65 | 6e 64 69 6e 67 20 6d 65 | mind se|nding me|
|00000890| 20 61 0a 58 3e 20 20 63 | 6f 70 79 20 6f 66 20 69 | a.X> c|opy of i|
|000008a0| 74 20 74 6f 6f 20 6c 6f | 6f 6b 20 61 74 2e 0a 58 |t too lo|ok at..X|
|000008b0| 0a 58 54 68 65 20 70 72 | 6f 67 72 61 6d 20 69 73 |.XThe pr|ogram is|
|000008c0| 20 77 72 69 74 74 65 6e | 20 69 6e 20 36 35 30 32 | written| in 6502|
|000008d0| 20 61 73 73 65 6d 62 6c | 79 20 6c 61 6e 67 75 61 | assembl|y langua|
|000008e0| 67 65 20 61 6e 64 20 41 | 70 70 6c 65 73 6f 66 74 |ge and A|pplesoft|
|000008f0| 20 42 41 53 49 43 20 61 | 6e 64 0a 58 72 75 6e 73 | BASIC a|nd.Xruns|
|00000900| 20 6f 6e 20 61 6e 20 41 | 70 70 6c 65 20 49 49 65 | on an A|pple IIe|
|00000910| 2e 20 20 55 6e 6c 65 73 | 73 20 79 6f 75 20 68 61 |. Unles|s you ha|
|00000920| 76 65 20 61 20 63 6f 6d | 70 61 74 69 62 6c 65 20 |ve a com|patible |
|00000930| 6d 61 63 68 69 6e 65 2c | 20 74 68 65 20 70 72 6f |machine,| the pro|
|00000940| 67 72 61 6d 0a 58 69 74 | 73 65 6c 66 20 70 72 6f |gram.Xit|self pro|
|00000950| 62 61 62 6c 79 20 77 6f | 75 6c 64 6e 27 74 20 68 |bably wo|uldn't h|
|00000960| 65 6c 70 20 79 6f 75 20 | 6d 75 63 68 2e 20 20 42 |elp you |much. B|
|00000970| 75 74 20 68 65 72 65 27 | 73 20 61 20 66 61 69 72 |ut here'|s a fair|
|00000980| 6c 79 20 64 65 74 61 69 | 6c 65 64 0a 58 64 65 73 |ly detai|led.Xdes|
|00000990| 63 72 69 70 74 69 6f 6e | 20 6f 66 20 68 6f 77 20 |cription| of how |
|000009a0| 69 74 20 77 6f 72 6b 73 | 2e 20 20 49 20 65 6e 63 |it works|. I enc|
|000009b0| 6f 75 72 61 67 65 20 79 | 6f 75 20 28 6f 72 20 61 |ourage y|ou (or a|
|000009c0| 6e 79 6f 6e 65 20 65 6c | 73 65 29 20 74 6f 20 77 |nyone el|se) to w|
|000009d0| 72 69 74 65 20 61 0a 58 | 73 69 6d 69 6c 61 72 20 |rite a.X|similar |
|000009e0| 70 72 6f 67 72 61 6d 20 | 66 6f 72 20 61 20 66 61 |program |for a fa|
|000009f0| 73 74 65 72 20 6d 61 63 | 68 69 6e 65 3b 20 49 27 |ster mac|hine; I'|
|00000a00| 6d 20 73 75 72 65 20 74 | 68 65 72 65 20 61 72 65 |m sure t|here are|
|00000a10| 20 74 68 69 6e 67 73 20 | 77 61 69 74 69 6e 67 20 | things |waiting |
|00000a20| 74 6f 0a 58 62 65 20 66 | 6f 75 6e 64 20 74 68 61 |to.Xbe f|ound tha|
|00000a30| 74 20 6d 79 20 41 70 70 | 6c 65 20 69 73 20 73 6c |t my App|le is sl|
|00000a40| 6f 77 20 74 6f 20 66 69 | 6e 64 2e 0a 58 0a 58 49 |ow to fi|nd..X.XI|
|00000a50| 66 20 79 6f 75 20 72 65 | 61 6c 6c 79 20 77 61 6e |f you re|ally wan|
|00000a60| 74 20 74 6f 20 73 65 65 | 20 74 68 65 20 70 72 6f |t to see| the pro|
|00000a70| 67 72 61 6d 20 69 74 73 | 65 6c 66 2c 20 6c 65 74 |gram its|elf, let|
|00000a80| 20 6d 65 20 6b 6e 6f 77 | 20 61 6e 64 20 49 27 6c | me know| and I'l|
|00000a90| 6c 20 74 72 79 20 74 6f | 0a 58 66 69 6e 64 20 61 |l try to|.Xfind a|
|00000aa0| 20 77 61 79 20 74 6f 20 | 73 65 6e 64 20 69 74 2e | way to |send it.|
|00000ab0| 20 20 28 49 74 27 73 20 | 6e 6f 74 20 65 61 73 79 | (It's |not easy|
|00000ac0| 2c 20 62 65 63 61 75 73 | 65 20 6f 66 20 69 6e 63 |, becaus|e of inc|
|00000ad0| 6f 6d 70 61 74 69 62 6c | 65 20 6f 70 65 72 61 74 |ompatibl|e operat|
|00000ae0| 69 6e 67 0a 58 73 79 73 | 74 65 6d 73 20 61 6e 64 |ing.Xsys|tems and|
|00000af0| 20 66 69 6c 65 20 73 74 | 72 75 63 74 75 72 65 73 | file st|ructures|
|00000b00| 2e 29 0a 58 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |.).X====|========|
|00000b10| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00000b20| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00000b30| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00000b40| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 0a 58 47 65 |========|====.XGe|
|00000b50| 6e 65 72 61 6c 20 64 65 | 73 63 72 69 70 74 69 6f |neral de|scriptio|
|00000b60| 6e 20 6f 66 20 74 68 65 | 20 4c 69 66 65 20 73 65 |n of the| Life se|
|00000b70| 61 72 63 68 20 70 72 6f | 67 72 61 6d 20 20 28 39 |arch pro|gram (9|
|00000b80| 2f 36 2f 38 39 29 0a 58 | 0a 58 20 20 20 20 20 54 |/6/89).X|.X T|
|00000b90| 68 69 73 20 69 73 20 61 | 20 67 65 6e 65 72 61 6c |his is a| general|
|00000ba0| 20 64 65 73 63 72 69 70 | 74 69 6f 6e 20 6f 66 20 | descrip|tion of |
|00000bb0| 74 68 65 20 70 72 6f 67 | 72 61 6d 20 61 6e 64 20 |the prog|ram and |
|00000bc0| 73 6f 6d 65 20 64 69 73 | 63 75 73 73 69 6f 6e 20 |some dis|cussion |
|00000bd0| 6f 66 0a 58 69 74 73 20 | 62 65 68 61 76 69 6f 75 |of.Xits |behaviou|
|00000be0| 72 2e 20 20 41 20 6d 75 | 63 68 20 6d 6f 72 65 20 |r. A mu|ch more |
|00000bf0| 64 65 74 61 69 6c 65 64 | 20 64 65 73 63 72 69 70 |detailed| descrip|
|00000c00| 74 69 6f 6e 20 66 6f 6c | 6c 6f 77 73 2e 0a 58 0a |tion fol|lows..X.|
|00000c10| 58 20 20 20 20 20 49 20 | 74 65 6c 6c 20 74 68 65 |X I |tell the|
|00000c20| 20 70 72 6f 67 72 61 6d | 20 74 68 65 20 64 65 73 | program| the des|
|00000c30| 69 72 65 64 20 63 6f 6e | 67 72 75 65 6e 63 65 20 |ired con|gruence |
|00000c40| 70 65 72 69 6f 64 20 54 | 20 6f 66 20 61 6e 20 6f |period T| of an o|
|00000c50| 62 6a 65 63 74 2c 20 61 | 0a 58 72 65 63 74 61 6e |bject, a|.Xrectan|
|00000c60| 67 6c 65 20 69 6e 20 77 | 68 69 63 68 20 67 65 6e |gle in w|hich gen|
|00000c70| 65 72 61 74 69 6f 6e 73 | 20 30 20 74 6f 20 54 20 |erations| 0 to T |
|00000c80| 6d 75 73 74 20 66 69 74 | 2c 20 61 6e 64 20 61 6e |must fit|, and an|
|00000c90| 20 69 73 6f 6d 65 74 72 | 79 20 72 65 6c 61 74 69 | isometr|y relati|
|00000ca0| 6e 67 0a 58 67 65 6e 2e | 20 30 20 74 6f 20 67 65 |ng.Xgen.| 0 to ge|
|00000cb0| 6e 2e 20 54 2e 20 20 54 | 68 65 20 70 72 6f 67 72 |n. T. T|he progr|
|00000cc0| 61 6d 20 63 72 65 61 74 | 65 73 20 61 20 33 44 20 |am creat|es a 3D |
|00000cd0| 61 72 72 61 79 20 69 6e | 20 77 68 69 63 68 20 65 |array in| which e|
|00000ce0| 61 63 68 20 63 65 6c 6c | 20 69 73 0a 58 65 69 74 |ach cell| is.Xeit|
|00000cf0| 68 65 72 20 6f 6e 2c 20 | 6f 66 66 2c 20 6f 72 20 |her on, |off, or |
|00000d00| 75 6e 6b 6e 6f 77 6e 3b | 20 69 6e 69 74 69 61 6c |unknown;| initial|
|00000d10| 6c 79 20 65 76 65 72 79 | 74 68 69 6e 67 27 73 20 |ly every|thing's |
|00000d20| 75 6e 6b 6e 6f 77 6e 20 | 65 78 63 65 70 74 20 66 |unknown |except f|
|00000d30| 6f 72 20 61 6e 79 0a 58 | 69 6e 69 74 69 61 6c 20 |or any.X|initial |
|00000d40| 63 6f 6e 64 69 74 69 6f | 6e 73 20 77 68 69 63 68 |conditio|ns which|
|00000d50| 20 49 20 73 70 65 63 69 | 66 79 2e 20 20 49 74 20 | I speci|fy. It |
|00000d60| 74 68 65 6e 20 70 69 63 | 6b 73 20 61 6e 20 75 6e |then pic|ks an un|
|00000d70| 6b 6e 6f 77 6e 20 63 65 | 6c 6c 2c 20 63 68 6f 6f |known ce|ll, choo|
|00000d80| 73 65 73 0a 58 61 20 76 | 61 6c 75 65 20 66 6f 72 |ses.Xa v|alue for|
|00000d90| 20 69 74 2c 20 61 6e 64 | 20 65 78 61 6d 69 6e 65 | it, and| examine|
|00000da0| 73 20 74 68 65 20 63 6f | 6e 73 65 71 75 65 6e 63 |s the co|nsequenc|
|00000db0| 65 73 20 6f 66 20 69 74 | 73 20 63 68 6f 69 63 65 |es of it|s choice|
|00000dc0| 2c 20 77 6f 72 6b 69 6e | 67 20 62 6f 74 68 0a 58 |, workin|g both.X|
|00000dd0| 66 6f 72 77 61 72 64 20 | 61 6e 64 20 62 61 63 6b |forward |and back|
|00000de0| 77 61 72 64 2e 20 20 49 | 66 20 69 74 20 72 75 6e |ward. I|f it run|
|00000df0| 73 20 6f 75 74 20 6f 66 | 20 63 6f 6e 73 65 71 75 |s out of| consequ|
|00000e00| 65 6e 63 65 73 2c 20 69 | 74 20 70 69 63 6b 73 20 |ences, i|t picks |
|00000e10| 61 6e 6f 74 68 65 72 0a | 58 75 6e 6b 6e 6f 77 6e |another.|Xunknown|
|00000e20| 20 63 65 6c 6c 20 61 6e | 64 20 63 6f 6e 74 69 6e | cell an|d contin|
|00000e30| 75 65 73 2e 20 20 49 66 | 20 69 74 20 66 69 6e 64 |ues. If| it find|
|00000e40| 73 20 61 20 63 6f 6e 74 | 72 61 64 69 63 74 69 6f |s a cont|radictio|
|00000e50| 6e 2c 20 69 74 20 62 61 | 63 6b 73 20 75 70 20 74 |n, it ba|cks up t|
|00000e60| 6f 0a 58 69 74 73 20 6d | 6f 73 74 20 72 65 63 65 |o.Xits m|ost rece|
|00000e70| 6e 74 20 63 68 6f 69 63 | 65 2c 20 72 65 76 65 72 |nt choic|e, rever|
|00000e80| 73 65 73 20 69 74 2c 20 | 6d 61 72 6b 73 20 69 74 |ses it, |marks it|
|00000e90| 20 61 73 20 61 20 63 6f | 6e 63 6c 75 73 69 6f 6e | as a co|nclusion|
|00000ea0| 20 72 61 74 68 65 72 20 | 74 68 61 6e 20 61 0a 58 | rather |than a.X|
|00000eb0| 63 68 6f 69 63 65 2c 20 | 61 6e 64 20 63 6f 6e 74 |choice, |and cont|
|00000ec0| 69 6e 75 65 73 2e 20 45 | 76 65 6e 74 75 61 6c 6c |inues. E|ventuall|
|00000ed0| 79 20 69 74 20 65 69 74 | 68 65 72 20 72 75 6e 73 |y it eit|her runs|
|00000ee0| 20 6f 75 74 20 6f 66 20 | 75 6e 6b 6e 6f 77 6e 20 | out of |unknown |
|00000ef0| 63 65 6c 6c 73 20 61 6e | 64 0a 58 72 65 70 6f 72 |cells an|d.Xrepor|
|00000f00| 74 73 20 74 68 61 74 20 | 69 74 27 73 20 66 6f 75 |ts that |it's fou|
|00000f10| 6e 64 20 73 6f 6d 65 74 | 68 69 6e 67 2c 20 6f 72 |nd somet|hing, or|
|00000f20| 20 74 72 69 65 73 20 74 | 6f 20 62 61 63 6b 20 75 | tries t|o back u|
|00000f30| 70 20 70 61 73 74 20 69 | 74 73 20 66 69 72 73 74 |p past i|ts first|
|00000f40| 0a 58 63 68 6f 69 63 65 | 20 61 6e 64 20 72 65 70 |.Xchoice| and rep|
|00000f50| 6f 72 74 73 20 74 68 61 | 74 20 74 68 65 20 6f 62 |orts tha|t the ob|
|00000f60| 6a 65 63 74 20 64 6f 65 | 73 6e 27 74 20 65 78 69 |ject doe|sn't exi|
|00000f70| 73 74 2e 20 20 28 4f 72 | 20 69 74 20 77 6f 75 6c |st. (Or| it woul|
|00000f80| 64 20 69 66 20 49 20 6c | 65 74 20 69 74 0a 58 72 |d if I l|et it.Xr|
|00000f90| 75 6e 20 66 6f 72 65 76 | 65 72 3b 20 6d 6f 72 65 |un forev|er; more|
|00000fa0| 20 6f 66 74 65 6e 20 49 | 20 73 74 6f 70 20 69 74 | often I| stop it|
|00000fb0| 20 61 66 74 65 72 20 61 | 20 77 68 69 6c 65 2e 29 | after a| while.)|
|00000fc0| 20 20 49 20 63 61 6e 20 | 68 61 76 65 20 69 74 20 | I can |have it |
|00000fd0| 64 69 73 70 6c 61 79 0a | 58 74 68 65 20 61 72 72 |display.|Xthe arr|
|00000fe0| 61 79 20 61 74 20 61 6e | 79 20 74 69 6d 65 3b 20 |ay at an|y time; |
|00000ff0| 73 6f 6d 65 74 69 6d 65 | 73 20 49 20 63 61 6e 20 |sometime|s I can |
|00001000| 66 69 67 75 72 65 20 6f | 75 74 20 73 6f 6d 65 74 |figure o|ut somet|
|00001010| 68 69 6e 67 20 69 6e 74 | 65 72 65 73 74 69 6e 67 |hing int|eresting|
|00001020| 0a 58 66 72 6f 6d 20 69 | 74 73 20 70 61 72 74 69 |.Xfrom i|ts parti|
|00001030| 61 6c 20 72 65 73 75 6c | 74 73 2e 20 20 45 2e 67 |al resul|ts. E.g|
|00001040| 2e 20 49 20 62 75 69 6c | 74 20 74 68 65 20 32 35 |. I buil|t the 25|
|00001050| 20 62 69 74 20 63 2f 33 | 20 73 70 61 63 65 73 68 | bit c/3| spacesh|
|00001060| 69 70 20 66 72 6f 6d 20 | 70 61 72 74 73 0a 58 69 |ip from |parts.Xi|
|00001070| 74 20 68 61 64 20 66 6f | 75 6e 64 20 69 6e 20 70 |t had fo|und in p|
|00001080| 72 65 76 69 6f 75 73 20 | 73 65 61 72 63 68 65 73 |revious |searches|
|00001090| 3b 20 74 68 65 20 70 72 | 6f 67 72 61 6d 20 66 6f |; the pr|ogram fo|
|000010a0| 75 6e 64 20 69 74 20 61 | 62 6f 75 74 20 61 6e 20 |und it a|bout an |
|000010b0| 68 6f 75 72 0a 58 6c 61 | 74 65 72 2e 0a 58 0a 58 |hour.Xla|ter..X.X|
|000010c0| 20 20 20 4f 6e 65 20 70 | 72 6f 62 6c 65 6d 20 49 | One p|roblem I|
|000010d0| 20 73 6f 6d 65 74 69 6d | 65 73 20 68 61 76 65 20 | sometim|es have |
|000010e0| 69 73 20 74 68 61 74 20 | 74 68 65 20 70 72 6f 67 |is that |the prog|
|000010f0| 72 61 6d 20 66 69 6e 64 | 73 20 74 68 69 6e 67 73 |ram find|s things|
|00001100| 20 77 69 74 68 0a 58 70 | 65 72 69 6f 64 73 20 73 | with.Xp|eriods s|
|00001110| 6d 61 6c 6c 65 72 20 74 | 68 61 6e 20 49 20 77 61 |maller t|han I wa|
|00001120| 6e 74 2c 20 6c 69 6b 65 | 20 31 2e 20 20 53 6f 20 |nt, like| 1. So |
|00001130| 49 20 75 73 75 61 6c 6c | 79 20 73 70 65 63 69 66 |I usuall|y specif|
|00001140| 79 20 74 68 65 20 76 61 | 6c 75 65 20 6f 66 0a 58 |y the va|lue of.X|
|00001150| 73 6f 6d 65 20 70 61 72 | 74 69 63 75 6c 61 72 20 |some par|ticular |
|00001160| 63 65 6c 6c 20 69 6e 20 | 65 6e 6f 75 67 68 20 70 |cell in |enough p|
|00001170| 68 61 73 65 73 20 74 6f | 20 66 6f 72 63 65 20 69 |hases to| force i|
|00001180| 74 20 74 6f 20 68 61 76 | 65 20 74 68 65 20 64 65 |t to hav|e the de|
|00001190| 73 69 72 65 64 0a 58 70 | 65 72 69 6f 64 2e 20 20 |sired.Xp|eriod. |
|000011a0| 28 4f 66 20 63 6f 75 72 | 73 65 20 49 20 6d 61 79 |(Of cour|se I may|
|000011b0| 20 6d 69 73 73 20 73 6f | 6d 65 74 68 69 6e 67 20 | miss so|mething |
|000011c0| 69 6e 74 65 72 65 73 74 | 69 6e 67 20 74 68 61 74 |interest|ing that|
|000011d0| 20 77 61 79 2e 29 20 20 | 41 6e 6f 74 68 65 72 0a | way.) |Another.|
|000011e0| 58 70 72 6f 62 6c 65 6d | 20 69 73 20 74 68 61 74 |Xproblem| is that|
|000011f0| 20 61 66 74 65 72 20 74 | 68 65 20 70 72 6f 67 72 | after t|he progr|
|00001200| 61 6d 20 66 69 6e 64 73 | 20 73 6f 6d 65 74 68 69 |am finds| somethi|
|00001210| 6e 67 20 77 68 69 63 68 | 20 69 73 20 73 6d 61 6c |ng which| is smal|
|00001220| 6c 65 72 20 74 68 61 6e | 20 74 68 65 0a 58 73 70 |ler than| the.Xsp|
|00001230| 65 63 69 66 69 65 64 20 | 72 65 63 74 61 6e 67 6c |ecified |rectangl|
|00001240| 65 2c 20 69 74 20 74 68 | 65 6e 20 66 69 6e 64 73 |e, it th|en finds|
|00001250| 20 74 68 65 20 73 61 6d | 65 20 74 68 69 6e 67 20 | the sam|e thing |
|00001260| 77 69 74 68 20 76 61 72 | 69 6f 75 73 20 73 74 61 |with var|ious sta|
|00001270| 62 6c 65 0a 58 6f 62 6a | 65 63 74 73 20 61 72 6f |ble.Xobj|ects aro|
|00001280| 75 6e 64 20 74 68 65 20 | 75 6e 6f 63 63 75 70 69 |und the |unoccupi|
|00001290| 65 64 20 65 64 67 65 73 | 2e 20 20 53 6f 20 49 20 |ed edges|. So I |
|000012a0| 62 61 63 6b 20 69 74 20 | 75 70 20 27 62 79 20 68 |back it |up 'by h|
|000012b0| 61 6e 64 27 20 66 61 72 | 20 65 6e 6f 75 67 68 0a |and' far| enough.|
|000012c0| 58 74 6f 20 67 65 74 20 | 74 6f 20 73 6f 6d 65 74 |Xto get |to somet|
|000012d0| 68 69 6e 67 20 6e 65 77 | 2e 0a 58 0a 58 20 20 20 |hing new|..X.X |
|000012e0| 49 20 68 61 76 65 6e 27 | 74 20 72 65 61 6c 6c 79 |I haven'|t really|
|000012f0| 20 73 65 74 74 6c 65 64 | 20 6f 6e 20 74 68 65 20 | settled| on the |
|00001300| 62 65 73 74 20 6f 72 64 | 65 72 20 69 6e 20 77 68 |best ord|er in wh|
|00001310| 69 63 68 20 74 6f 20 73 | 65 6c 65 63 74 20 75 6e |ich to s|elect un|
|00001320| 6b 6e 6f 77 6e 0a 58 63 | 65 6c 6c 73 2e 20 20 49 |known.Xc|ells. I|
|00001330| 20 75 73 75 61 6c 6c 79 | 20 77 6f 72 6b 20 69 6e | usually| work in|
|00001340| 20 61 20 72 65 63 74 61 | 6e 67 6c 65 20 77 68 69 | a recta|ngle whi|
|00001350| 63 68 20 69 73 20 77 69 | 64 65 20 62 75 74 20 6e |ch is wi|de but n|
|00001360| 6f 74 20 76 65 72 79 20 | 74 61 6c 6c 20 61 6e 64 |ot very |tall and|
|00001370| 0a 58 70 72 6f 63 65 65 | 64 20 75 70 20 74 68 65 |.Xprocee|d up the|
|00001380| 20 63 6f 6c 75 6d 6e 73 | 20 66 72 6f 6d 20 6c 65 | columns| from le|
|00001390| 66 74 20 74 6f 20 72 69 | 67 68 74 2c 20 65 69 74 |ft to ri|ght, eit|
|000013a0| 68 65 72 20 6a 75 73 74 | 20 69 6e 20 67 65 6e 2e |her just| in gen.|
|000013b0| 20 30 20 6f 72 20 64 6f | 69 6e 67 0a 58 61 6c 6c | 0 or do|ing.Xall|
|000013c0| 20 70 68 61 73 65 73 20 | 66 6f 72 20 65 61 63 68 | phases |for each|
|000013d0| 20 70 6f 73 69 74 69 6f | 6e 20 62 65 66 6f 72 65 | positio|n before|
|000013e0| 20 6d 6f 76 69 6e 67 20 | 74 6f 20 74 68 65 20 6e | moving |to the n|
|000013f0| 65 78 74 2e 20 20 49 27 | 76 65 20 74 72 69 65 64 |ext. I'|ve tried|
|00001400| 20 73 6f 6d 65 0a 58 73 | 65 61 72 63 68 65 73 20 | some.Xs|earches |
|00001410| 73 74 61 72 74 69 6e 67 | 20 61 74 20 74 68 65 20 |starting| at the |
|00001420| 63 65 6e 74 65 72 20 6f | 66 20 61 20 73 71 75 61 |center o|f a squa|
|00001430| 72 65 20 61 6e 64 20 73 | 70 69 72 61 6c 6c 69 6e |re and s|pirallin|
|00001440| 67 0a 58 6f 75 74 77 61 | 72 64 2c 20 62 75 74 20 |g.Xoutwa|rd, but |
|00001450| 74 68 65 20 70 72 6f 67 | 72 61 6d 20 74 65 6e 64 |the prog|ram tend|
|00001460| 73 20 74 6f 20 62 6f 67 | 20 64 6f 77 6e 20 77 68 |s to bog| down wh|
|00001470| 65 6e 20 69 74 27 73 20 | 66 61 72 20 66 72 6f 6d |en it's |far from|
|00001480| 20 74 68 65 20 63 65 6e | 74 65 72 3a 20 61 0a 58 | the cen|ter: a.X|
|00001490| 62 61 64 20 63 68 6f 69 | 63 65 20 66 6f 72 20 61 |bad choi|ce for a|
|000014a0| 20 63 65 6c 6c 20 6d 61 | 79 20 6e 6f 74 20 62 65 | cell ma|y not be|
|000014b0| 20 64 65 74 65 63 74 65 | 64 20 75 6e 74 69 6c 20 | detecte|d until |
|000014c0| 74 68 65 20 73 70 69 72 | 61 6c 20 63 6f 6d 65 73 |the spir|al comes|
|000014d0| 20 62 61 63 6b 0a 58 61 | 72 6f 75 6e 64 20 74 6f | back.Xa|round to|
|000014e0| 20 69 74 2c 20 73 6f 20 | 69 74 20 77 69 6c 6c 20 | it, so |it will |
|000014f0| 74 72 79 20 6d 61 6e 79 | 20 70 6f 73 73 69 62 69 |try many| possibi|
|00001500| 6c 69 74 69 65 73 20 66 | 6f 72 20 74 68 65 20 69 |lities f|or the i|
|00001510| 6e 74 65 72 76 65 6e 69 | 6e 67 20 63 65 6c 6c 73 |nterveni|ng cells|
|00001520| 0a 58 6f 66 20 74 68 65 | 20 73 70 69 72 61 6c 20 |.Xof the| spiral |
|00001530| 62 65 66 6f 72 65 20 69 | 74 20 63 68 61 6e 67 65 |before i|t change|
|00001540| 73 20 74 68 65 20 62 61 | 64 20 63 65 6c 6c 2e 20 |s the ba|d cell. |
|00001550| 20 50 72 6f 62 61 62 6c | 79 20 49 20 73 68 6f 75 | Probabl|y I shou|
|00001560| 6c 64 20 75 73 65 20 61 | 0a 58 73 65 6c 66 2d 61 |ld use a|.Xself-a|
|00001570| 64 6a 75 73 74 69 6e 67 | 20 73 65 61 72 63 68 20 |djusting| search |
|00001580| 6f 72 64 65 72 3b 20 77 | 68 65 6e 20 61 20 70 72 |order; w|hen a pr|
|00001590| 6f 62 6c 65 6d 20 69 73 | 20 64 65 74 65 63 74 65 |oblem is| detecte|
|000015a0| 64 2c 20 74 68 65 20 70 | 72 6f 67 72 61 6d 20 73 |d, the p|rogram s|
|000015b0| 68 6f 75 6c 64 0a 58 6d | 6f 76 65 20 6e 65 61 72 |hould.Xm|ove near|
|000015c0| 62 79 20 63 65 6c 6c 73 | 20 63 6c 6f 73 65 72 20 |by cells| closer |
|000015d0| 74 6f 20 74 68 65 20 66 | 72 6f 6e 74 20 6f 66 20 |to the f|ront of |
|000015e0| 74 68 65 20 73 65 61 72 | 63 68 20 6c 69 73 74 2e |the sear|ch list.|
|000015f0| 20 20 4d 79 20 66 69 72 | 73 74 0a 58 69 6d 70 6c | My fir|st.Ximpl|
|00001600| 65 6d 65 6e 74 61 74 69 | 6f 6e 20 6f 66 20 74 68 |ementati|on of th|
|00001610| 69 73 20 61 63 74 75 61 | 6c 6c 79 20 6d 61 64 65 |is actua|lly made|
|00001620| 20 74 68 65 20 70 72 6f | 67 72 61 6d 20 73 6c 6f | the pro|gram slo|
|00001630| 77 65 72 2c 20 73 69 6e | 63 65 20 63 65 6c 6c 73 |wer, sin|ce cells|
|00001640| 20 77 68 69 63 68 0a 58 | 67 6f 74 20 6d 6f 76 65 | which.X|got move|
|00001650| 64 20 74 6f 20 74 68 65 | 20 66 72 6f 6e 74 20 6f |d to the| front o|
|00001660| 66 20 74 68 65 20 6c 69 | 73 74 20 73 74 61 79 65 |f the li|st staye|
|00001670| 64 20 6e 65 61 72 20 74 | 68 65 72 65 20 65 76 65 |d near t|here eve|
|00001680| 6e 20 77 68 65 6e 20 74 | 68 65 79 20 77 65 72 65 |n when t|hey were|
|00001690| 20 6e 6f 0a 58 6c 6f 6e | 67 65 72 20 61 20 70 72 | no.Xlon|ger a pr|
|000016a0| 6f 62 6c 65 6d 2e 20 20 | 49 20 68 61 76 65 20 61 |oblem. |I have a|
|000016b0| 6e 20 69 64 65 61 20 66 | 6f 72 20 61 20 62 65 74 |n idea f|or a bet|
|000016c0| 74 65 72 20 77 61 79 20 | 74 6f 20 64 6f 20 69 74 |ter way |to do it|
|000016d0| 2c 20 62 75 74 20 49 20 | 68 61 76 65 6e 27 74 0a |, but I |haven't.|
|000016e0| 58 68 61 64 20 74 69 6d | 65 20 74 6f 20 69 6d 70 |Xhad tim|e to imp|
|000016f0| 6c 65 6d 65 6e 74 20 69 | 74 20 79 65 74 2e 0a 58 |lement i|t yet..X|
|00001700| 0a 58 20 20 20 41 6e 6f | 74 68 65 72 20 74 68 69 |.X Ano|ther thi|
|00001710| 6e 67 20 49 27 6d 20 73 | 74 69 6c 6c 20 65 78 70 |ng I'm s|till exp|
|00001720| 65 72 69 6d 65 6e 74 69 | 6e 67 20 77 69 74 68 20 |erimenti|ng with |
|00001730| 69 73 20 68 6f 77 20 74 | 6f 20 64 65 63 69 64 65 |is how t|o decide|
|00001740| 20 77 68 65 74 68 65 72 | 20 74 6f 0a 58 74 75 72 | whether| to.Xtur|
|00001750| 6e 20 61 6e 20 75 6e 6b | 6e 6f 77 6e 20 63 65 6c |n an unk|nown cel|
|00001760| 6c 20 6f 6e 20 6f 72 20 | 6f 66 66 2e 20 20 49 66 |l on or |off. If|
|00001770| 20 49 27 6d 20 67 6f 69 | 6e 67 20 74 6f 20 6c 65 | I'm goi|ng to le|
|00001780| 74 20 74 68 65 20 73 65 | 61 72 63 68 20 72 75 6e |t the se|arch run|
|00001790| 20 74 6f 0a 58 63 6f 6d | 70 6c 65 74 69 6f 6e 20 | to.Xcom|pletion |
|000017a0| 69 74 20 64 6f 65 73 6e | 27 74 20 6d 61 74 74 65 |it doesn|'t matte|
|000017b0| 72 3b 20 62 6f 74 68 20 | 63 68 6f 69 63 65 73 20 |r; both |choices |
|000017c0| 77 69 6c 6c 20 62 65 20 | 74 72 69 65 64 20 65 76 |will be |tried ev|
|000017d0| 65 6e 74 75 61 6c 6c 79 | 2e 20 20 42 75 74 0a 58 |entually|. But.X|
|000017e0| 66 6f 72 20 69 6e 63 6f | 6d 70 6c 65 74 65 20 73 |for inco|mplete s|
|000017f0| 65 61 72 63 68 65 73 20 | 73 6f 6d 65 20 68 65 75 |earches |some heu|
|00001800| 72 69 73 74 69 63 73 20 | 6d 69 67 68 74 20 68 65 |ristics |might he|
|00001810| 6c 70 2e 20 20 55 73 75 | 61 6c 6c 79 20 49 20 63 |lp. Usu|ally I c|
|00001820| 68 6f 6f 73 65 20 27 6f | 66 66 27 0a 58 66 69 72 |hoose 'o|ff'.Xfir|
|00001830| 73 74 2c 20 69 6e 20 74 | 68 65 20 68 6f 70 65 20 |st, in t|he hope |
|00001840| 74 68 61 74 20 61 6e 20 | 6f 62 6a 65 63 74 20 6f |that an |object o|
|00001850| 66 20 73 6d 61 6c 6c 20 | 70 6f 70 75 6c 61 74 69 |f small |populati|
|00001860| 6f 6e 20 77 69 6c 6c 20 | 62 65 20 66 6f 75 6e 64 |on will |be found|
|00001870| 2e 0a 58 41 6e 6f 74 68 | 65 72 20 67 6f 6f 64 20 |..XAnoth|er good |
|00001880| 63 68 6f 69 63 65 20 69 | 73 20 74 6f 20 6d 61 6b |choice i|s to mak|
|00001890| 65 20 61 20 6c 6f 63 61 | 74 69 6f 6e 20 68 61 76 |e a loca|tion hav|
|000018a0| 65 20 74 68 65 20 73 61 | 6d 65 20 76 61 6c 75 65 |e the sa|me value|
|000018b0| 20 61 74 20 74 69 6d 65 | 20 74 20 61 73 0a 58 61 | at time| t as.Xa|
|000018c0| 74 20 6f 74 68 65 72 2c | 20 61 6c 72 65 61 64 79 |t other,| already|
|000018d0| 20 61 73 73 69 67 6e 65 | 64 2c 20 74 69 6d 65 73 | assigne|d, times|
|000018e0| 3b 20 74 68 69 73 20 74 | 65 6e 64 73 20 74 6f 20 |; this t|ends to |
|000018f0| 6c 65 61 64 20 74 6f 20 | 62 69 6c 6c 69 61 72 64 |lead to |billiard|
|00001900| 20 74 61 62 6c 65 73 2e | 0a 58 0a 58 20 20 20 54 | tables.|.X.X T|
|00001910| 68 65 20 70 72 6f 67 72 | 61 6d 20 69 73 20 6d 6f |he progr|am is mo|
|00001920| 73 74 20 65 66 66 65 63 | 74 69 76 65 20 77 68 65 |st effec|tive whe|
|00001930| 6e 20 74 68 65 20 70 65 | 72 69 6f 64 20 69 73 20 |n the pe|riod is |
|00001940| 73 6d 61 6c 6c 3b 20 74 | 68 65 20 66 6f 72 77 61 |small; t|he forwa|
|00001950| 72 64 20 61 6e 64 0a 58 | 62 61 63 6b 77 61 72 64 |rd and.X|backward|
|00001960| 20 63 6f 6e 63 6c 75 73 | 69 6f 6e 73 20 74 65 6e | conclus|ions ten|
|00001970| 64 20 74 6f 20 77 72 61 | 70 20 61 72 6f 75 6e 64 |d to wra|p around|
|00001980| 20 74 68 65 20 65 6e 64 | 73 20 6f 66 20 74 69 6d | the end|s of tim|
|00001990| 65 20 61 6e 64 20 6d 65 | 65 74 2c 20 6c 65 61 64 |e and me|et, lead|
|000019a0| 69 6e 67 0a 58 74 6f 20 | 6d 6f 72 65 20 63 6f 6e |ing.Xto |more con|
|000019b0| 63 6c 75 73 69 6f 6e 73 | 20 6f 72 20 63 6f 6e 74 |clusions| or cont|
|000019c0| 72 61 64 69 63 74 69 6f | 6e 73 2e 20 20 46 6f 72 |radictio|ns. For|
|000019d0| 20 6c 61 72 67 65 20 70 | 65 72 69 6f 64 73 2c 20 | large p|eriods, |
|000019e0| 74 68 61 74 20 64 6f 65 | 73 6e 27 74 0a 58 68 61 |that doe|sn't.Xha|
|000019f0| 70 70 65 6e 20 6d 75 63 | 68 2c 20 73 6f 20 74 68 |ppen muc|h, so th|
|00001a00| 65 20 70 72 6f 67 72 61 | 6d 20 64 6f 65 73 6e 27 |e progra|m doesn'|
|00001a10| 74 20 64 65 74 65 63 74 | 20 69 74 73 20 62 61 64 |t detect| its bad|
|00001a20| 20 63 68 6f 69 63 65 73 | 20 73 6f 6f 6e 20 65 6e | choices| soon en|
|00001a30| 6f 75 67 68 20 74 6f 0a | 58 61 63 63 6f 6d 70 6c |ough to.|Xaccompl|
|00001a40| 69 73 68 20 6d 75 63 68 | 2e 20 20 54 68 65 20 70 |ish much|. The p|
|00001a50| 35 20 66 75 6d 61 72 6f | 6c 65 20 61 6e 64 20 6f |5 fumaro|le and o|
|00001a60| 6e 65 20 6f 74 68 65 72 | 20 70 35 20 61 72 65 20 |ne other| p5 are |
|00001a70| 74 68 65 20 6f 6e 6c 79 | 20 74 68 69 6e 67 73 0a |the only| things.|
|00001a80| 58 49 27 76 65 20 66 6f | 75 6e 64 20 73 6f 20 66 |XI've fo|und so f|
|00001a90| 61 72 20 77 69 74 68 20 | 61 20 63 6f 6e 67 72 75 |ar with |a congru|
|00001aa0| 65 6e 63 65 20 70 65 72 | 69 6f 64 20 67 72 65 61 |ence per|iod grea|
|00001ab0| 74 65 72 20 74 68 61 6e | 20 34 2e 0a 58 2d 2d 2d |ter than| 4..X---|
|00001ac0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001ad0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001ae0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001af0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001b00| 2d 2d 2d 0a 58 0a 58 44 | 65 74 61 69 6c 65 64 20 |---.X.XD|etailed |
|00001b10| 64 65 73 63 72 69 70 74 | 69 6f 6e 20 6f 66 20 74 |descript|ion of t|
|00001b20| 68 65 20 4c 69 66 65 20 | 73 65 61 72 63 68 20 70 |he Life |search p|
|00001b30| 72 6f 67 72 61 6d 20 20 | 28 39 2f 32 34 2f 38 39 |rogram |(9/24/89|
|00001b40| 29 0a 58 0a 58 20 20 20 | 20 20 54 68 65 20 70 72 |).X.X | The pr|
|00001b50| 6f 67 72 61 6d 20 63 6f | 6e 73 69 73 74 73 20 6f |ogram co|nsists o|
|00001b60| 66 20 74 77 6f 20 70 61 | 72 74 73 2c 20 61 6e 20 |f two pa|rts, an |
|00001b70| 61 73 73 65 6d 62 6c 79 | 20 6c 61 6e 67 75 61 67 |assembly| languag|
|00001b80| 65 20 70 61 72 74 20 77 | 68 69 63 68 0a 58 64 6f |e part w|hich.Xdo|
|00001b90| 65 73 20 74 68 65 20 73 | 65 61 72 63 68 69 6e 67 |es the s|earching|
|00001ba0| 20 61 6e 64 20 61 20 42 | 41 53 49 43 20 70 72 6f | and a B|ASIC pro|
|00001bb0| 67 72 61 6d 20 77 68 69 | 63 68 20 68 61 6e 64 6c |gram whi|ch handl|
|00001bc0| 65 73 20 69 6e 69 74 69 | 61 6c 69 7a 61 74 69 6f |es initi|alizatio|
|00001bd0| 6e 2c 0a 58 69 6e 74 65 | 72 70 72 65 74 69 6e 67 |n,.Xinte|rpreting|
|00001be0| 20 63 6f 6d 6d 61 6e 64 | 73 20 66 72 6f 6d 20 74 | command|s from t|
|00001bf0| 68 65 20 75 73 65 72 2c | 20 61 6e 64 20 64 69 73 |he user,| and dis|
|00001c00| 70 6c 61 79 2e 20 20 49 | 27 6c 6c 20 74 61 6c 6b |play. I|'ll talk|
|00001c10| 20 6d 6f 73 74 6c 79 20 | 61 62 6f 75 74 0a 58 74 | mostly |about.Xt|
|00001c20| 68 65 20 61 73 73 65 6d | 62 6c 79 20 6c 61 6e 67 |he assem|bly lang|
|00001c30| 75 61 67 65 20 70 6f 72 | 74 69 6f 6e 2e 0a 58 0a |uage por|tion..X.|
|00001c40| 58 20 20 20 20 20 54 68 | 72 65 65 20 63 6f 6e 73 |X Th|ree cons|
|00001c50| 74 61 6e 74 73 20 64 65 | 73 63 72 69 62 65 20 74 |tants de|scribe t|
|00001c60| 68 65 20 73 69 7a 65 20 | 6f 66 20 74 68 65 20 73 |he size |of the s|
|00001c70| 70 61 63 65 20 62 65 69 | 6e 67 20 73 65 61 72 63 |pace bei|ng searc|
|00001c80| 68 65 64 3a 0a 58 0a 58 | 20 20 20 20 20 20 20 20 |hed:.X.X| |
|00001c90| 20 20 54 50 20 3d 20 74 | 69 6d 65 20 70 65 72 69 | TP = t|ime peri|
|00001ca0| 6f 64 2c 20 6c 65 6e 67 | 74 68 20 6f 66 20 74 69 |od, leng|th of ti|
|00001cb0| 6d 65 20 75 6e 74 69 6c | 20 70 61 74 74 65 72 6e |me until| pattern|
|00001cc0| 20 69 73 20 74 6f 20 72 | 65 61 70 70 65 61 72 3b | is to r|eappear;|
|00001cd0| 0a 58 20 20 20 20 20 20 | 20 20 20 20 58 4d 20 3d |.X | XM =|
|00001ce0| 20 77 69 64 74 68 20 6f | 66 20 72 65 63 74 61 6e | width o|f rectan|
|00001cf0| 67 6c 65 20 74 6f 20 62 | 65 20 73 65 61 72 63 68 |gle to b|e search|
|00001d00| 65 64 3b 0a 58 20 20 20 | 20 20 20 20 20 20 20 59 |ed;.X | Y|
|00001d10| 4d 20 3d 20 68 65 69 67 | 68 74 20 6f 66 20 72 65 |M = heig|ht of re|
|00001d20| 63 74 61 6e 67 6c 65 20 | 74 6f 20 62 65 20 73 65 |ctangle |to be se|
|00001d30| 61 72 63 68 65 64 2e 0a | 58 0a 58 54 68 65 20 73 |arched..|X.XThe s|
|00001d40| 65 74 20 6f 66 20 70 61 | 69 72 73 20 28 58 2c 59 |et of pa|irs (X,Y|
|00001d50| 29 20 77 69 74 68 20 30 | 3c 3d 58 3c 58 4d 20 61 |) with 0|<=X<XM a|
|00001d60| 6e 64 20 30 3c 3d 59 3c | 59 4d 20 77 69 6c 6c 20 |nd 0<=Y<|YM will |
|00001d70| 62 65 20 63 61 6c 6c 65 | 64 20 22 74 68 65 0a 58 |be calle|d "the.X|
|00001d80| 72 65 63 74 61 6e 67 6c | 65 22 2e 0a 58 0a 58 20 |rectangl|e"..X.X |
|00001d90| 20 20 20 20 54 68 65 72 | 65 20 61 72 65 20 31 32 | Ther|e are 12|
|00001da0| 20 63 6f 6e 73 74 61 6e | 74 73 20 77 68 69 63 68 | constan|ts which|
|00001db0| 20 64 65 73 63 72 69 62 | 65 20 68 6f 77 20 67 65 | describ|e how ge|
|00001dc0| 6e 65 72 61 74 69 6f 6e | 20 30 20 69 73 20 72 65 |neration| 0 is re|
|00001dd0| 6c 61 74 65 64 20 74 6f | 0a 58 67 65 6e 65 72 61 |lated to|.Xgenera|
|00001de0| 74 69 6f 6e 20 54 50 3a | 20 20 41 2c 20 42 2c 20 |tion TP:| A, B, |
|00001df0| 43 2c 20 44 2c 20 45 2c | 20 46 2c 20 41 27 2c 20 |C, D, E,| F, A', |
|00001e00| 42 27 2c 20 43 27 2c 20 | 44 27 2c 20 45 27 2c 20 |B', C', |D', E', |
|00001e10| 46 27 2e 20 20 54 68 65 | 20 63 65 6c 6c 20 77 69 |F'. The| cell wi|
|00001e20| 74 68 0a 58 63 6f 6f 72 | 64 69 6e 61 74 65 73 20 |th.Xcoor|dinates |
|00001e30| 28 58 2c 20 59 29 20 69 | 6e 20 67 65 6e 65 72 61 |(X, Y) i|n genera|
|00001e40| 74 69 6f 6e 20 30 20 69 | 73 20 6d 61 70 70 65 64 |tion 0 i|s mapped|
|00001e50| 20 74 6f 20 74 68 65 20 | 63 65 6c 6c 20 77 69 74 | to the |cell wit|
|00001e60| 68 20 63 6f 6f 72 64 69 | 6e 61 74 65 73 0a 58 28 |h coordi|nates.X(|
|00001e70| 41 58 2b 42 59 2b 43 2c | 20 44 58 2b 45 59 2b 46 |AX+BY+C,| DX+EY+F|
|00001e80| 29 20 69 6e 20 67 65 6e | 65 72 61 74 69 6f 6e 20 |) in gen|eration |
|00001e90| 54 50 2e 20 20 54 68 65 | 20 63 65 6c 6c 20 77 69 |TP. The| cell wi|
|00001ea0| 74 68 20 63 6f 6f 72 64 | 69 6e 61 74 65 73 20 28 |th coord|inates (|
|00001eb0| 58 2c 20 59 29 20 69 6e | 0a 58 67 65 6e 65 72 61 |X, Y) in|.Xgenera|
|00001ec0| 74 69 6f 6e 20 54 50 20 | 69 73 20 6d 61 70 70 65 |tion TP |is mappe|
|00001ed0| 64 20 74 6f 20 74 68 65 | 20 63 65 6c 6c 20 28 41 |d to the| cell (A|
|00001ee0| 27 58 2b 42 27 59 2b 43 | 27 2c 20 44 27 58 2b 45 |'X+B'Y+C|', D'X+E|
|00001ef0| 27 59 2b 46 27 29 20 69 | 6e 20 67 65 6e 65 72 61 |'Y+F') i|n genera|
|00001f00| 74 69 6f 6e 0a 58 30 2e | 20 20 54 68 65 20 76 61 |tion.X0.| The va|
|00001f10| 6c 75 65 73 20 6f 66 20 | 41 20 74 68 72 75 20 46 |lues of |A thru F|
|00001f20| 20 61 72 65 20 73 70 65 | 63 69 66 69 65 64 20 62 | are spe|cified b|
|00001f30| 79 20 74 68 65 20 75 73 | 65 72 3b 20 74 68 65 20 |y the us|er; the |
|00001f40| 6f 74 68 65 72 73 20 61 | 72 65 20 67 69 76 65 6e |others a|re given|
|00001f50| 0a 58 62 79 3a 0a 58 20 | 20 20 20 41 27 20 3d 20 |.Xby:.X | A' = |
|00001f60| 20 45 2f 5a 2c 20 20 20 | 42 27 20 3d 20 2d 42 2f | E/Z, |B' = -B/|
|00001f70| 5a 2c 20 20 20 43 27 20 | 3d 20 28 42 46 2d 43 45 |Z, C' |= (BF-CE|
|00001f80| 29 2f 5a 2c 0a 58 20 20 | 20 20 44 27 20 3d 20 2d |)/Z,.X | D' = -|
|00001f90| 44 2f 5a 2c 20 20 20 45 | 27 20 3d 20 20 41 2f 5a |D/Z, E|' = A/Z|
|00001fa0| 2c 20 20 20 46 27 20 3d | 20 28 43 44 2d 41 46 29 |, F' =| (CD-AF)|
|00001fb0| 2f 5a 2c 0a 58 77 68 65 | 72 65 20 20 20 5a 20 3d |/Z,.Xwhe|re Z =|
|00001fc0| 20 41 45 2d 42 44 20 3d | 20 31 20 6f 72 20 2d 31 | AE-BD =| 1 or -1|
|00001fd0| 2e 20 20 54 68 65 20 6d | 61 70 70 69 6e 67 73 20 |. The m|appings |
|00001fe0| 61 72 65 20 73 75 70 70 | 6f 73 65 64 20 74 6f 20 |are supp|osed to |
|00001ff0| 62 65 20 69 73 6f 6d 65 | 74 72 69 65 73 2c 0a 58 |be isome|tries,.X|
|00002000| 6e 6f 74 20 67 65 6e 65 | 72 61 6c 20 69 6e 76 65 |not gene|ral inve|
|00002010| 72 74 69 62 6c 65 20 6c | 69 6e 65 61 72 20 6d 61 |rtible l|inear ma|
|00002020| 70 73 2c 20 73 6f 20 74 | 68 65 72 65 20 61 72 65 |ps, so t|here are|
|00002030| 20 73 65 76 65 72 65 20 | 72 65 73 74 72 69 63 74 | severe |restrict|
|00002040| 69 6f 6e 73 20 6f 6e 20 | 41 2c 0a 58 42 2c 20 44 |ions on |A,.XB, D|
|00002050| 2c 20 61 6e 64 20 45 20 | 77 68 69 63 68 20 49 20 |, and E |which I |
|00002060| 77 6f 6e 27 74 20 62 6f | 74 68 65 72 20 74 6f 20 |won't bo|ther to |
|00002070| 77 72 69 74 65 20 64 6f | 77 6e 2e 20 20 28 54 68 |write do|wn. (Th|
|00002080| 65 72 65 20 69 73 20 61 | 6c 73 6f 20 61 20 62 6f |ere is a|lso a bo|
|00002090| 6f 6c 65 61 6e 0a 58 76 | 61 72 69 61 62 6c 65 2c |olean.Xv|ariable,|
|000020a0| 20 55 53 45 4d 41 50 2c | 20 77 68 69 63 68 20 69 | USEMAP,| which i|
|000020b0| 73 20 6e 6f 72 6d 61 6c | 6c 79 20 74 72 75 65 2e |s normal|ly true.|
|000020c0| 20 20 49 66 20 69 74 20 | 69 73 20 66 61 6c 73 65 | If it |is false|
|000020d0| 2c 20 74 68 65 6e 20 74 | 68 65 0a 58 6d 61 70 70 |, then t|he.Xmapp|
|000020e0| 69 6e 67 73 20 61 72 65 | 20 69 67 6e 6f 72 65 64 |ings are| ignored|
|000020f0| 2c 20 73 6f 20 74 68 65 | 20 70 72 6f 67 72 61 6d |, so the| program|
|00002100| 20 63 61 6e 20 62 65 20 | 75 73 65 64 20 74 6f 20 | can be |used to |
|00002110| 73 65 61 72 63 68 20 66 | 6f 72 20 70 72 65 64 65 |search f|or prede|
|00002120| 63 65 73 73 6f 72 73 0a | 58 6f 66 20 77 68 61 74 |cessors.|Xof what|
|00002130| 65 76 65 72 20 74 68 65 | 20 75 73 65 72 20 70 75 |ever the| user pu|
|00002140| 74 73 20 69 6e 20 67 65 | 6e 65 72 61 74 69 6f 6e |ts in ge|neration|
|00002150| 20 54 50 2e 29 0a 58 0a | 58 20 20 20 20 20 54 68 | TP.).X.|X Th|
|00002160| 65 20 63 75 72 72 65 6e | 74 20 69 6e 66 6f 72 6d |e curren|t inform|
|00002170| 61 74 69 6f 6e 20 61 62 | 6f 75 74 20 67 65 6e 65 |ation ab|out gene|
|00002180| 72 61 74 69 6f 6e 73 20 | 30 20 74 6f 20 54 50 20 |rations |0 to TP |
|00002190| 69 73 20 6b 65 70 74 20 | 69 6e 20 61 20 33 0a 58 |is kept |in a 3.X|
|000021a0| 64 69 6d 65 6e 73 69 6f | 6e 61 6c 20 61 72 72 61 |dimensio|nal arra|
|000021b0| 79 20 43 45 4c 4c 2c 20 | 77 69 74 68 20 64 69 6d |y CELL, |with dim|
|000021c0| 65 6e 73 69 6f 6e 73 20 | 30 20 74 6f 20 54 50 2c |ensions |0 to TP,|
|000021d0| 20 30 20 74 6f 20 58 4d | 2d 31 2c 20 61 6e 64 20 | 0 to XM|-1, and |
|000021e0| 30 20 74 6f 20 59 4d 2d | 31 2e 0a 58 45 61 63 68 |0 to YM-|1..XEach|
|000021f0| 20 65 6e 74 72 79 20 63 | 61 6e 20 68 61 76 65 20 | entry c|an have |
|00002200| 6f 6e 65 20 6f 66 20 33 | 20 76 61 6c 75 65 73 2c |one of 3| values,|
|00002210| 20 30 3d 6f 66 66 2c 20 | 31 3d 6f 6e 2c 20 6f 72 | 0=off, |1=on, or|
|00002220| 20 55 4e 4b 3d 75 6e 6b | 6e 6f 77 6e 2e 20 20 28 | UNK=unk|nown. (|
|00002230| 49 20 75 73 65 20 61 0a | 58 77 68 6f 6c 65 20 62 |I use a.|Xwhole b|
|00002240| 79 74 65 20 66 6f 72 20 | 65 61 63 68 20 65 6e 74 |yte for |each ent|
|00002250| 72 79 2c 20 77 69 74 68 | 20 55 4e 4b 3d 24 31 30 |ry, with| UNK=$10|
|00002260| 2e 20 20 28 48 65 72 65 | 20 61 6e 64 20 6c 61 74 |. (Here| and lat|
|00002270| 65 72 2c 20 61 20 64 6f | 6c 6c 61 72 20 73 69 67 |er, a do|llar sig|
|00002280| 6e 0a 58 69 6e 64 69 63 | 61 74 65 73 20 74 68 61 |n.Xindic|ates tha|
|00002290| 74 20 61 20 6e 75 6d 62 | 65 72 20 69 73 20 69 6e |t a numb|er is in|
|000022a0| 20 62 61 73 65 20 31 36 | 2e 29 20 20 54 68 69 73 | base 16|.) This|
|000022b0| 20 6d 61 6b 65 73 20 74 | 68 65 20 63 6f 6d 70 75 | makes t|he compu|
|000022c0| 74 61 74 69 6f 6e 20 6f | 66 20 74 68 65 0a 58 6e |tation o|f the.Xn|
|000022d0| 65 69 67 68 62 6f 72 68 | 6f 6f 64 20 65 61 73 79 |eighborh|ood easy|
|000022e0| 3a 20 6a 75 73 74 20 61 | 64 64 20 74 68 65 20 76 |: just a|dd the v|
|000022f0| 61 6c 75 65 73 20 6f 66 | 20 74 68 65 20 38 20 6e |alues of| the 8 n|
|00002300| 65 69 67 68 62 6f 72 73 | 3b 20 74 68 65 20 68 69 |eighbors|; the hi|
|00002310| 67 68 20 6e 79 62 62 6c | 65 0a 58 69 73 20 74 68 |gh nybbl|e.Xis th|
|00002320| 65 20 6e 75 6d 62 65 72 | 20 6f 66 20 75 6e 6b 6e |e number| of unkn|
|00002330| 6f 77 6e 20 6e 65 69 67 | 68 62 6f 72 73 2c 20 61 |own neig|hbors, a|
|00002340| 6e 64 20 74 68 65 20 6c | 6f 77 20 6e 79 62 62 6c |nd the l|ow nybbl|
|00002350| 65 20 69 73 20 74 68 65 | 20 6e 75 6d 62 65 72 20 |e is the| number |
|00002360| 77 68 69 63 68 0a 58 61 | 72 65 20 6f 6e 2e 29 20 |which.Xa|re on.) |
|00002370| 49 6e 69 74 69 61 6c 6c | 79 20 74 68 65 20 65 64 |Initiall|y the ed|
|00002380| 67 65 73 20 28 61 6c 6c | 20 65 6c 65 6d 65 6e 74 |ges (all| element|
|00002390| 73 20 77 69 74 68 20 58 | 3d 30 20 6f 72 20 58 4d |s with X|=0 or XM|
|000023a0| 2d 31 20 6f 72 20 59 3d | 30 20 6f 72 20 59 4d 2d |-1 or Y=|0 or YM-|
|000023b0| 31 29 0a 58 61 72 65 20 | 74 75 72 6e 65 64 20 6f |1).Xare |turned o|
|000023c0| 66 66 2c 20 61 73 20 61 | 72 65 20 74 68 65 20 63 |ff, as a|re the c|
|000023d0| 65 6c 6c 73 20 69 6e 20 | 67 65 6e 65 72 61 74 69 |ells in |generati|
|000023e0| 6f 6e 20 30 20 77 68 69 | 63 68 20 6d 61 70 20 6f |on 0 whi|ch map o|
|000023f0| 75 74 73 69 64 65 20 74 | 68 65 0a 58 72 65 63 74 |utside t|he.Xrect|
|00002400| 61 6e 67 6c 65 20 69 6e | 20 67 65 6e 65 72 61 74 |angle in| generat|
|00002410| 69 6f 6e 20 54 50 20 61 | 6e 64 20 76 69 63 65 20 |ion TP a|nd vice |
|00002420| 76 65 72 73 61 3b 20 65 | 76 65 72 79 74 68 69 6e |versa; e|verythin|
|00002430| 67 20 65 6c 73 65 20 69 | 73 20 69 6e 69 74 69 61 |g else i|s initia|
|00002440| 6c 6c 79 0a 58 75 6e 6b | 6e 6f 77 6e 2e 20 20 41 |lly.Xunk|nown. A|
|00002450| 66 74 65 72 20 74 68 69 | 73 20 69 6e 69 74 69 61 |fter thi|s initia|
|00002460| 6c 69 7a 61 74 69 6f 6e | 2c 20 73 6f 6d 65 20 75 |lization|, some u|
|00002470| 73 65 72 2d 73 70 65 63 | 69 66 69 65 64 20 63 65 |ser-spec|ified ce|
|00002480| 6c 6c 73 20 6d 61 79 20 | 62 65 0a 58 74 75 72 6e |lls may |be.Xturn|
|00002490| 65 64 20 6f 6e 20 6f 72 | 20 6f 66 66 2c 20 62 79 |ed on or| off, by|
|000024a0| 20 63 61 6c 6c 69 6e 67 | 20 50 52 4f 43 45 45 44 | calling| PROCEED|
|000024b0| 20 28 64 65 73 63 72 69 | 62 65 64 20 6c 61 74 65 | (descri|bed late|
|000024c0| 72 29 2e 0a 58 0a 58 20 | 20 20 20 20 49 6e 20 61 |r)..X.X | In a|
|000024d0| 64 64 69 74 69 6f 6e 20 | 74 6f 20 43 45 4c 4c 2c |ddition |to CELL,|
|000024e0| 20 6f 6e 65 20 6f 74 68 | 65 72 20 6c 61 72 67 65 | one oth|er large|
|000024f0| 20 61 72 72 61 79 20 69 | 73 20 75 73 65 64 2c 20 | array i|s used, |
|00002500| 74 68 65 20 73 65 74 74 | 69 6e 67 20 6c 69 73 74 |the sett|ing list|
|00002510| 2e 0a 58 54 68 69 73 20 | 69 73 20 61 20 6c 69 73 |..XThis |is a lis|
|00002520| 74 20 6f 66 20 71 75 69 | 6e 74 75 70 6c 65 73 20 |t of qui|ntuples |
|00002530| 28 54 2c 20 58 2c 20 59 | 2c 20 56 41 4c 55 45 2c |(T, X, Y|, VALUE,|
|00002540| 20 46 52 45 45 29 20 77 | 68 65 72 65 20 30 3c 3d | FREE) w|here 0<=|
|00002550| 54 3d 54 50 2c 20 30 3c | 3d 58 3c 58 4d 2c 0a 58 |T=TP, 0<|=X<XM,.X|
|00002560| 30 3c 3d 59 3c 59 4d 2c | 20 56 41 4c 55 45 3d 30 |0<=Y<YM,| VALUE=0|
|00002570| 20 6f 72 20 31 2c 20 61 | 6e 64 20 46 52 45 45 3d | or 1, a|nd FREE=|
|00002580| 74 72 75 65 20 6f 72 20 | 66 61 6c 73 65 2e 20 20 |true or |false. |
|00002590| 57 68 65 6e 65 76 65 72 | 20 61 6e 20 65 6c 65 6d |Whenever| an elem|
|000025a0| 65 6e 74 20 6f 66 20 43 | 45 4c 4c 0a 58 69 73 20 |ent of C|ELL.Xis |
|000025b0| 63 68 61 6e 67 65 64 20 | 66 72 6f 6d 20 55 4e 4b |changed |from UNK|
|000025c0| 20 74 6f 20 30 20 6f 72 | 20 31 2c 20 61 6e 20 65 | to 0 or| 1, an e|
|000025d0| 6e 74 72 79 20 69 73 20 | 61 64 64 65 64 20 74 6f |ntry is |added to|
|000025e0| 20 74 68 65 20 6c 69 73 | 74 2e 20 20 46 52 45 45 | the lis|t. FREE|
|000025f0| 20 69 73 20 74 72 75 65 | 0a 58 69 66 20 74 68 65 | is true|.Xif the|
|00002600| 20 63 68 61 6e 67 65 20 | 69 73 20 61 20 66 72 65 | change |is a fre|
|00002610| 65 20 63 68 6f 69 63 65 | 2c 20 66 61 6c 73 65 20 |e choice|, false |
|00002620| 69 66 20 69 74 27 73 20 | 66 6f 72 63 65 64 20 62 |if it's |forced b|
|00002630| 79 20 73 6f 6d 65 20 70 | 72 65 76 69 6f 75 73 0a |y some p|revious.|
|00002640| 58 63 68 6f 69 63 65 2e | 20 20 54 68 65 72 65 20 |Xchoice.| There |
|00002650| 61 72 65 20 33 20 70 6f | 69 6e 74 65 72 73 20 69 |are 3 po|inters i|
|00002660| 6e 74 6f 20 74 68 65 20 | 6c 69 73 74 3a 0a 58 20 |nto the |list:.X |
|00002670| 20 20 20 20 20 20 20 20 | 20 53 54 4e 47 20 20 20 | | STNG |
|00002680| 70 6f 69 6e 74 73 20 74 | 6f 20 74 68 65 20 62 65 |points t|o the be|
|00002690| 67 69 6e 6e 69 6e 67 3b | 0a 58 20 20 20 20 20 20 |ginning;|.X |
|000026a0| 20 20 20 20 4e 57 53 54 | 4e 47 20 70 6f 69 6e 74 | NWST|NG point|
|000026b0| 73 20 74 6f 20 74 68 65 | 20 65 6e 64 3b 20 6e 65 |s to the| end; ne|
|000026c0| 77 20 65 6e 74 72 69 65 | 73 20 61 72 65 20 70 75 |w entrie|s are pu|
|000026d0| 74 20 68 65 72 65 3b 0a | 58 20 20 20 20 20 20 20 |t here;.|X |
|000026e0| 20 20 20 4e 58 53 54 4e | 47 20 70 6f 69 6e 74 73 | NXSTN|G points|
|000026f0| 20 74 6f 20 74 68 65 20 | 6e 65 78 74 20 73 65 74 | to the |next set|
|00002700| 74 69 6e 67 20 77 68 6f | 73 65 20 63 6f 6e 73 65 |ting who|se conse|
|00002710| 71 75 65 6e 63 65 73 20 | 61 72 65 20 74 6f 0a 58 |quences |are to.X|
|00002720| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002730| 20 62 65 20 65 78 61 6d | 69 6e 65 64 2e 0a 58 0a | be exam|ined..X.|
|00002740| 58 20 20 20 20 20 54 68 | 65 72 65 20 61 72 65 20 |X Th|ere are |
|00002750| 61 6c 73 6f 20 74 77 6f | 20 74 61 62 6c 65 73 20 |also two| tables |
|00002760| 77 68 69 63 68 20 61 72 | 65 20 75 73 65 64 20 74 |which ar|e used t|
|00002770| 6f 20 64 65 73 63 72 69 | 62 65 20 74 68 65 20 4c |o descri|be the L|
|00002780| 69 66 65 0a 58 74 72 61 | 6e 73 69 74 69 6f 6e 20 |ife.Xtra|nsition |
|00002790| 72 75 6c 65 73 2e 20 20 | 43 6f 6e 63 65 70 74 75 |rules. |Conceptu|
|000027a0| 61 6c 6c 79 2c 20 61 6e | 20 69 6e 64 65 78 20 69 |ally, an| index i|
|000027b0| 6e 74 6f 20 65 69 74 68 | 65 72 20 74 61 62 6c 65 |nto eith|er table|
|000027c0| 20 63 6f 6e 73 69 73 74 | 73 20 6f 66 20 61 0a 58 | consist|s of a.X|
|000027d0| 63 65 6c 6c 20 76 61 6c | 75 65 20 28 30 2c 20 31 |cell val|ue (0, 1|
|000027e0| 2c 20 6f 72 20 55 4e 4b | 29 20 61 6e 64 20 33 20 |, or UNK|) and 3 |
|000027f0| 6e 75 6d 62 65 72 73 20 | 77 68 69 63 68 20 61 64 |numbers |which ad|
|00002800| 64 20 75 70 20 74 6f 20 | 38 2c 20 74 65 6c 6c 69 |d up to |8, telli|
|00002810| 6e 67 20 68 6f 77 20 6d | 61 6e 79 0a 58 6e 65 69 |ng how m|any.Xnei|
|00002820| 67 68 62 6f 72 73 20 61 | 72 65 20 30 2c 20 31 2c |ghbors a|re 0, 1,|
|00002830| 20 61 6e 64 20 55 4e 4b | 3b 20 74 68 65 72 65 20 | and UNK|; there |
|00002840| 61 72 65 20 31 33 35 20 | 28 3d 33 2a 34 35 29 20 |are 135 |(=3*45) |
|00002850| 70 6f 73 73 69 62 6c 65 | 20 69 6e 64 69 63 65 73 |possible| indices|
|00002860| 2e 20 20 49 6e 0a 58 70 | 72 61 63 74 69 63 65 2c |. In.Xp|ractice,|
|00002870| 20 49 20 75 73 65 20 61 | 20 6f 6e 65 20 62 79 74 | I use a| one byt|
|00002880| 65 20 27 6e 65 69 67 68 | 62 6f 72 68 6f 6f 64 20 |e 'neigh|borhood |
|00002890| 64 65 73 63 72 69 70 74 | 6f 72 27 20 74 6f 20 65 |descript|or' to e|
|000028a0| 6e 63 6f 64 65 20 74 68 | 69 73 2c 20 73 6f 0a 58 |ncode th|is, so.X|
|000028b0| 65 61 63 68 20 74 61 62 | 6c 65 20 69 73 20 32 35 |each tab|le is 25|
|000028c0| 36 20 62 79 74 65 73 20 | 6c 6f 6e 67 2c 20 62 75 |6 bytes |long, bu|
|000028d0| 74 20 6f 6e 6c 79 20 70 | 61 72 74 69 61 6c 6c 79 |t only p|artially|
|000028e0| 20 75 73 65 64 2e 20 20 | 54 6f 20 63 6f 6d 70 75 | used. |To compu|
|000028f0| 74 65 20 74 68 65 0a 58 | 6e 65 69 67 68 62 6f 72 |te the.X|neighbor|
|00002900| 68 6f 6f 64 20 64 65 73 | 63 72 69 70 74 6f 72 20 |hood des|criptor |
|00002910| 6f 66 20 61 20 63 65 6c | 6c 2c 20 61 64 64 20 75 |of a cel|l, add u|
|00002920| 70 20 74 68 65 20 38 20 | 6e 65 69 67 68 62 6f 72 |p the 8 |neighbor|
|00002930| 73 2e 20 20 49 66 20 74 | 68 65 20 41 4e 44 20 6f |s. If t|he AND o|
|00002940| 66 0a 58 74 68 65 20 73 | 75 6d 20 61 6e 64 20 24 |f.Xthe s|um and $|
|00002950| 38 38 20 69 73 20 7a 65 | 72 6f 2c 20 74 68 65 6e |88 is ze|ro, then|
|00002960| 20 74 68 65 20 6e 65 69 | 67 68 62 6f 72 68 6f 6f | the nei|ghborhoo|
|00002970| 64 20 64 65 73 63 72 69 | 70 74 6f 72 20 69 73 20 |d descri|ptor is |
|00002980| 74 77 69 63 65 20 74 68 | 65 20 73 75 6d 0a 58 70 |twice th|e sum.Xp|
|00002990| 6c 75 73 20 74 68 65 20 | 63 65 6c 6c 2e 20 20 49 |lus the |cell. I|
|000029a0| 66 20 74 68 65 20 41 4e | 44 20 69 73 20 6e 6f 6e |f the AN|D is non|
|000029b0| 7a 65 72 6f 2c 20 74 68 | 65 20 64 65 73 63 72 69 |zero, th|e descri|
|000029c0| 70 74 6f 72 20 69 73 20 | 74 68 65 20 73 75 6d 20 |ptor is |the sum |
|000029d0| 70 6c 75 73 20 74 77 69 | 63 65 0a 58 74 68 65 20 |plus twi|ce.Xthe |
|000029e0| 63 65 6c 6c 20 70 6c 75 | 73 20 24 31 31 2e 0a 58 |cell plu|s $11..X|
|000029f0| 0a 58 20 20 20 20 20 54 | 68 65 20 66 69 72 73 74 |.X T|he first|
|00002a00| 20 74 61 62 6c 65 20 69 | 73 20 63 61 6c 6c 65 64 | table i|s called|
|00002a10| 20 54 52 41 4e 53 49 54 | 20 61 6e 64 20 74 65 6c | TRANSIT| and tel|
|00002a20| 6c 73 20 77 68 61 74 20 | 74 68 65 20 63 65 6c 6c |ls what |the cell|
|00002a30| 20 73 68 6f 75 6c 64 20 | 62 65 20 69 6e 0a 58 74 | should |be in.Xt|
|00002a40| 68 65 20 6e 65 78 74 20 | 67 65 6e 65 72 61 74 69 |he next |generati|
|00002a50| 6f 6e 2e 20 20 45 2e 67 | 2e 20 6e 65 69 67 68 62 |on. E.g|. neighb|
|00002a60| 6f 72 68 6f 6f 64 20 64 | 65 73 63 72 69 70 74 6f |orhood d|escripto|
|00002a70| 72 20 24 32 35 20 6d 65 | 61 6e 73 20 74 68 61 74 |r $25 me|ans that|
|00002a80| 20 74 68 65 0a 58 63 65 | 6c 6c 20 69 73 20 31 2c | the.Xce|ll is 1,|
|00002a90| 20 35 20 6f 66 20 69 74 | 73 20 6e 65 69 67 68 62 | 5 of it|s neighb|
|00002aa0| 6f 72 73 20 61 72 65 20 | 30 2c 20 32 20 61 72 65 |ors are |0, 2 are|
|00002ab0| 20 31 2c 20 61 6e 64 20 | 31 20 69 73 20 75 6e 6b | 1, and |1 is unk|
|00002ac0| 6e 6f 77 6e 2c 0a 58 54 | 52 41 4e 53 49 54 5b 24 |nown,.XT|RANSIT[$|
|00002ad0| 32 35 5d 20 3d 20 31 2e | 20 20 4f 66 20 63 6f 75 |25] = 1.| Of cou|
|00002ae0| 72 73 65 2c 20 6d 6f 73 | 74 20 65 6e 74 72 69 65 |rse, mos|t entrie|
|00002af0| 73 20 69 6e 20 54 52 41 | 4e 53 49 54 20 61 72 65 |s in TRA|NSIT are|
|00002b00| 20 55 4e 4b 2c 20 37 33 | 20 74 6f 20 62 65 0a 58 | UNK, 73| to be.X|
|00002b10| 65 78 61 63 74 2e 20 20 | 28 41 6e 64 20 35 37 20 |exact. |(And 57 |
|00002b20| 61 72 65 20 30 20 61 6e | 64 20 35 20 61 72 65 20 |are 0 an|d 5 are |
|00002b30| 31 2e 29 0a 58 0a 58 20 | 20 20 20 20 54 68 65 20 |1.).X.X | The |
|00002b40| 73 65 63 6f 6e 64 20 74 | 61 62 6c 65 20 69 73 20 |second t|able is |
|00002b50| 63 61 6c 6c 65 64 20 49 | 4d 50 4c 49 43 20 61 6e |called I|MPLIC an|
|00002b60| 64 20 63 6f 6e 74 61 69 | 6e 73 20 69 6e 66 6f 72 |d contai|ns infor|
|00002b70| 6d 61 74 69 6f 6e 20 61 | 62 6f 75 74 0a 58 69 6d |mation a|bout.Xim|
|00002b80| 70 6c 69 63 61 74 69 6f | 6e 73 20 69 6e 20 74 68 |plicatio|ns in th|
|00002b90| 65 20 6f 74 68 65 72 20 | 64 69 72 65 63 74 69 6f |e other |directio|
|00002ba0| 6e 2e 20 20 49 66 20 77 | 65 20 6b 6e 6f 77 20 74 |n. If w|e know t|
|00002bb0| 68 65 20 6e 65 69 67 68 | 62 6f 72 68 6f 6f 64 0a |he neigh|borhood.|
|00002bc0| 58 64 65 73 63 72 69 70 | 74 6f 72 20 61 6e 64 20 |Xdescrip|tor and |
|00002bd0| 74 68 65 20 76 61 6c 75 | 65 20 6f 66 20 74 68 65 |the valu|e of the|
|00002be0| 20 63 65 6c 6c 20 69 6e | 20 74 68 65 20 6e 65 78 | cell in| the nex|
|00002bf0| 74 20 67 65 6e 65 72 61 | 74 69 6f 6e 2c 20 77 65 |t genera|tion, we|
|00002c00| 20 6d 61 79 20 62 65 20 | 61 62 6c 65 0a 58 74 6f | may be |able.Xto|
|00002c10| 20 63 6f 6e 63 6c 75 64 | 65 20 74 68 61 74 20 73 | conclud|e that s|
|00002c20| 6f 6d 65 20 75 6e 6b 6e | 6f 77 6e 20 63 65 6c 6c |ome unkn|own cell|
|00002c30| 73 20 69 6e 20 74 68 69 | 73 20 67 65 6e 65 72 61 |s in thi|s genera|
|00002c40| 74 69 6f 6e 20 6d 75 73 | 74 20 62 65 20 30 20 6f |tion mus|t be 0 o|
|00002c50| 72 20 31 2e 0a 58 53 75 | 63 68 20 63 6f 6e 63 6c |r 1..XSu|ch concl|
|00002c60| 75 73 69 6f 6e 73 20 65 | 78 69 73 74 20 6f 6e 6c |usions e|xist onl|
|00002c70| 79 20 69 66 20 74 68 65 | 20 63 6f 72 72 65 73 70 |y if the| corresp|
|00002c80| 6f 6e 64 69 6e 67 20 65 | 6e 74 72 79 20 69 73 20 |onding e|ntry is |
|00002c90| 55 4e 4b 2c 20 73 6f 20 | 74 68 65 72 65 20 61 72 |UNK, so |there ar|
|00002ca0| 65 0a 58 6f 6e 6c 79 20 | 37 33 20 65 6e 74 72 69 |e.Xonly |73 entri|
|00002cb0| 65 73 20 69 6e 20 49 4d | 50 4c 49 43 2e 20 20 20 |es in IM|PLIC. |
|00002cc0| 54 68 65 72 65 20 61 72 | 65 20 38 20 70 6f 73 73 |There ar|e 8 poss|
|00002cd0| 69 62 6c 65 20 69 6d 70 | 6c 69 63 61 74 69 6f 6e |ible imp|lication|
|00002ce0| 73 2c 20 65 61 63 68 20 | 69 73 0a 58 67 69 76 65 |s, each |is.Xgive|
|00002cf0| 6e 20 62 79 20 6f 6e 65 | 20 62 69 74 20 69 6e 20 |n by one| bit in |
|00002d00| 74 68 65 20 49 4d 50 4c | 49 43 20 65 6e 74 72 79 |the IMPL|IC entry|
|00002d10| 3a 0a 58 0a 58 20 20 20 | 20 20 42 69 74 20 20 20 |:.X.X | Bit |
|00002d20| 20 20 20 20 4d 65 61 6e | 69 6e 67 0a 58 20 20 20 | Mean|ing.X |
|00002d30| 20 20 24 38 30 20 20 20 | 20 20 20 20 49 66 20 6e | $80 | If n|
|00002d40| 65 77 20 63 65 6c 6c 20 | 69 73 20 30 20 74 68 65 |ew cell |is 0 the|
|00002d50| 6e 20 63 75 72 72 65 6e | 74 20 63 65 6c 6c 20 73 |n curren|t cell s|
|00002d60| 68 6f 75 6c 64 20 62 65 | 20 30 2e 0a 58 20 20 20 |hould be| 0..X |
|00002d70| 20 20 24 34 30 20 20 20 | 20 20 20 20 49 66 20 6e | $40 | If n|
|00002d80| 65 77 20 63 65 6c 6c 20 | 69 73 20 30 20 74 68 65 |ew cell |is 0 the|
|00002d90| 6e 20 63 75 72 72 65 6e | 74 20 63 65 6c 6c 20 73 |n curren|t cell s|
|00002da0| 68 6f 75 6c 64 20 62 65 | 20 31 2e 0a 58 20 20 20 |hould be| 1..X |
|00002db0| 20 20 24 32 30 20 20 20 | 20 20 20 20 49 66 20 6e | $20 | If n|
|00002dc0| 65 77 20 63 65 6c 6c 20 | 69 73 20 31 20 74 68 65 |ew cell |is 1 the|
|00002dd0| 6e 20 63 75 72 72 65 6e | 74 20 63 65 6c 6c 20 73 |n curren|t cell s|
|00002de0| 68 6f 75 6c 64 20 62 65 | 20 30 2e 0a 58 20 20 20 |hould be| 0..X |
|00002df0| 20 20 24 31 30 20 20 20 | 20 20 20 20 49 66 20 6e | $10 | If n|
|00002e00| 65 77 20 63 65 6c 6c 20 | 69 73 20 31 20 74 68 65 |ew cell |is 1 the|
|00002e10| 6e 20 63 75 72 72 65 6e | 74 20 63 65 6c 6c 20 73 |n curren|t cell s|
|00002e20| 68 6f 75 6c 64 20 62 65 | 20 31 2e 0a 58 20 20 20 |hould be| 1..X |
|00002e30| 20 20 24 30 38 20 20 20 | 20 20 20 20 49 66 20 6e | $08 | If n|
|00002e40| 65 77 20 63 65 6c 6c 20 | 69 73 20 30 20 74 68 65 |ew cell |is 0 the|
|00002e50| 6e 20 61 6c 6c 20 75 6e | 6b 6e 6f 77 6e 20 6e 65 |n all un|known ne|
|00002e60| 69 67 68 62 6f 72 73 20 | 73 68 6f 75 6c 64 20 62 |ighbors |should b|
|00002e70| 65 20 30 2e 0a 58 20 20 | 20 20 20 24 30 34 20 20 |e 0..X | $04 |
|00002e80| 20 20 20 20 20 49 66 20 | 6e 65 77 20 63 65 6c 6c | If |new cell|
|00002e90| 20 69 73 20 30 20 74 68 | 65 6e 20 61 6c 6c 20 75 | is 0 th|en all u|
|00002ea0| 6e 6b 6e 6f 77 6e 20 6e | 65 69 67 68 62 6f 72 73 |nknown n|eighbors|
|00002eb0| 20 73 68 6f 75 6c 64 20 | 62 65 20 31 2e 0a 58 20 | should |be 1..X |
|00002ec0| 20 20 20 20 24 30 32 20 | 20 20 20 20 20 20 49 66 | $02 | If|
|00002ed0| 20 6e 65 77 20 63 65 6c | 6c 20 69 73 20 31 20 74 | new cel|l is 1 t|
|00002ee0| 68 65 6e 20 61 6c 6c 20 | 75 6e 6b 6e 6f 77 6e 20 |hen all |unknown |
|00002ef0| 6e 65 69 67 68 62 6f 72 | 73 20 73 68 6f 75 6c 64 |neighbor|s should|
|00002f00| 20 62 65 20 30 2e 0a 58 | 20 20 20 20 20 24 30 31 | be 0..X| $01|
|00002f10| 20 20 20 20 20 20 20 49 | 66 20 6e 65 77 20 63 65 | I|f new ce|
|00002f20| 6c 6c 20 69 73 20 31 20 | 74 68 65 6e 20 61 6c 6c |ll is 1 |then all|
|00002f30| 20 75 6e 6b 6e 6f 77 6e | 20 6e 65 69 67 68 62 6f | unknown| neighbo|
|00002f40| 72 73 20 73 68 6f 75 6c | 64 20 62 65 20 31 2e 0a |rs shoul|d be 1..|
|00002f50| 58 0a 58 28 49 6e 20 4c | 69 66 65 2c 20 62 69 74 |X.X(In L|ife, bit|
|00002f60| 73 20 24 34 30 20 61 6e | 64 20 24 32 30 20 61 72 |s $40 an|d $20 ar|
|00002f70| 65 20 6e 65 76 65 72 20 | 73 65 74 2c 20 62 75 74 |e never |set, but|
|00002f80| 20 74 68 65 79 20 6d 61 | 79 20 6f 63 63 75 72 20 | they ma|y occur |
|00002f90| 66 6f 72 20 6f 74 68 65 | 72 0a 58 74 72 61 6e 73 |for othe|r.Xtrans|
|00002fa0| 69 74 69 6f 6e 20 72 75 | 6c 65 73 2e 29 20 20 46 |ition ru|les.) F|
|00002fb0| 6f 72 20 65 78 61 6d 70 | 6c 65 2c 20 62 69 74 20 |or examp|le, bit |
|00002fc0| 24 38 30 20 69 73 20 73 | 65 74 20 69 66 66 20 74 |$80 is s|et iff t|
|00002fd0| 68 65 20 63 75 72 72 65 | 6e 74 20 63 65 6c 6c 20 |he curre|nt cell |
|00002fe0| 69 73 0a 58 75 6e 6b 6e | 6f 77 6e 2c 20 65 78 61 |is.Xunkn|own, exa|
|00002ff0| 63 74 6c 79 20 32 20 6f | 66 20 69 74 73 20 6e 65 |ctly 2 o|f its ne|
|00003000| 69 67 68 62 6f 72 73 20 | 61 72 65 20 31 2c 20 61 |ighbors |are 1, a|
|00003010| 6e 64 20 61 74 20 6d 6f | 73 74 20 31 20 6f 66 20 |nd at mo|st 1 of |
|00003020| 69 74 73 20 6e 65 69 67 | 68 62 6f 72 73 0a 58 69 |its neig|hbors.Xi|
|00003030| 73 20 75 6e 6b 6e 6f 77 | 6e 2c 20 69 2e 65 2e 20 |s unknow|n, i.e. |
|00003040| 66 6f 72 20 6e 65 69 67 | 68 62 6f 72 68 6f 6f 64 |for neig|hborhood|
|00003050| 20 64 65 73 63 72 69 70 | 74 6f 72 73 20 24 31 34 | descrip|tors $14|
|00003060| 20 61 6e 64 20 24 33 34 | 2e 0a 58 0a 58 20 20 20 | and $34|..X.X |
|00003070| 20 20 54 68 65 20 74 77 | 6f 20 74 61 62 6c 65 73 | The tw|o tables|
|00003080| 20 77 65 72 65 20 63 72 | 65 61 74 65 64 20 62 79 | were cr|eated by|
|00003090| 20 61 20 42 41 53 49 43 | 20 70 72 6f 67 72 61 6d | a BASIC| program|
|000030a0| 20 61 6e 64 20 61 72 65 | 20 6e 6f 77 20 6c 6f 61 | and are| now loa|
|000030b0| 64 65 64 20 66 72 6f 6d | 0a 58 64 69 73 6b 20 61 |ded from|.Xdisk a|
|000030c0| 73 20 70 61 72 74 20 6f | 66 20 74 68 65 20 69 6e |s part o|f the in|
|000030d0| 69 74 69 61 6c 69 7a 61 | 74 69 6f 6e 2e 0a 58 0a |itializa|tion..X.|
|000030e0| 58 20 20 20 20 20 54 68 | 65 20 62 61 73 69 63 20 |X Th|e basic |
|000030f0| 6f 70 65 72 61 74 69 6f | 6e 20 6f 66 20 74 68 65 |operatio|n of the|
|00003100| 20 70 72 6f 67 72 61 6d | 20 69 73 20 61 73 20 66 | program| is as f|
|00003110| 6f 6c 6c 6f 77 73 3a 20 | 53 75 70 70 6f 73 65 20 |ollows: |Suppose |
|00003120| 74 68 61 74 20 43 45 4c | 4c 20 69 73 0a 58 66 75 |that CEL|L is.Xfu|
|00003130| 6c 6c 79 20 63 6f 6e 73 | 69 73 74 65 6e 74 3b 20 |lly cons|istent; |
|00003140| 69 2e 65 2e 20 65 76 65 | 72 79 20 63 65 6c 6c 20 |i.e. eve|ry cell |
|00003150| 69 73 20 63 6f 6e 73 69 | 73 74 65 6e 74 20 77 69 |is consi|stent wi|
|00003160| 74 68 20 69 74 73 20 39 | 20 70 61 72 65 6e 74 73 |th its 9| parents|
|00003170| 20 61 6e 64 20 6e 6f 0a | 58 63 75 72 72 65 6e 74 | and no.|Xcurrent|
|00003180| 6c 79 20 75 6e 6b 6e 6f | 77 6e 20 63 65 6c 6c 73 |ly unkno|wn cells|
|00003190| 20 68 61 76 65 20 74 68 | 65 69 72 20 76 61 6c 75 | have th|eir valu|
|000031a0| 65 73 20 66 6f 72 63 65 | 64 2e 20 20 28 54 68 61 |es force|d. (Tha|
|000031b0| 74 20 69 73 2c 20 66 6f | 72 63 65 64 0a 58 64 69 |t is, fo|rced.Xdi|
|000031c0| 72 65 63 74 6c 79 2c 20 | 65 69 74 68 65 72 20 62 |rectly, |either b|
|000031d0| 79 20 74 68 65 69 72 20 | 70 61 72 65 6e 74 73 20 |y their |parents |
|000031e0| 6f 72 20 74 68 65 69 72 | 20 63 68 69 6c 64 72 65 |or their| childre|
|000031f0| 6e 2e 29 20 20 49 6e 20 | 74 68 69 73 20 73 69 74 |n.) In |this sit|
|00003200| 75 61 74 69 6f 6e 2c 0a | 58 4e 58 53 54 4e 47 20 |uation,.|XNXSTNG |
|00003210| 3d 20 4e 57 53 54 4e 47 | 2e 0a 58 0a 58 53 74 65 |= NWSTNG|..X.XSte|
|00003220| 70 20 30 3a 20 20 28 27 | 50 69 63 6b 20 61 6e 20 |p 0: ('|Pick an |
|00003230| 75 6e 6b 6e 6f 77 6e 20 | 63 65 6c 6c 27 29 20 20 |unknown |cell') |
|00003240| 49 66 20 74 68 65 72 65 | 20 61 72 65 20 6e 6f 20 |If there| are no |
|00003250| 75 6e 6b 6e 6f 77 6e 20 | 63 65 6c 6c 73 20 6c 65 |unknown |cells le|
|00003260| 66 74 2c 0a 58 72 65 70 | 6f 72 74 20 74 68 61 74 |ft,.Xrep|ort that|
|00003270| 20 61 6e 20 6f 62 6a 65 | 63 74 20 68 61 73 20 62 | an obje|ct has b|
|00003280| 65 65 6e 20 66 6f 75 6e | 64 2c 20 6c 65 74 20 74 |een foun|d, let t|
|00003290| 68 65 20 75 73 65 72 20 | 64 69 73 70 6c 61 79 20 |he user |display |
|000032a0| 69 74 2c 20 73 61 76 65 | 20 69 74 20 6f 6e 0a 58 |it, save| it on.X|
|000032b0| 64 69 73 6b 2c 20 70 72 | 69 6e 74 20 69 74 2c 20 |disk, pr|int it, |
|000032c0| 6f 72 20 77 68 61 74 65 | 76 65 72 3b 20 74 68 65 |or whate|ver; the|
|000032d0| 6e 20 67 6f 20 74 6f 20 | 73 74 65 70 20 32 2e 20 |n go to |step 2. |
|000032e0| 20 4f 74 68 65 72 77 69 | 73 65 2c 20 70 69 63 6b | Otherwi|se, pick|
|000032f0| 20 61 6e 20 75 6e 6b 6e | 6f 77 6e 0a 58 63 65 6c | an unkn|own.Xcel|
|00003300| 6c 20 61 6e 64 20 61 20 | 76 61 6c 75 65 20 66 6f |l and a |value fo|
|00003310| 72 20 69 74 2e 20 20 43 | 68 61 6e 67 65 20 69 74 |r it. C|hange it|
|00003320| 20 69 6e 20 43 45 4c 4c | 20 61 6e 64 20 61 64 64 | in CELL| and add|
|00003330| 20 61 6e 20 65 6e 74 72 | 79 20 74 6f 20 74 68 65 | an entr|y to the|
|00003340| 20 73 65 74 74 69 6e 67 | 0a 58 6c 69 73 74 20 77 | setting|.Xlist w|
|00003350| 69 74 68 20 46 52 45 45 | 3d 74 72 75 65 2c 20 75 |ith FREE|=true, u|
|00003360| 70 64 61 74 69 6e 67 20 | 4e 57 53 54 4e 47 2e 20 |pdating |NWSTNG. |
|00003370| 20 47 6f 20 74 6f 20 73 | 74 65 70 20 31 2e 0a 58 | Go to s|tep 1..X|
|00003380| 0a 58 53 74 65 70 20 31 | 3a 20 20 28 27 45 78 61 |.XStep 1|: ('Exa|
|00003390| 6d 69 6e 65 20 63 6f 6e | 73 65 71 75 65 6e 63 65 |mine con|sequence|
|000033a0| 73 27 29 20 20 49 66 20 | 4e 58 53 54 4e 47 20 3d |s') If |NXSTNG =|
|000033b0| 20 4e 57 53 54 4e 47 2c | 20 74 68 65 6e 20 43 45 | NWSTNG,| then CE|
|000033c0| 4c 4c 20 69 73 20 66 75 | 6c 6c 79 0a 58 63 6f 6e |LL is fu|lly.Xcon|
|000033d0| 73 69 73 74 65 6e 74 3b | 20 67 6f 20 74 6f 20 73 |sistent;| go to s|
|000033e0| 74 65 70 20 30 2e 20 20 | 4f 74 68 65 72 77 69 73 |tep 0. |Otherwis|
|000033f0| 65 2c 20 67 65 74 20 74 | 68 65 20 76 61 6c 75 65 |e, get t|he value|
|00003400| 73 20 6f 66 20 54 2c 20 | 58 2c 20 59 2c 20 61 6e |s of T, |X, Y, an|
|00003410| 64 20 56 41 4c 55 45 0a | 58 70 6f 69 6e 74 65 64 |d VALUE.|Xpointed|
|00003420| 20 74 6f 20 62 79 20 4e | 58 53 54 4e 47 20 61 6e | to by N|XSTNG an|
|00003430| 64 20 69 6e 63 72 65 6d | 65 6e 74 20 4e 58 53 54 |d increm|ent NXST|
|00003440| 4e 47 2e 20 20 54 68 65 | 20 66 61 63 74 20 74 68 |NG. The| fact th|
|00003450| 61 74 20 43 45 4c 4c 5b | 54 2c 58 2c 59 5d 20 3d |at CELL[|T,X,Y] =|
|00003460| 0a 58 56 41 4c 55 45 20 | 6d 61 79 20 64 69 72 65 |.XVALUE |may dire|
|00003470| 63 74 6c 79 20 66 6f 72 | 63 65 20 73 6f 6d 65 20 |ctly for|ce some |
|00003480| 63 75 72 72 65 6e 74 6c | 79 20 75 6e 6b 6e 6f 77 |currentl|y unknow|
|00003490| 6e 20 63 65 6c 6c 73 20 | 74 6f 20 62 65 20 30 20 |n cells |to be 0 |
|000034a0| 6f 72 20 31 3b 20 66 6f | 72 0a 58 65 61 63 68 20 |or 1; fo|r.Xeach |
|000034b0| 6f 66 20 74 68 65 73 65 | 2c 20 73 65 74 20 69 74 |of these|, set it|
|000034c0| 73 20 76 61 6c 75 65 20 | 69 6e 20 43 45 4c 4c 20 |s value |in CELL |
|000034d0| 61 6e 64 20 61 64 64 20 | 61 6e 20 65 6e 74 72 79 |and add |an entry|
|000034e0| 20 74 6f 20 74 68 65 20 | 73 65 74 74 69 6e 67 20 | to the |setting |
|000034f0| 6c 69 73 74 0a 58 77 69 | 74 68 20 46 52 45 45 3d |list.Xwi|th FREE=|
|00003500| 66 61 6c 73 65 2c 20 69 | 6e 63 72 65 6d 65 6e 74 |false, i|ncrement|
|00003510| 69 6e 67 20 4e 57 53 54 | 4e 47 2e 20 20 54 68 65 |ing NWST|NG. The|
|00003520| 6e 20 67 6f 20 74 6f 20 | 73 74 65 70 20 31 2e 20 |n go to |step 1. |
|00003530| 20 57 65 20 6d 61 79 20 | 61 6c 73 6f 0a 58 64 65 | We may |also.Xde|
|00003540| 74 65 63 74 20 61 20 63 | 6f 6e 74 72 61 64 69 63 |tect a c|ontradic|
|00003550| 74 69 6f 6e 20 61 74 20 | 74 68 69 73 20 70 6f 69 |tion at |this poi|
|00003560| 6e 74 3b 20 69 6e 20 74 | 68 61 74 20 63 61 73 65 |nt; in t|hat case|
|00003570| 20 67 6f 20 74 6f 20 73 | 74 65 70 20 32 2e 20 20 | go to s|tep 2. |
|00003580| 28 54 68 65 0a 58 66 6f | 72 63 69 6e 67 20 69 6e |(The.Xfo|rcing in|
|00003590| 20 74 68 69 73 20 73 74 | 65 70 20 69 73 20 6f 66 | this st|ep is of|
|000035a0| 20 34 20 74 79 70 65 73 | 3a 20 20 49 66 20 54 3d | 4 types|: If T=|
|000035b0| 30 20 6f 72 20 54 50 2c | 20 74 68 65 20 6d 61 70 |0 or TP,| the map|
|000035c0| 70 65 64 20 63 65 6c 6c | 20 69 6e 0a 58 67 65 6e |ped cell| in.Xgen|
|000035d0| 65 72 61 74 69 6f 6e 20 | 54 50 20 6f 72 20 30 20 |eration |TP or 0 |
|000035e0| 69 73 20 66 6f 72 63 65 | 64 2e 20 20 53 6f 6d 65 |is force|d. Some|
|000035f0| 20 6f 66 20 74 68 65 20 | 70 61 72 65 6e 74 73 20 | of the |parents |
|00003600| 6f 66 20 28 54 2c 58 2c | 59 29 20 6d 61 79 20 62 |of (T,X,|Y) may b|
|00003610| 65 0a 58 66 6f 72 63 65 | 64 2e 20 20 53 6f 6d 65 |e.Xforce|d. Some|
|00003620| 20 6f 66 20 74 68 65 20 | 63 68 69 6c 64 72 65 6e | of the |children|
|00003630| 20 6f 66 20 28 54 2c 58 | 2c 59 29 20 6d 61 79 20 | of (T,X|,Y) may |
|00003640| 62 65 20 66 6f 72 63 65 | 64 2e 20 20 41 6e 64 20 |be force|d. And |
|00003650| 73 6f 6d 65 20 63 65 6c | 6c 73 20 6d 61 79 0a 58 |some cel|ls may.X|
|00003660| 62 65 20 66 6f 72 63 65 | 64 20 62 79 20 61 64 64 |be force|d by add|
|00003670| 69 74 69 6f 6e 61 6c 20 | 63 6f 6e 73 74 72 61 69 |itional |constrai|
|00003680| 6e 74 73 20 73 75 63 68 | 20 61 73 20 73 79 6d 6d |nts such| as symm|
|00003690| 65 74 72 79 2e 29 0a 58 | 0a 58 53 74 65 70 20 32 |etry.).X|.XStep 2|
|000036a0| 3a 20 20 28 27 42 61 63 | 6b 20 75 70 27 2e 20 20 |: ('Bac|k up'. |
|000036b0| 41 74 20 74 68 69 73 20 | 70 6f 69 6e 74 2c 20 65 |At this |point, e|
|000036c0| 69 74 68 65 72 20 61 20 | 63 6f 6e 74 72 61 64 69 |ither a |contradi|
|000036d0| 63 74 69 6f 6e 20 68 61 | 73 20 62 65 65 6e 0a 58 |ction ha|s been.X|
|000036e0| 64 65 74 65 63 74 65 64 | 20 6f 72 20 77 65 27 76 |detected| or we'v|
|000036f0| 65 20 66 6f 75 6e 64 20 | 61 6e 20 6f 62 6a 65 63 |e found |an objec|
|00003700| 74 20 61 6e 64 20 77 69 | 73 68 20 74 6f 20 6c 6f |t and wi|sh to lo|
|00003710| 6f 6b 20 66 6f 72 20 6d | 6f 72 65 2e 29 20 20 49 |ok for m|ore.) I|
|00003720| 66 20 4e 57 53 54 4e 47 | 20 3d 0a 58 53 54 4e 47 |f NWSTNG| =.XSTNG|
|00003730| 2c 20 72 65 70 6f 72 74 | 20 74 68 61 74 20 6e 6f |, report| that no|
|00003740| 20 6d 6f 72 65 20 6f 62 | 6a 65 63 74 73 20 6f 66 | more ob|jects of|
|00003750| 20 74 68 65 20 64 65 73 | 69 72 65 64 20 74 79 70 | the des|ired typ|
|00003760| 65 20 65 78 69 73 74 20 | 61 6e 64 20 71 75 69 74 |e exist |and quit|
|00003770| 2e 0a 58 4f 74 68 65 72 | 77 69 73 65 2c 20 64 65 |..XOther|wise, de|
|00003780| 63 72 65 6d 65 6e 74 20 | 4e 57 53 54 4e 47 20 61 |crement |NWSTNG a|
|00003790| 6e 64 20 67 65 74 20 74 | 68 65 20 76 61 6c 75 65 |nd get t|he value|
|000037a0| 73 20 6f 66 20 54 2c 20 | 58 2c 20 59 2c 20 56 41 |s of T, |X, Y, VA|
|000037b0| 4c 55 45 2c 20 61 6e 64 | 20 46 52 45 45 0a 58 70 |LUE, and| FREE.Xp|
|000037c0| 6f 69 6e 74 65 64 20 74 | 6f 20 62 79 20 69 74 2e |ointed t|o by it.|
|000037d0| 20 20 49 66 20 46 52 45 | 45 20 3d 20 66 61 6c 73 | If FRE|E = fals|
|000037e0| 65 2c 20 73 65 74 20 43 | 45 4c 4c 5b 54 2c 58 2c |e, set C|ELL[T,X,|
|000037f0| 59 5d 20 74 6f 20 55 4e | 4b 20 61 6e 64 20 67 6f |Y] to UN|K and go|
|00003800| 20 74 6f 20 73 74 65 70 | 0a 58 32 2e 20 20 49 66 | to step|.X2. If|
|00003810| 20 46 52 45 45 20 3d 20 | 74 72 75 65 2c 20 74 68 | FREE = |true, th|
|00003820| 65 6e 20 65 69 74 68 65 | 72 20 77 65 27 76 65 20 |en eithe|r we've |
|00003830| 66 6f 75 6e 64 20 74 68 | 61 74 20 74 68 69 73 20 |found th|at this |
|00003840| 66 72 65 65 20 63 68 6f | 69 63 65 20 6c 65 64 20 |free cho|ice led |
|00003850| 74 6f 20 61 0a 58 63 6f | 6e 74 72 61 64 69 63 74 |to a.Xco|ntradict|
|00003860| 69 6f 6e 20 6f 72 20 77 | 65 27 76 65 20 61 6c 72 |ion or w|e've alr|
|00003870| 65 61 64 79 20 66 6f 75 | 6e 64 20 61 6c 6c 20 6f |eady fou|nd all o|
|00003880| 62 6a 65 63 74 73 20 69 | 6e 20 77 68 69 63 68 20 |bjects i|n which |
|00003890| 74 68 65 20 63 68 6f 69 | 63 65 20 77 61 73 0a 58 |the choi|ce was.X|
|000038a0| 76 61 6c 69 64 2e 20 20 | 53 6f 20 63 68 61 6e 67 |valid. |So chang|
|000038b0| 65 20 43 45 4c 4c 5b 54 | 2c 58 2c 59 5d 20 74 6f |e CELL[T|,X,Y] to|
|000038c0| 20 31 2d 56 41 4c 55 45 | 2c 20 63 68 61 6e 67 65 | 1-VALUE|, change|
|000038d0| 20 46 52 45 45 20 74 6f | 20 66 61 6c 73 65 2c 20 | FREE to| false, |
|000038e0| 73 65 74 20 4e 58 53 54 | 4e 47 0a 58 74 6f 20 4e |set NXST|NG.Xto N|
|000038f0| 57 53 54 4e 47 2c 20 69 | 6e 63 72 65 6d 65 6e 74 |WSTNG, i|ncrement|
|00003900| 20 4e 57 53 54 4e 47 2c | 20 61 6e 64 20 67 6f 20 | NWSTNG,| and go |
|00003910| 74 6f 20 73 74 65 70 20 | 31 2e 0a 58 0a 58 20 20 |to step |1..X.X |
|00003920| 20 20 20 41 73 20 64 65 | 73 63 72 69 62 65 64 20 | As de|scribed |
|00003930| 68 65 72 65 2c 20 70 61 | 72 74 20 6f 66 20 73 74 |here, pa|rt of st|
|00003940| 65 70 20 30 20 69 6e 76 | 6f 6c 76 65 73 20 72 65 |ep 0 inv|olves re|
|00003950| 74 75 72 6e 69 6e 67 20 | 63 6f 6e 74 72 6f 6c 20 |turning |control |
|00003960| 74 6f 20 74 68 65 0a 58 | 42 41 53 49 43 20 70 61 |to the.X|BASIC pa|
|00003970| 72 74 20 6f 66 20 74 68 | 65 20 70 72 6f 67 72 61 |rt of th|e progra|
|00003980| 6d 2e 20 20 42 75 74 20 | 6f 6e 20 6d 79 20 73 79 |m. But |on my sy|
|00003990| 73 74 65 6d 20 69 74 27 | 73 20 6e 6f 74 20 63 6f |stem it'|s not co|
|000039a0| 6e 76 65 6e 69 65 6e 74 | 20 74 6f 20 68 61 76 65 |nvenient| to have|
|000039b0| 20 61 0a 58 6d 61 63 68 | 69 6e 65 20 6c 61 6e 67 | a.Xmach|ine lang|
|000039c0| 75 61 67 65 20 72 6f 75 | 74 69 6e 65 20 63 61 6c |uage rou|tine cal|
|000039d0| 6c 20 61 20 42 41 53 49 | 43 20 72 6f 75 74 69 6e |l a BASI|C routin|
|000039e0| 65 2c 20 73 6f 20 49 27 | 76 65 20 72 65 61 72 72 |e, so I'|ve rearr|
|000039f0| 61 6e 67 65 64 20 74 68 | 69 6e 67 73 0a 58 73 6c |anged th|ings.Xsl|
|00003a00| 69 67 68 74 6c 79 2e 0a | 58 0a 58 20 20 20 20 20 |ightly..|X.X |
|00003a10| 49 27 6c 6c 20 6e 6f 77 | 20 64 65 73 63 72 69 62 |I'll now| describ|
|00003a20| 65 20 74 68 65 20 6d 61 | 63 68 69 6e 65 20 6c 61 |e the ma|chine la|
|00003a30| 6e 67 75 61 67 65 20 72 | 6f 75 74 69 6e 65 73 2e |nguage r|outines.|
|00003a40| 20 55 6e 6c 65 73 73 20 | 6f 74 68 65 72 77 69 73 | Unless |otherwis|
|00003a50| 65 0a 58 69 6e 64 69 63 | 61 74 65 64 2c 20 74 68 |e.Xindic|ated, th|
|00003a60| 65 20 70 61 72 61 6d 65 | 74 65 72 73 20 54 2c 20 |e parame|ters T, |
|00003a70| 58 2c 20 59 2c 20 56 41 | 4c 55 45 2c 20 61 6e 64 |X, Y, VA|LUE, and|
|00003a80| 20 46 52 45 45 20 61 72 | 65 20 61 73 73 75 6d 65 | FREE ar|e assume|
|00003a90| 64 20 74 6f 0a 58 73 61 | 74 69 73 66 79 20 20 30 |d to.Xsa|tisfy 0|
|00003aa0| 3c 3d 54 3c 3d 54 50 2c | 20 20 30 3c 3d 58 3c 58 |<=T<=TP,| 0<=X<X|
|00003ab0| 4d 2c 20 20 30 3c 3d 59 | 3c 59 4d 2c 20 20 56 41 |M, 0<=Y|<YM, VA|
|00003ac0| 4c 55 45 20 3d 20 30 2c | 20 31 2c 20 6f 72 20 55 |LUE = 0,| 1, or U|
|00003ad0| 4e 4b 2c 20 20 46 52 45 | 45 20 3d 20 74 72 75 65 |NK, FRE|E = true|
|00003ae0| 0a 58 6f 72 20 66 61 6c | 73 65 2e 0a 58 0a 58 20 |.Xor fal|se..X.X |
|00003af0| 20 20 20 20 4d 61 6e 79 | 20 6f 66 20 74 68 65 73 | Many| of thes|
|00003b00| 65 20 72 6f 75 74 69 6e | 65 73 20 73 6f 6d 65 74 |e routin|es somet|
|00003b10| 69 6d 65 73 20 64 65 74 | 65 63 74 20 61 6e 20 65 |imes det|ect an e|
|00003b20| 72 72 6f 72 3b 20 74 68 | 65 79 20 72 65 70 6f 72 |rror; th|ey repor|
|00003b30| 74 20 74 68 69 73 20 74 | 6f 0a 58 74 68 65 20 63 |t this t|o.Xthe c|
|00003b40| 61 6c 6c 69 6e 67 20 72 | 6f 75 74 69 6e 65 20 62 |alling r|outine b|
|00003b50| 79 20 73 65 74 74 69 6e | 67 20 74 68 65 20 63 61 |y settin|g the ca|
|00003b60| 72 72 79 20 62 69 74 20 | 61 6e 64 20 73 74 6f 72 |rry bit |and stor|
|00003b70| 69 6e 67 20 61 20 76 61 | 6c 75 65 20 69 6e 20 74 |ing a va|lue in t|
|00003b80| 68 65 0a 58 76 61 72 69 | 61 62 6c 65 20 45 52 52 |he.Xvari|able ERR|
|00003b90| 43 4f 44 45 20 74 6f 20 | 74 65 6c 6c 20 77 68 69 |CODE to |tell whi|
|00003ba0| 63 68 20 65 72 72 6f 72 | 20 6f 63 63 75 72 72 65 |ch error| occurre|
|00003bb0| 64 2e 20 20 28 43 61 6c | 6c 69 6e 67 20 74 68 65 |d. (Cal|ling the|
|00003bc0| 73 65 20 27 65 72 72 6f | 72 73 27 20 69 73 0a 58 |se 'erro|rs' is.X|
|00003bd0| 6d 69 73 6c 65 61 64 69 | 6e 67 2c 20 73 69 6e 63 |misleadi|ng, sinc|
|00003be0| 65 20 74 68 65 79 20 63 | 61 6e 20 6f 63 63 75 72 |e they c|an occur|
|00003bf0| 20 64 75 72 69 6e 67 20 | 74 68 65 20 6e 6f 72 6d | during |the norm|
|00003c00| 61 6c 20 63 6f 75 72 73 | 65 20 6f 66 20 65 76 65 |al cours|e of eve|
|00003c10| 6e 74 73 20 61 6e 64 0a | 58 73 6f 6d 65 20 61 72 |nts and.|Xsome ar|
|00003c20| 65 20 65 76 65 6e 20 64 | 65 73 69 72 61 62 6c 65 |e even d|esirable|
|00003c30| 2e 20 20 42 75 74 20 27 | 65 78 63 65 70 74 69 6f |. But '|exceptio|
|00003c40| 6e 61 6c 20 63 6f 6e 64 | 69 74 69 6f 6e 73 27 20 |nal cond|itions' |
|00003c50| 69 73 20 74 6f 6f 20 6c | 6f 6e 67 2c 20 73 6f 20 |is too l|ong, so |
|00003c60| 49 27 6c 6c 0a 58 63 6f | 6e 74 69 6e 75 65 20 74 |I'll.Xco|ntinue t|
|00003c70| 6f 20 63 61 6c 6c 20 74 | 68 65 6d 20 65 72 72 6f |o call t|hem erro|
|00003c80| 72 73 2e 29 0a 58 0a 58 | 4c 4f 4f 4b 55 50 28 54 |rs.).X.X|LOOKUP(T|
|00003c90| 2c 58 2c 59 29 3a 20 20 | 52 65 74 75 72 6e 20 74 |,X,Y): |Return t|
|00003ca0| 68 65 20 61 64 64 72 65 | 73 73 20 61 6e 64 20 76 |he addre|ss and v|
|00003cb0| 61 6c 75 65 20 6f 66 20 | 43 45 4c 4c 5b 54 2c 58 |alue of |CELL[T,X|
|00003cc0| 2c 59 5d 2e 20 28 54 68 | 69 73 20 72 6f 75 74 69 |,Y]. (Th|is routi|
|00003cd0| 6e 65 0a 58 67 65 74 73 | 20 63 61 6c 6c 65 64 20 |ne.Xgets| called |
|00003ce0| 6d 6f 72 65 20 6f 66 74 | 65 6e 20 74 68 61 6e 20 |more oft|en than |
|00003cf0| 61 6e 79 20 6f 74 68 65 | 72 2c 20 73 6f 20 73 68 |any othe|r, so sh|
|00003d00| 6f 75 6c 64 20 62 65 20 | 66 61 73 74 2e 20 20 49 |ould be |fast. I|
|00003d10| 20 61 63 74 75 61 6c 6c | 79 0a 58 69 6d 70 6c 65 | actuall|y.Ximple|
|00003d20| 6d 65 6e 74 65 64 20 69 | 74 20 61 73 20 61 6e 20 |mented i|t as an |
|00003d30| 61 73 73 65 6d 62 6c 79 | 20 6c 61 6e 67 75 61 67 |assembly| languag|
|00003d40| 65 20 6d 61 63 72 6f 20 | 72 61 74 68 65 72 20 74 |e macro |rather t|
|00003d50| 68 61 6e 20 61 73 20 61 | 20 73 75 62 72 6f 75 74 |han as a| subrout|
|00003d60| 69 6e 65 2e 0a 58 54 68 | 65 20 64 75 70 6c 69 63 |ine..XTh|e duplic|
|00003d70| 61 74 65 64 20 63 6f 64 | 65 20 6d 61 64 65 20 74 |ated cod|e made t|
|00003d80| 68 65 20 70 72 6f 67 72 | 61 6d 20 61 20 62 69 74 |he progr|am a bit|
|00003d90| 20 6c 61 72 67 65 72 2c | 20 62 75 74 20 61 6c 73 | larger,| but als|
|00003da0| 6f 20 6d 61 64 65 20 69 | 74 20 61 62 6f 75 74 0a |o made i|t about.|
|00003db0| 58 31 30 25 20 66 61 73 | 74 65 72 2e 20 20 49 20 |X10% fas|ter. I |
|00003dc0| 61 6c 73 6f 20 68 61 76 | 65 20 66 61 73 74 65 72 |also hav|e faster|
|00003dd0| 20 76 65 72 73 69 6f 6e | 73 20 66 6f 72 20 74 68 | version|s for th|
|00003de0| 65 20 73 70 65 63 69 61 | 6c 20 63 61 73 65 73 20 |e specia|l cases |
|00003df0| 69 6e 20 77 68 69 63 68 | 20 74 68 65 0a 58 63 65 |in which| the.Xce|
|00003e00| 6c 6c 20 62 65 69 6e 67 | 20 6c 6f 6f 6b 65 64 20 |ll being| looked |
|00003e10| 75 70 20 69 73 20 61 64 | 6a 61 63 65 6e 74 20 74 |up is ad|jacent t|
|00003e20| 6f 20 74 68 65 20 6f 6e | 65 20 70 72 65 76 69 6f |o the on|e previo|
|00003e30| 75 73 6c 79 20 6c 6f 6f | 6b 65 64 20 75 70 2e 20 |usly loo|ked up. |
|00003e40| 54 68 69 73 0a 58 73 70 | 65 65 64 73 20 75 70 20 |This.Xsp|eeds up |
|00003e50| 74 68 65 20 6e 65 69 67 | 68 62 6f 72 68 6f 6f 64 |the neig|hborhood|
|00003e60| 20 63 61 6c 63 75 6c 61 | 74 69 6f 6e 20 69 6e 20 | calcula|tion in |
|00003e70| 47 45 54 4e 42 48 44 2e | 29 0a 58 0a 58 4d 41 50 |GETNBHD.|).X.XMAP|
|00003e80| 28 58 2c 59 29 3a 20 20 | 52 65 74 75 72 6e 20 74 |(X,Y): |Return t|
|00003e90| 68 65 20 63 6f 6f 72 64 | 69 6e 61 74 65 73 20 6f |he coord|inates o|
|00003ea0| 66 20 74 68 65 20 63 65 | 6c 6c 20 69 6e 20 67 65 |f the ce|ll in ge|
|00003eb0| 6e 65 72 61 74 69 6f 6e | 20 54 50 0a 58 63 6f 72 |neration| TP.Xcor|
|00003ec0| 72 65 73 70 6f 6e 64 69 | 6e 67 20 74 6f 20 74 68 |respondi|ng to th|
|00003ed0| 65 20 63 65 6c 6c 20 28 | 30 2c 58 2c 59 29 2e 20 |e cell (|0,X,Y). |
|00003ee0| 20 52 65 70 6f 72 74 20 | 61 6e 20 27 6f 75 74 20 | Report |an 'out |
|00003ef0| 6f 66 20 62 6f 75 6e 64 | 73 27 20 65 72 72 6f 72 |of bound|s' error|
|00003f00| 20 69 66 20 74 68 65 0a | 58 6d 61 70 70 65 64 20 | if the.|Xmapped |
|00003f10| 63 6f 6f 72 64 69 6e 61 | 74 65 73 20 61 72 65 20 |coordina|tes are |
|00003f20| 6e 6f 74 20 69 6e 20 74 | 68 65 20 72 65 63 74 61 |not in t|he recta|
|00003f30| 6e 67 6c 65 2e 0a 58 0a | 58 49 4e 56 4d 41 50 28 |ngle..X.|XINVMAP(|
|00003f40| 58 2c 59 29 3a 20 20 52 | 65 74 75 72 6e 20 74 68 |X,Y): R|eturn th|
|00003f50| 65 20 63 6f 6f 72 64 69 | 6e 61 74 65 73 20 6f 66 |e coordi|nates of|
|00003f60| 20 74 68 65 20 63 65 6c | 6c 20 69 6e 20 67 65 6e | the cel|l in gen|
|00003f70| 65 72 61 74 69 6f 6e 20 | 30 0a 58 63 6f 72 72 65 |eration |0.Xcorre|
|00003f80| 73 70 6f 6e 64 69 6e 67 | 20 74 6f 20 74 68 65 20 |sponding| to the |
|00003f90| 63 65 6c 6c 20 28 54 50 | 2c 58 2c 59 29 2e 20 52 |cell (TP|,X,Y). R|
|00003fa0| 65 70 6f 72 74 20 61 6e | 20 27 6f 75 74 20 6f 66 |eport an| 'out of|
|00003fb0| 20 62 6f 75 6e 64 73 27 | 20 65 72 72 6f 72 20 69 | bounds'| error i|
|00003fc0| 66 20 74 68 65 0a 58 6d | 61 70 70 65 64 20 63 6f |f the.Xm|apped co|
|00003fd0| 6f 72 64 69 6e 61 74 65 | 73 20 61 72 65 20 6e 6f |ordinate|s are no|
|00003fe0| 74 20 69 6e 20 74 68 65 | 20 72 65 63 74 61 6e 67 |t in the| rectang|
|00003ff0| 6c 65 2e 0a 58 0a 58 4e | 57 53 45 54 28 54 2c 58 |le..X.XN|WSET(T,X|
|00004000| 2c 59 2c 56 41 4c 55 45 | 2c 46 52 45 45 29 3a 20 |,Y,VALUE|,FREE): |
|00004010| 20 53 74 6f 72 65 20 61 | 20 71 75 69 6e 74 75 70 | Store a| quintup|
|00004020| 6c 65 20 61 74 20 4e 57 | 53 54 4e 47 20 61 6e 64 |le at NW|STNG and|
|00004030| 20 69 6e 63 72 65 6d 65 | 6e 74 20 4e 57 53 54 4e | increme|nt NWSTN|
|00004040| 47 2e 0a 58 0a 58 53 45 | 54 43 45 4c 4c 28 54 2c |G..X.XSE|TCELL(T,|
|00004050| 58 2c 59 2c 56 41 4c 55 | 45 2c 46 52 45 45 29 3a |X,Y,VALU|E,FREE):|
|00004060| 20 20 28 53 68 6f 75 6c | 64 20 6e 6f 74 20 62 65 | (Shoul|d not be|
|00004070| 20 63 61 6c 6c 65 64 20 | 77 69 74 68 20 56 41 4c | called |with VAL|
|00004080| 55 45 20 3d 20 55 4e 4b | 2e 29 20 20 4c 6f 6f 6b |UE = UNK|.) Look|
|00004090| 0a 58 75 70 20 43 45 4c | 4c 5b 54 2c 58 2c 59 5d |.Xup CEL|L[T,X,Y]|
|000040a0| 2e 20 20 49 66 20 69 74 | 20 65 71 75 61 6c 73 20 |. If it| equals |
|000040b0| 56 41 4c 55 45 2c 20 64 | 6f 20 6e 6f 74 68 69 6e |VALUE, d|o nothin|
|000040c0| 67 2e 20 20 49 66 20 69 | 74 20 65 71 75 61 6c 73 |g. If i|t equals|
|000040d0| 20 31 2d 56 41 4c 55 45 | 2c 0a 58 72 65 70 6f 72 | 1-VALUE|,.Xrepor|
|000040e0| 74 20 61 6e 20 27 69 6e | 63 6f 6e 73 69 73 74 65 |t an 'in|consiste|
|000040f0| 6e 63 79 27 20 65 72 72 | 6f 72 2e 20 20 49 66 20 |ncy' err|or. If |
|00004100| 69 74 20 69 73 20 75 6e | 6b 6e 6f 77 6e 2c 20 73 |it is un|known, s|
|00004110| 65 74 20 69 74 20 74 6f | 20 56 41 4c 55 45 20 61 |et it to| VALUE a|
|00004120| 6e 64 0a 58 63 61 6c 6c | 20 4e 57 53 45 54 20 74 |nd.Xcall| NWSET t|
|00004130| 6f 20 61 64 64 20 74 68 | 65 20 71 75 69 6e 74 75 |o add th|e quintu|
|00004140| 70 6c 65 20 74 6f 20 74 | 68 65 20 73 65 74 74 69 |ple to t|he setti|
|00004150| 6e 67 20 6c 69 73 74 2e | 0a 58 0a 58 47 45 54 4e |ng list.|.X.XGETN|
|00004160| 42 48 44 28 54 2c 58 2c | 59 29 3a 20 20 28 53 68 |BHD(T,X,|Y): (Sh|
|00004170| 6f 75 6c 64 20 6e 6f 74 | 20 62 65 20 63 61 6c 6c |ould not| be call|
|00004180| 65 64 20 77 69 74 68 20 | 54 3d 30 2e 29 20 20 52 |ed with |T=0.) R|
|00004190| 65 74 75 72 6e 20 74 68 | 65 20 6e 65 69 67 68 62 |eturn th|e neighb|
|000041a0| 6f 72 68 6f 6f 64 0a 58 | 64 65 73 63 72 69 70 74 |orhood.X|descript|
|000041b0| 6f 72 20 66 6f 72 20 28 | 54 2d 31 2c 58 2c 59 29 |or for (|T-1,X,Y)|
|000041c0| 3b 20 69 2e 65 2e 20 64 | 65 73 63 72 69 62 69 6e |; i.e. d|escribin|
|000041d0| 67 20 74 68 65 20 70 61 | 72 65 6e 74 73 20 6f 66 |g the pa|rents of|
|000041e0| 20 28 54 2c 58 2c 59 29 | 2e 20 20 4e 6f 74 65 3a | (T,X,Y)|. Note:|
|000041f0| 20 49 66 0a 58 28 58 2c | 59 29 20 69 73 20 6f 6e | If.X(X,|Y) is on|
|00004200| 20 74 68 65 20 62 6f 75 | 6e 64 61 72 79 20 6f 66 | the bou|ndary of|
|00004210| 20 74 68 65 20 72 65 63 | 74 61 6e 67 6c 65 2c 20 | the rec|tangle, |
|00004220| 74 68 65 6e 20 47 45 54 | 4e 42 48 44 20 61 73 73 |then GET|NBHD ass|
|00004230| 75 6d 65 73 20 74 68 61 | 74 20 74 68 65 0a 58 6e |umes tha|t the.Xn|
|00004240| 65 69 67 68 62 6f 72 73 | 20 77 68 69 63 68 20 61 |eighbors| which a|
|00004250| 72 65 20 6f 75 74 73 69 | 64 65 20 61 72 65 20 30 |re outsi|de are 0|
|00004260| 2e 20 20 54 68 65 72 65 | 20 61 72 65 20 73 6f 6d |. There| are som|
|00004270| 65 20 73 69 74 75 61 74 | 69 6f 6e 73 20 69 6e 20 |e situat|ions in |
|00004280| 77 68 69 63 68 20 69 74 | 0a 58 77 6f 75 6c 64 20 |which it|.Xwould |
|00004290| 62 65 20 62 65 74 74 65 | 72 20 74 6f 20 61 73 73 |be bette|r to ass|
|000042a0| 75 6d 65 20 74 68 65 79 | 20 61 72 65 20 55 4e 4b |ume they| are UNK|
|000042b0| 2e 0a 58 0a 58 43 4f 4e | 53 49 53 46 59 28 54 2c |..X.XCON|SISFY(T,|
|000042c0| 58 2c 59 29 3a 20 20 28 | 53 68 6f 75 6c 64 20 6e |X,Y): (|Should n|
|000042d0| 6f 74 20 62 65 20 63 61 | 6c 6c 65 64 20 77 69 74 |ot be ca|lled wit|
|000042e0| 68 20 54 3d 30 2e 20 20 | 58 20 61 6e 64 20 59 20 |h T=0. |X and Y |
|000042f0| 6d 61 79 20 62 65 20 6f | 75 74 20 6f 66 0a 58 62 |may be o|ut of.Xb|
|00004300| 6f 75 6e 64 73 2c 20 69 | 6e 20 77 68 69 63 68 20 |ounds, i|n which |
|00004310| 63 61 73 65 20 74 68 65 | 20 72 6f 75 74 69 6e 65 |case the| routine|
|00004320| 20 64 6f 65 73 20 6e 6f | 74 68 69 6e 67 2e 29 20 | does no|thing.) |
|00004330| 20 4d 61 6b 65 20 28 54 | 2c 58 2c 59 29 20 66 75 | Make (T|,X,Y) fu|
|00004340| 6c 6c 79 0a 58 63 6f 6e | 73 69 73 74 65 6e 74 20 |lly.Xcon|sistent |
|00004350| 77 69 74 68 20 69 74 73 | 20 70 61 72 65 6e 74 73 |with its| parents|
|00004360| 2e 20 20 53 70 65 63 69 | 66 69 63 61 6c 6c 79 3a |. Speci|fically:|
|00004370| 20 20 43 6f 6d 70 75 74 | 65 20 74 68 65 20 6e 65 | Comput|e the ne|
|00004380| 69 67 68 62 6f 72 68 6f | 6f 64 0a 58 64 65 73 63 |ighborho|od.Xdesc|
|00004390| 72 69 70 74 6f 72 20 6f | 66 20 28 54 2d 31 2c 58 |riptor o|f (T-1,X|
|000043a0| 2c 59 29 2c 20 61 6e 64 | 20 6c 6f 6f 6b 20 69 74 |,Y), and| look it|
|000043b0| 20 75 70 20 69 6e 20 54 | 52 41 4e 53 49 54 20 61 | up in T|RANSIT a|
|000043c0| 6e 64 20 49 4d 50 4c 49 | 43 2e 20 20 49 66 20 74 |nd IMPLI|C. If t|
|000043d0| 68 65 0a 58 65 6e 74 72 | 79 20 69 6e 20 54 52 41 |he.Xentr|y in TRA|
|000043e0| 4e 53 49 54 20 69 73 20 | 30 20 6f 72 20 31 20 61 |NSIT is |0 or 1 a|
|000043f0| 6e 64 20 74 68 65 20 76 | 61 6c 75 65 20 6f 66 20 |nd the v|alue of |
|00004400| 43 45 4c 4c 5b 54 2c 58 | 2c 59 5d 20 69 73 20 31 |CELL[T,X|,Y] is 1|
|00004410| 20 6f 72 20 30 2c 0a 58 | 72 65 73 70 65 63 74 69 | or 0,.X|respecti|
|00004420| 76 65 6c 79 2c 20 72 65 | 70 6f 72 74 20 61 6e 20 |vely, re|port an |
|00004430| 27 69 6e 63 6f 6e 73 69 | 73 74 65 6e 63 79 27 20 |'inconsi|stency' |
|00004440| 65 72 72 6f 72 2e 20 20 | 4f 74 68 65 72 77 69 73 |error. |Otherwis|
|00004450| 65 20 63 61 6c 6c 20 53 | 45 54 43 45 4c 4c 0a 58 |e call S|ETCELL.X|
|00004460| 28 77 69 74 68 20 46 52 | 45 45 3d 66 61 6c 73 65 |(with FR|EE=false|
|00004470| 29 20 66 6f 72 20 61 6e | 79 20 6f 66 20 28 54 2c |) for an|y of (T,|
|00004480| 58 2c 59 29 20 6f 72 20 | 69 74 73 20 70 61 72 65 |X,Y) or |its pare|
|00004490| 6e 74 73 20 77 68 69 63 | 68 20 61 72 65 20 63 75 |nts whic|h are cu|
|000044a0| 72 72 65 6e 74 6c 79 0a | 58 75 6e 6b 6e 6f 77 6e |rrently.|Xunknown|
|000044b0| 20 62 75 74 20 61 72 65 | 20 66 6f 72 63 65 64 20 | but are| forced |
|000044c0| 74 6f 20 62 65 20 30 20 | 6f 72 20 31 2e 0a 58 0a |to be 0 |or 1..X.|
|000044d0| 58 43 4f 4e 53 49 53 31 | 30 28 54 2c 58 2c 59 29 |XCONSIS1|0(T,X,Y)|
|000044e0| 3a 20 20 43 61 6c 6c 20 | 43 4f 4e 53 49 53 46 59 |: Call |CONSISFY|
|000044f0| 20 66 6f 72 20 28 54 2c | 58 2c 59 29 20 28 70 72 | for (T,|X,Y) (pr|
|00004500| 6f 76 69 64 65 64 20 74 | 68 61 74 20 54 3e 30 29 |ovided t|hat T>0)|
|00004510| 20 61 6e 64 20 66 6f 72 | 0a 58 65 61 63 68 20 6f | and for|.Xeach o|
|00004520| 66 20 69 74 73 20 39 20 | 63 68 69 6c 64 72 65 6e |f its 9 |children|
|00004530| 20 28 70 72 6f 76 69 64 | 65 64 20 74 68 61 74 20 | (provid|ed that |
|00004540| 54 3c 54 50 29 2e 20 20 | 52 65 70 6f 72 74 20 61 |T<TP). |Report a|
|00004550| 6e 79 20 27 69 6e 63 6f | 6e 73 69 73 74 65 6e 63 |ny 'inco|nsistenc|
|00004560| 79 27 0a 58 65 72 72 6f | 72 20 66 6f 75 6e 64 20 |y'.Xerro|r found |
|00004570| 62 79 20 43 4f 4e 53 49 | 53 46 59 2e 0a 58 0a 58 |by CONSI|SFY..X.X|
|00004580| 41 50 50 4c 59 4d 41 50 | 28 54 2c 58 2c 59 2c 56 |APPLYMAP|(T,X,Y,V|
|00004590| 41 4c 55 45 29 3a 20 20 | 28 53 68 6f 75 6c 64 20 |ALUE): |(Should |
|000045a0| 6e 6f 74 20 62 65 20 63 | 61 6c 6c 65 64 20 77 69 |not be c|alled wi|
|000045b0| 74 68 20 56 41 4c 55 45 | 20 3d 20 55 4e 4b 2e 29 |th VALUE| = UNK.)|
|000045c0| 20 20 49 66 20 55 53 45 | 4d 41 50 0a 58 3d 20 66 | If USE|MAP.X= f|
|000045d0| 61 6c 73 65 2c 20 64 6f | 20 6e 6f 74 68 69 6e 67 |alse, do| nothing|
|000045e0| 2e 20 20 4f 74 68 65 72 | 77 69 73 65 2c 20 69 66 |. Other|wise, if|
|000045f0| 20 54 20 3d 20 30 20 6f | 72 20 54 50 2c 20 63 61 | T = 0 o|r TP, ca|
|00004600| 6c 6c 20 4d 41 50 20 6f | 72 20 49 4e 56 4d 41 50 |ll MAP o|r INVMAP|
|00004610| 2e 20 20 49 66 0a 58 74 | 68 65 20 6d 61 70 70 65 |. If.Xt|he mappe|
|00004620| 64 20 63 65 6c 6c 20 69 | 73 20 6f 75 74 20 6f 66 |d cell i|s out of|
|00004630| 20 62 6f 75 6e 64 73 2c | 20 64 6f 20 6e 6f 74 68 | bounds,| do noth|
|00004640| 69 6e 67 2e 20 20 4f 74 | 68 65 72 77 69 73 65 2c |ing. Ot|herwise,|
|00004650| 20 63 61 6c 6c 20 53 45 | 54 43 45 4c 4c 20 66 6f | call SE|TCELL fo|
|00004660| 72 0a 58 74 68 65 20 6d | 61 70 70 65 64 20 63 65 |r.Xthe m|apped ce|
|00004670| 6c 6c 20 61 6e 64 20 56 | 41 4c 55 45 2c 20 77 69 |ll and V|ALUE, wi|
|00004680| 74 68 20 46 52 45 45 3d | 66 61 6c 73 65 2e 20 20 |th FREE=|false. |
|00004690| 52 65 70 6f 72 74 20 61 | 6e 79 20 27 69 6e 63 6f |Report a|ny 'inco|
|000046a0| 6e 73 69 73 74 65 6e 63 | 79 27 0a 58 65 72 72 6f |nsistenc|y'.Xerro|
|000046b0| 72 20 66 6f 75 6e 64 20 | 62 79 20 53 45 54 43 45 |r found |by SETCE|
|000046c0| 4c 4c 2e 0a 58 0a 58 53 | 59 4d 4d 28 54 2c 58 2c |LL..X.XS|YMM(T,X,|
|000046d0| 59 2c 56 41 4c 55 45 29 | 3a 20 20 28 53 68 6f 75 |Y,VALUE)|: (Shou|
|000046e0| 6c 64 20 6e 6f 74 20 62 | 65 20 63 61 6c 6c 65 64 |ld not b|e called|
|000046f0| 20 77 69 74 68 20 56 41 | 4c 55 45 20 3d 20 55 4e | with VA|LUE = UN|
|00004700| 4b 2e 29 20 54 68 69 73 | 20 72 6f 75 74 69 6e 65 |K.) This| routine|
|00004710| 0a 58 64 65 61 6c 73 20 | 77 69 74 68 20 73 79 6d |.Xdeals |with sym|
|00004720| 6d 65 74 72 79 2c 20 62 | 69 6c 6c 69 61 72 64 20 |metry, b|illiard |
|00004730| 74 61 62 6c 69 63 69 74 | 79 2c 20 61 6e 64 20 6f |tablicit|y, and o|
|00004740| 74 68 65 72 20 72 65 73 | 74 72 69 63 74 69 6f 6e |ther res|triction|
|00004750| 73 20 64 65 73 69 72 65 | 64 20 62 79 0a 58 74 68 |s desire|d by.Xth|
|00004760| 65 20 75 73 65 72 2e 20 | 20 53 65 70 61 72 61 74 |e user. | Separat|
|00004770| 65 20 76 65 72 73 69 6f | 6e 73 20 6f 66 20 69 74 |e versio|ns of it|
|00004780| 20 65 78 69 73 74 20 66 | 6f 72 20 64 69 66 66 65 | exist f|or diffe|
|00004790| 72 65 6e 74 20 73 69 74 | 75 61 74 69 6f 6e 73 2e |rent sit|uations.|
|000047a0| 20 20 45 61 63 68 0a 58 | 6f 6e 65 20 6c 6f 6f 6b | Each.X|one look|
|000047b0| 73 20 61 74 20 54 2c 20 | 58 2c 20 59 2c 20 61 6e |s at T, |X, Y, an|
|000047c0| 64 20 56 41 4c 55 45 2c | 20 64 65 63 69 64 65 73 |d VALUE,| decides|
|000047d0| 20 69 66 20 61 6e 79 20 | 6f 74 68 65 72 20 63 65 | if any |other ce|
|000047e0| 6c 6c 73 20 61 72 65 20 | 66 6f 72 63 65 64 2c 20 |lls are |forced, |
|000047f0| 61 6e 64 0a 58 63 61 6c | 6c 73 20 53 45 54 43 45 |and.Xcal|ls SETCE|
|00004800| 4c 4c 20 66 6f 72 20 74 | 68 65 6d 2c 20 72 65 70 |LL for t|hem, rep|
|00004810| 6f 72 74 69 6e 67 20 61 | 6e 79 20 27 69 6e 63 6f |orting a|ny 'inco|
|00004820| 6e 73 69 73 74 65 6e 63 | 79 27 20 65 72 72 6f 72 |nsistenc|y' error|
|00004830| 73 2e 20 20 28 53 75 70 | 70 6f 73 65 20 66 6f 72 |s. (Sup|pose for|
|00004840| 0a 58 65 78 61 6d 70 6c | 65 20 74 68 61 74 20 77 |.Xexampl|e that w|
|00004850| 65 20 77 61 6e 74 20 61 | 20 70 61 74 74 65 72 6e |e want a| pattern|
|00004860| 20 74 6f 20 68 61 76 65 | 20 39 30 20 64 65 67 72 | to have| 90 degr|
|00004870| 65 65 20 72 6f 74 61 74 | 69 6f 6e 61 6c 20 73 79 |ee rotat|ional sy|
|00004880| 6d 6d 65 74 72 79 2e 20 | 20 54 68 65 6e 0a 58 53 |mmetry. | Then.XS|
|00004890| 59 4d 4d 20 63 6f 75 6c | 64 20 63 6f 6d 70 75 74 |YMM coul|d comput|
|000048a0| 65 20 74 68 65 20 63 6f | 6f 72 64 69 6e 61 74 65 |e the co|ordinate|
|000048b0| 73 20 6f 66 20 74 68 65 | 20 63 65 6c 6c 20 6f 62 |s of the| cell ob|
|000048c0| 74 61 69 6e 65 64 20 62 | 79 20 72 6f 74 61 74 69 |tained b|y rotati|
|000048d0| 6e 67 20 28 58 2c 59 29 | 0a 58 39 30 20 64 65 67 |ng (X,Y)|.X90 deg|
|000048e0| 72 65 65 73 20 61 62 6f | 75 74 20 74 68 65 20 63 |rees abo|ut the c|
|000048f0| 65 6e 74 65 72 20 6f 66 | 20 73 79 6d 6d 65 74 72 |enter of| symmetr|
|00004900| 79 20 61 6e 64 20 63 61 | 6c 6c 20 53 45 54 43 45 |y and ca|ll SETCE|
|00004910| 4c 4c 20 66 6f 72 20 69 | 74 2e 20 20 49 74 20 69 |LL for i|t. It i|
|00004920| 73 20 6e 6f 74 0a 58 6e | 65 63 65 73 73 61 72 79 |s not.Xn|ecessary|
|00004930| 20 74 6f 20 64 6f 20 74 | 68 65 20 73 61 6d 65 20 | to do t|he same |
|00004940| 66 6f 72 20 74 68 65 20 | 31 38 30 20 61 6e 64 20 |for the |180 and |
|00004950| 32 37 30 20 64 65 67 72 | 65 65 0a 58 72 6f 74 61 |270 degr|ee.Xrota|
|00004960| 74 69 6f 6e 73 3b 20 74 | 68 65 20 68 69 67 68 65 |tions; t|he highe|
|00004970| 72 20 6c 65 76 65 6c 73 | 20 6f 66 20 74 68 65 20 |r levels| of the |
|00004980| 70 72 6f 67 72 61 6d 20 | 77 69 6c 6c 20 74 61 6b |program |will tak|
|00004990| 65 20 63 61 72 65 20 6f | 66 20 74 68 61 74 2e 29 |e care o|f that.)|
|000049a0| 0a 58 0a 58 45 58 41 4d | 4e 45 58 54 3a 20 20 49 |.X.XEXAM|NEXT: I|
|000049b0| 66 20 4e 58 53 54 4e 47 | 20 3d 20 4e 57 53 54 4e |f NXSTNG| = NWSTN|
|000049c0| 47 2c 20 72 65 70 6f 72 | 74 20 61 20 27 66 75 6c |G, repor|t a 'ful|
|000049d0| 6c 20 63 6f 6e 73 69 73 | 74 65 6e 63 79 20 61 63 |l consis|tency ac|
|000049e0| 68 69 65 76 65 64 27 20 | 65 72 72 6f 72 2e 0a 58 |hieved' |error..X|
|000049f0| 4f 74 68 65 72 77 69 73 | 65 2c 20 67 65 74 20 74 |Otherwis|e, get t|
|00004a00| 68 65 20 76 61 6c 75 65 | 73 20 6f 66 20 54 2c 20 |he value|s of T, |
|00004a10| 58 2c 20 59 2c 20 61 6e | 64 20 56 41 4c 55 45 20 |X, Y, an|d VALUE |
|00004a20| 70 6f 69 6e 74 65 64 20 | 74 6f 20 62 79 20 4e 58 |pointed |to by NX|
|00004a30| 53 54 4e 47 2c 20 61 6e | 64 0a 58 69 6e 63 72 65 |STNG, an|d.Xincre|
|00004a40| 6d 65 6e 74 20 4e 58 53 | 54 4e 47 2e 20 43 61 6c |ment NXS|TNG. Cal|
|00004a50| 6c 20 41 50 50 4c 59 4d | 41 50 2c 20 53 59 4d 4d |l APPLYM|AP, SYMM|
|00004a60| 2c 20 61 6e 64 20 43 4f | 4e 53 49 53 31 30 2c 20 |, and CO|NSIS10, |
|00004a70| 72 65 70 6f 72 74 69 6e | 67 20 61 6e 79 20 65 72 |reportin|g any er|
|00004a80| 72 6f 72 73 0a 58 66 6f | 75 6e 64 20 62 79 20 74 |rors.Xfo|und by t|
|00004a90| 68 65 6d 2e 20 20 28 49 | 66 20 6f 6e 65 20 6f 66 |hem. (I|f one of|
|00004aa0| 20 74 68 65 20 72 6f 75 | 74 69 6e 65 73 20 67 69 | the rou|tines gi|
|00004ab0| 76 65 73 20 61 6e 20 65 | 72 72 6f 72 2c 20 69 74 |ves an e|rror, it|
|00004ac0| 27 73 20 6e 6f 74 20 6e | 65 63 65 73 73 61 72 79 |'s not n|ecessary|
|00004ad0| 0a 58 74 6f 20 63 61 6c | 6c 20 74 68 65 20 6f 74 |.Xto cal|l the ot|
|00004ae0| 68 65 72 73 2e 29 0a 58 | 0a 58 50 52 4f 43 45 45 |hers.).X|.XPROCEE|
|00004af0| 44 28 54 2c 58 2c 59 2c | 56 41 4c 55 45 2c 46 52 |D(T,X,Y,|VALUE,FR|
|00004b00| 45 45 29 3a 20 20 43 61 | 6c 6c 20 53 45 54 43 45 |EE): Ca|ll SETCE|
|00004b10| 4c 4c 2c 20 72 65 70 6f | 72 74 69 6e 67 20 61 6e |LL, repo|rting an|
|00004b20| 20 27 69 6e 63 6f 6e 73 | 69 73 74 65 6e 63 79 27 | 'incons|istency'|
|00004b30| 0a 58 65 72 72 6f 72 20 | 69 66 20 69 74 20 66 69 |.Xerror |if it fi|
|00004b40| 6e 64 73 20 6f 6e 65 2e | 20 20 4f 74 68 65 72 77 |nds one.| Otherw|
|00004b50| 69 73 65 2c 20 63 61 6c | 6c 20 45 58 41 4d 4e 45 |ise, cal|l EXAMNE|
|00004b60| 58 54 20 72 65 70 65 61 | 74 65 64 6c 79 2e 20 20 |XT repea|tedly. |
|00004b70| 45 76 65 6e 74 75 61 6c | 6c 79 2c 0a 58 69 74 20 |Eventual|ly,.Xit |
|00004b80| 77 69 6c 6c 20 72 65 70 | 6f 72 74 20 65 69 74 68 |will rep|ort eith|
|00004b90| 65 72 20 61 6e 20 69 6e | 63 6f 6e 73 69 73 74 65 |er an in|consiste|
|00004ba0| 6e 63 79 20 6f 72 20 66 | 75 6c 6c 20 63 6f 6e 73 |ncy or f|ull cons|
|00004bb0| 69 73 74 65 6e 63 79 2e | 20 20 49 6e 20 74 68 65 |istency.| In the|
|00004bc0| 20 66 69 72 73 74 0a 58 | 63 61 73 65 2c 20 72 65 | first.X|case, re|
|00004bd0| 70 6f 72 74 20 69 74 2e | 20 20 49 6e 20 74 68 65 |port it.| In the|
|00004be0| 20 73 65 63 6f 6e 64 20 | 63 61 73 65 2c 20 72 65 | second |case, re|
|00004bf0| 74 75 72 6e 20 77 69 74 | 68 6f 75 74 20 72 65 70 |turn wit|hout rep|
|00004c00| 6f 72 74 69 6e 67 20 61 | 6e 20 65 72 72 6f 72 2e |orting a|n error.|
|00004c10| 0a 58 54 68 69 73 20 72 | 6f 75 74 69 6e 65 20 69 |.XThis r|outine i|
|00004c20| 73 20 63 61 6c 6c 65 64 | 20 77 68 65 6e 65 76 65 |s called| wheneve|
|00004c30| 72 20 77 65 20 65 69 74 | 68 65 72 20 6d 61 6b 65 |r we eit|her make|
|00004c40| 20 61 20 66 72 65 65 20 | 63 68 6f 69 63 65 20 66 | a free |choice f|
|00004c50| 6f 72 20 61 20 63 65 6c | 6c 20 6f 72 0a 58 68 61 |or a cel|l or.Xha|
|00004c60| 76 65 20 62 61 63 6b 65 | 64 20 75 70 20 74 6f 20 |ve backe|d up to |
|00004c70| 61 20 66 72 65 65 20 63 | 68 6f 69 63 65 20 61 6e |a free c|hoice an|
|00004c80| 64 20 6e 6f 77 20 77 61 | 6e 74 20 74 6f 20 74 72 |d now wa|nt to tr|
|00004c90| 79 20 74 68 65 20 6f 74 | 68 65 72 20 76 61 6c 75 |y the ot|her valu|
|00004ca0| 65 20 74 68 65 72 65 3b | 0a 58 69 74 20 66 69 6e |e there;|.Xit fin|
|00004cb0| 64 73 20 61 6c 6c 20 74 | 68 65 20 28 64 69 72 65 |ds all t|he (dire|
|00004cc0| 63 74 20 6f 72 20 69 6e | 64 69 72 65 63 74 29 20 |ct or in|direct) |
|00004cd0| 63 6f 6e 63 6c 75 73 69 | 6f 6e 73 20 28 6f 72 20 |conclusi|ons (or |
|00004ce0| 61 20 63 6f 6e 74 72 61 | 64 69 63 74 69 6f 6e 29 |a contra|diction)|
|00004cf0| 20 66 72 6f 6d 0a 58 74 | 68 65 20 63 68 6f 69 63 | from.Xt|he choic|
|00004d00| 65 2e 20 20 49 74 20 63 | 61 6e 20 61 6c 73 6f 20 |e. It c|an also |
|00004d10| 62 65 20 63 61 6c 6c 65 | 64 20 66 72 6f 6d 20 74 |be calle|d from t|
|00004d20| 68 65 20 42 41 53 49 43 | 20 70 72 6f 67 72 61 6d |he BASIC| program|
|00004d30| 20 74 6f 20 69 6e 69 74 | 69 61 6c 69 7a 65 0a 58 | to init|ialize.X|
|00004d40| 63 65 72 74 61 69 6e 20 | 63 65 6c 6c 73 2e 20 20 |certain |cells. |
|00004d50| 28 4e 6f 74 65 3a 20 41 | 66 74 65 72 20 42 41 53 |(Note: A|fter BAS|
|00004d60| 49 43 20 68 61 73 20 64 | 6f 6e 65 20 73 75 63 68 |IC has d|one such|
|00004d70| 20 69 6e 69 74 69 61 6c | 69 7a 61 74 69 6f 6e 2c | initial|ization,|
|00004d80| 20 69 74 20 63 61 6e 20 | 73 65 74 0a 58 4e 58 53 | it can |set.XNXS|
|00004d90| 54 4e 47 20 61 6e 64 20 | 4e 57 53 54 4e 47 20 65 |TNG and |NWSTNG e|
|00004da0| 71 75 61 6c 20 74 6f 20 | 53 54 4e 47 20 69 6e 20 |qual to |STNG in |
|00004db0| 6f 72 64 65 72 20 74 6f | 20 73 61 76 65 20 73 70 |order to| save sp|
|00004dc0| 61 63 65 3b 20 73 69 6e | 63 65 20 77 65 20 64 6f |ace; sin|ce we do|
|00004dd0| 6e 27 74 20 77 61 6e 74 | 0a 58 74 6f 20 62 61 63 |n't want|.Xto bac|
|00004de0| 6b 20 75 70 20 6f 76 65 | 72 20 74 68 65 20 69 6e |k up ove|r the in|
|00004df0| 69 74 69 61 6c 69 7a 65 | 64 20 63 65 6c 6c 73 2c |itialize|d cells,|
|00004e00| 20 77 65 20 64 6f 6e 27 | 74 20 6e 65 65 64 20 74 | we don'|t need t|
|00004e10| 6f 20 72 65 6d 65 6d 62 | 65 72 20 74 68 65 6d 20 |o rememb|er them |
|00004e20| 69 6e 0a 58 74 68 65 20 | 73 65 74 74 69 6e 67 20 |in.Xthe |setting |
|00004e30| 6c 69 73 74 2e 29 0a 58 | 0a 58 42 41 43 4b 55 50 |list.).X|.XBACKUP|
|00004e40| 3a 20 20 55 6e 64 6f 20 | 61 6c 6c 20 73 65 74 74 |: Undo |all sett|
|00004e50| 69 6e 67 73 20 66 72 6f | 6d 20 4e 57 53 54 4e 47 |ings fro|m NWSTNG|
|00004e60| 20 62 61 63 6b 20 74 6f | 20 28 61 6e 64 20 69 6e | back to| (and in|
|00004e70| 63 6c 75 64 69 6e 67 29 | 20 74 68 65 20 6d 6f 73 |cluding)| the mos|
|00004e80| 74 0a 58 72 65 63 65 6e | 74 20 66 72 65 65 20 63 |t.Xrecen|t free c|
|00004e90| 68 6f 69 63 65 2c 20 63 | 68 61 6e 67 69 6e 67 20 |hoice, c|hanging |
|00004ea0| 74 68 65 69 72 20 76 61 | 6c 75 65 73 20 69 6e 20 |their va|lues in |
|00004eb0| 43 45 4c 4c 20 62 61 63 | 6b 20 74 6f 20 55 4e 4b |CELL bac|k to UNK|
|00004ec0| 2e 20 20 49 66 20 77 65 | 20 62 61 63 6b 0a 58 75 |. If we| back.Xu|
|00004ed0| 70 20 61 6c 6c 20 74 68 | 65 20 77 61 79 20 74 6f |p all th|e way to|
|00004ee0| 20 53 54 4e 47 2c 20 72 | 65 70 6f 72 74 20 61 6e | STNG, r|eport an|
|00004ef0| 20 27 6f 62 6a 65 63 74 | 20 64 6f 65 73 20 6e 6f | 'object| does no|
|00004f00| 74 20 65 78 69 73 74 27 | 20 65 72 72 6f 72 2e 20 |t exist'| error. |
|00004f10| 4f 74 68 65 72 77 69 73 | 65 2c 0a 58 6d 61 6b 65 |Otherwis|e,.Xmake|
|00004f20| 20 4e 57 53 54 4e 47 20 | 61 6e 64 20 4e 58 53 54 | NWSTNG |and NXST|
|00004f30| 4e 47 20 70 6f 69 6e 74 | 20 74 6f 20 74 68 65 20 |NG point| to the |
|00004f40| 66 72 65 65 20 63 68 6f | 69 63 65 20 61 6e 64 20 |free cho|ice and |
|00004f50| 72 65 74 75 72 6e 20 74 | 68 65 20 76 61 6c 75 65 |return t|he value|
|00004f60| 73 20 6f 66 20 54 2c 0a | 58 58 2c 20 59 2c 20 61 |s of T,.|XX, Y, a|
|00004f70| 6e 64 20 56 41 4c 55 45 | 20 66 72 6f 6d 20 69 74 |nd VALUE| from it|
|00004f80| 2e 20 20 28 54 68 69 73 | 20 63 6f 72 72 65 73 70 |. (This| corresp|
|00004f90| 6f 6e 64 73 20 74 6f 20 | 72 65 70 65 61 74 65 64 |onds to |repeated|
|00004fa0| 20 61 70 70 6c 69 63 61 | 74 69 6f 6e 20 6f 66 20 | applica|tion of |
|00004fb0| 53 74 65 70 0a 58 32 20 | 69 6e 20 74 68 65 20 70 |Step.X2 |in the p|
|00004fc0| 72 6f 67 72 61 6d 20 6f | 75 74 6c 69 6e 65 20 61 |rogram o|utline a|
|00004fd0| 62 6f 76 65 2e 29 0a 58 | 0a 58 47 4f 28 54 2c 58 |bove.).X|.XGO(T,X|
|00004fe0| 2c 59 2c 56 41 4c 55 45 | 2c 46 52 45 45 29 3a 20 |,Y,VALUE|,FREE): |
|00004ff0| 20 5b 49 20 72 61 6e 20 | 6f 75 74 20 6f 66 20 67 | [I ran |out of g|
|00005000| 6f 6f 64 20 64 65 73 63 | 72 69 70 74 69 76 65 20 |ood desc|riptive |
|00005010| 73 75 62 72 6f 75 74 69 | 6e 65 20 6e 61 6d 65 73 |subrouti|ne names|
|00005020| 2e 5d 0a 58 43 61 6c 6c | 20 50 52 4f 43 45 45 44 |.].XCall| PROCEED|
|00005030| 28 54 2c 58 2c 59 2c 56 | 41 4c 55 45 2c 46 52 45 |(T,X,Y,V|ALUE,FRE|
|00005040| 45 29 2e 20 20 49 66 20 | 69 74 20 72 65 74 75 72 |E). If |it retur|
|00005050| 6e 73 20 77 69 74 68 6f | 75 74 20 61 6e 20 65 72 |ns witho|ut an er|
|00005060| 72 6f 72 2c 20 74 68 65 | 6e 20 66 75 6c 6c 0a 58 |ror, the|n full.X|
|00005070| 63 6f 6e 73 69 73 74 65 | 6e 63 79 20 68 61 73 20 |consiste|ncy has |
|00005080| 62 65 65 6e 20 61 63 68 | 69 65 76 65 64 3b 20 72 |been ach|ieved; r|
|00005090| 65 74 75 72 6e 20 77 69 | 74 68 6f 75 74 20 61 6e |eturn wi|thout an|
|000050a0| 20 65 72 72 6f 72 2e 20 | 20 4f 74 68 65 72 77 69 | error. | Otherwi|
|000050b0| 73 65 20 63 61 6c 6c 0a | 58 42 41 43 4b 55 50 2c |se call.|XBACKUP,|
|000050c0| 20 72 65 70 6f 72 74 69 | 6e 67 20 61 6e 20 27 6f | reporti|ng an 'o|
|000050d0| 62 6a 65 63 74 20 64 6f | 65 73 20 6e 6f 74 20 65 |bject do|es not e|
|000050e0| 78 69 73 74 27 20 65 72 | 72 6f 72 20 69 66 20 42 |xist' er|ror if B|
|000050f0| 41 43 4b 55 50 20 66 69 | 6e 64 73 20 6f 6e 65 2e |ACKUP fi|nds one.|
|00005100| 0a 58 4f 74 68 65 72 77 | 69 73 65 2c 20 63 61 6c |.XOtherw|ise, cal|
|00005110| 6c 20 50 52 4f 43 45 45 | 44 28 54 2c 58 2c 59 2c |l PROCEE|D(T,X,Y,|
|00005120| 31 2d 56 41 4c 55 45 2c | 66 61 6c 73 65 29 2e 20 |1-VALUE,|false). |
|00005130| 20 43 6f 6e 74 69 6e 75 | 65 20 63 61 6c 6c 69 6e | Continu|e callin|
|00005140| 67 20 50 52 4f 43 45 45 | 44 20 61 6e 64 0a 58 42 |g PROCEE|D and.XB|
|00005150| 41 43 4b 55 50 20 61 6c | 74 65 72 6e 61 74 65 6c |ACKUP al|ternatel|
|00005160| 79 20 75 6e 74 69 6c 20 | 65 69 74 68 65 72 20 66 |y until |either f|
|00005170| 75 6c 6c 20 63 6f 6e 73 | 69 73 74 65 6e 63 79 20 |ull cons|istency |
|00005180| 69 73 20 61 63 68 69 65 | 76 65 64 20 6f 72 20 61 |is achie|ved or a|
|00005190| 6e 20 27 6f 62 6a 65 63 | 74 0a 58 64 6f 65 73 20 |n 'objec|t.Xdoes |
|000051a0| 6e 6f 74 20 65 78 69 73 | 74 27 20 65 72 72 6f 72 |not exis|t' error|
|000051b0| 20 6f 63 63 75 72 73 2e | 20 28 54 68 69 73 20 63 | occurs.| (This c|
|000051c0| 6f 72 72 65 73 70 6f 6e | 64 73 20 74 6f 20 72 65 |orrespon|ds to re|
|000051d0| 70 65 61 74 65 64 20 61 | 70 70 6c 69 63 61 74 69 |peated a|pplicati|
|000051e0| 6f 6e 20 6f 66 0a 58 53 | 74 65 70 73 20 31 20 61 |on of.XS|teps 1 a|
|000051f0| 6e 64 20 32 20 61 62 6f | 76 65 2e 29 0a 58 0a 58 |nd 2 abo|ve.).X.X|
|00005200| 47 45 54 55 4e 4b 3a 20 | 20 53 65 6c 65 63 74 20 |GETUNK: | Select |
|00005210| 61 6e 20 75 6e 6b 6e 6f | 77 6e 20 63 65 6c 6c 2e |an unkno|wn cell.|
|00005220| 20 20 49 66 20 6e 6f 6e | 65 20 65 78 69 73 74 2c | If non|e exist,|
|00005230| 20 72 65 70 6f 72 74 20 | 61 20 6e 6f 20 27 6d 6f | report |a no 'mo|
|00005240| 72 65 20 75 6e 6b 6e 6f | 77 6e 0a 58 63 65 6c 6c |re unkno|wn.Xcell|
|00005250| 73 27 20 65 72 72 6f 72 | 2e 20 20 28 54 68 69 73 |s' error|. (This|
|00005260| 20 6d 65 61 6e 73 20 74 | 68 61 74 20 61 6e 20 6f | means t|hat an o|
|00005270| 62 6a 65 63 74 20 68 61 | 73 20 62 65 65 6e 20 66 |bject ha|s been f|
|00005280| 6f 75 6e 64 2e 29 20 20 | 4f 74 68 65 72 77 69 73 |ound.) |Otherwis|
|00005290| 65 2c 0a 58 72 65 74 75 | 72 6e 20 74 68 65 20 76 |e,.Xretu|rn the v|
|000052a0| 61 6c 75 65 73 20 6f 66 | 20 54 2c 20 58 2c 20 61 |alues of| T, X, a|
|000052b0| 6e 64 20 59 2e 20 20 49 | 20 77 6f 6e 27 74 20 64 |nd Y. I| won't d|
|000052c0| 65 73 63 72 69 62 65 20 | 74 68 69 73 20 72 6f 75 |escribe |this rou|
|000052d0| 74 69 6e 65 20 69 6e 20 | 64 65 74 61 69 6c 0a 58 |tine in |detail.X|
|000052e0| 62 65 63 61 75 73 65 20 | 49 20 68 61 76 65 6e 27 |because |I haven'|
|000052f0| 74 20 64 65 74 65 72 6d | 69 6e 65 64 20 74 68 65 |t determ|ined the|
|00005300| 20 62 65 73 74 20 77 61 | 79 20 66 6f 72 20 69 74 | best wa|y for it|
|00005310| 20 74 6f 20 6d 61 6b 65 | 20 69 74 73 20 63 68 6f | to make| its cho|
|00005320| 69 63 65 2e 20 20 57 65 | 27 64 0a 58 6c 69 6b 65 |ice. We|'d.Xlike|
|00005330| 20 74 6f 20 63 68 6f 6f | 73 65 20 63 65 6c 6c 73 | to choo|se cells|
|00005340| 20 77 68 69 63 68 20 61 | 72 65 20 6d 6f 73 74 20 | which a|re most |
|00005350| 6c 69 6b 65 6c 79 20 74 | 6f 20 72 65 76 65 61 6c |likely t|o reveal|
|00005360| 20 61 6e 79 20 70 72 65 | 76 69 6f 75 73 20 62 61 | any pre|vious ba|
|00005370| 64 0a 58 63 68 6f 69 63 | 65 73 2e 20 20 43 68 6f |d.Xchoic|es. Cho|
|00005380| 6f 73 69 6e 67 20 63 65 | 6c 6c 73 20 77 68 69 63 |osing ce|lls whic|
|00005390| 68 20 61 72 65 20 6e 65 | 61 72 20 72 65 63 65 6e |h are ne|ar recen|
|000053a0| 74 6c 79 20 63 68 6f 73 | 65 6e 20 6f 72 20 66 6f |tly chos|en or fo|
|000053b0| 72 63 65 64 20 63 65 6c | 6c 73 20 69 73 0a 58 61 |rced cel|ls is.Xa|
|000053c0| 20 67 6f 6f 64 20 69 64 | 65 61 2c 20 62 75 74 20 | good id|ea, but |
|000053d0| 74 68 65 72 65 27 73 20 | 61 20 64 61 6e 67 65 72 |there's |a danger|
|000053e0| 20 74 68 61 74 20 77 65 | 27 6c 6c 20 67 65 74 20 | that we|'ll get |
|000053f0| 73 74 75 63 6b 20 69 6e | 20 6f 6e 65 20 72 65 67 |stuck in| one reg|
|00005400| 69 6f 6e 20 61 6e 64 0a | 58 6e 6f 74 20 6e 6f 74 |ion and.|Xnot not|
|00005410| 69 63 65 20 74 68 61 74 | 20 73 6f 6d 65 74 68 69 |ice that| somethi|
|00005420| 6e 67 20 63 68 6f 73 65 | 6e 20 6c 6f 6e 67 20 61 |ng chose|n long a|
|00005430| 67 6f 20 77 61 73 20 62 | 61 64 2e 20 20 43 75 72 |go was b|ad. Cur|
|00005440| 72 65 6e 74 6c 79 2c 20 | 49 20 75 73 65 20 61 20 |rently, |I use a |
|00005450| 6c 69 73 74 0a 58 6f 66 | 20 61 6c 6c 20 63 65 6c |list.Xof| all cel|
|00005460| 6c 73 20 73 65 74 20 75 | 70 20 62 79 20 74 68 65 |ls set u|p by the|
|00005470| 20 42 41 53 49 43 20 70 | 72 6f 67 72 61 6d 20 61 | BASIC p|rogram a|
|00005480| 6e 64 20 6a 75 73 74 20 | 63 68 6f 6f 73 65 20 74 |nd just |choose t|
|00005490| 68 65 20 66 69 72 73 74 | 20 75 6e 6b 6e 6f 77 6e |he first| unknown|
|000054a0| 0a 58 6f 6e 65 20 6f 6e | 20 74 68 65 20 6c 69 73 |.Xone on| the lis|
|000054b0| 74 2e 20 20 42 75 74 20 | 65 76 65 6e 20 61 73 73 |t. But |even ass|
|000054c0| 75 6d 69 6e 67 20 74 68 | 61 74 20 77 65 27 72 65 |uming th|at we're|
|000054d0| 20 67 6f 69 6e 67 20 74 | 6f 20 64 6f 20 69 74 20 | going t|o do it |
|000054e0| 74 68 61 74 20 77 61 79 | 2c 0a 58 69 74 27 73 20 |that way|,.Xit's |
|000054f0| 6e 6f 74 20 63 6c 65 61 | 72 20 68 6f 77 20 74 68 |not clea|r how th|
|00005500| 65 20 6c 69 73 74 20 73 | 68 6f 75 6c 64 20 62 65 |e list s|hould be|
|00005510| 20 61 72 72 61 6e 67 65 | 64 2e 20 20 55 73 75 61 | arrange|d. Usua|
|00005520| 6c 6c 79 20 49 20 70 72 | 6f 63 65 65 64 20 75 70 |lly I pr|oceed up|
|00005530| 20 74 68 65 0a 58 63 6f | 6c 75 6d 6e 73 20 66 72 | the.Xco|lumns fr|
|00005540| 6f 6d 20 6c 65 66 74 20 | 74 6f 20 72 69 67 68 74 |om left |to right|
|00005550| 20 6f 72 20 64 6f 77 6e | 20 73 6c 6f 70 65 20 2d | or down| slope -|
|00005560| 31 20 64 69 61 67 6f 6e | 61 6c 73 20 66 72 6f 6d |1 diagon|als from|
|00005570| 20 6c 65 66 74 20 74 6f | 20 72 69 67 68 74 2e 0a | left to| right..|
|00005580| 58 0a 58 43 48 4f 4f 53 | 45 28 54 2c 58 2c 59 29 |X.XCHOOS|E(T,X,Y)|
|00005590| 3a 20 20 52 65 74 75 72 | 6e 20 61 20 76 61 6c 75 |: Retur|n a valu|
|000055a0| 65 20 74 6f 20 62 65 20 | 61 73 73 69 67 6e 65 64 |e to be |assigned|
|000055b0| 20 74 6f 20 74 68 65 20 | 63 75 72 72 65 6e 74 6c | to the |currentl|
|000055c0| 79 20 75 6e 6b 6e 6f 77 | 6e 20 63 65 6c 6c 0a 58 |y unknow|n cell.X|
|000055d0| 28 54 2c 58 2c 59 29 2c | 20 65 69 74 68 65 72 20 |(T,X,Y),| either |
|000055e0| 30 20 6f 72 20 31 2e 20 | 20 41 67 61 69 6e 2c 20 |0 or 1. | Again, |
|000055f0| 49 20 64 6f 6e 27 74 20 | 6b 6e 6f 77 20 74 68 65 |I don't |know the|
|00005600| 20 62 65 73 74 20 77 61 | 79 20 74 6f 20 64 6f 20 | best wa|y to do |
|00005610| 74 68 69 73 2e 20 20 46 | 6f 72 0a 58 61 20 63 6f |this. F|or.Xa co|
|00005620| 6d 70 6c 65 74 65 20 73 | 65 61 72 63 68 2c 20 69 |mplete s|earch, i|
|00005630| 74 20 64 6f 65 73 6e 27 | 74 20 6d 61 74 74 65 72 |t doesn'|t matter|
|00005640| 3b 20 62 6f 74 68 20 63 | 68 6f 69 63 65 73 20 77 |; both c|hoices w|
|00005650| 69 6c 6c 20 65 76 65 6e | 74 75 61 6c 6c 79 20 62 |ill even|tually b|
|00005660| 65 0a 58 74 72 69 65 64 | 2e 20 20 46 6f 72 20 61 |e.Xtried|. For a|
|00005670| 20 70 61 72 74 69 61 6c | 20 73 65 61 72 63 68 2c | partial| search,|
|00005680| 20 69 74 20 64 6f 65 73 | 2e 20 20 49 20 75 73 75 | it does|. I usu|
|00005690| 61 6c 6c 79 20 63 68 6f | 6f 73 65 20 30 20 66 69 |ally cho|ose 0 fi|
|000056a0| 72 73 74 2c 20 68 6f 70 | 69 6e 67 0a 58 74 68 61 |rst, hop|ing.Xtha|
|000056b0| 74 20 61 20 73 6d 61 6c | 6c 20 6f 62 6a 65 63 74 |t a smal|l object|
|000056c0| 20 77 69 6c 6c 20 62 65 | 20 66 6f 75 6e 64 2e 20 | will be| found. |
|000056d0| 20 53 6f 6d 65 74 69 6d | 65 73 20 49 20 63 68 6f | Sometim|es I cho|
|000056e0| 6f 73 65 20 31 20 74 6f | 20 70 72 65 76 65 6e 74 |ose 1 to| prevent|
|000056f0| 20 74 68 65 0a 58 65 6d | 70 74 79 20 6f 62 6a 65 | the.Xem|pty obje|
|00005700| 63 74 20 66 72 6f 6d 20 | 62 65 69 6e 67 20 66 6f |ct from |being fo|
|00005710| 75 6e 64 2e 20 20 53 6f | 6d 65 74 69 6d 65 73 20 |und. So|metimes |
|00005720| 49 20 6c 6f 6f 6b 20 66 | 6f 72 20 61 6e 20 61 6c |I look f|or an al|
|00005730| 72 65 61 64 79 20 63 68 | 6f 73 65 6e 0a 58 76 61 |ready ch|osen.Xva|
|00005740| 6c 75 65 20 6f 66 20 43 | 45 4c 4c 5b 54 27 2c 58 |lue of C|ELL[T',X|
|00005750| 2c 59 5d 2c 20 66 6f 72 | 20 54 27 20 6e 6f 74 20 |,Y], for| T' not |
|00005760| 65 71 75 61 6c 20 74 6f | 20 54 2c 20 61 6e 64 20 |equal to| T, and |
|00005770| 67 69 76 65 20 43 45 4c | 4c 5b 54 2c 58 2c 59 5d |give CEL|L[T,X,Y]|
|00005780| 20 74 68 65 20 73 61 6d | 65 0a 58 76 61 6c 75 65 | the sam|e.Xvalue|
|00005790| 2c 20 68 6f 70 69 6e 67 | 20 74 68 61 74 20 61 20 |, hoping| that a |
|000057a0| 62 69 6c 6c 69 61 72 64 | 20 74 61 62 6c 65 20 77 |billiard| table w|
|000057b0| 69 6c 6c 20 62 65 20 66 | 6f 75 6e 64 2e 20 20 49 |ill be f|ound. I|
|000057c0| 20 63 61 6e 20 73 70 65 | 63 69 66 79 20 77 68 69 | can spe|cify whi|
|000057d0| 63 68 20 6f 66 0a 58 74 | 68 65 73 65 20 6d 65 74 |ch of.Xt|hese met|
|000057e0| 68 6f 64 73 20 77 69 6c | 6c 20 62 65 20 75 73 65 |hods wil|l be use|
|000057f0| 64 20 69 6e 69 74 69 61 | 6c 6c 79 2c 20 61 6e 64 |d initia|lly, and|
|00005800| 20 63 61 6e 20 63 68 61 | 6e 67 65 20 69 74 20 69 | can cha|nge it i|
|00005810| 6e 20 74 68 65 20 6d 69 | 64 64 6c 65 20 6f 66 20 |n the mi|ddle of |
|00005820| 61 0a 58 73 65 61 72 63 | 68 2e 0a 58 0a 58 4d 41 |a.Xsearc|h..X.XMA|
|00005830| 49 4e 3a 20 20 20 54 68 | 69 73 20 69 73 20 74 68 |IN: Th|is is th|
|00005840| 65 20 74 6f 70 20 6c 65 | 76 65 6c 20 6d 61 63 68 |e top le|vel mach|
|00005850| 69 6e 65 20 6c 61 6e 67 | 75 61 67 65 20 72 6f 75 |ine lang|uage rou|
|00005860| 74 69 6e 65 20 77 68 69 | 63 68 20 69 73 20 63 61 |tine whi|ch is ca|
|00005870| 6c 6c 65 64 20 66 72 6f | 6d 0a 58 74 68 65 20 42 |lled fro|m.Xthe B|
|00005880| 41 53 49 43 20 70 72 6f | 67 72 61 6d 2e 20 20 49 |ASIC pro|gram. I|
|00005890| 74 20 73 65 61 72 63 68 | 65 73 20 75 6e 74 69 6c |t search|es until|
|000058a0| 20 69 74 20 65 69 74 68 | 65 72 20 66 69 6e 64 73 | it eith|er finds|
|000058b0| 20 61 6e 20 6f 62 6a 65 | 63 74 20 6f 66 20 74 68 | an obje|ct of th|
|000058c0| 65 0a 58 64 65 73 69 72 | 65 64 20 74 79 70 65 2c |e.Xdesir|ed type,|
|000058d0| 20 64 65 63 69 64 65 73 | 20 74 68 61 74 20 74 68 | decides| that th|
|000058e0| 65 72 65 20 61 72 65 6e | 27 74 20 61 6e 79 20 6d |ere aren|'t any m|
|000058f0| 6f 72 65 2c 20 6f 72 20 | 69 73 20 69 6e 74 65 72 |ore, or |is inter|
|00005900| 72 75 70 74 65 64 20 62 | 79 20 74 68 65 0a 58 75 |rupted b|y the.Xu|
|00005910| 73 65 72 2e 20 20 53 70 | 65 63 69 66 69 63 61 6c |ser. Sp|ecifical|
|00005920| 6c 79 2c 20 69 74 20 64 | 6f 65 73 20 74 68 69 73 |ly, it d|oes this|
|00005930| 3a 0a 58 0a 58 20 20 20 | 20 20 53 74 65 70 20 30 |:.X.X | Step 0|
|00005940| 3a 20 43 61 6c 6c 20 47 | 45 54 55 4e 4b 2e 20 20 |: Call G|ETUNK. |
|00005950| 49 66 20 69 74 20 66 69 | 6e 64 73 20 61 6e 20 75 |If it fi|nds an u|
|00005960| 6e 6b 6e 6f 77 6e 20 63 | 65 6c 6c 20 28 54 2c 58 |nknown c|ell (T,X|
|00005970| 2c 59 29 2c 20 67 6f 20 | 74 6f 0a 58 20 20 20 20 |,Y), go |to.X |
|00005980| 20 20 20 20 20 20 20 20 | 20 73 74 65 70 20 31 2e | | step 1.|
|00005990| 20 20 4f 74 68 65 72 77 | 69 73 65 2c 20 77 65 27 | Otherw|ise, we'|
|000059a0| 76 65 20 61 6c 72 65 61 | 64 79 20 66 6f 75 6e 64 |ve alrea|dy found|
|000059b0| 20 61 6e 20 6f 62 6a 65 | 63 74 20 61 6e 64 20 77 | an obje|ct and w|
|000059c0| 61 6e 74 0a 58 20 20 20 | 20 20 20 20 20 20 20 20 |ant.X | |
|000059d0| 20 20 74 6f 20 6c 6f 6f | 6b 20 66 6f 72 20 61 6e | to loo|k for an|
|000059e0| 6f 74 68 65 72 20 6f 6e | 65 2e 20 20 53 6f 20 63 |other on|e. So c|
|000059f0| 61 6c 6c 20 42 41 43 4b | 55 50 2e 20 20 49 66 20 |all BACK|UP. If |
|00005a00| 69 74 20 67 69 76 65 73 | 20 61 6e 0a 58 20 20 20 |it gives| an.X |
|00005a10| 20 20 20 20 20 20 20 20 | 20 20 27 6f 62 6a 65 63 | | 'objec|
|00005a20| 74 20 64 6f 65 73 20 6e | 6f 74 20 65 78 69 73 74 |t does n|ot exist|
|00005a30| 27 20 65 72 72 6f 72 2c | 20 72 65 70 6f 72 74 20 |' error,| report |
|00005a40| 69 74 2e 20 4f 74 68 65 | 72 77 69 73 65 2c 0a 58 |it. Othe|rwise,.X|
|00005a50| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 63 68 61 | | cha|
|00005a60| 6e 67 65 20 56 41 4c 55 | 45 20 74 6f 20 31 2d 56 |nge VALU|E to 1-V|
|00005a70| 41 4c 55 45 2c 20 73 65 | 74 20 46 52 45 45 20 3d |ALUE, se|t FREE =|
|00005a80| 20 66 61 6c 73 65 2c 20 | 61 6e 64 20 67 6f 20 74 | false, |and go t|
|00005a90| 6f 0a 58 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |o.X | |
|00005aa0| 73 74 65 70 20 32 2e 0a | 58 0a 58 20 20 20 20 20 |step 2..|X.X |
|00005ab0| 53 74 65 70 20 31 3a 20 | 43 61 6c 6c 20 43 48 4f |Step 1: |Call CHO|
|00005ac0| 4f 53 45 20 74 6f 20 73 | 65 6c 65 63 74 20 61 20 |OSE to s|elect a |
|00005ad0| 56 41 4c 55 45 20 66 6f | 72 20 74 68 65 20 75 6e |VALUE fo|r the un|
|00005ae0| 6b 6e 6f 77 6e 20 63 65 | 6c 6c 2c 20 73 65 74 0a |known ce|ll, set.|
|00005af0| 58 20 20 20 20 20 20 20 | 20 20 20 20 20 20 46 52 |X | FR|
|00005b00| 45 45 20 3d 20 74 72 75 | 65 2c 20 61 6e 64 20 67 |EE = tru|e, and g|
|00005b10| 6f 20 74 6f 20 73 74 65 | 70 20 32 2e 0a 58 0a 58 |o to ste|p 2..X.X|
|00005b20| 20 20 20 20 20 53 74 65 | 70 20 32 3a 20 43 61 6c | Ste|p 2: Cal|
|00005b30| 6c 20 47 4f 28 54 2c 58 | 2c 59 2c 56 41 4c 55 45 |l GO(T,X|,Y,VALUE|
|00005b40| 2c 46 52 45 45 29 2e 20 | 20 49 66 20 69 74 20 67 |,FREE). | If it g|
|00005b50| 69 76 65 73 20 61 6e 20 | 27 6f 62 6a 65 63 74 20 |ives an |'object |
|00005b60| 64 6f 65 73 20 6e 6f 74 | 0a 58 20 20 20 20 20 20 |does not|.X |
|00005b70| 20 20 20 20 20 20 20 65 | 78 69 73 74 27 20 65 72 | e|xist' er|
|00005b80| 72 6f 72 2c 20 72 65 70 | 6f 72 74 20 69 74 2e 20 |ror, rep|ort it. |
|00005b90| 20 4f 74 68 65 72 77 69 | 73 65 2c 20 63 68 65 63 | Otherwi|se, chec|
|00005ba0| 6b 20 74 6f 20 73 65 65 | 20 69 66 20 74 68 65 0a |k to see| if the.|
|00005bb0| 58 20 20 20 20 20 20 20 | 20 20 20 20 20 20 75 73 |X | us|
|00005bc0| 65 72 20 68 61 73 20 74 | 79 70 65 64 20 61 20 6b |er has t|yped a k|
|00005bd0| 65 79 2e 20 20 49 66 20 | 73 6f 2c 20 72 65 74 75 |ey. If |so, retu|
|00005be0| 72 6e 2e 20 20 28 54 68 | 65 20 75 73 65 72 20 63 |rn. (Th|e user c|
|00005bf0| 61 6e 20 74 68 65 6e 0a | 58 20 20 20 20 20 20 20 |an then.|X |
|00005c00| 20 20 20 20 20 20 64 69 | 73 70 6c 61 79 20 74 68 | di|splay th|
|00005c10| 65 20 63 75 72 72 65 6e | 74 20 63 6f 6e 74 65 6e |e curren|t conten|
|00005c20| 74 73 20 6f 66 20 43 45 | 4c 4c 20 74 6f 20 6f 62 |ts of CE|LL to ob|
|00005c30| 73 65 72 76 65 20 74 68 | 65 0a 58 20 20 20 20 20 |serve th|e.X |
|00005c40| 20 20 20 20 20 20 20 20 | 70 72 6f 67 72 65 73 73 | |progress|
|00005c50| 20 6f 66 20 74 68 65 20 | 73 65 61 72 63 68 2c 20 | of the |search, |
|00005c60| 61 6e 64 20 6d 61 6b 65 | 20 73 6f 6d 65 20 63 68 |and make| some ch|
|00005c70| 61 6e 67 65 73 20 69 66 | 20 64 65 73 69 72 65 64 |anges if| desired|
|00005c80| 2e 0a 58 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |..X | |
|00005c90| 43 61 6c 6c 69 6e 67 20 | 4d 41 49 4e 20 61 67 61 |Calling |MAIN aga|
|00005ca0| 69 6e 20 77 69 6c 6c 20 | 63 6f 6e 74 69 6e 75 65 |in will |continue|
|00005cb0| 20 74 68 65 20 73 65 61 | 72 63 68 2e 29 20 49 66 | the sea|rch.) If|
|00005cc0| 20 6e 6f 20 6b 65 79 0a | 58 20 20 20 20 20 20 20 | no key.|X |
|00005cd0| 20 20 20 20 20 20 68 61 | 73 20 62 65 65 6e 20 74 | ha|s been t|
|00005ce0| 79 70 65 64 2c 20 67 6f | 20 74 6f 20 73 74 65 70 |yped, go| to step|
|00005cf0| 20 33 2e 0a 58 0a 58 20 | 20 20 20 20 53 74 65 70 | 3..X.X | Step|
|00005d00| 20 33 3a 20 43 61 6c 6c | 20 47 45 54 55 4e 4b 2e | 3: Call| GETUNK.|
|00005d10| 20 20 49 66 20 69 74 20 | 66 69 6e 64 73 20 61 6e | If it |finds an|
|00005d20| 20 75 6e 6b 6e 6f 77 6e | 20 63 65 6c 6c 20 28 54 | unknown| cell (T|
|00005d30| 2c 58 2c 59 29 2c 20 67 | 6f 20 74 6f 0a 58 20 20 |,X,Y), g|o to.X |
|00005d40| 20 20 20 20 20 20 20 20 | 20 20 20 73 74 65 70 20 | | step |
|00005d50| 31 2e 20 20 4f 74 68 65 | 72 77 69 73 65 2c 20 72 |1. Othe|rwise, r|
|00005d60| 65 70 6f 72 74 20 74 68 | 61 74 20 61 6e 20 6f 62 |eport th|at an ob|
|00005d70| 6a 65 63 74 20 68 61 73 | 20 62 65 65 6e 20 66 6f |ject has| been fo|
|00005d80| 75 6e 64 2e 0a 58 0a 58 | 20 20 20 20 20 49 6e 20 |und..X.X| In |
|00005d90| 61 64 64 69 74 69 6f 6e | 20 74 6f 20 4d 41 49 4e |addition| to MAIN|
|00005da0| 2c 20 74 68 65 20 75 73 | 65 72 20 63 61 6e 20 61 |, the us|er can a|
|00005db0| 6c 73 6f 20 63 61 6c 6c | 20 50 52 4f 43 45 45 44 |lso call| PROCEED|
|00005dc0| 20 61 6e 64 20 42 41 43 | 4b 55 50 3b 20 74 68 65 | and BAC|KUP; the|
|00005dd0| 73 65 0a 58 61 72 65 20 | 73 6f 6d 65 74 69 6d 65 |se.Xare |sometime|
|00005de0| 73 20 75 73 65 66 75 6c | 20 66 6f 72 20 67 75 69 |s useful| for gui|
|00005df0| 64 69 6e 67 20 61 20 73 | 65 61 72 63 68 20 69 6e |ding a s|earch in|
|00005e00| 20 61 20 70 72 6f 6d 69 | 73 69 6e 67 20 64 69 72 | a promi|sing dir|
|00005e10| 65 63 74 69 6f 6e 2e 0a | 58 3d 3d 3d 3d 3d 3d 3d |ection..|X=======|
|00005e20| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00005e30| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00005e40| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00005e50| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00005e60| 3d 3d 3d 3d 0a 58 45 4e | 44 20 4f 46 20 46 49 4c |====.XEN|D OF FIL|
|00005e70| 45 0a 45 4e 44 5f 4f 46 | 5f 46 49 4c 45 0a 69 66 |E.END_OF|_FILE.if|
|00005e80| 20 74 65 73 74 20 32 32 | 39 30 33 20 2d 6e 65 20 | test 22|903 -ne |
|00005e90| 60 77 63 20 2d 63 20 3c | 27 4f 52 49 47 49 4e 27 |`wc -c <|'ORIGIN'|
|00005ea0| 60 3b 20 74 68 65 6e 0a | 20 20 20 20 65 63 68 6f |`; then.| echo|
|00005eb0| 20 73 68 61 72 3a 20 5c | 22 27 4f 52 49 47 49 4e | shar: \|"'ORIGIN|
|00005ec0| 27 5c 22 20 75 6e 70 61 | 63 6b 65 64 20 77 69 74 |'\" unpa|cked wit|
|00005ed0| 68 20 77 72 6f 6e 67 20 | 73 69 7a 65 21 0a 66 69 |h wrong |size!.fi|
|00005ee0| 0a 23 20 65 6e 64 20 6f | 66 20 27 4f 52 49 47 49 |.# end o|f 'ORIGI|
|00005ef0| 4e 27 0a 66 69 0a 69 66 | 20 74 65 73 74 20 2d 66 |N'.fi.if| test -f|
|00005f00| 20 27 73 65 61 72 63 68 | 2e 63 27 20 2d 61 20 22 | 'search|.c' -a "|
|00005f10| 24 7b 31 7d 22 20 21 3d | 20 22 2d 63 22 20 3b 20 |${1}" !=| "-c" ; |
|00005f20| 74 68 65 6e 20 0a 20 20 | 65 63 68 6f 20 73 68 61 |then . |echo sha|
|00005f30| 72 3a 20 57 69 6c 6c 20 | 6e 6f 74 20 63 6c 6f 62 |r: Will |not clob|
|00005f40| 62 65 72 20 65 78 69 73 | 74 69 6e 67 20 66 69 6c |ber exis|ting fil|
|00005f50| 65 20 5c 22 27 73 65 61 | 72 63 68 2e 63 27 5c 22 |e \"'sea|rch.c'\"|
|00005f60| 0a 65 6c 73 65 0a 65 63 | 68 6f 20 73 68 61 72 3a |.else.ec|ho shar:|
|00005f70| 20 45 78 74 72 61 63 74 | 69 6e 67 20 5c 22 27 73 | Extract|ing \"'s|
|00005f80| 65 61 72 63 68 2e 63 27 | 5c 22 20 5c 28 32 34 36 |earch.c'|\" \(246|
|00005f90| 34 37 20 63 68 61 72 61 | 63 74 65 72 73 5c 29 0a |47 chara|cters\).|
|00005fa0| 73 65 64 20 22 73 2f 5e | 58 2f 2f 22 20 3e 27 73 |sed "s/^|X//" >'s|
|00005fb0| 65 61 72 63 68 2e 63 27 | 20 3c 3c 27 45 4e 44 5f |earch.c'| <<'END_|
|00005fc0| 4f 46 5f 46 49 4c 45 27 | 0a 58 2f 2a 0a 58 20 2a |OF_FILE'|.X/*.X *|
|00005fd0| 20 4c 69 66 65 20 73 65 | 61 72 63 68 20 70 72 6f | Life se|arch pro|
|00005fe0| 67 72 61 6d 20 2d 20 61 | 63 74 75 61 6c 20 73 65 |gram - a|ctual se|
|00005ff0| 61 72 63 68 20 72 6f 75 | 74 69 6e 65 73 2e 0a 58 |arch rou|tines..X|
|00006000| 20 2a 20 41 75 74 68 6f | 72 3a 20 44 61 76 69 64 | * Autho|r: David|
|00006010| 20 49 2e 20 42 65 6c 6c | 2e 0a 58 20 2a 20 42 61 | I. Bell|..X * Ba|
|00006020| 73 65 64 20 6f 6e 20 74 | 68 65 20 61 6c 67 6f 72 |sed on t|he algor|
|00006030| 69 74 68 6d 73 20 62 79 | 20 44 65 61 6e 20 48 69 |ithms by| Dean Hi|
|00006040| 63 6b 65 72 73 6f 6e 20 | 74 68 61 74 20 77 65 72 |ckerson |that wer|
|00006050| 65 0a 58 20 2a 20 69 6e | 63 6c 75 64 65 64 20 77 |e.X * in|cluded w|
|00006060| 69 74 68 20 74 68 65 20 | 22 78 6c 69 66 65 20 32 |ith the |"xlife 2|
|00006070| 2e 30 22 20 64 69 73 74 | 72 69 62 75 74 69 6f 6e |.0" dist|ribution|
|00006080| 2e 20 20 54 68 61 6e 6b | 73 21 0a 58 20 2a 2f 0a |. Thank|s!.X */.|
|00006090| 58 0a 58 23 69 6e 63 6c | 75 64 65 20 22 6c 69 66 |X.X#incl|ude "lif|
|000060a0| 65 73 72 63 2e 68 22 0a | 58 0a 58 0a 58 2f 2a 0a |esrc.h".|X.X.X/*.|
|000060b0| 58 20 2a 20 49 4d 50 4c | 49 43 20 66 6c 61 67 20 |X * IMPL|IC flag |
|000060c0| 76 61 6c 75 65 73 2e 0a | 58 20 2a 2f 0a 58 74 79 |values..|X */.Xty|
|000060d0| 70 65 64 65 66 09 75 6e | 73 69 67 6e 65 64 20 63 |pedef.un|signed c|
|000060e0| 68 61 72 09 46 4c 41 47 | 53 3b 0a 58 23 64 65 66 |har.FLAG|S;.X#def|
|000060f0| 69 6e 65 09 4e 30 49 43 | 30 09 28 28 46 4c 41 47 |ine.N0IC|0.((FLAG|
|00006100| 53 29 20 30 78 30 31 29 | 09 2f 2a 20 6e 65 77 20 |S) 0x01)|./* new |
|00006110| 63 65 6c 6c 20 30 20 3d | 3d 3e 20 63 75 72 72 65 |cell 0 =|=> curre|
|00006120| 6e 74 20 63 65 6c 6c 20 | 30 20 2a 2f 0a 58 23 64 |nt cell |0 */.X#d|
|00006130| 65 66 69 6e 65 09 4e 30 | 49 43 31 09 28 28 46 4c |efine.N0|IC1.((FL|
|00006140| 41 47 53 29 20 30 78 30 | 32 29 09 2f 2a 20 6e 65 |AGS) 0x0|2)./* ne|
|00006150| 77 20 63 65 6c 6c 20 30 | 20 3d 3d 3e 20 63 75 72 |w cell 0| ==> cur|
|00006160| 72 65 6e 74 20 63 65 6c | 6c 20 31 20 2a 2f 0a 58 |rent cel|l 1 */.X|
|00006170| 23 64 65 66 69 6e 65 09 | 4e 31 49 43 30 09 28 28 |#define.|N1IC0.((|
|00006180| 46 4c 41 47 53 29 20 30 | 78 30 34 29 09 2f 2a 20 |FLAGS) 0|x04)./* |
|00006190| 6e 65 77 20 63 65 6c 6c | 20 31 20 3d 3d 3e 20 63 |new cell| 1 ==> c|
|000061a0| 75 72 72 65 6e 74 20 63 | 65 6c 6c 20 30 20 2a 2f |urrent c|ell 0 */|
|000061b0| 0a 58 23 64 65 66 69 6e | 65 09 4e 31 49 43 31 09 |.X#defin|e.N1IC1.|
|000061c0| 28 28 46 4c 41 47 53 29 | 20 30 78 30 38 29 09 2f |((FLAGS)| 0x08)./|
|000061d0| 2a 20 6e 65 77 20 63 65 | 6c 6c 20 31 20 3d 3d 3e |* new ce|ll 1 ==>|
|000061e0| 20 63 75 72 72 65 6e 74 | 20 63 65 6c 6c 20 31 20 | current| cell 1 |
|000061f0| 2a 2f 0a 58 23 64 65 66 | 69 6e 65 09 4e 30 49 43 |*/.X#def|ine.N0IC|
|00006200| 55 4e 30 09 28 28 46 4c | 41 47 53 29 20 30 78 31 |UN0.((FL|AGS) 0x1|
|00006210| 30 29 09 2f 2a 20 6e 65 | 77 20 63 65 6c 6c 20 30 |0)./* ne|w cell 0|
|00006220| 20 3d 3d 3e 20 63 75 72 | 72 65 6e 74 20 75 6e 6b | ==> cur|rent unk|
|00006230| 6e 6f 77 6e 20 6e 65 69 | 67 68 62 6f 72 73 20 30 |nown nei|ghbors 0|
|00006240| 20 2a 2f 0a 58 23 64 65 | 66 69 6e 65 09 4e 30 49 | */.X#de|fine.N0I|
|00006250| 43 55 4e 31 09 28 28 46 | 4c 41 47 53 29 20 30 78 |CUN1.((F|LAGS) 0x|
|00006260| 32 30 29 09 2f 2a 20 6e | 65 77 20 63 65 6c 6c 20 |20)./* n|ew cell |
|00006270| 30 20 3d 3d 3e 20 63 75 | 72 72 65 6e 74 20 75 6e |0 ==> cu|rrent un|
|00006280| 6b 6e 6f 77 6e 20 6e 65 | 69 67 68 62 6f 72 73 20 |known ne|ighbors |
|00006290| 31 20 2a 2f 0a 58 23 64 | 65 66 69 6e 65 09 4e 31 |1 */.X#d|efine.N1|
|000062a0| 49 43 55 4e 30 09 28 28 | 46 4c 41 47 53 29 20 30 |ICUN0.((|FLAGS) 0|
|000062b0| 78 34 30 29 09 2f 2a 20 | 6e 65 77 20 63 65 6c 6c |x40)./* |new cell|
|000062c0| 20 31 20 3d 3d 3e 20 63 | 75 72 72 65 6e 74 20 75 | 1 ==> c|urrent u|
|000062d0| 6e 6b 6e 6f 77 6e 20 6e | 65 69 67 68 62 6f 72 73 |nknown n|eighbors|
|000062e0| 20 30 20 2a 2f 0a 58 23 | 64 65 66 69 6e 65 09 4e | 0 */.X#|define.N|
|000062f0| 31 49 43 55 4e 31 09 28 | 28 46 4c 41 47 53 29 20 |1ICUN1.(|(FLAGS) |
|00006300| 30 78 38 30 29 09 2f 2a | 20 6e 65 77 20 63 65 6c |0x80)./*| new cel|
|00006310| 6c 20 31 20 3d 3d 3e 20 | 63 75 72 72 65 6e 74 20 |l 1 ==> |current |
|00006320| 75 6e 6b 6e 6f 77 6e 20 | 6e 65 69 67 68 62 6f 72 |unknown |neighbor|
|00006330| 73 20 31 20 2a 2f 0a 58 | 0a 58 0a 58 2f 2a 0a 58 |s 1 */.X|.X.X/*.X|
|00006340| 20 2a 20 54 61 62 6c 65 | 20 6f 66 20 74 72 61 6e | * Table| of tran|
|00006350| 73 69 74 69 6f 6e 73 2e | 0a 58 20 2a 20 47 69 76 |sitions.|.X * Giv|
|00006360| 65 6e 20 74 68 65 20 73 | 74 61 74 65 20 6f 66 20 |en the s|tate of |
|00006370| 61 20 63 65 6c 6c 20 61 | 6e 64 20 69 74 73 20 6e |a cell a|nd its n|
|00006380| 65 69 67 68 62 6f 72 73 | 20 69 6e 20 6f 6e 65 20 |eighbors| in one |
|00006390| 67 65 6e 65 72 61 74 69 | 6f 6e 2c 0a 58 20 2a 20 |generati|on,.X * |
|000063a0| 74 68 69 73 20 74 61 62 | 6c 65 20 64 65 74 65 72 |this tab|le deter|
|000063b0| 6d 69 6e 65 73 20 74 68 | 65 20 73 74 61 74 65 20 |mines th|e state |
|000063c0| 6f 66 20 74 68 65 20 63 | 65 6c 6c 20 69 6e 20 74 |of the c|ell in t|
|000063d0| 68 65 20 6e 65 78 74 20 | 67 65 6e 65 72 61 74 69 |he next |generati|
|000063e0| 6f 6e 2e 0a 58 20 2a 20 | 54 68 65 20 74 61 62 6c |on..X * |The tabl|
|000063f0| 65 20 69 73 20 69 6e 64 | 65 78 65 64 20 62 79 20 |e is ind|exed by |
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.