home *** CD-ROM | disk | FTP | other *** search
/ Giga Games 1 / Giga Games.iso / net / go / prog / sgf2mi13.taz / sgf2mi13
Tape Archive  |  1993-06-20  |  200.0 KB

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: Tape Archive (archive/tar).

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert Tape Archive (archive/tar) magic Supported
100% file POSIX tar archive default
99% file POSIX tar archive, file sgf2misc.c, mode 000444 , uid 000471 , gid 000012 , size 00000012027 , seconds 05343536306, user jansteen, group cl default
98% file data default
62% TrID TAR - Tape ARchive (POSIX) default
37% TrID TAR - Tape ARchive (file) default
100% lsar Tar default
100% gt2 TAR Archiv gefunden (Auflistung ist deaktiviert) default
100% disktype POSIX tar archive default
100% detectItEasy Archive: tar default
100% binwalkID POSIX tar archive, owner user name: ".c" default
100% xdgMime application/x-tar default



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 73 67 66 32 6d 69 73 63 | 2e 63 00 00 00 00 00 00 |sgf2misc|.c......|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000050| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000060| 00 00 00 00 30 30 30 34 | 34 34 20 00 30 30 30 34 |....0004|44 .0004|
|00000070| 37 31 20 00 30 30 30 30 | 31 32 20 00 30 30 30 30 |71 .0000|12 .0000|
|00000080| 30 30 31 32 30 32 37 20 | 30 35 33 34 33 35 33 36 |0012027 |05343536|
|00000090| 33 30 36 20 30 31 32 30 | 30 32 00 20 30 00 00 00 |306 0120|02. 0...|
|000000a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000100| 00 75 73 74 61 72 00 30 | 30 6a 61 6e 73 74 65 65 |.ustar.0|0janstee|
|00000110| 6e 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |n.......|........|
|00000120| 00 00 00 00 00 00 00 00 | 00 63 6c 00 00 00 00 00 |........|.cl.....|
|00000130| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000140| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000150| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000160| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000170| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000180| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000190| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000200| 2f 2a 20 23 5b 69 6e 66 | 6f 3a 09 09 09 2a 2f 0a |/* #[inf|o:...*/.|
|00000210| 2f 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |/*******|********|
|00000220| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000230| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000240| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000250| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 0a 20 2a 09 09 09 09 |********|*. *....|
|00000260| 09 09 09 09 09 2a 0a 20 | 2a 09 20 20 20 20 20 23 |.....*. |*. #|
|00000270| 23 23 23 20 20 23 23 23 | 23 20 20 23 23 23 23 23 |### ###|# #####|
|00000280| 20 20 20 20 20 20 20 20 | 23 20 20 20 20 23 20 23 | |# # #|
|00000290| 23 23 20 20 23 23 23 23 | 20 20 20 23 23 23 09 09 |## ####| ###..|
|000002a0| 2a 0a 20 2a 09 20 20 20 | 20 23 20 20 20 20 20 23 |*. *. | # #|
|000002b0| 20 20 20 20 20 20 23 20 | 20 20 20 20 20 23 23 23 | # | ###|
|000002c0| 20 20 20 23 23 20 20 23 | 23 20 20 23 20 20 23 20 | ## #|# # # |
|000002d0| 20 20 20 20 20 23 20 20 | 20 09 09 2a 0a 20 2a 09 | # | ..*. *.|
|000002e0| 20 20 20 20 23 20 20 20 | 20 20 23 20 20 20 20 20 | # | # |
|000002f0| 20 23 20 20 20 20 20 23 | 20 20 20 23 20 20 23 20 | # #| # # |
|00000300| 23 23 20 23 20 20 23 20 | 20 23 20 20 20 20 20 23 |## # # | # #|
|00000310| 20 20 20 20 09 09 2a 0a | 20 2a 09 20 20 20 20 20 | ..*.| *. |
|00000320| 23 23 23 20 20 23 20 20 | 23 23 20 20 23 23 23 20 |### # |## ### |
|00000330| 20 20 20 20 20 23 20 20 | 20 23 20 20 20 20 23 20 | # | # # |
|00000340| 20 23 20 20 20 23 23 23 | 20 20 23 20 20 20 20 09 | # ###| # .|
|00000350| 09 2a 0a 20 2a 09 20 20 | 20 20 20 20 20 20 23 20 |.*. *. | # |
|00000360| 23 20 20 20 20 23 20 23 | 20 20 20 20 20 20 20 23 |# # #| #|
|00000370| 20 20 20 20 23 20 20 20 | 20 23 20 20 23 20 20 20 | # | # # |
|00000380| 20 20 20 23 20 23 20 20 | 20 20 09 09 2a 0a 20 2a | # # | ..*. *|
|00000390| 09 20 20 20 20 20 20 20 | 20 23 20 23 20 20 20 20 |. | # # |
|000003a0| 23 20 23 20 20 20 20 20 | 20 23 20 20 20 20 20 23 |# # | # #|
|000003b0| 20 20 20 20 23 20 20 23 | 20 20 20 20 20 20 23 20 | # #| # |
|000003c0| 20 23 20 20 20 09 09 2a | 0a 20 2a 09 20 20 20 20 | # ..*|. *. |
|000003d0| 23 23 23 23 20 20 20 23 | 23 23 23 20 20 23 20 20 |#### #|### # |
|000003e0| 20 20 20 23 23 23 23 23 | 23 20 23 20 20 20 20 23 | #####|# # #|
|000003f0| 20 23 23 23 20 23 23 23 | 23 20 20 20 20 23 23 23 | ### ###|# ###|
|00000400| 09 09 2a 0a 20 2a 09 09 | 09 09 09 09 09 09 09 2a |..*. *..|.......*|
|00000410| 0a 20 2a 09 09 09 20 20 | 20 20 4a 61 6e 20 76 61 |. *... | Jan va|
|00000420| 6e 20 64 65 72 20 53 74 | 65 65 6e 09 09 09 09 2a |n der St|een....*|
|00000430| 0a 20 2a 09 09 09 09 09 | 09 09 09 09 2a 0a 20 2a |. *.....|....*. *|
|00000440| 09 20 20 20 20 20 20 43 | 65 6e 74 72 65 20 66 6f |. C|entre fo|
|00000450| 72 20 4d 61 74 68 65 6d | 61 74 69 63 73 20 61 6e |r Mathem|atics an|
|00000460| 64 20 43 6f 6d 70 75 74 | 65 72 20 53 63 69 65 6e |d Comput|er Scien|
|00000470| 63 65 09 09 2a 0a 20 2a | 09 09 20 20 20 20 20 20 |ce..*. *|.. |
|00000480| 41 6d 73 74 65 72 64 61 | 6d 2c 20 74 68 65 20 4e |Amsterda|m, the N|
|00000490| 65 74 68 65 72 6c 61 6e | 64 73 09 09 09 2a 0a 20 |etherlan|ds...*. |
|000004a0| 2a 09 09 09 09 09 09 09 | 09 09 2a 0a 20 2a 2d 2d |*.......|..*. *--|
|000004b0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000004c0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000004d0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000004e0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000004f0| 2d 2d 2d 2d 2a 0a 20 2a | 20 46 69 6c 65 20 20 20 |----*. *| File |
|00000500| 20 3a 20 73 67 66 32 6d | 69 73 63 2e 63 20 09 09 | : sgf2m|isc.c ..|
|00000510| 09 09 09 09 2a 0a 20 2a | 20 50 75 72 70 6f 73 65 |....*. *| Purpose|
|00000520| 20 3a 20 52 65 61 64 20 | 61 6e 64 20 63 6f 6e 76 | : Read |and conv|
|00000530| 65 72 74 20 61 20 53 6d | 61 72 74 20 47 6f 20 46 |ert a Sm|art Go F|
|00000540| 6f 72 6d 61 74 20 66 69 | 6c 65 09 09 09 2a 0a 20 |ormat fi|le...*. |
|00000550| 2a 20 56 65 72 73 69 6f | 6e 20 3a 20 31 2e 31 32 |* Versio|n : 1.12|
|00000560| 20 09 09 09 09 09 09 2a | 0a 20 2a 20 4d 6f 64 69 | ......*|. * Modi|
|00000570| 66 69 65 64 3a 20 32 2f | 31 34 2f 39 33 20 31 33 |fied: 2/|14/93 13|
|00000580| 3a 33 39 3a 30 37 09 09 | 09 09 09 09 2a 0a 20 2a |:39:07..|....*. *|
|00000590| 20 41 75 74 68 6f 72 20 | 20 3a 20 4a 61 6e 20 76 | Author | : Jan v|
|000005a0| 61 6e 20 64 65 72 20 53 | 74 65 65 6e 20 28 6a 61 |an der S|teen (ja|
|000005b0| 6e 73 74 65 65 6e 40 63 | 77 69 2e 6e 6c 29 20 09 |nsteen@c|wi.nl) .|
|000005c0| 09 09 2a 0a 20 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |..*. ***|********|
|000005d0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000005e0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000005f0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000600| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2f 0a 2f |********|*****/./|
|00000610| 2a 20 23 5d 69 6e 66 6f | 3a 09 09 09 2a 2f 20 0a |* #]info|:...*/ .|
|00000620| 2f 2a 20 23 5b 52 45 41 | 44 4d 45 3a 09 09 09 2a |/* #[REA|DME:...*|
|00000630| 2f 0a 0a 2f 2a 0a 20 2a | 20 41 20 4d 69 63 6b 65 |/../*. *| A Micke|
|00000640| 79 2d 4d 6f 75 73 65 20 | 53 6d 61 72 74 20 47 6f |y-Mouse |Smart Go|
|00000650| 20 46 6f 72 6d 61 74 20 | 74 6f 20 4c 61 54 65 58 | Format |to LaTeX|
|00000660| 2f 53 47 46 20 63 6f 6e | 76 65 72 74 65 72 2e 20 |/SGF con|verter. |
|00000670| 49 74 0a 20 2a 20 69 73 | 20 64 65 76 65 6c 6f 70 |It. * is| develop|
|00000680| 65 64 20 61 73 20 61 20 | 71 75 69 63 6b 20 68 61 |ed as a |quick ha|
|00000690| 63 6b 20 74 6f 20 63 6f | 6e 76 65 72 74 20 74 68 |ck to co|nvert th|
|000006a0| 65 20 4f 74 61 6b 65 2d | 4b 6f 62 61 79 61 73 68 |e Otake-|Kobayash|
|000006b0| 69 0a 20 2a 20 4d 65 69 | 6a 69 6e 20 67 61 6d 65 |i. * Mei|jin game|
|000006c0| 20 74 6f 20 61 20 70 72 | 69 6e 74 61 62 6c 65 20 | to a pr|intable |
|000006d0| 61 6e 64 20 72 61 74 68 | 65 72 20 70 6f 72 74 61 |and rath|er porta|
|000006e0| 62 6c 65 20 64 6f 63 75 | 6d 65 6e 74 2e 0a 20 2a |ble docu|ment.. *|
|000006f0| 20 54 68 65 20 63 6f 6e | 76 65 72 74 65 72 20 64 | The con|verter d|
|00000700| 6f 65 73 6e 27 74 20 68 | 61 76 65 20 6d 75 63 68 |oesn't h|ave much|
|00000710| 20 6b 6e 6f 77 6c 65 64 | 67 65 20 61 62 6f 75 74 | knowled|ge about|
|00000720| 20 53 47 46 20 66 6f 72 | 6d 61 74 20 79 65 74 2e | SGF for|mat yet.|
|00000730| 0a 20 2a 20 49 74 27 73 | 20 74 79 70 69 63 61 6c |. * It's| typical|
|00000740| 6c 79 20 62 61 73 65 64 | 20 6f 6e 20 74 68 65 20 |ly based| on the |
|00000750| 53 47 46 20 66 69 6c 65 | 73 20 61 73 20 70 72 6f |SGF file|s as pro|
|00000760| 64 75 63 65 64 20 62 79 | 20 49 47 53 3a 0a 20 2a |duced by| IGS:. *|
|00000770| 0a 20 2a 09 28 0a 20 2a | 09 3b 0a 20 2a 09 45 56 |. *.(. *|.;. *.EV|
|00000780| 65 6e 74 5b 41 20 67 61 | 6d 65 20 70 6c 61 79 65 |ent[A ga|me playe|
|00000790| 64 20 6f 6e 20 74 68 65 | 20 49 6e 74 65 72 6e 65 |d on the| Interne|
|000007a0| 74 20 47 6f 20 53 65 72 | 76 65 72 5d 0a 20 2a 09 |t Go Ser|ver]. *.|
|000007b0| 55 53 65 72 5b 42 72 6f | 75 67 68 74 20 74 6f 20 |USer[Bro|ught to |
|000007c0| 79 6f 75 20 62 79 20 74 | 68 65 20 49 47 53 20 70 |you by t|he IGS p|
|000007d0| 72 6f 67 72 61 6d 5d 0a | 20 2a 09 50 6c 61 79 65 |rogram].| *.Playe|
|000007e0| 72 42 6c 61 63 6b 5b 6b | 6f 62 61 79 61 73 68 69 |rBlack[k|obayashi|
|000007f0| 5d 0a 20 2a 09 42 6c 61 | 63 6b 52 61 6e 6b 69 6e |]. *.Bla|ckRankin|
|00000800| 67 5b 4e 52 5d 0a 20 2a | 09 50 6c 61 79 65 72 57 |g[NR]. *|.PlayerW|
|00000810| 68 69 74 65 5b 6f 74 61 | 6b 65 5d 0a 20 2a 09 57 |hite[ota|ke]. *.W|
|00000820| 68 69 74 65 52 61 6e 6b | 69 6e 67 5b 4e 52 5d 0a |hiteRank|ing[NR].|
|00000830| 20 2a 09 44 61 54 65 5b | 31 39 39 32 2d 30 39 2d | *.DaTe[|1992-09-|
|00000840| 31 35 5d 0a 20 2a 09 47 | 61 4d 65 5b 31 5d 0a 20 |15]. *.G|aMe[1]. |
|00000850| 2a 09 56 69 65 57 5b 5d | 0a 20 2a 09 53 69 5a 65 |*.VieW[]|. *.SiZe|
|00000860| 5b 31 39 5d 0a 20 2a 09 | 47 61 6d 65 4e 61 6d 65 |[19]. *.|GameName|
|00000870| 5b 28 49 47 53 29 20 6f | 74 61 6b 65 28 57 29 20 |[(IGS) o|take(W) |
|00000880| 76 73 20 6b 6f 62 61 79 | 61 73 68 69 28 42 29 5d |vs kobay|ashi(B)]|
|00000890| 0a 20 2a 09 50 6c 61 43 | 65 5b 49 47 53 3a 20 20 |. *.PlaC|e[IGS: |
|000008a0| 41 6c 62 75 71 75 65 72 | 71 75 65 2c 20 4e 4d 2c |Albuquer|que, NM,|
|000008b0| 20 55 53 41 20 31 32 39 | 2e 32 34 2e 31 34 2e 37 | USA 129|.24.14.7|
|000008c0| 30 20 36 39 36 39 5d 0a | 20 2a 09 52 45 73 75 6c |0 6969].| *.REsul|
|000008d0| 74 5b 42 2b 72 65 73 69 | 67 6e 5d 0a 20 2a 09 4b |t[B+resi|gn]. *.K|
|000008e0| 6f 4d 69 5b 30 2e 30 30 | 30 30 30 30 5d 0a 20 2a |oMi[0.00|0000]. *|
|000008f0| 09 42 6c 61 63 6b 74 69 | 6d 65 4c 65 66 74 5b 30 |.Blackti|meLeft[0|
|00000900| 5d 0a 20 2a 09 57 68 69 | 74 65 74 69 6d 65 4c 65 |]. *.Whi|tetimeLe|
|00000910| 66 74 5b 30 5d 0a 20 2a | 09 3b 0a 20 2a 09 42 5b |ft[0]. *|.;. *.B[|
|00000920| 70 64 5d 0a 20 2a 09 3b | 0a 20 2a 09 57 5b 64 64 |pd]. *.;|. *.W[dd|
|00000930| 5d 0a 20 2a 09 43 5b 0a | 20 2a 09 20 7a 68 75 67 |]. *.C[.| *. zhug|
|00000940| 65 20 4e 52 3a 20 6f 6b | 61 79 2c 20 4c 33 2e 0a |e NR: ok|ay, L3..|
|00000950| 20 2a 09 20 6a 6a 73 20 | 4e 52 3a 20 79 65 61 68 | *. jjs |NR: yeah|
|00000960| 2c 20 62 75 74 20 69 20 | 68 61 76 65 20 6f 64 64 |, but i |have odd|
|00000970| 69 76 65 20 68 6f 75 72 | 20 61 74 20 32 70 6d 0a |ive hour| at 2pm.|
|00000980| 20 2a 09 5d 0a 20 2a 09 | 3b 0a 20 2a 09 29 0a 20 | *.]. *.|;. *.). |
|00000990| 2a 0a 20 2a 20 53 6f 6d | 65 20 67 65 6e 65 72 61 |*. * Som|e genera|
|000009a0| 6c 20 63 68 61 72 61 63 | 74 65 72 69 73 74 69 63 |l charac|teristic|
|000009b0| 73 20 6f 66 20 74 68 65 | 20 73 67 66 32 54 65 58 |s of the| sgf2TeX|
|000009c0| 20 63 6f 6e 76 65 72 74 | 69 6f 6e 0a 20 2a 20 2d | convert|ion. * -|
|000009d0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000009e0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000009f0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000a00| 2d 2d 2d 2d 2d 0a 20 2a | 20 31 2e 20 49 74 20 6f |-----. *| 1. It o|
|00000a10| 6e 6c 79 20 72 65 63 6f | 67 6e 69 73 65 20 6d 6f |nly reco|gnise mo|
|00000a20| 76 65 73 20 61 6e 64 20 | 6b 69 62 69 74 7a 20 63 |ves and |kibitz c|
|00000a30| 6f 6d 6d 65 6e 74 73 2e | 0a 20 2a 20 32 2e 20 49 |omments.|. * 2. I|
|00000a40| 74 20 65 78 63 68 61 6e | 67 65 73 20 6d 6f 76 65 |t exchan|ges move|
|00000a50| 20 61 6e 64 20 6b 69 62 | 69 74 7a 2e 0a 20 2a 20 | and kib|itz.. * |
|00000a60| 20 20 20 54 68 65 79 20 | 61 72 65 20 77 72 69 74 | They |are writ|
|00000a70| 74 65 6e 20 69 6e 20 74 | 68 65 20 73 67 66 20 66 |ten in t|he sgf f|
|00000a80| 69 6c 65 20 69 6e 20 74 | 68 65 20 77 72 6f 6e 67 |ile in t|he wrong|
|00000a90| 20 6f 72 64 65 72 0a 20 | 2a 20 20 20 20 28 69 2e | order. |* (i.|
|00000aa0| 65 2e 20 66 69 72 73 74 | 20 6d 6f 76 65 20 74 68 |e. first| move th|
|00000ab0| 65 6e 20 6b 69 62 69 74 | 7a 29 2e 0a 20 2a 20 33 |en kibit|z).. * 3|
|00000ac0| 2e 20 4d 65 72 67 65 20 | 6d 6f 76 65 73 20 77 69 |. Merge |moves wi|
|00000ad0| 74 68 6f 75 74 20 6b 69 | 62 69 74 7a 20 69 6e 20 |thout ki|bitz in |
|00000ae0| 6f 6e 65 20 64 69 61 67 | 72 61 6d 2e 0a 20 2a 20 |one diag|ram.. * |
|00000af0| 34 2e 20 47 65 6e 65 72 | 61 74 65 20 6f 6e 65 20 |4. Gener|ate one |
|00000b00| 6b 69 62 69 74 7a 20 6c | 61 62 65 6c 20 66 6f 72 |kibitz l|abel for|
|00000b10| 20 63 6f 6e 73 65 71 75 | 65 74 69 76 65 20 6b 69 | consequ|etive ki|
|00000b20| 62 69 74 7a 65 73 2e 0a | 20 2a 2f 0a 0a 2f 2a 20 |bitzes..| */../* |
|00000b30| 23 5d 52 45 41 44 4d 45 | 3a 09 09 09 2a 2f 20 0a |#]README|:...*/ .|
|00000b40| 2f 2a 20 23 5b 69 6e 63 | 6c 75 64 65 3a 09 09 09 |/* #[inc|lude:...|
|00000b50| 2a 2f 0a 0a 23 69 6e 63 | 6c 75 64 65 20 3c 73 74 |*/..#inc|lude <st|
|00000b60| 64 69 6f 2e 68 3e 0a 23 | 69 6e 63 6c 75 64 65 20 |dio.h>.#|include |
|00000b70| 3c 73 74 64 6c 69 62 2e | 68 3e 0a 23 69 6e 63 6c |<stdlib.|h>.#incl|
|00000b80| 75 64 65 20 3c 73 74 72 | 69 6e 67 2e 68 3e 0a 23 |ude <str|ing.h>.#|
|00000b90| 69 6e 63 6c 75 64 65 20 | 22 67 6f 67 61 6d 65 2e |include |"gogame.|
|00000ba0| 68 22 0a 23 69 6e 63 6c | 75 64 65 20 22 73 67 66 |h".#incl|ude "sgf|
|00000bb0| 72 65 61 64 2e 68 22 0a | 23 69 6e 63 6c 75 64 65 |read.h".|#include|
|00000bc0| 20 22 67 61 6d 65 32 74 | 65 78 2e 68 22 0a 23 69 | "game2t|ex.h".#i|
|00000bd0| 6e 63 6c 75 64 65 20 22 | 67 61 6d 65 32 65 70 73 |nclude "|game2eps|
|00000be0| 2e 68 22 0a 23 69 6e 63 | 6c 75 64 65 20 22 67 61 |.h".#inc|lude "ga|
|00000bf0| 6d 65 32 73 67 66 2e 68 | 22 0a 23 69 6e 63 6c 75 |me2sgf.h|".#inclu|
|00000c00| 64 65 20 22 74 6f 6f 6c | 73 2e 68 22 0a 23 69 6e |de "tool|s.h".#in|
|00000c10| 63 6c 75 64 65 20 22 73 | 79 73 64 65 70 2e 68 22 |clude "s|ysdep.h"|
|00000c20| 0a 0a 2f 2a 20 23 5d 69 | 6e 63 6c 75 64 65 3a 09 |../* #]i|nclude:.|
|00000c30| 09 09 2a 2f 20 0a 2f 2a | 20 23 5b 67 6c 6f 62 61 |..*/ ./*| #[globa|
|00000c40| 6c 3a 09 09 09 2a 2f 0a | 0a 69 6e 74 09 09 6f 70 |l:...*/.|.int..op|
|00000c50| 74 69 6e 64 20 20 3d 20 | 31 3b 09 09 2f 2a 20 69 |tind = |1;../* i|
|00000c60| 6e 64 65 78 20 69 6e 74 | 6f 20 61 72 67 76 20 76 |ndex int|o argv v|
|00000c70| 65 63 74 6f 72 09 2a 2f | 0a 69 6e 74 09 09 63 61 |ector.*/|.int..ca|
|00000c80| 63 68 69 6e 67 20 3d 20 | 30 3b 09 09 2f 2a 20 43 |ching = |0;../* C|
|00000c90| 61 63 68 69 6e 67 20 6d | 6f 64 65 09 09 09 2a 2f |aching m|ode...*/|
|00000ca0| 0a 69 6e 74 09 09 74 65 | 78 74 6f 75 74 09 3d 20 |.int..te|xtout.= |
|00000cb0| 31 3b 09 09 2f 2a 20 45 | 6d 69 74 20 74 68 65 20 |1;../* E|mit the |
|00000cc0| 74 65 78 74 09 09 2a 2f | 0a 69 6e 74 09 09 73 74 |text..*/|.int..st|
|00000cd0| 61 74 6f 75 74 09 3d 20 | 30 3b 09 09 2f 2a 20 45 |atout.= |0;../* E|
|00000ce0| 6d 69 74 20 74 68 65 20 | 6b 69 62 69 74 7a 20 73 |mit the |kibitz s|
|00000cf0| 74 61 74 73 09 2a 2f 0a | 69 6e 74 09 09 63 6f 6f |tats.*/.|int..coo|
|00000d00| 72 64 73 09 3d 20 31 3b | 09 09 2f 2a 20 50 72 69 |rds.= 1;|../* Pri|
|00000d10| 6e 74 20 63 6f 6f 72 64 | 69 6e 61 74 65 73 09 09 |nt coord|inates..|
|00000d20| 2a 2f 0a 63 68 61 72 20 | 2a 09 09 70 72 6f 67 72 |*/.char |*..progr|
|00000d30| 61 6d 20 3d 20 22 73 67 | 66 32 6d 69 73 63 22 3b |am = "sg|f2misc";|
|00000d40| 09 2f 2a 20 50 72 6f 67 | 72 61 6d 20 6e 61 6d 65 |./* Prog|ram name|
|00000d50| 09 09 09 2a 2f 0a 69 6e | 74 09 09 76 65 72 62 6f |...*/.in|t..verbo|
|00000d60| 73 65 20 3d 20 30 3b 09 | 09 2f 2a 20 56 65 72 62 |se = 0;.|./* Verb|
|00000d70| 6f 73 65 20 6d 6f 64 65 | 09 09 09 2a 2f 0a 45 50 |ose mode|...*/.EP|
|00000d80| 53 46 49 4e 46 4f 09 65 | 70 73 66 3b 09 09 09 2f |SFINFO.e|psf;.../|
|00000d90| 2a 20 54 68 65 20 65 70 | 73 20 66 69 6c 65 6e 61 |* The ep|s filena|
|00000da0| 6d 65 2f 64 69 72 65 63 | 74 6f 72 79 09 2a 2f 0a |me/direc|tory.*/.|
|00000db0| 2f 2a 0a 20 2a 20 54 68 | 65 20 6e 65 78 74 20 76 |/*. * Th|e next v|
|00000dc0| 61 72 69 61 62 6c 65 20 | 64 65 63 69 64 65 73 20 |ariable |decides |
|00000dd0| 68 6f 77 20 74 6f 20 73 | 6f 6c 76 65 20 74 68 65 |how to s|olve the|
|00000de0| 20 47 6f 20 64 69 61 67 | 72 61 6d 20 69 73 73 75 | Go diag|ram issu|
|00000df0| 65 3a 0a 20 2a 0a 20 2a | 20 20 20 20 44 45 56 49 |e:. *. *| DEVI|
|00000e00| 43 45 5f 45 50 53 20 20 | 20 44 69 61 67 72 61 6d |CE_EPS | Diagram|
|00000e10| 73 20 61 72 65 20 68 61 | 6e 64 6c 65 64 20 62 79 |s are ha|ndled by|
|00000e20| 20 65 70 73 66 20 50 6f | 73 74 53 63 72 69 70 74 | epsf Po|stScript|
|00000e30| 20 69 6e 63 6c 75 73 69 | 6f 6e 0a 20 2a 20 20 20 | inclusi|on. * |
|00000e40| 20 44 45 56 49 43 45 5f | 54 45 58 20 20 20 44 69 | DEVICE_|TEX Di|
|00000e50| 61 67 72 61 6d 73 20 61 | 72 65 20 68 61 6e 64 6c |agrams a|re handl|
|00000e60| 65 64 20 62 79 20 61 20 | 73 70 65 63 69 61 6c 20 |ed by a |special |
|00000e70| 54 65 58 20 47 6f 20 66 | 6f 6e 74 0a 20 2a 2f 0a |TeX Go f|ont. */.|
|00000e80| 69 6e 74 09 09 70 72 6e | 5f 64 65 76 20 3d 20 44 |int..prn|_dev = D|
|00000e90| 45 56 49 43 45 5f 45 50 | 53 3b 09 2f 2a 20 44 45 |EVICE_EP|S;./* DE|
|00000ea0| 56 49 43 45 5f 7b 45 50 | 53 2c 54 45 58 7d 09 09 |VICE_{EP|S,TEX}..|
|00000eb0| 2a 2f 0a 0a 2f 2a 0a 20 | 2a 20 54 68 65 20 6e 65 |*/../*. |* The ne|
|00000ec0| 78 74 20 76 61 72 69 61 | 62 6c 65 73 20 61 6c 6c |xt varia|bles all|
|00000ed0| 6f 77 20 74 68 65 20 75 | 73 65 72 20 74 6f 20 73 |ow the u|ser to s|
|00000ee0| 70 65 63 69 66 79 20 61 | 6e 20 6f 75 74 70 75 74 |pecify a|n output|
|00000ef0| 20 6c 69 73 74 0a 20 2a | 20 6f 66 20 66 69 67 75 | list. *| of figu|
|00000f00| 72 65 73 2f 64 69 61 67 | 72 61 6d 73 0a 20 2a 2f |res/diag|rams. */|
|00000f10| 0a 69 6e 74 09 09 66 69 | 67 6c 69 73 74 5b 4d 41 |.int..fi|glist[MA|
|00000f20| 58 4e 55 4d 5d 3b 09 2f | 2a 20 46 69 67 75 72 65 |XNUM];./|* Figure|
|00000f30| 20 20 6c 69 73 74 09 09 | 09 2a 2f 0a 69 6e 74 09 | list..|.*/.int.|
|00000f40| 09 64 69 61 6c 69 73 74 | 5b 4d 41 58 4e 55 4d 5d |.dialist|[MAXNUM]|
|00000f50| 3b 09 2f 2a 20 44 69 61 | 67 72 61 6d 20 6c 69 73 |;./* Dia|gram lis|
|00000f60| 74 09 09 09 2a 2f 0a 69 | 6e 74 09 09 75 73 65 72 |t...*/.i|nt..user|
|00000f70| 5f 66 69 67 73 20 3d 20 | 30 3b 09 09 2f 2a 20 55 |_figs = |0;../* U|
|00000f80| 73 65 72 73 20 66 69 67 | 20 6c 69 73 74 3f 09 09 |sers fig| list?..|
|00000f90| 2a 2f 0a 69 6e 74 09 09 | 75 73 65 72 5f 64 69 61 |*/.int..|user_dia|
|00000fa0| 73 20 3d 20 30 3b 09 09 | 2f 2a 20 55 73 65 72 73 |s = 0;..|/* Users|
|00000fb0| 20 64 69 61 20 6c 69 73 | 74 3f 09 09 2a 2f 0a 0a | dia lis|t?..*/..|
|00000fc0| 2f 2a 20 23 5d 67 6c 6f | 62 61 6c 3a 09 09 09 2a |/* #]glo|bal:...*|
|00000fd0| 2f 20 0a 2f 2a 20 23 5b | 70 72 6f 74 6f 74 79 70 |/ ./* #[|prototyp|
|00000fe0| 65 3a 09 09 09 2a 2f 0a | 0a 23 69 66 64 65 66 20 |e:...*/.|.#ifdef |
|00000ff0| 5f 5f 53 54 44 43 5f 5f | 0a 23 09 64 65 66 69 6e |__STDC__|.#.defin|
|00001000| 65 09 50 52 4f 54 4f 28 | 73 29 20 73 0a 23 65 6c |e.PROTO(|s) s.#el|
|00001010| 73 65 0a 23 09 64 65 66 | 69 6e 65 09 50 52 4f 54 |se.#.def|ine.PROT|
|00001020| 4f 28 73 29 20 28 29 0a | 23 65 6e 64 69 66 0a 0a |O(s) ().|#endif..|
|00001030| 76 6f 69 64 09 09 6d 61 | 69 6e 09 09 50 52 4f 54 |void..ma|in..PROT|
|00001040| 4f 28 28 69 6e 74 20 61 | 72 67 63 2c 20 63 68 61 |O((int a|rgc, cha|
|00001050| 72 20 2a 2a 61 72 67 76 | 29 29 3b 0a 73 74 61 74 |r **argv|));.stat|
|00001060| 69 63 20 63 68 61 72 20 | 2a 09 65 70 73 66 5f 66 |ic char |*.epsf_f|
|00001070| 69 6c 65 6e 61 6d 65 09 | 50 52 4f 54 4f 28 28 63 |ilename.|PROTO((c|
|00001080| 68 61 72 20 2a 66 75 6c | 6c 70 61 74 68 6e 61 6d |har *ful|lpathnam|
|00001090| 65 29 29 3b 0a 0a 23 75 | 6e 64 65 66 20 50 52 4f |e));..#u|ndef PRO|
|000010a0| 54 4f 0a 0a 2f 2a 20 23 | 5d 70 72 6f 74 6f 74 79 |TO../* #|]prototy|
|000010b0| 70 65 3a 09 09 09 2a 2f | 20 0a 0a 2f 2a 20 23 5b |pe:...*/| ../* #[|
|000010c0| 6d 61 69 6e 3a 09 09 09 | 2a 2f 0a 0a 76 6f 69 64 |main:...|*/..void|
|000010d0| 0a 6d 61 69 6e 28 61 72 | 67 63 2c 20 61 72 67 76 |.main(ar|gc, argv|
|000010e0| 29 0a 69 6e 74 20 20 20 | 20 61 72 67 63 3b 0a 63 |).int | argc;.c|
|000010f0| 68 61 72 20 2a 2a 61 72 | 67 76 3b 0a 7b 0a 20 20 |har **ar|gv;.{. |
|00001100| 20 20 47 4f 47 41 4d 45 | 20 2a 67 6f 67 61 6d 65 | GOGAME| *gogame|
|00001110| 20 3d 20 28 47 4f 47 41 | 4d 45 20 2a 29 20 30 3b | = (GOGA|ME *) 0;|
|00001120| 09 2f 2a 20 54 68 65 20 | 63 6f 6d 70 6c 65 74 65 |./* The |complete|
|00001130| 20 67 61 6d 65 09 2a 2f | 0a 20 20 20 20 46 49 4c | game.*/|. FIL|
|00001140| 45 20 20 20 2a 66 70 20 | 20 20 20 20 3d 20 73 74 |E *fp | = st|
|00001150| 64 69 6e 3b 09 09 2f 2a | 20 54 68 65 20 72 65 61 |din;../*| The rea|
|00001160| 64 20 63 68 61 6e 6e 65 | 6c 09 2a 2f 0a 0a 23 69 |d channe|l.*/..#i|
|00001170| 66 20 64 65 66 69 6e 65 | 64 28 41 54 41 52 49 29 |f define|d(ATARI)|
|00001180| 0a 20 20 20 20 61 72 67 | 76 5b 30 5d 20 3d 20 70 |. arg|v[0] = p|
|00001190| 72 6f 67 72 61 6d 3b 0a | 23 65 6c 73 65 0a 20 20 |rogram;.|#else. |
|000011a0| 20 20 70 72 6f 67 72 61 | 6d 20 3d 20 61 72 67 76 | progra|m = argv|
|000011b0| 5b 30 5d 3b 0a 23 65 6e | 64 69 66 0a 20 20 20 20 |[0];.#en|dif. |
|000011c0| 67 65 74 6f 70 74 69 6f | 6e 73 28 61 72 67 63 2c |getoptio|ns(argc,|
|000011d0| 20 61 72 67 76 29 3b 0a | 0a 20 20 20 20 2f 2a 0a | argv);.|. /*.|
|000011e0| 20 20 20 20 20 2a 20 50 | 72 6f 63 65 73 73 20 74 | * P|rocess t|
|000011f0| 68 65 20 53 6d 61 72 74 | 20 47 6f 20 46 6f 72 6d |he Smart| Go Form|
|00001200| 61 74 20 66 69 6c 65 0a | 20 20 20 20 20 2a 2f 0a |at file.| */.|
|00001210| 20 20 20 20 69 66 20 28 | 6f 70 74 69 6e 64 20 3c | if (|optind <|
|00001220| 20 61 72 67 63 29 20 7b | 0a 09 69 66 20 28 28 66 | argc) {|..if ((f|
|00001230| 70 20 3d 20 66 6f 70 65 | 6e 28 61 72 67 76 5b 6f |p = fope|n(argv[o|
|00001240| 70 74 69 6e 64 5d 2c 20 | 22 72 22 29 29 20 3d 3d |ptind], |"r")) ==|
|00001250| 20 28 46 49 4c 45 20 2a | 29 20 30 29 20 7b 0a 09 | (FILE *|) 0) {..|
|00001260| 20 20 20 20 66 70 72 69 | 6e 74 66 28 73 74 64 65 | fpri|ntf(stde|
|00001270| 72 72 2c 20 22 43 61 6e | 27 74 20 6f 70 65 6e 20 |rr, "Can|'t open |
|00001280| 5c 22 25 73 5c 22 5c 6e | 22 2c 20 61 72 67 76 5b |\"%s\"\n|", argv[|
|00001290| 6f 70 74 69 6e 64 5d 29 | 3b 0a 09 20 20 20 20 65 |optind])|;.. e|
|000012a0| 78 69 74 28 31 29 3b 0a | 09 7d 0a 09 65 70 73 66 |xit(1);.|.}..epsf|
|000012b0| 2e 65 70 73 5f 6e 61 6d | 65 20 3d 20 65 70 73 66 |.eps_nam|e = epsf|
|000012c0| 5f 66 69 6c 65 6e 61 6d | 65 28 61 72 67 76 5b 6f |_filenam|e(argv[o|
|000012d0| 70 74 69 6e 64 5d 29 3b | 0a 20 20 20 20 7d 20 65 |ptind]);|. } e|
|000012e0| 6c 73 65 0a 09 65 70 73 | 66 2e 65 70 73 5f 6e 61 |lse..eps|f.eps_na|
|000012f0| 6d 65 20 3d 20 22 73 74 | 64 69 6e 22 3b 0a 0a 20 |me = "st|din";.. |
|00001300| 20 20 20 69 66 20 28 28 | 67 6f 67 61 6d 65 20 3d | if ((|gogame =|
|00001310| 20 73 67 66 5f 72 65 61 | 64 28 66 70 29 29 20 21 | sgf_rea|d(fp)) !|
|00001320| 3d 20 28 47 4f 47 41 4d | 45 20 2a 29 20 30 29 20 |= (GOGAM|E *) 0) |
|00001330| 7b 0a 09 69 66 20 28 75 | 73 65 72 5f 66 69 67 73 |{..if (u|ser_figs|
|00001340| 29 09 6c 69 73 74 32 74 | 65 78 28 67 6f 67 61 6d |).list2t|ex(gogam|
|00001350| 65 29 3b 0a 09 65 6c 73 | 65 09 09 67 61 6d 65 32 |e);..els|e..game2|
|00001360| 74 65 78 28 67 6f 67 61 | 6d 65 29 3b 0a 09 67 61 |tex(goga|me);..ga|
|00001370| 6d 65 5f 66 72 65 65 20 | 28 67 6f 67 61 6d 65 29 |me_free |(gogame)|
|00001380| 3b 0a 20 20 20 20 7d 0a | 20 20 20 20 65 78 69 74 |;. }.| exit|
|00001390| 28 30 29 3b 0a 7d 0a 0a | 2f 2a 20 23 5d 6d 61 69 |(0);.}..|/* #]mai|
|000013a0| 6e 3a 09 09 09 2a 2f 20 | 0a 2f 2a 20 23 5b 65 70 |n:...*/ |./* #[ep|
|000013b0| 73 66 5f 66 69 6c 65 6e | 61 6d 65 3a 09 09 2a 2f |sf_filen|ame:..*/|
|000013c0| 20 0a 0a 73 74 61 74 69 | 63 20 63 68 61 72 20 2a | ..stati|c char *|
|000013d0| 0a 65 70 73 66 5f 66 69 | 6c 65 6e 61 6d 65 28 66 |.epsf_fi|lename(f|
|000013e0| 75 6c 6c 70 61 74 68 6e | 61 6d 65 29 0a 2f 2a 0a |ullpathn|ame)./*.|
|000013f0| 20 2a 20 4c 6f 6f 6b 20 | 66 6f 72 20 73 75 66 66 | * Look |for suff|
|00001400| 69 78 20 61 6e 64 20 64 | 65 6c 65 74 65 20 69 74 |ix and d|elete it|
|00001410| 20 28 64 65 74 72 75 63 | 74 69 76 65 20 6f 6e 20 | (detruc|tive on |
|00001420| 73 6f 75 72 63 65 21 29 | 0a 20 2a 20 4e 65 78 74 |source!)|. * Next|
|00001430| 2c 20 72 65 74 75 72 6e | 20 74 68 65 20 62 61 73 |, return| the bas|
|00001440| 65 6e 61 6d 65 20 6f 66 | 20 74 68 65 20 66 69 6c |ename of| the fil|
|00001450| 65 2e 0a 20 2a 2f 0a 63 | 68 61 72 20 2a 66 75 6c |e.. */.c|har *ful|
|00001460| 6c 70 61 74 68 6e 61 6d | 65 3b 0a 7b 0a 20 20 20 |lpathnam|e;.{. |
|00001470| 20 63 68 61 72 20 2a 73 | 20 3d 20 66 75 6c 6c 70 | char *s| = fullp|
|00001480| 61 74 68 6e 61 6d 65 3b | 0a 0a 20 20 20 20 2f 2a |athname;|.. /*|
|00001490| 0a 20 20 20 20 20 2a 20 | 46 69 72 73 74 20 64 65 |. * |First de|
|000014a0| 6c 65 74 65 20 74 68 65 | 20 73 75 66 66 69 78 0a |lete the| suffix.|
|000014b0| 20 20 20 20 20 2a 2f 0a | 20 20 20 20 77 68 69 6c | */.| whil|
|000014c0| 65 20 28 2a 73 29 20 73 | 2b 2b 3b 0a 20 20 20 20 |e (*s) s|++;. |
|000014d0| 77 68 69 6c 65 20 28 73 | 20 3e 20 66 75 6c 6c 70 |while (s| > fullp|
|000014e0| 61 74 68 6e 61 6d 65 20 | 26 26 20 2a 73 20 21 3d |athname |&& *s !=|
|000014f0| 20 50 41 54 48 53 45 50 | 20 26 26 20 2a 73 20 21 | PATHSEP| && *s !|
|00001500| 3d 20 27 2e 27 29 20 73 | 2d 2d 3b 0a 20 20 20 20 |= '.') s|--;. |
|00001510| 2f 2a 0a 20 20 20 20 20 | 2a 20 57 65 20 6e 65 76 |/*. |* We nev|
|00001520| 65 72 20 77 61 6e 74 20 | 74 6f 20 72 65 6d 6f 76 |er want |to remov|
|00001530| 65 20 74 68 65 20 70 61 | 74 68 20 73 65 70 65 72 |e the pa|th seper|
|00001540| 61 74 6f 72 0a 20 20 20 | 20 20 2a 2f 0a 20 20 20 |ator. | */. |
|00001550| 20 69 66 20 28 2a 73 20 | 21 3d 20 50 41 54 48 53 | if (*s |!= PATHS|
|00001560| 45 50 29 20 2a 73 20 3d | 20 30 3b 0a 0a 20 20 20 |EP) *s =| 0;.. |
|00001570| 20 2f 2a 0a 20 20 20 20 | 20 2a 20 4e 65 78 74 2c | /*. | * Next,|
|00001580| 20 72 65 74 75 72 6e 20 | 74 68 65 20 62 61 73 65 | return |the base|
|00001590| 6e 61 6d 65 0a 20 20 20 | 20 20 2a 2f 0a 20 20 20 |name. | */. |
|000015a0| 20 77 68 69 6c 65 20 28 | 73 20 3e 20 66 75 6c 6c | while (|s > full|
|000015b0| 70 61 74 68 6e 61 6d 65 | 20 26 26 20 2a 73 20 21 |pathname| && *s !|
|000015c0| 3d 20 50 41 54 48 53 45 | 50 29 20 73 2d 2d 3b 0a |= PATHSE|P) s--;.|
|000015d0| 20 20 20 20 69 66 20 28 | 2a 73 20 3d 3d 20 50 41 | if (|*s == PA|
|000015e0| 54 48 53 45 50 29 20 73 | 2b 2b 3b 0a 0a 20 20 20 |THSEP) s|++;.. |
|000015f0| 20 72 65 74 75 72 6e 20 | 73 3b 0a 7d 0a 0a 2f 2a | return |s;.}../*|
|00001600| 20 23 5d 65 70 73 66 5f | 66 69 6c 65 6e 61 6d 65 | #]epsf_|filename|
|00001610| 3a 09 09 2a 2f 20 0a 63 | 74 69 76 65 20 6f 6e 20 |:..*/ .c|tive on |
|00001620| 73 6f 75 72 63 65 21 29 | 0a 20 2a 20 4e 65 78 74 |source!)|. * Next|
|00001630| 2c 20 72 65 74 75 72 6e | 20 74 68 65 20 62 61 73 |, return| the bas|
|00001640| 65 6e 61 6d 65 20 6f 66 | 20 74 68 65 20 66 69 6c |ename of| the fil|
|00001650| 65 2e 0a 20 2a 2f 0a 63 | 68 61 72 20 2a 66 75 6c |e.. */.c|har *ful|
|00001660| 6c 70 61 74 68 6e 61 6d | 65 3b 0a 7b 0a 20 20 20 |lpathnam|e;.{. |
|00001670| 20 63 68 61 72 20 2a 73 | 20 3d 20 66 75 6c 6c 70 | char *s| = fullp|
|00001680| 61 74 68 6e 61 6d 65 3b | 0a 0a 20 20 20 20 2f 2a |athname;|.. /*|
|00001690| 0a 20 20 20 20 20 2a 20 | 46 69 72 73 74 20 64 65 |. * |First de|
|000016a0| 6c 65 74 65 20 74 68 65 | 20 73 75 66 66 69 78 0a |lete the| suffix.|
|000016b0| 20 20 20 20 20 2a 2f 0a | 20 20 20 20 77 68 69 6c | */.| whil|
|000016c0| 65 20 28 2a 73 29 20 73 | 2b 2b 3b 0a 20 20 20 20 |e (*s) s|++;. |
|000016d0| 77 68 69 6c 65 20 28 73 | 20 3e 20 66 75 6c 6c 70 |while (s| > fullp|
|000016e0| 61 74 68 6e 61 6d 65 20 | 26 26 20 2a 73 20 21 3d |athname |&& *s !=|
|000016f0| 20 50 41 54 48 53 45 50 | 20 26 26 20 2a 73 20 21 | PATHSEP| && *s !|
|00001700| 3d 20 27 2e 27 29 20 73 | 2d 2d 3b 0a 20 20 20 20 |= '.') s|--;. |
|00001710| 2f 2a 0a 20 20 20 20 20 | 2a 20 57 65 20 6e 65 76 |/*. |* We nev|
|00001720| 65 72 20 77 61 6e 74 20 | 74 6f 20 72 65 6d 6f 76 |er want |to remov|
|00001730| 65 20 74 68 65 20 70 61 | 74 68 20 73 65 70 65 72 |e the pa|th seper|
|00001740| 61 74 6f 72 0a 20 20 20 | 20 20 2a 2f 0a 20 20 20 |ator. | */. |
|00001750| 20 69 66 20 28 2a 73 20 | 21 3d 20 50 41 54 48 53 | if (*s |!= PATHS|
|00001760| 45 50 29 20 2a 73 20 3d | 20 30 3b 0a 0a 20 20 20 |EP) *s =| 0;.. |
|00001770| 20 2f 2a 0a 20 20 20 20 | 20 2a 20 4e 65 78 74 2c | /*. | * Next,|
|00001780| 20 72 65 74 75 72 6e 20 | 74 68 65 20 62 61 73 65 | return |the base|
|00001790| 6e 61 6d 65 0a 20 20 20 | 20 20 2a 2f 0a 20 20 20 |name. | */. |
|000017a0| 20 77 68 69 6c 65 20 28 | 73 20 3e 20 66 75 6c 6c | while (|s > full|
|000017b0| 70 61 74 68 6e 61 6d 65 | 20 26 26 20 2a 73 20 21 |pathname| && *s !|
|000017c0| 3d 20 50 41 54 48 53 45 | 50 29 20 73 2d 2d 3b 0a |= PATHSE|P) s--;.|
|000017d0| 20 20 20 20 69 66 20 28 | 2a 73 20 3d 3d 20 50 41 | if (|*s == PA|
|000017e0| 54 48 53 45 50 29 20 73 | 2b 2b 3b 0a 0a 20 20 20 |THSEP) s|++;.. |
|000017f0| 20 72 65 74 75 72 6e 20 | 73 3b 0a 7d 0a 0a 2f 2a | return |s;.}../*|
|00001800| 73 67 66 72 65 61 64 2e | 63 00 00 00 00 00 00 00 |sgfread.|c.......|
|00001810| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001820| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001830| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001840| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001850| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001860| 00 00 00 00 30 30 30 34 | 34 34 20 00 30 30 30 34 |....0004|44 .0004|
|00001870| 37 31 20 00 30 30 30 30 | 31 32 20 00 30 30 30 30 |71 .0000|12 .0000|
|00001880| 30 30 32 32 37 37 30 20 | 30 35 33 34 33 35 33 36 |0022770 |05343536|
|00001890| 33 32 37 20 30 31 31 37 | 31 31 00 20 30 00 00 00 |327 0117|11. 0...|
|000018a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000018b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000018c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000018d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000018e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000018f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001900| 00 75 73 74 61 72 00 30 | 30 6a 61 6e 73 74 65 65 |.ustar.0|0janstee|
|00001910| 6e 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |n.......|........|
|00001920| 00 00 00 00 00 00 00 00 | 00 63 6c 00 00 00 00 00 |........|.cl.....|
|00001930| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001940| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001950| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001960| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001970| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001980| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001990| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000019a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000019b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000019c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000019d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000019e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000019f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001a00| 2f 2a 20 23 5b 69 6e 66 | 6f 3a 09 09 09 2a 2f 0a |/* #[inf|o:...*/.|
|00001a10| 2f 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |/*******|********|
|00001a20| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00001a30| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00001a40| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00001a50| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 0a 20 2a 09 09 09 09 |********|*. *....|
|00001a60| 09 09 09 09 09 2a 0a 20 | 2a 09 20 20 20 20 20 20 |.....*. |*. |
|00001a70| 20 23 23 23 23 20 20 23 | 23 23 23 20 20 23 23 23 | #### #|### ###|
|00001a80| 23 23 20 23 23 23 23 23 | 20 20 23 23 23 23 23 20 |## #####| ##### |
|00001a90| 20 20 20 23 20 20 20 20 | 23 23 23 23 20 20 09 09 | # |#### ..|
|00001aa0| 2a 0a 20 2a 09 20 20 20 | 20 20 20 23 20 20 20 20 |*. *. | # |
|00001ab0| 20 23 20 20 20 20 20 20 | 23 20 20 20 20 20 23 20 | # |# # |
|00001ac0| 20 20 20 23 20 23 20 20 | 20 20 20 20 20 23 20 23 | # # | # #|
|00001ad0| 20 20 20 23 20 20 20 23 | 20 09 09 2a 0a 20 2a 09 | # #| ..*. *.|
|00001ae0| 20 20 20 20 20 20 23 20 | 20 20 20 20 23 20 20 20 | # | # |
|00001af0| 20 20 20 23 20 20 20 20 | 20 23 20 20 20 20 23 20 | # | # # |
|00001b00| 23 20 20 20 20 20 20 23 | 20 20 20 23 20 20 23 20 |# #| # # |
|00001b10| 20 20 20 23 09 09 2a 0a | 20 2a 09 20 20 20 20 20 | #..*.| *. |
|00001b20| 20 20 23 23 23 20 20 23 | 20 20 23 23 20 20 23 23 | ### #| ## ##|
|00001b30| 23 20 20 20 23 23 23 23 | 23 20 20 23 23 23 20 20 |# ####|# ### |
|00001b40| 20 23 23 23 23 23 23 23 | 20 23 20 20 20 20 23 09 | #######| # #.|
|00001b50| 09 2a 0a 20 2a 09 20 20 | 20 20 20 20 20 20 20 20 |.*. *. | |
|00001b60| 23 20 23 20 20 20 20 23 | 20 23 20 20 20 20 20 23 |# # #| # #|
|00001b70| 20 20 23 20 20 20 23 20 | 20 20 20 20 23 20 20 20 | # # | # |
|00001b80| 20 20 23 20 23 20 20 20 | 20 23 09 09 2a 0a 20 2a | # # | #..*. *|
|00001b90| 09 20 20 20 20 20 20 20 | 20 20 20 23 20 23 20 20 |. | # # |
|00001ba0| 20 20 23 20 23 20 20 20 | 20 20 23 20 20 20 23 20 | # # | # # |
|00001bb0| 20 23 20 20 20 20 20 23 | 20 20 20 20 20 23 20 23 | # #| # #|
|00001bc0| 20 20 20 23 20 09 09 2a | 0a 20 2a 09 20 20 20 20 | # ..*|. *. |
|00001bd0| 20 20 23 23 23 23 20 20 | 20 23 23 23 23 20 20 23 | #### | #### #|
|00001be0| 20 20 20 20 20 23 20 20 | 20 20 23 20 23 23 23 23 | # | # ####|
|00001bf0| 23 20 23 20 20 20 20 20 | 23 20 23 23 23 23 20 20 |# # |# #### |
|00001c00| 09 09 2a 0a 20 2a 09 09 | 09 09 09 09 09 09 09 2a |..*. *..|.......*|
|00001c10| 0a 20 2a 09 09 09 20 20 | 20 20 4a 61 6e 20 76 61 |. *... | Jan va|
|00001c20| 6e 20 64 65 72 20 53 74 | 65 65 6e 09 09 09 09 2a |n der St|een....*|
|00001c30| 0a 20 2a 09 09 09 09 09 | 09 09 09 09 2a 0a 20 2a |. *.....|....*. *|
|00001c40| 09 20 20 20 20 20 20 43 | 65 6e 74 72 65 20 66 6f |. C|entre fo|
|00001c50| 72 20 4d 61 74 68 65 6d | 61 74 69 63 73 20 61 6e |r Mathem|atics an|
|00001c60| 64 20 43 6f 6d 70 75 74 | 65 72 20 53 63 69 65 6e |d Comput|er Scien|
|00001c70| 63 65 09 09 2a 0a 20 2a | 09 09 20 20 20 20 20 20 |ce..*. *|.. |
|00001c80| 41 6d 73 74 65 72 64 61 | 6d 2c 20 74 68 65 20 4e |Amsterda|m, the N|
|00001c90| 65 74 68 65 72 6c 61 6e | 64 73 09 09 09 2a 0a 20 |etherlan|ds...*. |
|00001ca0| 2a 09 09 09 09 09 09 09 | 09 09 2a 0a 20 2a 2d 2d |*.......|..*. *--|
|00001cb0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001cc0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001cd0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001ce0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001cf0| 2d 2d 2d 2d 2a 0a 20 2a | 20 46 69 6c 65 20 20 20 |----*. *| File |
|00001d00| 20 3a 20 73 67 66 72 65 | 61 64 2e 63 20 09 09 09 | : sgfre|ad.c ...|
|00001d10| 09 09 09 2a 0a 20 2a 20 | 50 75 72 70 6f 73 65 20 |...*. * |Purpose |
|00001d20| 3a 20 52 65 61 64 20 61 | 6e 64 20 73 74 6f 72 65 |: Read a|nd store|
|00001d30| 20 61 20 53 6d 61 72 74 | 20 47 6f 20 46 6f 72 6d | a Smart| Go Form|
|00001d40| 61 74 20 66 69 6c 65 09 | 09 09 2a 0a 20 2a 20 56 |at file.|..*. * V|
|00001d50| 65 72 73 69 6f 6e 20 3a | 20 31 2e 32 20 09 09 09 |ersion :| 1.2 ...|
|00001d60| 09 09 09 2a 0a 20 2a 20 | 4d 6f 64 69 66 69 65 64 |...*. * |Modified|
|00001d70| 3a 20 31 32 2f 31 36 2f | 39 32 20 31 38 3a 33 34 |: 12/16/|92 18:34|
|00001d80| 3a 30 37 09 09 09 09 09 | 09 2a 0a 20 2a 20 41 75 |:07.....|.*. * Au|
|00001d90| 74 68 6f 72 20 20 3a 20 | 4a 61 6e 20 76 61 6e 20 |thor : |Jan van |
|00001da0| 64 65 72 20 53 74 65 65 | 6e 20 28 6a 61 6e 73 74 |der Stee|n (janst|
|00001db0| 65 65 6e 40 63 77 69 2e | 6e 6c 29 20 09 09 09 2a |een@cwi.|nl) ...*|
|00001dc0| 0a 20 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |. ******|********|
|00001dd0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00001de0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00001df0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00001e00| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2f 0a 2f 2a 20 23 |********|**/./* #|
|00001e10| 5d 69 6e 66 6f 3a 09 09 | 09 2a 2f 20 0a 2f 2a 20 |]info:..|.*/ ./* |
|00001e20| 23 5b 69 6e 63 6c 75 64 | 65 3a 09 09 09 2a 2f 0a |#[includ|e:...*/.|
|00001e30| 0a 23 69 6e 63 6c 75 64 | 65 20 3c 73 74 64 69 6f |.#includ|e <stdio|
|00001e40| 2e 68 3e 0a 23 69 6e 63 | 6c 75 64 65 20 3c 73 74 |.h>.#inc|lude <st|
|00001e50| 64 6c 69 62 2e 68 3e 0a | 23 69 6e 63 6c 75 64 65 |dlib.h>.|#include|
|00001e60| 20 3c 73 74 72 69 6e 67 | 2e 68 3e 0a 23 69 6e 63 | <string|.h>.#inc|
|00001e70| 6c 75 64 65 20 22 74 6f | 6f 6c 73 2e 68 22 0a 23 |lude "to|ols.h".#|
|00001e80| 69 6e 63 6c 75 64 65 20 | 22 67 6f 67 61 6d 65 2e |include |"gogame.|
|00001e90| 68 22 0a 23 69 6e 63 6c | 75 64 65 20 22 73 67 66 |h".#incl|ude "sgf|
|00001ea0| 72 65 61 64 2e 68 22 0a | 0a 2f 2a 20 23 5d 69 6e |read.h".|./* #]in|
|00001eb0| 63 6c 75 64 65 3a 09 09 | 09 2a 2f 20 0a 2f 2a 20 |clude:..|.*/ ./* |
|00001ec0| 23 5b 64 65 66 69 6e 65 | 3a 09 09 09 2a 2f 0a 0a |#[define|:...*/..|
|00001ed0| 23 64 65 66 69 6e 65 20 | 4d 41 58 4c 49 4e 45 09 |#define |MAXLINE.|
|00001ee0| 31 30 32 34 0a 0a 2f 2a | 20 23 5d 64 65 66 69 6e |1024../*| #]defin|
|00001ef0| 65 3a 09 09 09 2a 2f 20 | 0a 2f 2a 20 23 5b 74 79 |e:...*/ |./* #[ty|
|00001f00| 70 65 64 65 66 3a 09 09 | 09 2a 2f 0a 0a 23 69 66 |pedef:..|.*/..#if|
|00001f10| 64 65 66 20 5f 5f 53 54 | 44 43 5f 5f 0a 23 09 64 |def __ST|DC__.#.d|
|00001f20| 65 66 69 6e 65 09 50 52 | 4f 54 4f 28 73 29 20 73 |efine.PR|OTO(s) s|
|00001f30| 0a 23 65 6c 73 65 0a 23 | 09 64 65 66 69 6e 65 09 |.#else.#|.define.|
|00001f40| 50 52 4f 54 4f 28 73 29 | 20 28 29 0a 23 65 6e 64 |PROTO(s)| ().#end|
|00001f50| 69 66 0a 0a 74 79 70 65 | 64 65 66 20 73 74 72 75 |if..type|def stru|
|00001f60| 63 74 20 6b 65 79 5f 69 | 6e 66 6f 20 7b 0a 20 20 |ct key_i|nfo {. |
|00001f70| 20 20 63 68 61 72 20 2a | 09 09 6b 79 5f 6c 6f 6e | char *|..ky_lon|
|00001f80| 67 3b 0a 20 20 20 20 63 | 68 61 72 20 2a 09 09 6b |g;. c|har *..k|
|00001f90| 79 5f 73 68 6f 72 74 3b | 0a 20 20 20 20 76 6f 69 |y_short;|. voi|
|00001fa0| 64 09 09 28 2a 6b 79 5f | 68 61 6e 64 6c 65 29 50 |d..(*ky_|handle)P|
|00001fb0| 52 4f 54 4f 28 28 47 4f | 47 41 4d 45 20 2a 67 2c |ROTO((GO|GAME *g,|
|00001fc0| 20 63 68 61 72 20 2a 6c | 69 6e 65 29 29 3b 0a 7d | char *l|ine));.}|
|00001fd0| 20 4b 45 59 3b 0a 0a 23 | 75 6e 64 65 66 20 50 52 | KEY;..#|undef PR|
|00001fe0| 4f 54 4f 0a 0a 2f 2a 20 | 23 5d 74 79 70 65 64 65 |OTO../* |#]typede|
|00001ff0| 66 3a 09 09 09 2a 2f 20 | 0a 2f 2a 20 23 5b 70 72 |f:...*/ |./* #[pr|
|00002000| 6f 74 6f 74 79 70 65 3a | 09 09 09 2a 2f 0a 0a 23 |ototype:|...*/..#|
|00002010| 69 66 64 65 66 20 5f 5f | 53 54 44 43 5f 5f 0a 23 |ifdef __|STDC__.#|
|00002020| 09 64 65 66 69 6e 65 09 | 50 52 4f 54 4f 28 73 29 |.define.|PROTO(s)|
|00002030| 20 73 0a 23 65 6c 73 65 | 0a 23 09 64 65 66 69 6e | s.#else|.#.defin|
|00002040| 65 09 50 52 4f 54 4f 28 | 73 29 20 28 29 0a 23 65 |e.PROTO(|s) ().#e|
|00002050| 6e 64 69 66 0a 0a 2f 2a | 0a 20 2a 20 4b 65 79 77 |ndif../*|. * Keyw|
|00002060| 6f 72 64 20 68 61 6e 64 | 6c 65 72 73 0a 20 2a 2f |ord hand|lers. */|
|00002070| 0a 73 74 61 74 69 63 20 | 76 6f 69 64 09 64 6f 5f |.static |void.do_|
|00002080| 62 6c 61 63 6b 09 20 50 | 52 4f 54 4f 28 28 47 4f |black. P|ROTO((GO|
|00002090| 47 41 4d 45 20 2a 67 2c | 20 63 68 61 72 20 2a 6c |GAME *g,| char *l|
|000020a0| 69 6e 65 29 29 3b 0a 73 | 74 61 74 69 63 20 76 6f |ine));.s|tatic vo|
|000020b0| 69 64 09 64 6f 5f 77 68 | 69 74 65 09 20 50 52 4f |id.do_wh|ite. PRO|
|000020c0| 54 4f 28 28 47 4f 47 41 | 4d 45 20 2a 67 2c 20 63 |TO((GOGA|ME *g, c|
|000020d0| 68 61 72 20 2a 6c 69 6e | 65 29 29 3b 0a 73 74 61 |har *lin|e));.sta|
|000020e0| 74 69 63 20 76 6f 69 64 | 09 64 6f 5f 63 6f 6d 6d |tic void|.do_comm|
|000020f0| 65 6e 74 09 20 50 52 4f | 54 4f 28 28 47 4f 47 41 |ent. PRO|TO((GOGA|
|00002100| 4d 45 20 2a 67 2c 20 63 | 68 61 72 20 2a 6c 69 6e |ME *g, c|har *lin|
|00002110| 65 29 29 3b 0a 73 74 61 | 74 69 63 20 76 6f 69 64 |e));.sta|tic void|
|00002120| 09 64 6f 5f 65 76 65 6e | 74 09 20 50 52 4f 54 4f |.do_even|t. PROTO|
|00002130| 28 28 47 4f 47 41 4d 45 | 20 2a 67 2c 20 63 68 61 |((GOGAME| *g, cha|
|00002140| 72 20 2a 6c 69 6e 65 29 | 29 3b 0a 73 74 61 74 69 |r *line)|);.stati|
|00002150| 63 20 76 6f 69 64 09 64 | 6f 5f 75 73 65 72 09 09 |c void.d|o_user..|
|00002160| 20 50 52 4f 54 4f 28 28 | 47 4f 47 41 4d 45 20 2a | PROTO((|GOGAME *|
|00002170| 67 2c 20 63 68 61 72 20 | 2a 6c 69 6e 65 29 29 3b |g, char |*line));|
|00002180| 0a 73 74 61 74 69 63 20 | 76 6f 69 64 09 64 6f 5f |.static |void.do_|
|00002190| 70 6c 61 79 65 72 62 6c | 61 63 6b 09 20 50 52 4f |playerbl|ack. PRO|
|000021a0| 54 4f 28 28 47 4f 47 41 | 4d 45 20 2a 67 2c 20 63 |TO((GOGA|ME *g, c|
|000021b0| 68 61 72 20 2a 6c 69 6e | 65 29 29 3b 0a 73 74 61 |har *lin|e));.sta|
|000021c0| 74 69 63 20 76 6f 69 64 | 09 64 6f 5f 62 6c 61 63 |tic void|.do_blac|
|000021d0| 6b 72 61 6e 6b 69 6e 67 | 09 20 50 52 4f 54 4f 28 |kranking|. PROTO(|
|000021e0| 28 47 4f 47 41 4d 45 20 | 2a 67 2c 20 63 68 61 72 |(GOGAME |*g, char|
|000021f0| 20 2a 6c 69 6e 65 29 29 | 3b 0a 73 74 61 74 69 63 | *line))|;.static|
|00002200| 20 76 6f 69 64 09 64 6f | 5f 70 6c 61 79 65 72 77 | void.do|_playerw|
|00002210| 68 69 74 65 09 20 50 52 | 4f 54 4f 28 28 47 4f 47 |hite. PR|OTO((GOG|
|00002220| 41 4d 45 20 2a 67 2c 20 | 63 68 61 72 20 2a 6c 69 |AME *g, |char *li|
|00002230| 6e 65 29 29 3b 0a 73 74 | 61 74 69 63 20 76 6f 69 |ne));.st|atic voi|
|00002240| 64 09 64 6f 5f 77 68 69 | 74 65 72 61 6e 6b 69 6e |d.do_whi|terankin|
|00002250| 67 09 20 50 52 4f 54 4f | 28 28 47 4f 47 41 4d 45 |g. PROTO|((GOGAME|
|00002260| 20 2a 67 2c 20 63 68 61 | 72 20 2a 6c 69 6e 65 29 | *g, cha|r *line)|
|00002270| 29 3b 0a 73 74 61 74 69 | 63 20 76 6f 69 64 09 64 |);.stati|c void.d|
|00002280| 6f 5f 64 61 74 65 09 09 | 20 50 52 4f 54 4f 28 28 |o_date..| PROTO((|
|00002290| 47 4f 47 41 4d 45 20 2a | 67 2c 20 63 68 61 72 20 |GOGAME *|g, char |
|000022a0| 2a 6c 69 6e 65 29 29 3b | 0a 73 74 61 74 69 63 20 |*line));|.static |
|000022b0| 76 6f 69 64 09 64 6f 5f | 67 61 6d 65 09 09 20 50 |void.do_|game.. P|
|000022c0| 52 4f 54 4f 28 28 47 4f | 47 41 4d 45 20 2a 67 2c |ROTO((GO|GAME *g,|
|000022d0| 20 63 68 61 72 20 2a 6c | 69 6e 65 29 29 3b 0a 73 | char *l|ine));.s|
|000022e0| 74 61 74 69 63 20 76 6f | 69 64 09 64 6f 5f 76 69 |tatic vo|id.do_vi|
|000022f0| 65 77 09 09 20 50 52 4f | 54 4f 28 28 47 4f 47 41 |ew.. PRO|TO((GOGA|
|00002300| 4d 45 20 2a 67 2c 20 63 | 68 61 72 20 2a 6c 69 6e |ME *g, c|har *lin|
|00002310| 65 29 29 3b 0a 73 74 61 | 74 69 63 20 76 6f 69 64 |e));.sta|tic void|
|00002320| 09 64 6f 5f 73 69 7a 65 | 09 09 20 50 52 4f 54 4f |.do_size|.. PROTO|
|00002330| 28 28 47 4f 47 41 4d 45 | 20 2a 67 2c 20 63 68 61 |((GOGAME| *g, cha|
|00002340| 72 20 2a 6c 69 6e 65 29 | 29 3b 0a 73 74 61 74 69 |r *line)|);.stati|
|00002350| 63 20 76 6f 69 64 09 64 | 6f 5f 67 61 6d 65 6e 61 |c void.d|o_gamena|
|00002360| 6d 65 09 20 50 52 4f 54 | 4f 28 28 47 4f 47 41 4d |me. PROT|O((GOGAM|
|00002370| 45 20 2a 67 2c 20 63 68 | 61 72 20 2a 6c 69 6e 65 |E *g, ch|ar *line|
|00002380| 29 29 3b 0a 73 74 61 74 | 69 63 20 76 6f 69 64 09 |));.stat|ic void.|
|00002390| 64 6f 5f 70 6c 61 63 65 | 09 20 50 52 4f 54 4f 28 |do_place|. PROTO(|
|000023a0| 28 47 4f 47 41 4d 45 20 | 2a 67 2c 20 63 68 61 72 |(GOGAME |*g, char|
|000023b0| 20 2a 6c 69 6e 65 29 29 | 3b 0a 73 74 61 74 69 63 | *line))|;.static|
|000023c0| 20 76 6f 69 64 09 64 6f | 5f 72 65 73 75 6c 74 09 | void.do|_result.|
|000023d0| 20 50 52 4f 54 4f 28 28 | 47 4f 47 41 4d 45 20 2a | PROTO((|GOGAME *|
|000023e0| 67 2c 20 63 68 61 72 20 | 2a 6c 69 6e 65 29 29 3b |g, char |*line));|
|000023f0| 0a 73 74 61 74 69 63 20 | 76 6f 69 64 09 64 6f 5f |.static |void.do_|
|00002400| 6b 6f 6d 69 09 09 20 50 | 52 4f 54 4f 28 28 47 4f |komi.. P|ROTO((GO|
|00002410| 47 41 4d 45 20 2a 67 2c | 20 63 68 61 72 20 2a 6c |GAME *g,| char *l|
|00002420| 69 6e 65 29 29 3b 0a 73 | 74 61 74 69 63 20 76 6f |ine));.s|tatic vo|
|00002430| 69 64 09 64 6f 5f 61 64 | 64 62 6c 61 63 6b 09 20 |id.do_ad|dblack. |
|00002440| 50 52 4f 54 4f 28 28 47 | 4f 47 41 4d 45 20 2a 67 |PROTO((G|OGAME *g|
|00002450| 2c 20 63 68 61 72 20 2a | 6c 69 6e 65 29 29 3b 0a |, char *|line));.|
|00002460| 73 74 61 74 69 63 20 76 | 6f 69 64 09 64 6f 5f 61 |static v|oid.do_a|
|00002470| 64 64 77 68 69 74 65 09 | 20 50 52 4f 54 4f 28 28 |ddwhite.| PROTO((|
|00002480| 47 4f 47 41 4d 45 20 2a | 67 2c 20 63 68 61 72 20 |GOGAME *|g, char |
|00002490| 2a 6c 69 6e 65 29 29 3b | 0a 73 74 61 74 69 63 20 |*line));|.static |
|000024a0| 76 6f 69 64 09 64 6f 5f | 62 6c 61 63 6b 74 69 6d |void.do_|blacktim|
|000024b0| 65 6c 65 66 74 20 50 52 | 4f 54 4f 28 28 47 4f 47 |eleft PR|OTO((GOG|
|000024c0| 41 4d 45 20 2a 67 2c 20 | 63 68 61 72 20 2a 6c 69 |AME *g, |char *li|
|000024d0| 6e 65 29 29 3b 0a 73 74 | 61 74 69 63 20 76 6f 69 |ne));.st|atic voi|
|000024e0| 64 09 64 6f 5f 77 68 69 | 74 65 74 69 6d 65 6c 65 |d.do_whi|tetimele|
|000024f0| 66 74 20 50 52 4f 54 4f | 28 28 47 4f 47 41 4d 45 |ft PROTO|((GOGAME|
|00002500| 20 2a 67 2c 20 63 68 61 | 72 20 2a 6c 69 6e 65 29 | *g, cha|r *line)|
|00002510| 29 3b 0a 0a 23 75 6e 64 | 65 66 20 50 52 4f 54 4f |);..#und|ef PROTO|
|00002520| 0a 0a 2f 2a 20 23 5d 70 | 72 6f 74 6f 74 79 70 65 |../* #]p|rototype|
|00002530| 3a 09 09 09 2a 2f 20 0a | 2f 2a 20 23 5b 73 74 61 |:...*/ .|/* #[sta|
|00002540| 74 69 63 3a 09 09 09 2a | 2f 0a 0a 73 74 61 74 69 |tic:...*|/..stati|
|00002550| 63 20 4b 45 59 20 6b 65 | 79 5b 5d 20 3d 20 7b 0a |c KEY ke|y[] = {.|
|00002560| 20 20 20 20 7b 09 22 42 | 6c 61 63 6b 22 09 09 2c | {."B|lack"..,|
|00002570| 20 20 22 42 22 20 09 09 | 2c 20 64 6f 5f 62 6c 61 | "B" ..|, do_bla|
|00002580| 63 6b 09 09 7d 2c 0a 20 | 20 20 20 7b 09 22 57 68 |ck..},. | {."Wh|
|00002590| 69 74 65 22 09 09 2c 20 | 20 22 57 22 20 09 09 2c |ite".., | "W" ..,|
|000025a0| 20 64 6f 5f 77 68 69 74 | 65 09 09 7d 2c 0a 20 20 | do_whit|e..},. |
|000025b0| 20 20 7b 09 22 43 6f 6d | 6d 65 6e 74 22 09 2c 20 | {."Com|ment"., |
|000025c0| 20 22 43 22 20 09 09 2c | 20 64 6f 5f 63 6f 6d 6d | "C" ..,| do_comm|
|000025d0| 65 6e 74 09 09 7d 2c 0a | 20 20 20 20 7b 09 22 45 |ent..},.| {."E|
|000025e0| 56 65 6e 74 22 09 09 2c | 20 20 22 45 56 22 09 09 |Vent"..,| "EV"..|
|000025f0| 2c 20 64 6f 5f 65 76 65 | 6e 74 09 09 7d 2c 0a 20 |, do_eve|nt..},. |
|00002600| 20 20 20 7b 09 22 55 53 | 65 72 22 09 09 2c 20 20 | {."US|er".., |
|00002610| 22 55 53 22 09 09 2c 20 | 64 6f 5f 75 73 65 72 09 |"US".., |do_user.|
|00002620| 09 7d 2c 0a 20 20 20 20 | 7b 09 22 50 6c 61 79 65 |.},. |{."Playe|
|00002630| 72 42 6c 61 63 6b 22 09 | 2c 20 20 22 50 42 22 09 |rBlack".|, "PB".|
|00002640| 09 2c 20 64 6f 5f 70 6c | 61 79 65 72 62 6c 61 63 |., do_pl|ayerblac|
|00002650| 6b 09 7d 2c 0a 20 20 20 | 20 7b 09 22 42 6c 61 63 |k.},. | {."Blac|
|00002660| 6b 52 61 6e 6b 69 6e 67 | 22 09 2c 20 20 22 42 52 |kRanking|"., "BR|
|00002670| 22 09 09 2c 20 64 6f 5f | 62 6c 61 63 6b 72 61 6e |".., do_|blackran|
|00002680| 6b 69 6e 67 09 7d 2c 0a | 20 20 20 20 7b 09 22 50 |king.},.| {."P|
|00002690| 6c 61 79 65 72 57 68 69 | 74 65 22 09 2c 20 20 22 |layerWhi|te"., "|
|000026a0| 50 57 22 09 09 2c 20 64 | 6f 5f 70 6c 61 79 65 72 |PW".., d|o_player|
|000026b0| 77 68 69 74 65 09 7d 2c | 0a 20 20 20 20 7b 09 22 |white.},|. {."|
|000026c0| 57 68 69 74 65 52 61 6e | 6b 69 6e 67 22 09 2c 20 |WhiteRan|king"., |
|000026d0| 20 22 57 52 22 09 09 2c | 20 64 6f 5f 77 68 69 74 | "WR"..,| do_whit|
|000026e0| 65 72 61 6e 6b 69 6e 67 | 09 7d 2c 0a 20 20 20 20 |eranking|.},. |
|000026f0| 7b 09 22 44 61 54 65 22 | 09 09 2c 20 20 22 44 54 |{."DaTe"|.., "DT|
|00002700| 22 09 09 2c 20 64 6f 5f | 64 61 74 65 09 09 7d 2c |".., do_|date..},|
|00002710| 0a 20 20 20 20 7b 09 22 | 47 61 4d 65 22 09 09 2c |. {."|GaMe"..,|
|00002720| 20 20 22 47 4d 22 09 09 | 2c 20 64 6f 5f 67 61 6d | "GM"..|, do_gam|
|00002730| 65 09 09 7d 2c 0a 20 20 | 20 20 7b 09 22 56 69 65 |e..},. | {."Vie|
|00002740| 57 22 09 09 2c 20 20 22 | 56 57 22 09 09 2c 20 64 |W".., "|VW".., d|
|00002750| 6f 5f 76 69 65 77 09 09 | 7d 2c 0a 20 20 20 20 7b |o_view..|},. {|
|00002760| 09 22 53 69 5a 65 22 09 | 09 2c 20 20 22 53 5a 22 |."SiZe".|., "SZ"|
|00002770| 09 09 2c 20 64 6f 5f 73 | 69 7a 65 09 09 7d 2c 0a |.., do_s|ize..},.|
|00002780| 20 20 20 20 7b 09 22 47 | 61 6d 65 4e 61 6d 65 22 | {."G|ameName"|
|00002790| 09 2c 20 20 22 47 4e 22 | 09 09 2c 20 64 6f 5f 67 |., "GN"|.., do_g|
|000027a0| 61 6d 65 6e 61 6d 65 09 | 09 7d 2c 0a 20 20 20 20 |amename.|.},. |
|000027b0| 7b 09 22 50 6c 61 43 65 | 22 09 09 2c 20 20 22 50 |{."PlaCe|".., "P|
|000027c0| 43 22 09 09 2c 20 64 6f | 5f 70 6c 61 63 65 09 09 |C".., do|_place..|
|000027d0| 7d 2c 0a 20 20 20 20 7b | 09 22 52 45 73 75 6c 74 |},. {|."REsult|
|000027e0| 22 09 2c 20 20 22 52 45 | 22 09 09 2c 20 64 6f 5f |"., "RE|".., do_|
|000027f0| 72 65 73 75 6c 74 09 09 | 7d 2c 0a 20 20 20 20 7b |result..|},. {|
|00002800| 09 22 4b 6f 4d 69 22 09 | 09 2c 20 20 22 4b 4d 22 |."KoMi".|., "KM"|
|00002810| 09 09 2c 20 64 6f 5f 6b | 6f 6d 69 09 09 7d 2c 0a |.., do_k|omi..},.|
|00002820| 20 20 20 20 7b 09 22 41 | 64 64 42 6c 61 63 6b 22 | {."A|ddBlack"|
|00002830| 09 2c 20 20 22 41 42 22 | 09 09 2c 20 64 6f 5f 61 |., "AB"|.., do_a|
|00002840| 64 64 62 6c 61 63 6b 09 | 09 7d 2c 0a 20 20 20 20 |ddblack.|.},. |
|00002850| 7b 09 22 41 64 64 57 68 | 69 74 65 22 09 2c 20 20 |{."AddWh|ite"., |
|00002860| 22 41 57 22 09 09 2c 20 | 64 6f 5f 61 64 64 77 68 |"AW".., |do_addwh|
|00002870| 69 74 65 09 09 7d 2c 0a | 20 20 20 20 7b 09 22 42 |ite..},.| {."B|
|00002880| 6c 61 63 6b 74 69 6d 65 | 4c 65 66 74 22 09 2c 20 |lacktime|Left"., |
|00002890| 20 22 42 4c 22 09 09 2c | 20 64 6f 5f 62 6c 61 63 | "BL"..,| do_blac|
|000028a0| 6b 74 69 6d 65 6c 65 66 | 74 09 7d 2c 0a 20 20 20 |ktimelef|t.},. |
|000028b0| 20 7b 09 22 57 68 69 74 | 65 74 69 6d 65 4c 65 66 | {."Whit|etimeLef|
|000028c0| 74 22 09 2c 20 20 22 57 | 4c 22 09 09 2c 20 64 6f |t"., "W|L".., do|
|000028d0| 5f 77 68 69 74 65 74 69 | 6d 65 6c 65 66 74 09 7d |_whiteti|meleft.}|
|000028e0| 2c 0a 20 20 20 20 7b 09 | 28 63 68 61 72 20 2a 29 |,. {.|(char *)|
|000028f0| 20 30 09 2c 20 20 28 63 | 68 61 72 20 2a 29 20 30 | 0., (c|har *) 0|
|00002900| 09 2c 20 30 09 09 09 7d | 0a 7d 3b 0a 0a 73 74 61 |., 0...}|.};..sta|
|00002910| 74 69 63 09 46 49 4c 45 | 20 2a 69 6e 70 75 74 3b |tic.FILE| *input;|
|00002920| 0a 0a 2f 2a 20 23 5d 73 | 74 61 74 69 63 3a 09 09 |../* #]s|tatic:..|
|00002930| 09 2a 2f 20 0a 0a 2f 2a | 20 23 5b 64 6f 5f 62 6c |.*/ ../*| #[do_bl|
|00002940| 61 63 6b 3a 09 09 09 2a | 2f 0a 0a 73 74 61 74 69 |ack:...*|/..stati|
|00002950| 63 20 76 6f 69 64 0a 64 | 6f 5f 62 6c 61 63 6b 28 |c void.d|o_black(|
|00002960| 67 6f 67 61 6d 65 2c 20 | 6c 69 6e 65 29 0a 47 4f |gogame, |line).GO|
|00002970| 47 41 4d 45 20 2a 67 6f | 67 61 6d 65 3b 0a 63 68 |GAME *go|game;.ch|
|00002980| 61 72 20 20 20 2a 6c 69 | 6e 65 3b 0a 7b 0a 20 20 |ar *li|ne;.{. |
|00002990| 20 20 69 6e 74 09 09 69 | 09 3d 20 2a 28 6c 69 6e | int..i|.= *(lin|
|000029a0| 65 20 20 29 20 2d 20 27 | 61 27 3b 0a 20 20 20 20 |e ) - '|a';. |
|000029b0| 69 6e 74 09 09 6a 09 3d | 20 2a 28 6c 69 6e 65 2b |int..j.=| *(line+|
|000029c0| 31 29 20 2d 20 27 61 27 | 3b 0a 20 20 20 20 50 4c |1) - 'a'|;. PL|
|000029d0| 41 43 45 09 70 6c 61 63 | 65 09 3d 20 69 20 2b 20 |ACE.plac|e.= i + |
|000029e0| 28 6a 20 2a 20 67 6f 67 | 61 6d 65 2d 3e 67 6d 5f |(j * gog|ame->gm_|
|000029f0| 73 69 7a 65 29 3b 0a 0a | 20 20 20 20 6d 6f 76 65 |size);..| move|
|00002a00| 5f 73 74 6f 72 65 28 67 | 6f 67 61 6d 65 2c 20 42 |_store(g|ogame, B|
|00002a10| 4c 41 43 4b 2c 20 70 6c | 61 63 65 29 3b 0a 7d 0a |LACK, pl|ace);.}.|
|00002a20| 0a 2f 2a 20 23 5d 64 6f | 5f 62 6c 61 63 6b 3a 09 |./* #]do|_black:.|
|00002a30| 09 09 2a 2f 20 0a 2f 2a | 20 23 5b 64 6f 5f 77 68 |..*/ ./*| #[do_wh|
|00002a40| 69 74 65 3a 09 09 09 2a | 2f 0a 0a 73 74 61 74 69 |ite:...*|/..stati|
|00002a50| 63 20 76 6f 69 64 0a 64 | 6f 5f 77 68 69 74 65 28 |c void.d|o_white(|
|00002a60| 67 6f 67 61 6d 65 2c 20 | 6c 69 6e 65 29 0a 47 4f |gogame, |line).GO|
|00002a70| 47 41 4d 45 20 2a 67 6f | 67 61 6d 65 3b 0a 63 68 |GAME *go|game;.ch|
|00002a80| 61 72 20 20 20 2a 6c 69 | 6e 65 3b 0a 7b 0a 20 20 |ar *li|ne;.{. |
|00002a90| 20 20 69 6e 74 09 09 69 | 09 3d 20 2a 28 6c 69 6e | int..i|.= *(lin|
|00002aa0| 65 20 20 29 20 2d 20 27 | 61 27 3b 0a 20 20 20 20 |e ) - '|a';. |
|00002ab0| 69 6e 74 09 09 6a 09 3d | 20 2a 28 6c 69 6e 65 2b |int..j.=| *(line+|
|00002ac0| 31 29 20 2d 20 27 61 27 | 3b 0a 20 20 20 20 50 4c |1) - 'a'|;. PL|
|00002ad0| 41 43 45 09 70 6c 61 63 | 65 09 3d 20 69 20 2b 20 |ACE.plac|e.= i + |
|00002ae0| 28 6a 20 2a 20 67 6f 67 | 61 6d 65 2d 3e 67 6d 5f |(j * gog|ame->gm_|
|00002af0| 73 69 7a 65 29 3b 0a 0a | 20 20 20 20 6d 6f 76 65 |size);..| move|
|00002b00| 5f 73 74 6f 72 65 28 67 | 6f 67 61 6d 65 2c 20 57 |_store(g|ogame, W|
|00002b10| 48 49 54 45 2c 20 70 6c | 61 63 65 29 3b 0a 7d 0a |HITE, pl|ace);.}.|
|00002b20| 0a 2f 2a 20 23 5d 64 6f | 5f 77 68 69 74 65 3a 09 |./* #]do|_white:.|
|00002b30| 09 09 2a 2f 20 0a 2f 2a | 20 23 5b 64 6f 5f 61 64 |..*/ ./*| #[do_ad|
|00002b40| 64 62 6c 61 63 6b 3a 09 | 09 2a 2f 0a 0a 73 74 61 |dblack:.|.*/..sta|
|00002b50| 74 69 63 20 76 6f 69 64 | 0a 64 6f 5f 61 64 64 62 |tic void|.do_addb|
|00002b60| 6c 61 63 6b 28 67 6f 67 | 61 6d 65 2c 20 6c 69 6e |lack(gog|ame, lin|
|00002b70| 65 29 0a 2f 2a 0a 20 2a | 20 41 64 64 20 61 20 62 |e)./*. *| Add a b|
|00002b80| 6c 61 63 6b 20 73 74 6f | 6e 65 20 74 6f 20 74 68 |lack sto|ne to th|
|00002b90| 65 20 67 61 6d 65 0a 20 | 2a 20 54 4f 44 4f 3a 20 |e game. |* TODO: |
|00002ba0| 4d 61 6b 65 20 69 74 20 | 61 63 63 65 70 74 3a 20 |Make it |accept: |
|00002bb0| 5b 64 70 5d 5b 70 64 5d | 5b 2e 2e 5d 0a 20 2a 2f |[dp][pd]|[..]. */|
|00002bc0| 0a 47 4f 47 41 4d 45 20 | 2a 67 6f 67 61 6d 65 3b |.GOGAME |*gogame;|
|00002bd0| 0a 63 68 61 72 20 20 20 | 2a 6c 69 6e 65 3b 0a 7b |.char |*line;.{|
|00002be0| 0a 20 20 20 20 69 6e 74 | 09 09 69 09 3d 20 2a 28 |. int|..i.= *(|
|00002bf0| 6c 69 6e 65 20 20 29 20 | 2d 20 27 61 27 3b 0a 20 |line ) |- 'a';. |
|00002c00| 20 20 20 69 6e 74 09 09 | 6a 09 3d 20 2a 28 6c 69 | int..|j.= *(li|
|00002c10| 6e 65 2b 31 29 20 2d 20 | 27 61 27 3b 0a 20 20 20 |ne+1) - |'a';. |
|00002c20| 20 50 4c 41 43 45 09 70 | 6c 61 63 65 09 3d 20 69 | PLACE.p|lace.= i|
|00002c30| 20 2b 20 28 6a 20 2a 20 | 67 6f 67 61 6d 65 2d 3e | + (j * |gogame->|
|00002c40| 67 6d 5f 73 69 7a 65 29 | 3b 0a 0a 20 20 20 20 6d |gm_size)|;.. m|
|00002c50| 6f 76 65 5f 73 74 6f 72 | 65 28 67 6f 67 61 6d 65 |ove_stor|e(gogame|
|00002c60| 2c 20 42 4c 41 43 4b 2c | 20 70 6c 61 63 65 29 3b |, BLACK,| place);|
|00002c70| 0a 20 20 20 20 67 6f 67 | 61 6d 65 2d 3e 67 6d 5f |. gog|ame->gm_|
|00002c80| 6d 6f 76 65 6e 72 2d 2d | 3b 0a 7d 0a 0a 2f 2a 20 |movenr--|;.}../* |
|00002c90| 23 5d 64 6f 5f 61 64 64 | 62 6c 61 63 6b 3a 09 09 |#]do_add|black:..|
|00002ca0| 2a 2f 20 0a 2f 2a 20 23 | 5b 64 6f 5f 61 64 64 77 |*/ ./* #|[do_addw|
|00002cb0| 68 69 74 65 3a 09 09 2a | 2f 0a 0a 73 74 61 74 69 |hite:..*|/..stati|
|00002cc0| 63 20 76 6f 69 64 0a 64 | 6f 5f 61 64 64 77 68 69 |c void.d|o_addwhi|
|00002cd0| 74 65 28 67 6f 67 61 6d | 65 2c 20 6c 69 6e 65 29 |te(gogam|e, line)|
|00002ce0| 0a 2f 2a 0a 20 2a 20 41 | 64 64 20 61 20 77 68 69 |./*. * A|dd a whi|
|00002cf0| 74 65 20 73 74 6f 6e 65 | 20 74 6f 20 74 68 65 20 |te stone| to the |
|00002d00| 67 61 6d 65 0a 20 2a 20 | 54 4f 44 4f 3a 20 4d 61 |game. * |TODO: Ma|
|00002d10| 6b 65 20 69 74 20 61 63 | 63 65 70 74 3a 20 5b 64 |ke it ac|cept: [d|
|00002d20| 70 5d 5b 70 64 5d 5b 2e | 2e 5d 0a 20 2a 2f 0a 47 |p][pd][.|.]. */.G|
|00002d30| 4f 47 41 4d 45 20 2a 67 | 6f 67 61 6d 65 3b 0a 63 |OGAME *g|ogame;.c|
|00002d40| 68 61 72 20 20 20 2a 6c | 69 6e 65 3b 0a 7b 0a 20 |har *l|ine;.{. |
|00002d50| 20 20 20 69 6e 74 09 09 | 69 09 3d 20 2a 28 6c 69 | int..|i.= *(li|
|00002d60| 6e 65 20 20 29 20 2d 20 | 27 61 27 3b 0a 20 20 20 |ne ) - |'a';. |
|00002d70| 20 69 6e 74 09 09 6a 09 | 3d 20 2a 28 6c 69 6e 65 | int..j.|= *(line|
|00002d80| 2b 31 29 20 2d 20 27 61 | 27 3b 0a 20 20 20 20 50 |+1) - 'a|';. P|
|00002d90| 4c 41 43 45 09 70 6c 61 | 63 65 09 3d 20 69 20 2b |LACE.pla|ce.= i +|
|00002da0| 20 28 6a 20 2a 20 67 6f | 67 61 6d 65 2d 3e 67 6d | (j * go|game->gm|
|00002db0| 5f 73 69 7a 65 29 3b 0a | 0a 20 20 20 20 6d 6f 76 |_size);.|. mov|
|00002dc0| 65 5f 73 74 6f 72 65 28 | 67 6f 67 61 6d 65 2c 20 |e_store(|gogame, |
|00002dd0| 42 4c 41 43 4b 2c 20 70 | 6c 61 63 65 29 3b 0a 20 |BLACK, p|lace);. |
|00002de0| 20 20 20 67 6f 67 61 6d | 65 2d 3e 67 6d 5f 6d 6f | gogam|e->gm_mo|
|00002df0| 76 65 6e 72 2d 2d 3b 0a | 7d 0a 0a 2f 2a 20 23 5d |venr--;.|}../* #]|
|00002e00| 64 6f 5f 61 64 64 77 68 | 69 74 65 3a 09 09 2a 2f |do_addwh|ite:..*/|
|00002e10| 20 0a 2f 2a 20 23 5b 64 | 6f 5f 63 6f 6d 6d 65 6e | ./* #[d|o_commen|
|00002e20| 74 3a 09 09 2a 2f 0a 0a | 73 74 61 74 69 63 20 76 |t:..*/..|static v|
|00002e30| 6f 69 64 0a 64 6f 5f 63 | 6f 6d 6d 65 6e 74 28 67 |oid.do_c|omment(g|
|00002e40| 6f 67 61 6d 65 2c 20 6c | 69 6e 65 29 0a 47 4f 47 |ogame, l|ine).GOG|
|00002e50| 41 4d 45 20 2a 67 6f 67 | 61 6d 65 3b 0a 63 68 61 |AME *gog|ame;.cha|
|00002e60| 72 20 20 20 2a 6c 69 6e | 65 3b 0a 7b 0a 20 20 20 |r *lin|e;.{. |
|00002e70| 20 63 68 61 72 20 6e 65 | 78 74 6c 69 6e 65 5b 4d | char ne|xtline[M|
|00002e80| 41 58 4c 49 4e 45 5d 3b | 0a 0a 20 20 20 20 69 66 |AXLINE];|.. if|
|00002e90| 20 28 67 6f 67 61 6d 65 | 2d 3e 67 6d 5f 6d 6f 76 | (gogame|->gm_mov|
|00002ea0| 65 6c 61 73 74 20 3d 3d | 20 28 47 4f 4d 4f 56 45 |elast ==| (GOMOVE|
|00002eb0| 20 2a 29 20 30 29 20 7b | 0a 09 66 70 72 69 6e 74 | *) 0) {|..fprint|
|00002ec0| 66 28 73 74 64 65 72 72 | 2c 20 22 43 6f 6d 6d 65 |f(stderr|, "Comme|
|00002ed0| 6e 74 20 77 69 74 68 6f | 75 74 20 6d 6f 76 65 20 |nt witho|ut move |
|00002ee0| 72 65 63 65 69 76 65 64 | 20 28 69 67 6e 6f 72 65 |received| (ignore|
|00002ef0| 64 29 5c 6e 22 29 3b 0a | 09 72 65 74 75 72 6e 3b |d)\n");.|.return;|
|00002f00| 0a 20 20 20 20 7d 0a 20 | 20 20 20 69 66 20 28 2a |. }. | if (*|
|00002f10| 6c 69 6e 65 29 20 74 65 | 78 74 5f 73 74 6f 72 65 |line) te|xt_store|
|00002f20| 28 67 6f 67 61 6d 65 2c | 20 6c 69 6e 65 29 3b 0a |(gogame,| line);.|
|00002f30| 20 20 20 20 77 68 69 6c | 65 20 28 66 67 65 74 73 | whil|e (fgets|
|00002f40| 28 6e 65 78 74 6c 69 6e | 65 2c 20 4d 41 58 4c 49 |(nextlin|e, MAXLI|
|00002f50| 4e 45 2c 20 69 6e 70 75 | 74 29 20 21 3d 20 28 63 |NE, inpu|t) != (c|
|00002f60| 68 61 72 20 2a 29 20 30 | 29 20 7b 0a 09 69 66 20 |har *) 0|) {..if |
|00002f70| 28 2a 6e 65 78 74 6c 69 | 6e 65 20 3d 3d 20 2f 2a |(*nextli|ne == /*|
|00002f80| 5b 2a 2f 20 27 5d 27 29 | 20 72 65 74 75 72 6e 3b |[*/ ']')| return;|
|00002f90| 0a 09 6e 65 78 74 6c 69 | 6e 65 5b 73 74 72 6c 65 |..nextli|ne[strle|
|00002fa0| 6e 28 6e 65 78 74 6c 69 | 6e 65 29 20 2d 20 31 5d |n(nextli|ne) - 1]|
|00002fb0| 20 3d 20 30 3b 0a 09 74 | 65 78 74 5f 73 74 6f 72 | = 0;..t|ext_stor|
|00002fc0| 65 28 67 6f 67 61 6d 65 | 2c 20 6e 65 78 74 6c 69 |e(gogame|, nextli|
|00002fd0| 6e 65 29 3b 0a 20 20 20 | 20 7d 0a 7d 0a 0a 2f 2a |ne);. | }.}../*|
|00002fe0| 20 23 5d 64 6f 5f 63 6f | 6d 6d 65 6e 74 3a 09 09 | #]do_co|mment:..|
|00002ff0| 2a 2f 20 0a 2f 2a 20 23 | 5b 64 6f 5f 65 76 65 6e |*/ ./* #|[do_even|
|00003000| 74 3a 09 09 09 2a 2f 0a | 0a 73 74 61 74 69 63 20 |t:...*/.|.static |
|00003010| 76 6f 69 64 0a 64 6f 5f | 65 76 65 6e 74 28 67 6f |void.do_|event(go|
|00003020| 67 61 6d 65 2c 20 6c 69 | 6e 65 29 0a 47 4f 47 41 |game, li|ne).GOGA|
|00003030| 4d 45 20 2a 67 6f 67 61 | 6d 65 3b 0a 63 68 61 72 |ME *goga|me;.char|
|00003040| 20 20 20 2a 6c 69 6e 65 | 3b 0a 7b 0a 20 20 20 20 | *line|;.{. |
|00003050| 67 6f 67 61 6d 65 2d 3e | 67 6d 5f 65 76 65 6e 74 |gogame->|gm_event|
|00003060| 20 3d 20 73 74 72 69 6e | 67 5f 73 74 6f 72 65 28 | = strin|g_store(|
|00003070| 6c 69 6e 65 29 3b 0a 7d | 0a 0a 2f 2a 20 23 5d 64 |line);.}|../* #]d|
|00003080| 6f 5f 65 76 65 6e 74 3a | 09 09 09 2a 2f 20 0a 2f |o_event:|...*/ ./|
|00003090| 2a 20 23 5b 64 6f 5f 75 | 73 65 72 3a 09 09 09 2a |* #[do_u|ser:...*|
|000030a0| 2f 0a 0a 73 74 61 74 69 | 63 20 76 6f 69 64 0a 64 |/..stati|c void.d|
|000030b0| 6f 5f 75 73 65 72 28 67 | 6f 67 61 6d 65 2c 20 6c |o_user(g|ogame, l|
|000030c0| 69 6e 65 29 0a 47 4f 47 | 41 4d 45 20 2a 67 6f 67 |ine).GOG|AME *gog|
|000030d0| 61 6d 65 3b 0a 63 68 61 | 72 20 20 20 2a 6c 69 6e |ame;.cha|r *lin|
|000030e0| 65 3b 0a 7b 0a 20 20 20 | 20 67 6f 67 61 6d 65 2d |e;.{. | gogame-|
|000030f0| 3e 67 6d 5f 75 73 65 72 | 20 3d 20 73 74 72 69 6e |>gm_user| = strin|
|00003100| 67 5f 73 74 6f 72 65 28 | 6c 69 6e 65 29 3b 0a 7d |g_store(|line);.}|
|00003110| 0a 0a 2f 2a 20 23 5d 64 | 6f 5f 75 73 65 72 3a 09 |../* #]d|o_user:.|
|00003120| 09 09 2a 2f 20 0a 2f 2a | 20 23 5b 64 6f 5f 70 6c |..*/ ./*| #[do_pl|
|00003130| 61 79 65 72 62 6c 61 63 | 6b 3a 09 09 2a 2f 0a 0a |ayerblac|k:..*/..|
|00003140| 73 74 61 74 69 63 20 76 | 6f 69 64 0a 64 6f 5f 70 |static v|oid.do_p|
|00003150| 6c 61 79 65 72 62 6c 61 | 63 6b 28 67 6f 67 61 6d |layerbla|ck(gogam|
|00003160| 65 2c 20 6c 69 6e 65 29 | 0a 47 4f 47 41 4d 45 20 |e, line)|.GOGAME |
|00003170| 2a 67 6f 67 61 6d 65 3b | 0a 63 68 61 72 20 20 20 |*gogame;|.char |
|00003180| 2a 6c 69 6e 65 3b 0a 7b | 0a 20 20 20 20 67 6f 67 |*line;.{|. gog|
|00003190| 61 6d 65 2d 3e 67 6d 5f | 62 6c 61 63 6b 20 3d 20 |ame->gm_|black = |
|000031a0| 73 74 72 69 6e 67 5f 73 | 74 6f 72 65 28 6c 69 6e |string_s|tore(lin|
|000031b0| 65 29 3b 0a 7d 0a 0a 2f | 2a 20 23 5d 64 6f 5f 70 |e);.}../|* #]do_p|
|000031c0| 6c 61 79 65 72 62 6c 61 | 63 6b 3a 09 09 2a 2f 20 |layerbla|ck:..*/ |
|000031d0| 0a 2f 2a 20 23 5b 64 6f | 5f 62 6c 61 63 6b 72 61 |./* #[do|_blackra|
|000031e0| 6e 6b 69 6e 67 3a 09 09 | 2a 2f 0a 0a 73 74 61 74 |nking:..|*/..stat|
|000031f0| 69 63 20 76 6f 69 64 0a | 64 6f 5f 62 6c 61 63 6b |ic void.|do_black|
|00003200| 72 61 6e 6b 69 6e 67 28 | 67 6f 67 61 6d 65 2c 20 |ranking(|gogame, |
|00003210| 6c 69 6e 65 29 0a 47 4f | 47 41 4d 45 20 2a 67 6f |line).GO|GAME *go|
|00003220| 67 61 6d 65 3b 0a 63 68 | 61 72 20 20 20 2a 6c 69 |game;.ch|ar *li|
|00003230| 6e 65 3b 0a 7b 0a 20 20 | 20 20 67 6f 67 61 6d 65 |ne;.{. | gogame|
|00003240| 2d 3e 67 6d 5f 62 72 61 | 6e 6b 20 3d 20 73 74 72 |->gm_bra|nk = str|
|00003250| 69 6e 67 5f 73 74 6f 72 | 65 28 6c 69 6e 65 29 3b |ing_stor|e(line);|
|00003260| 0a 7d 0a 0a 2f 2a 20 23 | 5d 64 6f 5f 62 6c 61 63 |.}../* #|]do_blac|
|00003270| 6b 72 61 6e 6b 69 6e 67 | 3a 09 09 2a 2f 20 0a 2f |kranking|:..*/ ./|
|00003280| 2a 20 23 5b 64 6f 5f 62 | 6c 61 63 6b 74 69 6d 65 |* #[do_b|lacktime|
|00003290| 6c 65 66 74 3a 09 09 2a | 2f 0a 0a 73 74 61 74 69 |left:..*|/..stati|
|000032a0| 63 20 76 6f 69 64 0a 64 | 6f 5f 62 6c 61 63 6b 74 |c void.d|o_blackt|
|000032b0| 69 6d 65 6c 65 66 74 28 | 67 6f 67 61 6d 65 2c 20 |imeleft(|gogame, |
|000032c0| 6c 69 6e 65 29 0a 47 4f | 47 41 4d 45 20 2a 67 6f |line).GO|GAME *go|
|000032d0| 67 61 6d 65 3b 0a 63 68 | 61 72 20 20 20 2a 6c 69 |game;.ch|ar *li|
|000032e0| 6e 65 3b 0a 7b 0a 20 20 | 20 20 67 6f 67 61 6d 65 |ne;.{. | gogame|
|000032f0| 2d 3e 67 6d 5f 62 74 69 | 6d 65 20 3d 20 73 74 72 |->gm_bti|me = str|
|00003300| 69 6e 67 5f 73 74 6f 72 | 65 28 6c 69 6e 65 29 3b |ing_stor|e(line);|
|00003310| 0a 7d 0a 0a 2f 2a 20 23 | 5d 64 6f 5f 62 6c 61 63 |.}../* #|]do_blac|
|00003320| 6b 74 69 6d 65 6c 65 66 | 74 3a 09 09 2a 2f 20 0a |ktimelef|t:..*/ .|
|00003330| 2f 2a 20 23 5b 64 6f 5f | 70 6c 61 79 65 72 77 68 |/* #[do_|playerwh|
|00003340| 69 74 65 3a 09 09 2a 2f | 0a 0a 73 74 61 74 69 63 |ite:..*/|..static|
|00003350| 20 76 6f 69 64 0a 64 6f | 5f 70 6c 61 79 65 72 77 | void.do|_playerw|
|00003360| 68 69 74 65 28 67 6f 67 | 61 6d 65 2c 20 6c 69 6e |hite(gog|ame, lin|
|00003370| 65 29 0a 47 4f 47 41 4d | 45 20 2a 67 6f 67 61 6d |e).GOGAM|E *gogam|
|00003380| 65 3b 0a 63 68 61 72 20 | 20 20 2a 6c 69 6e 65 3b |e;.char | *line;|
|00003390| 0a 7b 0a 20 20 20 20 67 | 6f 67 61 6d 65 2d 3e 67 |.{. g|ogame->g|
|000033a0| 6d 5f 77 68 69 74 65 20 | 3d 20 73 74 72 69 6e 67 |m_white |= string|
|000033b0| 5f 73 74 6f 72 65 28 6c | 69 6e 65 29 3b 0a 7d 0a |_store(l|ine);.}.|
|000033c0| 0a 2f 2a 20 23 5d 64 6f | 5f 70 6c 61 79 65 72 77 |./* #]do|_playerw|
|000033d0| 68 69 74 65 3a 09 09 2a | 2f 20 0a 2f 2a 20 23 5b |hite:..*|/ ./* #[|
|000033e0| 64 6f 5f 77 68 69 74 65 | 72 61 6e 6b 69 6e 67 3a |do_white|ranking:|
|000033f0| 09 09 2a 2f 0a 0a 73 74 | 61 74 69 63 20 76 6f 69 |..*/..st|atic voi|
|00003400| 64 0a 64 6f 5f 77 68 69 | 74 65 72 61 6e 6b 69 6e |d.do_whi|terankin|
|00003410| 67 28 67 6f 67 61 6d 65 | 2c 20 6c 69 6e 65 29 0a |g(gogame|, line).|
|00003420| 47 4f 47 41 4d 45 20 2a | 67 6f 67 61 6d 65 3b 0a |GOGAME *|gogame;.|
|00003430| 63 68 61 72 20 20 20 2a | 6c 69 6e 65 3b 0a 7b 0a |char *|line;.{.|
|00003440| 20 20 20 20 67 6f 67 61 | 6d 65 2d 3e 67 6d 5f 77 | goga|me->gm_w|
|00003450| 72 61 6e 6b 20 3d 20 73 | 74 72 69 6e 67 5f 73 74 |rank = s|tring_st|
|00003460| 6f 72 65 28 6c 69 6e 65 | 29 3b 0a 7d 0a 0a 2f 2a |ore(line|);.}../*|
|00003470| 20 23 5d 64 6f 5f 77 68 | 69 74 65 72 61 6e 6b 69 | #]do_wh|iteranki|
|00003480| 6e 67 3a 09 09 2a 2f 20 | 0a 2f 2a 20 23 5b 64 6f |ng:..*/ |./* #[do|
|00003490| 5f 77 68 69 74 65 74 69 | 6d 65 6c 65 66 74 3a 09 |_whiteti|meleft:.|
|000034a0| 09 2a 2f 0a 0a 73 74 61 | 74 69 63 20 76 6f 69 64 |.*/..sta|tic void|
|000034b0| 0a 64 6f 5f 77 68 69 74 | 65 74 69 6d 65 6c 65 66 |.do_whit|etimelef|
|000034c0| 74 28 67 6f 67 61 6d 65 | 2c 20 6c 69 6e 65 29 0a |t(gogame|, line).|
|000034d0| 47 4f 47 41 4d 45 20 2a | 67 6f 67 61 6d 65 3b 0a |GOGAME *|gogame;.|
|000034e0| 63 68 61 72 20 20 20 2a | 6c 69 6e 65 3b 0a 7b 0a |char *|line;.{.|
|000034f0| 20 20 20 20 67 6f 67 61 | 6d 65 2d 3e 67 6d 5f 77 | goga|me->gm_w|
|00003500| 74 69 6d 65 20 3d 20 73 | 74 72 69 6e 67 5f 73 74 |time = s|tring_st|
|00003510| 6f 72 65 28 6c 69 6e 65 | 29 3b 0a 7d 0a 0a 2f 2a |ore(line|);.}../*|
|00003520| 20 23 5d 64 6f 5f 77 68 | 69 74 65 74 69 6d 65 6c | #]do_wh|itetimel|
|00003530| 65 66 74 3a 09 09 2a 2f | 20 0a 2f 2a 20 23 5b 64 |eft:..*/| ./* #[d|
|00003540| 6f 5f 64 61 74 65 3a 09 | 09 09 2a 2f 0a 0a 73 74 |o_date:.|..*/..st|
|00003550| 61 74 69 63 20 76 6f 69 | 64 0a 64 6f 5f 64 61 74 |atic voi|d.do_dat|
|00003560| 65 28 67 6f 67 61 6d 65 | 2c 20 6c 69 6e 65 29 0a |e(gogame|, line).|
|00003570| 47 4f 47 41 4d 45 20 2a | 67 6f 67 61 6d 65 3b 0a |GOGAME *|gogame;.|
|00003580| 63 68 61 72 20 20 20 2a | 6c 69 6e 65 3b 0a 7b 0a |char *|line;.{.|
|00003590| 20 20 20 20 67 6f 67 61 | 6d 65 2d 3e 67 6d 5f 64 | goga|me->gm_d|
|000035a0| 61 74 65 20 3d 20 73 74 | 72 69 6e 67 5f 73 74 6f |ate = st|ring_sto|
|000035b0| 72 65 28 6c 69 6e 65 29 | 3b 0a 7d 0a 0a 2f 2a 20 |re(line)|;.}../* |
|000035c0| 23 5d 64 6f 5f 64 61 74 | 65 3a 09 09 09 2a 2f 20 |#]do_dat|e:...*/ |
|000035d0| 0a 2f 2a 20 23 5b 64 6f | 5f 67 61 6d 65 3a 09 09 |./* #[do|_game:..|
|000035e0| 09 2a 2f 0a 0a 73 74 61 | 74 69 63 20 76 6f 69 64 |.*/..sta|tic void|
|000035f0| 0a 64 6f 5f 67 61 6d 65 | 28 67 6f 67 61 6d 65 2c |.do_game|(gogame,|
|00003600| 20 6c 69 6e 65 29 0a 47 | 4f 47 41 4d 45 20 2a 67 | line).G|OGAME *g|
|00003610| 6f 67 61 6d 65 3b 0a 63 | 68 61 72 20 20 20 2a 6c |ogame;.c|har *l|
|00003620| 69 6e 65 3b 0a 7b 0a 20 | 20 20 20 67 6f 67 61 6d |ine;.{. | gogam|
|00003630| 65 2d 3e 67 6d 5f 67 61 | 6d 65 20 3d 20 73 74 72 |e->gm_ga|me = str|
|00003640| 69 6e 67 5f 73 74 6f 72 | 65 28 6c 69 6e 65 29 3b |ing_stor|e(line);|
|00003650| 0a 7d 0a 0a 2f 2a 20 23 | 5d 64 6f 5f 67 61 6d 65 |.}../* #|]do_game|
|00003660| 3a 09 09 09 2a 2f 20 0a | 2f 2a 20 23 5b 64 6f 5f |:...*/ .|/* #[do_|
|00003670| 76 69 65 77 3a 09 09 09 | 2a 2f 0a 0a 73 74 61 74 |view:...|*/..stat|
|00003680| 69 63 20 76 6f 69 64 0a | 64 6f 5f 76 69 65 77 28 |ic void.|do_view(|
|00003690| 67 6f 67 61 6d 65 2c 20 | 6c 69 6e 65 29 0a 47 4f |gogame, |line).GO|
|000036a0| 47 41 4d 45 20 2a 67 6f | 67 61 6d 65 3b 0a 63 68 |GAME *go|game;.ch|
|000036b0| 61 72 20 20 20 2a 6c 69 | 6e 65 3b 0a 7b 0a 20 20 |ar *li|ne;.{. |
|000036c0| 20 20 67 6f 67 61 6d 65 | 2d 3e 67 6d 5f 76 69 65 | gogame|->gm_vie|
|000036d0| 77 20 3d 20 73 74 72 69 | 6e 67 5f 73 74 6f 72 65 |w = stri|ng_store|
|000036e0| 28 6c 69 6e 65 29 3b 0a | 7d 0a 0a 2f 2a 20 23 5d |(line);.|}../* #]|
|000036f0| 64 6f 5f 76 69 65 77 3a | 09 09 09 2a 2f 20 0a 2f |do_view:|...*/ ./|
|00003700| 2a 20 23 5b 64 6f 5f 73 | 69 7a 65 3a 09 09 09 2a |* #[do_s|ize:...*|
|00003710| 2f 0a 0a 73 74 61 74 69 | 63 20 76 6f 69 64 0a 64 |/..stati|c void.d|
|00003720| 6f 5f 73 69 7a 65 28 67 | 6f 67 61 6d 65 2c 20 6c |o_size(g|ogame, l|
|00003730| 69 6e 65 29 0a 47 4f 47 | 41 4d 45 20 2a 67 6f 67 |ine).GOG|AME *gog|
|00003740| 61 6d 65 3b 0a 63 68 61 | 72 20 20 20 2a 6c 69 6e |ame;.cha|r *lin|
|00003750| 65 3b 0a 7b 0a 20 20 20 | 20 69 6e 74 20 73 69 7a |e;.{. | int siz|
|00003760| 65 20 3d 20 61 74 6f 69 | 28 6c 69 6e 65 29 3b 0a |e = atoi|(line);.|
|00003770| 0a 20 20 20 20 69 66 20 | 28 73 69 7a 65 20 21 3d |. if |(size !=|
|00003780| 20 4d 41 58 53 49 5a 45 | 29 20 7b 0a 09 66 72 65 | MAXSIZE|) {..fre|
|00003790| 65 28 67 6f 67 61 6d 65 | 2d 3e 67 6d 5f 67 6f 62 |e(gogame|->gm_gob|
|000037a0| 61 6e 29 3b 0a 09 67 6f | 67 61 6d 65 2d 3e 67 6d |an);..go|game->gm|
|000037b0| 5f 67 6f 62 61 6e 20 3d | 20 67 6f 62 61 6e 5f 6e |_goban =| goban_n|
|000037c0| 65 77 28 67 6f 67 61 6d | 65 2c 20 73 69 7a 65 29 |ew(gogam|e, size)|
|000037d0| 3b 0a 20 20 20 20 7d 0a | 20 20 20 20 67 6f 67 61 |;. }.| goga|
|000037e0| 6d 65 2d 3e 67 6d 5f 73 | 69 7a 65 20 3d 20 73 69 |me->gm_s|ize = si|
|000037f0| 7a 65 3b 0a 7d 0a 0a 2f | 2a 20 23 5d 64 6f 5f 73 |ze;.}../|* #]do_s|
|00003800| 69 7a 65 3a 09 09 09 2a | 2f 20 0a 2f 2a 20 23 5b |ize:...*|/ ./* #[|
|00003810| 64 6f 5f 67 61 6d 65 6e | 61 6d 65 3a 09 09 2a 2f |do_gamen|ame:..*/|
|00003820| 0a 0a 73 74 61 74 69 63 | 20 76 6f 69 64 0a 64 6f |..static| void.do|
|00003830| 5f 67 61 6d 65 6e 61 6d | 65 28 67 6f 67 61 6d 65 |_gamenam|e(gogame|
|00003840| 2c 20 6c 69 6e 65 29 0a | 47 4f 47 41 4d 45 20 2a |, line).|GOGAME *|
|00003850| 67 6f 67 61 6d 65 3b 0a | 63 68 61 72 20 20 20 2a |gogame;.|char *|
|00003860| 6c 69 6e 65 3b 0a 7b 0a | 20 20 20 20 67 6f 67 61 |line;.{.| goga|
|00003870| 6d 65 2d 3e 67 6d 5f 6e | 61 6d 65 20 3d 20 73 74 |me->gm_n|ame = st|
|00003880| 72 69 6e 67 5f 73 74 6f | 72 65 28 6c 69 6e 65 29 |ring_sto|re(line)|
|00003890| 3b 0a 7d 0a 0a 2f 2a 20 | 23 5d 64 6f 5f 67 61 6d |;.}../* |#]do_gam|
|000038a0| 65 6e 61 6d 65 3a 09 09 | 2a 2f 20 0a 2f 2a 20 23 |ename:..|*/ ./* #|
|000038b0| 5b 64 6f 5f 70 6c 61 63 | 65 3a 09 09 09 2a 2f 0a |[do_plac|e:...*/.|
|000038c0| 0a 73 74 61 74 69 63 20 | 76 6f 69 64 0a 64 6f 5f |.static |void.do_|
|000038d0| 70 6c 61 63 65 28 67 6f | 67 61 6d 65 2c 20 6c 69 |place(go|game, li|
|000038e0| 6e 65 29 0a 47 4f 47 41 | 4d 45 20 2a 67 6f 67 61 |ne).GOGA|ME *goga|
|000038f0| 6d 65 3b 0a 63 68 61 72 | 20 20 20 2a 6c 69 6e 65 |me;.char| *line|
|00003900| 3b 0a 7b 0a 20 20 20 20 | 67 6f 67 61 6d 65 2d 3e |;.{. |gogame->|
|00003910| 67 6d 5f 70 6c 61 63 65 | 20 3d 20 73 74 72 69 6e |gm_place| = strin|
|00003920| 67 5f 73 74 6f 72 65 28 | 6c 69 6e 65 29 3b 0a 7d |g_store(|line);.}|
|00003930| 0a 0a 2f 2a 20 23 5d 64 | 6f 5f 70 6c 61 63 65 3a |../* #]d|o_place:|
|00003940| 09 09 09 2a 2f 20 0a 2f | 2a 20 23 5b 64 6f 5f 72 |...*/ ./|* #[do_r|
|00003950| 65 73 75 6c 74 3a 09 09 | 09 2a 2f 0a 0a 73 74 61 |esult:..|.*/..sta|
|00003960| 74 69 63 20 76 6f 69 64 | 0a 64 6f 5f 72 65 73 75 |tic void|.do_resu|
|00003970| 6c 74 28 67 6f 67 61 6d | 65 2c 20 6c 69 6e 65 29 |lt(gogam|e, line)|
|00003980| 0a 47 4f 47 41 4d 45 20 | 2a 67 6f 67 61 6d 65 3b |.GOGAME |*gogame;|
|00003990| 0a 63 68 61 72 20 20 20 | 2a 6c 69 6e 65 3b 0a 7b |.char |*line;.{|
|000039a0| 0a 20 20 20 20 67 6f 67 | 61 6d 65 2d 3e 67 6d 5f |. gog|ame->gm_|
|000039b0| 72 65 73 75 6c 74 20 3d | 20 73 74 72 69 6e 67 5f |result =| string_|
|000039c0| 73 74 6f 72 65 28 6c 69 | 6e 65 29 3b 0a 7d 0a 0a |store(li|ne);.}..|
|000039d0| 2f 2a 20 23 5d 64 6f 5f | 72 65 73 75 6c 74 3a 09 |/* #]do_|result:.|
|000039e0| 09 09 2a 2f 20 0a 2f 2a | 20 23 5b 64 6f 5f 6b 6f |..*/ ./*| #[do_ko|
|000039f0| 6d 69 3a 09 09 09 2a 2f | 0a 0a 73 74 61 74 69 63 |mi:...*/|..static|
|00003a00| 20 76 6f 69 64 0a 64 6f | 5f 6b 6f 6d 69 28 67 6f | void.do|_komi(go|
|00003a10| 67 61 6d 65 2c 20 6c 69 | 6e 65 29 0a 47 4f 47 41 |game, li|ne).GOGA|
|00003a20| 4d 45 20 2a 67 6f 67 61 | 6d 65 3b 0a 63 68 61 72 |ME *goga|me;.char|
|00003a30| 20 20 20 2a 6c 69 6e 65 | 3b 0a 7b 0a 20 20 20 20 | *line|;.{. |
|00003a40| 67 6f 67 61 6d 65 2d 3e | 67 6d 5f 6b 6f 6d 69 20 |gogame->|gm_komi |
|00003a50| 3d 20 73 74 72 69 6e 67 | 5f 73 74 6f 72 65 28 6c |= string|_store(l|
|00003a60| 69 6e 65 29 3b 0a 7d 0a | 0a 2f 2a 20 23 5d 64 6f |ine);.}.|./* #]do|
|00003a70| 5f 6b 6f 6d 69 3a 09 09 | 09 2a 2f 20 0a 20 0a 2f |_komi:..|.*/ . ./|
|00003a80| 2a 20 23 5b 73 67 66 5f | 72 65 61 64 3a 09 09 09 |* #[sgf_|read:...|
|00003a90| 2a 2f 0a 0a 47 4f 47 41 | 4d 45 20 2a 0a 73 67 66 |*/..GOGA|ME *.sgf|
|00003aa0| 5f 72 65 61 64 28 66 70 | 29 0a 46 49 4c 45 20 2a |_read(fp|).FILE *|
|00003ab0| 66 70 3b 0a 7b 0a 20 20 | 20 20 47 4f 47 41 4d 45 |fp;.{. | GOGAME|
|00003ac0| 20 2a 09 67 6f 67 61 6d | 65 20 3d 20 28 47 4f 47 | *.gogam|e = (GOG|
|00003ad0| 41 4d 45 20 2a 29 20 30 | 3b 0a 20 20 20 20 4b 45 |AME *) 0|;. KE|
|00003ae0| 59 09 20 2a 09 6b 3b 0a | 20 20 20 20 63 68 61 72 |Y. *.k;.| char|
|00003af0| 09 6c 69 6e 65 5b 4d 41 | 58 4c 49 4e 45 5d 3b 0a |.line[MA|XLINE];.|
|00003b00| 20 20 20 20 63 68 61 72 | 20 2a 09 6f 5f 62 72 61 | char| *.o_bra|
|00003b10| 63 6b 65 74 3b 0a 0a 20 | 20 20 20 69 6e 70 75 74 |cket;.. | input|
|00003b20| 20 3d 20 66 70 3b 0a 20 | 20 20 20 77 68 69 6c 65 | = fp;. | while|
|00003b30| 20 28 66 67 65 74 73 28 | 6c 69 6e 65 2c 20 4d 41 | (fgets(|line, MA|
|00003b40| 58 4c 49 4e 45 2c 20 66 | 70 29 20 21 3d 20 28 63 |XLINE, f|p) != (c|
|00003b50| 68 61 72 20 2a 29 20 30 | 29 20 7b 0a 09 2f 2a 0a |har *) 0|) {../*.|
|00003b60| 09 20 2a 20 46 69 72 73 | 74 20 74 72 79 20 6f 6e |. * Firs|t try on|
|00003b70| 65 20 63 68 61 72 61 63 | 74 65 72 20 64 69 72 65 |e charac|ter dire|
|00003b80| 63 74 69 76 65 73 0a 09 | 20 2a 2f 0a 09 73 77 69 |ctives..| */..swi|
|00003b90| 74 63 68 20 28 2a 6c 69 | 6e 65 29 20 7b 0a 09 20 |tch (*li|ne) {.. |
|00003ba0| 20 20 20 63 61 73 65 20 | 27 28 27 3a 09 69 66 20 | case |'(':.if |
|00003bb0| 28 67 6f 67 61 6d 65 20 | 3d 3d 20 28 47 4f 47 41 |(gogame |== (GOGA|
|00003bc0| 4d 45 20 2a 29 20 30 29 | 20 7b 0a 09 09 09 20 20 |ME *) 0)| {.... |
|00003bd0| 20 20 67 6f 67 61 6d 65 | 20 3d 20 67 61 6d 65 5f | gogame| = game_|
|00003be0| 61 6c 6c 6f 63 28 29 3b | 0a 09 09 09 7d 20 65 6c |alloc();|....} el|
|00003bf0| 73 65 20 7b 0a 09 09 09 | 20 20 20 20 66 70 72 69 |se {....| fpri|
|00003c00| 6e 74 66 28 73 74 64 65 | 72 72 2c 20 22 52 65 63 |ntf(stde|rr, "Rec|
|00003c10| 75 72 73 69 76 65 20 67 | 61 6d 65 20 65 6e 63 6f |ursive g|ame enco|
|00003c20| 75 6e 74 65 72 65 64 21 | 5c 6e 22 29 3b 0a 09 09 |untered!|\n");...|
|00003c30| 09 20 20 20 20 65 78 69 | 74 28 31 29 3b 0a 09 09 |. exi|t(1);...|
|00003c40| 09 7d 0a 09 09 09 63 6f | 6e 74 69 6e 75 65 3b 0a |.}....co|ntinue;.|
|00003c50| 09 20 20 20 20 63 61 73 | 65 20 27 3b 27 3a 09 63 |. cas|e ';':.c|
|00003c60| 6f 6e 74 69 6e 75 65 3b | 0a 09 20 20 20 20 63 61 |ontinue;|.. ca|
|00003c70| 73 65 20 27 29 27 3a 09 | 72 65 74 75 72 6e 20 67 |se ')':.|return g|
|00003c80| 6f 67 61 6d 65 3b 0a 09 | 20 20 20 20 64 65 66 61 |ogame;..| defa|
|00003c90| 75 6c 74 3a 09 62 72 65 | 61 6b 3b 0a 09 7d 0a 09 |ult:.bre|ak;..}..|
|00003ca0| 2f 2a 0a 09 20 2a 20 4e | 65 78 74 20 74 72 79 20 |/*.. * N|ext try |
|00003cb0| 6b 65 79 77 6f 72 64 73 | 0a 09 20 2a 2f 0a 09 69 |keywords|.. */..i|
|00003cc0| 66 20 28 67 6f 67 61 6d | 65 20 3d 3d 20 28 47 4f |f (gogam|e == (GO|
|00003cd0| 47 41 4d 45 20 2a 29 20 | 30 29 20 63 6f 6e 74 69 |GAME *) |0) conti|
|00003ce0| 6e 75 65 3b 0a 09 6c 69 | 6e 65 5b 73 74 72 6c 65 |nue;..li|ne[strle|
|00003cf0| 6e 28 6c 69 6e 65 29 20 | 2d 20 31 5d 20 3d 20 30 |n(line) |- 1] = 0|
|00003d00| 3b 0a 09 6f 5f 62 72 61 | 63 6b 65 74 20 3d 20 73 |;..o_bra|cket = s|
|00003d10| 74 72 63 68 72 28 6c 69 | 6e 65 2c 20 27 5b 27 2f |trchr(li|ne, '['/|
|00003d20| 2a 5d 2a 2f 29 3b 0a 09 | 69 66 20 28 21 6f 5f 62 |*]*/);..|if (!o_b|
|00003d30| 72 61 63 6b 65 74 29 20 | 7b 0a 09 20 20 20 20 66 |racket) |{.. f|
|00003d40| 70 72 69 6e 74 66 28 73 | 74 64 65 72 72 2c 0a 09 |printf(s|tderr,..|
|00003d50| 09 20 20 20 20 22 4e 6f | 20 6f 70 65 6e 69 6e 67 |. "No| opening|
|00003d60| 20 62 72 61 63 6b 65 74 | 20 69 6e 20 6c 69 6e 65 | bracket| in line|
|00003d70| 3a 20 5c 22 25 73 5c 22 | 5c 6e 22 2c 20 6c 69 6e |: \"%s\"|\n", lin|
|00003d80| 65 29 3b 0a 09 20 20 20 | 20 63 6f 6e 74 69 6e 75 |e);.. | continu|
|00003d90| 65 3b 0a 09 7d 0a 09 2a | 6f 5f 62 72 61 63 6b 65 |e;..}..*|o_bracke|
|00003da0| 74 20 3d 20 30 3b 0a 09 | 66 6f 72 20 28 6b 20 3d |t = 0;..|for (k =|
|00003db0| 20 6b 65 79 3b 20 6b 2d | 3e 6b 79 5f 6c 6f 6e 67 | key; k-|>ky_long|
|00003dc0| 20 21 3d 20 28 63 68 61 | 72 20 2a 29 20 30 3b 20 | != (cha|r *) 0; |
|00003dd0| 6b 2b 2b 29 20 7b 0a 09 | 20 20 20 20 69 66 20 28 |k++) {..| if (|
|00003de0| 21 73 74 72 6e 63 6d 70 | 28 6c 69 6e 65 2c 20 6b |!strncmp|(line, k|
|00003df0| 2d 3e 6b 79 5f 6c 6f 6e | 67 20 2c 20 73 74 72 6c |->ky_lon|g , strl|
|00003e00| 65 6e 28 6c 69 6e 65 29 | 29 20 7c 7c 0a 09 09 21 |en(line)|) ||...!|
|00003e10| 73 74 72 6e 63 6d 70 28 | 6c 69 6e 65 2c 20 6b 2d |strncmp(|line, k-|
|00003e20| 3e 6b 79 5f 73 68 6f 72 | 74 2c 20 73 74 72 6c 65 |>ky_shor|t, strle|
|00003e30| 6e 28 6c 69 6e 65 29 29 | 29 20 7b 0a 09 09 69 66 |n(line))|) {...if|
|00003e40| 20 28 6b 2d 3e 6b 79 5f | 68 61 6e 64 6c 65 29 20 | (k->ky_|handle) |
|00003e50| 7b 0a 09 09 20 20 20 20 | 63 68 61 72 20 2a 63 5f |{... |char *c_|
|00003e60| 62 72 61 63 6b 65 74 20 | 3d 20 73 74 72 63 68 72 |bracket |= strchr|
|00003e70| 28 6f 5f 62 72 61 63 6b | 65 74 2b 31 2c 20 2f 2a |(o_brack|et+1, /*|
|00003e80| 5b 2a 2f 27 5d 27 29 3b | 0a 0a 09 09 20 20 20 20 |[*/']');|.... |
|00003e90| 69 66 20 28 63 5f 62 72 | 61 63 6b 65 74 29 20 2a |if (c_br|acket) *|
|00003ea0| 63 5f 62 72 61 63 6b 65 | 74 20 3d 20 30 3b 0a 09 |c_bracke|t = 0;..|
|00003eb0| 09 20 20 20 20 28 6b 2d | 3e 6b 79 5f 68 61 6e 64 |. (k-|>ky_hand|
|00003ec0| 6c 65 29 28 67 6f 67 61 | 6d 65 2c 20 6f 5f 62 72 |le)(goga|me, o_br|
|00003ed0| 61 63 6b 65 74 2b 31 29 | 3b 0a 09 09 20 20 20 20 |acket+1)|;... |
|00003ee0| 62 72 65 61 6b 3b 0a 09 | 09 7d 20 65 6c 73 65 20 |break;..|.} else |
|00003ef0| 66 70 72 69 6e 74 66 28 | 73 74 64 65 72 72 2c 20 |fprintf(|stderr, |
|00003f00| 22 4e 6f 74 20 73 75 70 | 70 6f 72 74 65 64 3a 20 |"Not sup|ported: |
|00003f10| 5c 22 25 73 5c 22 5c 6e | 22 2c 20 6c 69 6e 65 29 |\"%s\"\n|", line)|
|00003f20| 3b 0a 09 20 20 20 20 7d | 0a 09 7d 0a 20 20 20 20 |;.. }|..}. |
|00003f30| 7d 0a 20 20 20 20 69 66 | 20 28 67 6f 67 61 6d 65 |}. if| (gogame|
|00003f40| 20 21 3d 20 28 47 4f 47 | 41 4d 45 20 2a 29 20 30 | != (GOG|AME *) 0|
|00003f50| 29 20 7b 0a 09 66 70 72 | 69 6e 74 66 28 73 74 64 |) {..fpr|intf(std|
|00003f60| 65 72 72 2c 20 22 73 67 | 66 5f 72 65 61 64 28 29 |err, "sg|f_read()|
|00003f70| 3a 20 45 4f 46 20 65 6e | 63 6f 75 6e 74 65 72 65 |: EOF en|countere|
|00003f80| 64 20 62 65 66 6f 72 65 | 20 45 6e 64 20 4f 66 20 |d before| End Of |
|00003f90| 47 61 6d 65 5c 6e 22 29 | 3b 0a 09 67 61 6d 65 5f |Game\n")|;..game_|
|00003fa0| 66 72 65 65 28 67 6f 67 | 61 6d 65 29 3b 0a 09 67 |free(gog|ame);..g|
|00003fb0| 6f 67 61 6d 65 20 3d 20 | 28 47 4f 47 41 4d 45 20 |ogame = |(GOGAME |
|00003fc0| 2a 29 20 30 3b 0a 20 20 | 20 20 7d 0a 20 20 20 20 |*) 0;. | }. |
|00003fd0| 72 65 74 75 72 6e 20 67 | 6f 67 61 6d 65 3b 0a 7d |return g|ogame;.}|
|00003fe0| 0a 0a 2f 2a 20 23 5d 73 | 67 66 5f 72 65 61 64 3a |../* #]s|gf_read:|
|00003ff0| 09 09 09 2a 2f 20 0a 0a | 67 20 2c 20 73 74 72 6c |...*/ ..|g , strl|
|00004000| 67 6f 67 61 6d 65 2e 63 | 00 00 00 00 00 00 00 00 |gogame.c|........|
|00004010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004040| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004050| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004060| 00 00 00 00 30 30 30 34 | 34 34 20 00 30 30 30 34 |....0004|44 .0004|
|00004070| 37 31 20 00 30 30 30 30 | 31 32 20 00 30 30 30 30 |71 .0000|12 .0000|
|00004080| 30 30 32 34 33 36 35 20 | 30 35 33 35 31 30 35 34 |0024365 |05351054|
|00004090| 37 37 33 20 30 31 31 35 | 33 36 00 20 30 00 00 00 |773 0115|36. 0...|
|000040a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000040b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000040c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000040d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000040e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000040f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004100| 00 75 73 74 61 72 00 30 | 30 6a 61 6e 73 74 65 65 |.ustar.0|0janstee|
|00004110| 6e 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |n.......|........|
|00004120| 00 00 00 00 00 00 00 00 | 00 63 6c 00 00 00 00 00 |........|.cl.....|
|00004130| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004140| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004150| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004160| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004170| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004180| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004190| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000041a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000041b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000041c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000041d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000041e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000041f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004200| 2f 2a 20 23 5b 69 6e 66 | 6f 3a 09 09 09 2a 2f 0a |/* #[inf|o:...*/.|
|00004210| 2f 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |/*******|********|
|00004220| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00004230| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00004240| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00004250| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 0a 20 2a 09 09 09 09 |********|*. *....|
|00004260| 09 09 09 09 09 2a 0a 20 | 2a 09 09 20 20 23 23 23 |.....*. |*.. ###|
|00004270| 23 20 20 20 23 23 23 23 | 20 20 20 23 23 23 23 20 |# ####| #### |
|00004280| 20 20 20 20 23 20 20 20 | 20 23 20 20 20 20 23 20 | # | # # |
|00004290| 23 23 23 23 23 09 09 2a | 0a 20 2a 09 09 20 23 20 |#####..*|. *.. # |
|000042a0| 20 20 20 20 20 23 20 20 | 20 20 23 20 23 20 20 20 | # | # # |
|000042b0| 20 20 20 20 20 23 20 23 | 20 20 20 23 23 20 20 23 | # #| ## #|
|000042c0| 23 20 23 09 09 09 2a 0a | 20 2a 09 09 20 23 20 20 |# #...*.| *.. # |
|000042d0| 20 20 20 20 23 20 20 20 | 20 23 20 23 20 20 20 20 | # | # # |
|000042e0| 20 20 20 23 20 20 20 23 | 20 20 23 20 23 23 20 23 | # #| # ## #|
|000042f0| 20 23 09 09 09 2a 0a 20 | 2a 09 09 20 23 20 20 23 | #...*. |*.. # #|
|00004300| 23 20 20 23 20 20 20 20 | 23 20 23 20 20 23 23 20 |# # |# # ## |
|00004310| 20 23 23 23 23 23 23 23 | 20 23 20 20 20 20 23 20 | #######| # # |
|00004320| 23 23 23 09 09 2a 0a 20 | 2a 09 09 20 23 20 20 20 |###..*. |*.. # |
|00004330| 20 23 20 23 20 20 20 20 | 23 20 23 20 20 20 20 23 | # # |# # #|
|00004340| 20 23 20 20 20 20 20 23 | 20 23 20 20 20 20 23 20 | # #| # # |
|00004350| 23 09 09 09 2a 0a 20 2a | 09 09 20 23 20 20 20 20 |#...*. *|.. # |
|00004360| 23 20 23 20 20 20 20 23 | 20 23 20 20 20 20 23 20 |# # #| # # |
|00004370| 23 20 20 20 20 20 23 20 | 23 20 20 20 20 23 20 23 |# # |# # #|
|00004380| 09 09 09 2a 0a 20 2a 09 | 09 20 20 23 23 23 23 20 |...*. *.|. #### |
|00004390| 20 20 23 23 23 23 20 20 | 20 23 23 23 23 20 20 23 | #### | #### #|
|000043a0| 20 20 20 20 20 23 20 23 | 20 20 20 20 23 20 23 23 | # #| # ##|
|000043b0| 23 23 23 09 09 2a 0a 20 | 2a 09 09 09 09 09 09 09 |###..*. |*.......|
|000043c0| 09 09 2a 0a 20 2a 09 09 | 09 20 20 20 20 4a 61 6e |..*. *..|. Jan|
|000043d0| 20 76 61 6e 20 64 65 72 | 20 53 74 65 65 6e 09 09 | van der| Steen..|
|000043e0| 09 09 2a 0a 20 2a 09 09 | 09 09 09 09 09 09 09 2a |..*. *..|.......*|
|000043f0| 0a 20 2a 09 20 20 20 20 | 20 20 43 65 6e 74 72 65 |. *. | Centre|
|00004400| 20 66 6f 72 20 4d 61 74 | 68 65 6d 61 74 69 63 73 | for Mat|hematics|
|00004410| 20 61 6e 64 20 43 6f 6d | 70 75 74 65 72 20 53 63 | and Com|puter Sc|
|00004420| 69 65 6e 63 65 09 09 2a | 0a 20 2a 09 09 20 20 20 |ience..*|. *.. |
|00004430| 20 20 20 41 6d 73 74 65 | 72 64 61 6d 2c 20 74 68 | Amste|rdam, th|
|00004440| 65 20 4e 65 74 68 65 72 | 6c 61 6e 64 73 09 09 09 |e Nether|lands...|
|00004450| 2a 0a 20 2a 09 09 09 09 | 09 09 09 09 09 2a 0a 20 |*. *....|.....*. |
|00004460| 2a 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |*-------|--------|
|00004470| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00004480| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00004490| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000044a0| 2d 2d 2d 2d 2d 2d 2d 2a | 0a 20 2a 20 46 69 6c 65 |-------*|. * File|
|000044b0| 09 20 20 3a 20 67 6f 67 | 61 6d 65 2e 63 20 09 09 |. : gog|ame.c ..|
|000044c0| 09 09 09 09 2a 0a 20 2a | 20 50 75 72 70 6f 73 65 |....*. *| Purpose|
|000044d0| 20 3a 20 49 6d 70 6c 65 | 6d 65 6e 74 20 66 75 6e | : Imple|ment fun|
|000044e0| 63 74 69 6f 6e 73 20 74 | 6f 20 6d 61 69 6e 74 61 |ctions t|o mainta|
|000044f0| 69 6e 20 61 20 47 6f 20 | 47 61 6d 65 20 44 61 74 |in a Go |Game Dat|
|00004500| 61 20 73 74 72 75 63 74 | 75 72 65 09 2a 0a 20 2a |a struct|ure.*. *|
|00004510| 20 56 65 72 73 69 6f 6e | 20 3a 20 31 2e 37 20 09 | Version| : 1.7 .|
|00004520| 09 09 09 09 09 2a 0a 20 | 2a 20 4d 6f 64 69 66 69 |.....*. |* Modifi|
|00004530| 65 64 3a 20 33 2f 31 35 | 2f 39 33 20 31 31 3a 32 |ed: 3/15|/93 11:2|
|00004540| 36 3a 35 36 09 09 09 09 | 09 09 2a 0a 20 2a 20 41 |6:56....|..*. * A|
|00004550| 75 74 68 6f 72 20 20 3a | 20 4a 61 6e 20 76 61 6e |uthor :| Jan van|
|00004560| 20 64 65 72 20 53 74 65 | 65 6e 20 28 6a 61 6e 73 | der Ste|en (jans|
|00004570| 74 65 65 6e 40 63 77 69 | 2e 6e 6c 29 20 09 09 09 |teen@cwi|.nl) ...|
|00004580| 2a 0a 20 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |*. *****|********|
|00004590| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000045a0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000045b0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000045c0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2f 0a 2f 2a 20 |********|***/./* |
|000045d0| 23 5d 69 6e 66 6f 3a 09 | 09 09 2a 2f 20 0a 2f 2a |#]info:.|..*/ ./*|
|000045e0| 20 23 5b 69 6e 63 6c 75 | 64 65 3a 09 09 09 2a 2f | #[inclu|de:...*/|
|000045f0| 0a 0a 23 69 6e 63 6c 75 | 64 65 20 3c 73 74 64 69 |..#inclu|de <stdi|
|00004600| 6f 2e 68 3e 0a 23 69 6e | 63 6c 75 64 65 20 3c 73 |o.h>.#in|clude <s|
|00004610| 74 64 6c 69 62 2e 68 3e | 0a 23 69 6e 63 6c 75 64 |tdlib.h>|.#includ|
|00004620| 65 20 3c 73 74 72 69 6e | 67 2e 68 3e 0a 23 69 6e |e <strin|g.h>.#in|
|00004630| 63 6c 75 64 65 20 22 74 | 6f 6f 6c 73 2e 68 22 0a |clude "t|ools.h".|
|00004640| 23 69 6e 63 6c 75 64 65 | 20 22 67 6f 67 61 6d 65 |#include| "gogame|
|00004650| 2e 68 22 0a 23 69 6e 63 | 6c 75 64 65 20 22 67 6f |.h".#inc|lude "go|
|00004660| 72 75 6c 65 73 2e 68 22 | 0a 0a 2f 2a 20 23 5d 69 |rules.h"|../* #]i|
|00004670| 6e 63 6c 75 64 65 3a 09 | 09 09 2a 2f 20 0a 2f 2a |nclude:.|..*/ ./*|
|00004680| 20 23 5b 70 72 6f 74 6f | 74 79 70 65 3a 09 09 09 | #[proto|type:...|
|00004690| 2a 2f 0a 0a 23 69 66 64 | 65 66 20 5f 5f 53 54 44 |*/..#ifd|ef __STD|
|000046a0| 43 5f 5f 0a 23 09 64 65 | 66 69 6e 65 09 50 52 4f |C__.#.de|fine.PRO|
|000046b0| 54 4f 28 73 29 20 73 0a | 23 65 6c 73 65 0a 23 09 |TO(s) s.|#else.#.|
|000046c0| 64 65 66 69 6e 65 09 50 | 52 4f 54 4f 28 73 29 20 |define.P|ROTO(s) |
|000046d0| 28 29 0a 23 65 6e 64 69 | 66 0a 0a 2f 2a 0a 20 2a |().#endi|f../*. *|
|000046e0| 20 4d 65 6d 6f 72 79 20 | 6d 61 6e 61 67 65 72 73 | Memory |managers|
|000046f0| 0a 20 2a 2f 0a 73 74 61 | 74 69 63 20 43 48 41 49 |. */.sta|tic CHAI|
|00004700| 4e 20 2a 09 63 68 61 69 | 6e 5f 61 6c 6c 6f 63 09 |N *.chai|n_alloc.|
|00004710| 50 52 4f 54 4f 28 28 76 | 6f 69 64 29 29 3b 0a 73 |PROTO((v|oid));.s|
|00004720| 74 61 74 69 63 20 47 4f | 4d 4f 56 45 20 2a 20 6d |tatic GO|MOVE * m|
|00004730| 6f 76 65 5f 61 6c 6c 6f | 63 09 50 52 4f 54 4f 28 |ove_allo|c.PROTO(|
|00004740| 28 76 6f 69 64 29 29 3b | 0a 73 74 61 74 69 63 20 |(void));|.static |
|00004750| 54 45 58 54 20 2a 09 74 | 65 78 74 5f 61 6c 6c 6f |TEXT *.t|ext_allo|
|00004760| 63 09 50 52 4f 54 4f 28 | 28 76 6f 69 64 29 29 3b |c.PROTO(|(void));|
|00004770| 0a 73 74 61 74 69 63 20 | 47 4f 42 41 4e 20 2a 09 |.static |GOBAN *.|
|00004780| 67 6f 62 61 6e 5f 61 6c | 6c 6f 63 09 50 52 4f 54 |goban_al|loc.PROT|
|00004790| 4f 28 28 69 6e 74 20 73 | 69 7a 65 29 29 3b 0a 73 |O((int s|ize));.s|
|000047a0| 74 61 74 69 63 20 69 6e | 74 09 67 6f 62 61 6e 5f |tatic in|t.goban_|
|000047b0| 6c 6f 6f 70 09 50 52 4f | 54 4f 28 28 09 47 4f 42 |loop.PRO|TO((.GOB|
|000047c0| 41 4e 20 20 2a 67 6f 62 | 61 6e 2c 0a 09 09 09 09 |AN *gob|an,.....|
|000047d0| 09 47 4f 4e 4f 44 45 20 | 2a 67 6f 6e 6f 64 65 2c |.GONODE |*gonode,|
|000047e0| 0a 09 09 09 09 09 69 6e | 74 20 28 2a 66 29 50 52 |......in|t (*f)PR|
|000047f0| 4f 54 4f 28 28 09 47 4f | 42 41 4e 20 20 2a 67 6f |OTO((.GO|BAN *go|
|00004800| 62 61 6e 2c 0a 09 09 09 | 09 09 09 09 47 4f 4e 4f |ban,....|....GONO|
|00004810| 44 45 20 2a 67 6f 6e 6f | 64 65 0a 09 09 09 09 09 |DE *gono|de......|
|00004820| 09 29 29 0a 09 09 09 09 | 29 29 3b 0a 73 74 61 74 |.)).....|));.stat|
|00004830| 69 63 20 69 6e 74 09 67 | 6f 62 61 6e 5f 64 6f 09 |ic int.g|oban_do.|
|00004840| 50 52 4f 54 4f 28 28 09 | 47 4f 42 41 4e 20 20 2a |PROTO((.|GOBAN *|
|00004850| 67 6f 62 61 6e 2c 0a 09 | 09 09 09 09 47 4f 4e 4f |goban,..|....GONO|
|00004860| 44 45 20 2a 67 6f 6e 6f | 64 65 2c 0a 09 09 09 09 |DE *gono|de,.....|
|00004870| 09 69 6e 74 20 28 2a 66 | 29 50 52 4f 54 4f 28 28 |.int (*f|)PROTO((|
|00004880| 09 47 4f 42 41 4e 20 20 | 2a 67 6f 62 61 6e 2c 0a |.GOBAN |*goban,.|
|00004890| 09 09 09 09 09 09 09 47 | 4f 4e 4f 44 45 20 2a 67 |.......G|ONODE *g|
|000048a0| 6f 6e 6f 64 65 0a 09 09 | 09 09 09 09 29 29 0a 09 |onode...|....))..|
|000048b0| 09 09 09 29 29 3b 0a 0a | 23 75 6e 64 65 66 20 50 |...));..|#undef P|
|000048c0| 52 4f 54 4f 0a 0a 2f 2a | 20 23 5d 70 72 6f 74 6f |ROTO../*| #]proto|
|000048d0| 74 79 70 65 3a 09 09 09 | 2a 2f 20 0a 0a 2f 2a 20 |type:...|*/ ../* |
|000048e0| 23 5b 74 65 78 74 5f 61 | 6c 6c 6f 63 3a 09 09 2a |#[text_a|lloc:..*|
|000048f0| 2f 0a 0a 73 74 61 74 69 | 63 20 54 45 58 54 20 2a |/..stati|c TEXT *|
|00004900| 0a 74 65 78 74 5f 61 6c | 6c 6f 63 28 29 0a 2f 2a |.text_al|loc()./*|
|00004910| 0a 20 2a 20 41 6c 6c 6f | 63 61 74 65 20 61 20 74 |. * Allo|cate a t|
|00004920| 65 78 74 20 6c 69 73 74 | 0a 20 2a 2f 0a 7b 0a 20 |ext list|. */.{. |
|00004930| 20 20 20 54 45 58 54 20 | 2a 74 65 78 74 20 3d 20 | TEXT |*text = |
|00004940| 28 54 45 58 54 20 2a 29 | 20 63 61 6c 6c 6f 63 28 |(TEXT *)| calloc(|
|00004950| 31 2c 20 73 69 7a 65 6f | 66 28 54 45 58 54 29 29 |1, sizeo|f(TEXT))|
|00004960| 3b 0a 0a 20 20 20 20 69 | 66 20 28 74 65 78 74 20 |;.. i|f (text |
|00004970| 3d 3d 20 28 54 45 58 54 | 20 2a 29 20 30 29 20 7b |== (TEXT| *) 0) {|
|00004980| 0a 09 66 70 72 69 6e 74 | 66 28 73 74 64 65 72 72 |..fprint|f(stderr|
|00004990| 2c 20 22 4f 75 74 20 6f | 66 20 6d 65 6d 6f 72 79 |, "Out o|f memory|
|000049a0| 20 69 6e 20 74 65 78 74 | 5f 61 6c 6c 6f 63 28 29 | in text|_alloc()|
|000049b0| 5c 6e 22 29 3b 0a 09 65 | 78 69 74 28 31 29 3b 0a |\n");..e|xit(1);.|
|000049c0| 20 20 20 20 7d 0a 20 20 | 20 20 72 65 74 75 72 6e | }. | return|
|000049d0| 20 74 65 78 74 3b 0a 7d | 0a 0a 2f 2a 20 23 5d 74 | text;.}|../* #]t|
|000049e0| 65 78 74 5f 61 6c 6c 6f | 63 3a 09 09 2a 2f 20 0a |ext_allo|c:..*/ .|
|000049f0| 2f 2a 20 23 5b 74 65 78 | 74 5f 73 74 6f 72 65 3a |/* #[tex|t_store:|
|00004a00| 09 09 2a 2f 0a 0a 76 6f | 69 64 0a 74 65 78 74 5f |..*/..vo|id.text_|
|00004a10| 73 74 6f 72 65 28 67 6f | 67 61 6d 65 2c 20 6c 69 |store(go|game, li|
|00004a20| 6e 65 29 0a 2f 2a 0a 20 | 2a 20 54 68 65 20 77 61 |ne)./*. |* The wa|
|00004a30| 79 20 77 65 20 64 65 61 | 6c 20 77 69 74 68 20 69 |y we dea|l with i|
|00004a40| 6e 63 6f 6d 6d 69 6e 67 | 20 74 65 78 74 20 69 73 |ncomming| text is|
|00004a50| 20 76 65 72 79 20 49 47 | 53 20 73 70 65 63 69 66 | very IG|S specif|
|00004a60| 69 63 2e 0a 20 2a 20 4e | 6f 72 6d 61 6c 6c 79 20 |ic.. * N|ormally |
|00004a70| 77 65 20 77 6f 75 6c 64 | 20 6a 75 73 74 20 61 70 |we would| just ap|
|00004a80| 70 65 6e 64 20 74 68 65 | 20 74 65 78 74 20 74 6f |pend the| text to|
|00004a90| 20 74 68 65 20 74 65 78 | 74 20 62 75 66 66 65 72 | the tex|t buffer|
|00004aa0| 2e 0a 20 2a 20 42 75 74 | 2c 20 73 69 6e 63 65 20 |.. * But|, since |
|00004ab0| 69 6e 20 63 61 73 65 20 | 6f 66 20 49 47 53 20 69 |in case |of IGS i|
|00004ac0| 74 20 65 69 74 68 65 72 | 20 63 6f 6e 74 61 69 6e |t either| contain|
|00004ad0| 73 20 22 73 61 79 22 20 | 6f 72 20 22 6b 69 62 69 |s "say" |or "kibi|
|00004ae0| 74 7a 22 20 6d 65 73 73 | 61 67 65 73 0a 20 2a 20 |tz" mess|ages. * |
|00004af0| 77 65 20 68 61 76 65 20 | 69 6e 74 72 6f 64 75 63 |we have |introduc|
|00004b00| 65 64 20 61 20 73 70 65 | 63 69 61 6c 20 66 6f 72 |ed a spe|cial for|
|00004b10| 6d 61 74 20 74 6f 20 73 | 74 6f 72 65 20 74 68 65 |mat to s|tore the|
|00004b20| 73 65 20 74 79 70 69 63 | 61 6c 20 63 61 73 65 73 |se typic|al cases|
|00004b30| 2e 0a 20 2a 2f 0a 47 4f | 47 41 4d 45 20 2a 67 6f |.. */.GO|GAME *go|
|00004b40| 67 61 6d 65 3b 0a 63 68 | 61 72 20 2a 09 6c 69 6e |game;.ch|ar *.lin|
|00004b50| 65 3b 0a 7b 0a 20 20 20 | 20 54 45 58 54 20 2a 74 |e;.{. | TEXT *t|
|00004b60| 65 78 74 3b 0a 20 20 20 | 20 54 45 58 54 20 2a 74 |ext;. | TEXT *t|
|00004b70| 65 78 74 6c 61 73 74 20 | 3d 20 67 6f 67 61 6d 65 |extlast |= gogame|
|00004b80| 2d 3e 67 6d 5f 6d 6f 76 | 65 6c 61 73 74 2d 3e 6d |->gm_mov|elast->m|
|00004b90| 76 5f 74 65 78 74 6c 61 | 73 74 3b 0a 20 20 20 20 |v_textla|st;. |
|00004ba0| 63 68 61 72 20 2a 6e 61 | 6d 65 3b 0a 20 20 20 20 |char *na|me;. |
|00004bb0| 63 68 61 72 20 2a 72 61 | 6e 6b 3b 0a 20 20 20 20 |char *ra|nk;. |
|00004bc0| 63 68 61 72 20 2a 6d 65 | 73 67 3b 0a 20 20 20 20 |char *me|sg;. |
|00004bd0| 63 68 61 72 20 2a 73 70 | 61 63 65 3b 0a 0a 20 20 |char *sp|ace;.. |
|00004be0| 20 20 2f 2a 0a 20 20 20 | 20 20 2a 20 54 68 65 20 | /*. | * The |
|00004bf0| 6b 69 62 69 74 7a 20 6d | 65 73 73 61 67 65 73 20 |kibitz m|essages |
|00004c00| 68 61 76 65 20 74 68 65 | 20 66 6f 72 6d 61 74 3a |have the| format:|
|00004c10| 0a 20 20 20 20 20 2a 0a | 20 20 20 20 20 2a 09 3c |. *.| *.<|
|00004c20| 73 70 61 63 65 3e 3c 75 | 73 65 72 6e 61 6d 65 3e |space><u|sername>|
|00004c30| 20 3c 72 61 6e 6b 3e 3c | 6f 70 74 69 6f 6e 61 6c | <rank><|optional|
|00004c40| 20 5b 73 70 61 63 65 7c | 2a 5d 3e 3a 20 3c 74 65 | [space||*]>: <te|
|00004c50| 78 74 3e 0a 20 20 20 20 | 20 2a 0a 20 20 20 20 20 |xt>. | *. |
|00004c60| 2a 09 6a 61 6e 73 74 65 | 65 6e 20 33 64 3a 20 4d |*.janste|en 3d: M|
|00004c70| 79 20 7e 63 6f 6e 6e 65 | 63 74 69 6f 6e 7e 20 69 |y ~conne|ction~ i|
|00004c80| 73 20 74 65 72 72 69 62 | 6c 65 2e 2e 2e 09 28 6f |s terrib|le....(o|
|00004c90| 6c 64 20 49 47 53 29 0a | 20 20 20 20 20 2a 09 6a |ld IGS).| *.j|
|00004ca0| 61 6e 73 74 65 65 6e 20 | 33 64 20 3a 20 4d 79 20 |ansteen |3d : My |
|00004cb0| 7e 63 6f 6e 6e 65 63 74 | 69 6f 6e 7e 20 69 73 20 |~connect|ion~ is |
|00004cc0| 74 65 72 72 69 62 6c 65 | 2e 2e 2e 09 28 72 61 6e |terrible|....(ran|
|00004cd0| 6b 29 0a 20 20 20 20 20 | 2a 09 6a 61 6e 73 74 65 |k). |*.janste|
|00004ce0| 65 6e 20 33 64 2a 3a 20 | 4d 79 20 7e 63 6f 6e 6e |en 3d*: |My ~conn|
|00004cf0| 65 63 74 69 6f 6e 7e 20 | 69 73 20 74 65 72 72 69 |ection~ |is terri|
|00004d00| 62 6c 65 2e 2e 2e 09 28 | 72 61 74 69 6e 67 29 0a |ble....(|rating).|
|00004d10| 20 20 20 20 20 2a 2f 0a | 20 20 20 20 69 66 20 28 | */.| if (|
|00004d20| 2a 6c 69 6e 65 20 21 3d | 20 27 20 27 29 20 7b 0a |*line !=| ' ') {.|
|00004d30| 09 66 70 72 69 6e 74 66 | 28 73 74 64 65 72 72 2c |.fprintf|(stderr,|
|00004d40| 20 22 43 5b 25 73 5d 20 | 64 69 64 6e 27 74 20 63 | "C[%s] |didn't c|
|00004d50| 6f 6e 74 61 69 6e 20 6b | 69 62 69 74 7a 20 28 73 |ontain k|ibitz (s|
|00004d60| 6b 69 70 70 65 64 29 5c | 6e 22 2c 20 6c 69 6e 65 |kipped)\|n", line|
|00004d70| 29 3b 0a 09 72 65 74 75 | 72 6e 3b 0a 20 20 20 20 |);..retu|rn;. |
|00004d80| 7d 3b 0a 0a 20 20 20 20 | 74 65 78 74 20 3d 20 74 |};.. |text = t|
|00004d90| 65 78 74 5f 61 6c 6c 6f | 63 28 29 3b 0a 20 20 20 |ext_allo|c();. |
|00004da0| 20 69 66 20 28 67 6f 67 | 61 6d 65 2d 3e 67 6d 5f | if (gog|ame->gm_|
|00004db0| 6d 6f 76 65 6c 61 73 74 | 2d 3e 6d 76 5f 74 65 78 |movelast|->mv_tex|
|00004dc0| 74 20 3d 3d 20 28 54 45 | 58 54 20 2a 29 20 30 29 |t == (TE|XT *) 0)|
|00004dd0| 0a 09 67 6f 67 61 6d 65 | 2d 3e 67 6d 5f 6d 6f 76 |..gogame|->gm_mov|
|00004de0| 65 6c 61 73 74 2d 3e 6d | 76 5f 74 65 78 74 20 3d |elast->m|v_text =|
|00004df0| 20 74 65 78 74 3b 0a 20 | 20 20 20 65 6c 73 65 0a | text;. | else.|
|00004e00| 09 67 6f 67 61 6d 65 2d | 3e 67 6d 5f 6d 6f 76 65 |.gogame-|>gm_move|
|00004e10| 6c 61 73 74 2d 3e 6d 76 | 5f 74 65 78 74 6c 61 73 |last->mv|_textlas|
|00004e20| 74 2d 3e 63 63 5f 6e 65 | 78 74 20 3d 20 74 65 78 |t->cc_ne|xt = tex|
|00004e30| 74 3b 0a 20 20 20 20 67 | 6f 67 61 6d 65 2d 3e 67 |t;. g|ogame->g|
|00004e40| 6d 5f 6d 6f 76 65 6c 61 | 73 74 2d 3e 6d 76 5f 74 |m_movela|st->mv_t|
|00004e50| 65 78 74 6c 61 73 74 20 | 3d 20 74 65 78 74 3b 0a |extlast |= text;.|
|00004e60| 0a 20 20 20 20 6e 61 6d | 65 20 20 3d 20 2b 2b 6c |. nam|e = ++l|
|00004e70| 69 6e 65 3b 0a 20 20 20 | 20 72 61 6e 6b 20 20 3d |ine;. | rank =|
|00004e80| 20 73 74 72 63 68 72 28 | 6e 61 6d 65 2c 20 27 20 | strchr(|name, ' |
|00004e90| 27 29 3b 20 69 66 20 28 | 72 61 6e 6b 20 3d 3d 20 |'); if (|rank == |
|00004ea0| 28 63 68 61 72 20 2a 29 | 20 30 29 20 67 6f 74 6f |(char *)| 0) goto|
|00004eb0| 20 65 72 72 6f 72 3b 0a | 20 20 20 20 6d 65 73 67 | error;.| mesg|
|00004ec0| 20 20 3d 20 73 74 72 63 | 68 72 28 72 61 6e 6b 2c | = strc|hr(rank,|
|00004ed0| 20 27 3a 27 29 3b 20 69 | 66 20 28 6d 65 73 67 20 | ':'); i|f (mesg |
|00004ee0| 3d 3d 20 28 63 68 61 72 | 20 2a 29 20 30 29 20 67 |== (char| *) 0) g|
|00004ef0| 6f 74 6f 20 65 72 72 6f | 72 3b 0a 20 20 20 20 2a |oto erro|r;. *|
|00004f00| 72 61 6e 6b 20 3d 20 30 | 3b 20 72 61 6e 6b 20 2b |rank = 0|; rank +|
|00004f10| 3d 20 31 3b 0a 20 20 20 | 20 2a 6d 65 73 67 20 3d |= 1;. | *mesg =|
|00004f20| 20 30 3b 20 6d 65 73 67 | 20 2b 3d 20 32 3b 0a 20 | 0; mesg| += 2;. |
|00004f30| 20 20 20 73 70 61 63 65 | 20 3d 20 72 61 6e 6b 2b | space| = rank+|
|00004f40| 73 74 72 6c 65 6e 28 72 | 61 6e 6b 29 2d 31 3b 20 |strlen(r|ank)-1; |
|00004f50| 69 66 20 28 2a 73 70 61 | 63 65 20 3d 3d 20 27 20 |if (*spa|ce == ' |
|00004f60| 27 29 20 2a 73 70 61 63 | 65 20 3d 20 30 3b 0a 20 |') *spac|e = 0;. |
|00004f70| 20 20 20 74 65 78 74 2d | 3e 63 63 5f 6e 61 6d 65 | text-|>cc_name|
|00004f80| 20 3d 20 73 74 72 69 6e | 67 5f 73 74 6f 72 65 28 | = strin|g_store(|
|00004f90| 6e 61 6d 65 29 3b 0a 20 | 20 20 20 74 65 78 74 2d |name);. | text-|
|00004fa0| 3e 63 63 5f 72 61 6e 6b | 20 3d 20 73 74 72 69 6e |>cc_rank| = strin|
|00004fb0| 67 5f 73 74 6f 72 65 28 | 72 61 6e 6b 29 3b 0a 20 |g_store(|rank);. |
|00004fc0| 20 20 20 74 65 78 74 2d | 3e 63 63 5f 74 65 78 74 | text-|>cc_text|
|00004fd0| 20 3d 20 73 74 72 69 6e | 67 5f 73 74 6f 72 65 28 | = strin|g_store(|
|00004fe0| 6d 65 73 67 29 3b 0a 20 | 20 20 20 74 65 78 74 2d |mesg);. | text-|
|00004ff0| 3e 63 63 5f 70 72 65 76 | 20 3d 20 74 65 78 74 6c |>cc_prev| = textl|
|00005000| 61 73 74 3b 0a 20 20 20 | 20 72 65 74 75 72 6e 3b |ast;. | return;|
|00005010| 0a 65 72 72 6f 72 3a 0a | 20 20 20 20 66 70 72 69 |.error:.| fpri|
|00005020| 6e 74 66 28 73 74 64 65 | 72 72 2c 20 22 4d 65 73 |ntf(stde|rr, "Mes|
|00005030| 73 61 67 65 20 73 65 65 | 6d 73 20 61 20 62 61 64 |sage see|ms a bad|
|00005040| 6c 79 20 66 6f 72 6d 61 | 74 74 65 64 20 6b 69 62 |ly forma|tted kib|
|00005050| 69 74 7a 20 28 69 67 6e | 6f 72 65 64 29 5c 6e 22 |itz (ign|ored)\n"|
|00005060| 29 3b 0a 7d 0a 0a 2f 2a | 20 23 5d 74 65 78 74 5f |);.}../*| #]text_|
|00005070| 73 74 6f 72 65 3a 09 09 | 2a 2f 20 0a 2f 2a 20 23 |store:..|*/ ./* #|
|00005080| 5b 67 6f 62 61 6e 5f 61 | 6c 6c 6f 63 3a 09 09 2a |[goban_a|lloc:..*|
|00005090| 2f 0a 0a 73 74 61 74 69 | 63 20 47 4f 42 41 4e 20 |/..stati|c GOBAN |
|000050a0| 2a 0a 67 6f 62 61 6e 5f | 61 6c 6c 6f 63 20 28 73 |*.goban_|alloc (s|
|000050b0| 69 7a 65 29 0a 2f 2a 0a | 20 2a 20 41 6c 6c 6f 63 |ize)./*.| * Alloc|
|000050c0| 61 74 65 20 61 20 6e 65 | 77 20 47 6f 20 62 6f 61 |ate a ne|w Go boa|
|000050d0| 72 64 0a 20 2a 2f 0a 69 | 6e 74 20 73 69 7a 65 3b |rd. */.i|nt size;|
|000050e0| 0a 7b 0a 20 20 20 20 47 | 4f 42 41 4e 20 2a 20 67 |.{. G|OBAN * g|
|000050f0| 6f 62 61 6e 20 3d 20 28 | 47 4f 42 41 4e 20 2a 29 |oban = (|GOBAN *)|
|00005100| 20 63 61 6c 6c 6f 63 28 | 31 2c 20 73 69 7a 65 6f | calloc(|1, sizeo|
|00005110| 66 28 47 4f 42 41 4e 29 | 29 3b 0a 0a 20 20 20 20 |f(GOBAN)|);.. |
|00005120| 69 66 20 28 67 6f 62 61 | 6e 20 3d 3d 20 28 47 4f |if (goba|n == (GO|
|00005130| 42 41 4e 20 2a 29 20 30 | 29 20 7b 0a 09 66 70 72 |BAN *) 0|) {..fpr|
|00005140| 69 6e 74 66 28 73 74 64 | 65 72 72 2c 20 22 4f 75 |intf(std|err, "Ou|
|00005150| 74 20 6f 66 20 6d 65 6d | 6f 72 79 20 69 6e 20 67 |t of mem|ory in g|
|00005160| 6f 62 61 6e 5f 61 6c 6c | 6f 63 28 29 5c 6e 22 29 |oban_all|oc()\n")|
|00005170| 3b 0a 09 65 78 69 74 28 | 31 29 3b 0a 20 20 20 20 |;..exit(|1);. |
|00005180| 7d 0a 20 20 20 20 69 66 | 20 28 73 69 7a 65 20 3c |}. if| (size <|
|00005190| 3d 20 30 29 20 7b 0a 09 | 66 70 72 69 6e 74 66 28 |= 0) {..|fprintf(|
|000051a0| 73 74 64 65 72 72 2c 20 | 22 42 6f 61 72 64 20 73 |stderr, |"Board s|
|000051b0| 69 7a 65 20 6f 75 74 20 | 6f 66 20 72 61 6e 67 65 |ize out |of range|
|000051c0| 20 69 6e 20 67 6f 62 61 | 6e 5f 61 6c 6c 6f 63 28 | in goba|n_alloc(|
|000051d0| 29 3a 20 25 64 5c 6e 22 | 2c 20 73 69 7a 65 29 3b |): %d\n"|, size);|
|000051e0| 0a 09 65 78 69 74 28 31 | 29 3b 0a 20 20 20 20 7d |..exit(1|);. }|
|000051f0| 0a 20 20 20 20 67 6f 62 | 61 6e 2d 3e 67 62 5f 6e |. gob|an->gb_n|
|00005200| 6f 64 65 20 3d 20 28 47 | 4f 4e 4f 44 45 20 2a 29 |ode = (G|ONODE *)|
|00005210| 20 63 61 6c 6c 6f 63 28 | 73 69 7a 65 2a 73 69 7a | calloc(|size*siz|
|00005220| 65 2c 20 73 69 7a 65 6f | 66 28 47 4f 4e 4f 44 45 |e, sizeo|f(GONODE|
|00005230| 29 29 3b 0a 20 20 20 20 | 69 66 20 28 67 6f 62 61 |));. |if (goba|
|00005240| 6e 2d 3e 67 62 5f 6e 6f | 64 65 20 3d 3d 20 28 47 |n->gb_no|de == (G|
|00005250| 4f 4e 4f 44 45 20 2a 29 | 20 30 29 20 7b 0a 09 66 |ONODE *)| 0) {..f|
|00005260| 70 72 69 6e 74 66 28 73 | 74 64 65 72 72 2c 20 22 |printf(s|tderr, "|
|00005270| 4f 75 74 20 6f 66 20 6d | 65 6d 6f 72 79 20 69 6e |Out of m|emory in|
|00005280| 20 67 6f 62 61 6e 5f 61 | 6c 6c 6f 63 28 29 5c 6e | goban_a|lloc()\n|
|00005290| 22 29 3b 0a 09 65 78 69 | 74 28 31 29 3b 0a 20 20 |");..exi|t(1);. |
|000052a0| 20 20 7d 0a 0a 20 20 20 | 20 72 65 74 75 72 6e 20 | }.. | return |
|000052b0| 67 6f 62 61 6e 3b 0a 7d | 0a 0a 2f 2a 20 23 5d 67 |goban;.}|../* #]g|
|000052c0| 6f 62 61 6e 5f 61 6c 6c | 6f 63 3a 09 09 2a 2f 20 |oban_all|oc:..*/ |
|000052d0| 0a 2f 2a 20 23 5b 67 6f | 62 61 6e 5f 6e 65 77 3a |./* #[go|ban_new:|
|000052e0| 09 09 09 2a 2f 0a 0a 47 | 4f 42 41 4e 20 2a 0a 67 |...*/..G|OBAN *.g|
|000052f0| 6f 62 61 6e 5f 6e 65 77 | 28 67 6f 67 61 6d 65 2c |oban_new|(gogame,|
|00005300| 20 73 29 0a 2f 2a 0a 20 | 2a 20 41 6c 6c 6f 63 61 | s)./*. |* Alloca|
|00005310| 74 65 20 61 6e 64 20 63 | 6f 6e 73 74 72 75 63 74 |te and c|onstruct|
|00005320| 20 61 20 6e 65 77 20 47 | 6f 20 62 6f 61 72 64 0a | a new G|o board.|
|00005330| 20 2a 2f 0a 47 4f 47 41 | 4d 45 20 2a 67 6f 67 61 | */.GOGA|ME *goga|
|00005340| 6d 65 3b 0a 69 6e 74 09 | 73 3b 09 09 2f 2a 20 52 |me;.int.|s;../* R|
|00005350| 65 71 75 65 73 74 65 64 | 20 73 69 7a 65 20 2a 2f |equested| size */|
|00005360| 0a 7b 0a 20 20 20 20 50 | 4c 41 43 45 20 20 70 3b |.{. P|LACE p;|
|00005370| 0a 0a 20 20 20 20 67 6f | 67 61 6d 65 2d 3e 67 6d |.. go|game->gm|
|00005380| 5f 67 6f 62 61 6e 20 3d | 20 67 6f 62 61 6e 5f 61 |_goban =| goban_a|
|00005390| 6c 6c 6f 63 28 73 29 3b | 0a 20 20 20 20 66 6f 72 |lloc(s);|. for|
|000053a0| 20 28 70 20 3d 20 30 3b | 20 70 20 3c 20 73 2a 73 | (p = 0;| p < s*s|
|000053b0| 3b 20 70 2b 2b 29 20 7b | 0a 09 4e 4f 44 45 28 67 |; p++) {|..NODE(g|
|000053c0| 6f 67 61 6d 65 2c 70 29 | 2d 3e 67 6e 5f 6e 20 3d |ogame,p)|->gn_n =|
|000053d0| 20 4e 4f 44 45 28 67 6f | 67 61 6d 65 2c 70 2d 73 | NODE(go|game,p-s|
|000053e0| 29 3b 0a 09 4e 4f 44 45 | 28 67 6f 67 61 6d 65 2c |);..NODE|(gogame,|
|000053f0| 70 29 2d 3e 67 6e 5f 65 | 20 3d 20 4e 4f 44 45 28 |p)->gn_e| = NODE(|
|00005400| 67 6f 67 61 6d 65 2c 70 | 2b 31 29 3b 0a 09 4e 4f |gogame,p|+1);..NO|
|00005410| 44 45 28 67 6f 67 61 6d | 65 2c 70 29 2d 3e 67 6e |DE(gogam|e,p)->gn|
|00005420| 5f 73 20 3d 20 4e 4f 44 | 45 28 67 6f 67 61 6d 65 |_s = NOD|E(gogame|
|00005430| 2c 70 2b 73 29 3b 0a 09 | 4e 4f 44 45 28 67 6f 67 |,p+s);..|NODE(gog|
|00005440| 61 6d 65 2c 70 29 2d 3e | 67 6e 5f 77 20 3d 20 4e |ame,p)->|gn_w = N|
|00005450| 4f 44 45 28 67 6f 67 61 | 6d 65 2c 70 2d 31 29 3b |ODE(goga|me,p-1);|
|00005460| 0a 20 20 20 20 7d 0a 20 | 20 20 20 66 6f 72 20 28 |. }. | for (|
|00005470| 70 20 3d 20 30 20 20 20 | 20 20 20 3b 20 70 20 3c |p = 0 | ; p <|
|00005480| 20 73 20 20 3b 20 70 2b | 2b 20 29 20 4e 4f 44 45 | s ; p+|+ ) NODE|
|00005490| 28 67 6f 67 61 6d 65 2c | 70 29 2d 3e 67 6e 5f 6e |(gogame,|p)->gn_n|
|000054a0| 20 3d 20 28 47 4f 4e 4f | 44 45 20 2a 29 20 30 3b | = (GONO|DE *) 0;|
|000054b0| 0a 20 20 20 20 66 6f 72 | 20 28 70 20 3d 20 73 2d |. for| (p = s-|
|000054c0| 31 20 20 20 20 3b 20 70 | 20 3c 20 73 2a 73 3b 20 |1 ; p| < s*s; |
|000054d0| 70 2b 3d 73 29 20 4e 4f | 44 45 28 67 6f 67 61 6d |p+=s) NO|DE(gogam|
|000054e0| 65 2c 70 29 2d 3e 67 6e | 5f 65 20 3d 20 28 47 4f |e,p)->gn|_e = (GO|
|000054f0| 4e 4f 44 45 20 2a 29 20 | 30 3b 0a 20 20 20 20 66 |NODE *) |0;. f|
|00005500| 6f 72 20 28 70 20 3d 20 | 73 2a 28 73 2d 31 29 3b |or (p = |s*(s-1);|
|00005510| 20 70 20 3c 20 73 2a 73 | 3b 20 70 2b 2b 20 29 20 | p < s*s|; p++ ) |
|00005520| 4e 4f 44 45 28 67 6f 67 | 61 6d 65 2c 70 29 2d 3e |NODE(gog|ame,p)->|
|00005530| 67 6e 5f 73 20 3d 20 28 | 47 4f 4e 4f 44 45 20 2a |gn_s = (|GONODE *|
|00005540| 29 20 30 3b 0a 20 20 20 | 20 66 6f 72 20 28 70 20 |) 0;. | for (p |
|00005550| 3d 20 30 20 20 20 20 20 | 20 3b 20 70 20 3c 20 73 |= 0 | ; p < s|
|00005560| 2a 73 3b 20 70 2b 3d 73 | 29 20 4e 4f 44 45 28 67 |*s; p+=s|) NODE(g|
|00005570| 6f 67 61 6d 65 2c 70 29 | 2d 3e 67 6e 5f 77 20 3d |ogame,p)|->gn_w =|
|00005580| 20 28 47 4f 4e 4f 44 45 | 20 2a 29 20 30 3b 0a 0a | (GONODE| *) 0;..|
|00005590| 20 20 20 20 72 65 74 75 | 72 6e 20 67 6f 67 61 6d | retu|rn gogam|
|000055a0| 65 2d 3e 67 6d 5f 67 6f | 62 61 6e 3b 0a 7d 0a 0a |e->gm_go|ban;.}..|
|000055b0| 2f 2a 20 23 5d 67 6f 62 | 61 6e 5f 6e 65 77 3a 09 |/* #]gob|an_new:.|
|000055c0| 09 09 2a 2f 20 0a 2f 2a | 20 23 5b 67 6f 62 61 6e |..*/ ./*| #[goban|
|000055d0| 5f 6c 6f 6f 70 3a 09 09 | 2a 2f 0a 0a 23 69 66 64 |_loop:..|*/..#ifd|
|000055e0| 65 66 20 5f 5f 53 54 44 | 43 5f 5f 0a 23 09 64 65 |ef __STD|C__.#.de|
|000055f0| 66 69 6e 65 20 20 50 52 | 4f 54 4f 28 73 29 20 73 |fine PR|OTO(s) s|
|00005600| 0a 23 65 6c 73 65 0a 23 | 09 64 65 66 69 6e 65 20 |.#else.#|.define |
|00005610| 20 50 52 4f 54 4f 28 73 | 29 20 28 29 0a 23 65 6e | PROTO(s|) ().#en|
|00005620| 64 69 66 0a 0a 73 74 61 | 74 69 63 20 69 6e 74 0a |dif..sta|tic int.|
|00005630| 67 6f 62 61 6e 5f 6c 6f | 6f 70 28 67 6f 62 61 6e |goban_lo|op(goban|
|00005640| 2c 20 67 6f 6e 6f 64 65 | 2c 20 66 29 0a 2f 2a 0a |, gonode|, f)./*.|
|00005650| 20 2a 20 56 69 73 69 74 | 20 22 61 6c 6c 22 20 67 | * Visit| "all" g|
|00005660| 6f 62 61 6e 20 70 6f 69 | 6e 74 73 20 61 6e 64 20 |oban poi|nts and |
|00005670| 65 78 65 63 75 74 65 20 | 66 28 29 0a 20 2a 2f 0a |execute |f(). */.|
|00005680| 47 4f 42 41 4e 20 20 2a | 67 6f 62 61 6e 3b 0a 47 |GOBAN *|goban;.G|
|00005690| 4f 4e 4f 44 45 20 2a 67 | 6f 6e 6f 64 65 3b 0a 69 |ONODE *g|onode;.i|
|000056a0| 6e 74 09 28 2a 66 29 50 | 52 4f 54 4f 28 28 47 4f |nt.(*f)P|ROTO((GO|
|000056b0| 42 41 4e 20 2a 67 6f 62 | 61 6e 2c 20 47 4f 4e 4f |BAN *gob|an, GONO|
|000056c0| 44 45 20 2a 67 6f 6e 6f | 64 65 29 29 3b 0a 7b 0a |DE *gono|de));.{.|
|000056d0| 20 20 20 20 28 67 6f 62 | 61 6e 2d 3e 67 62 5f 6c | (gob|an->gb_l|
|000056e0| 6f 6f 70 29 2b 2b 3b 0a | 0a 20 20 20 20 72 65 74 |oop)++;.|. ret|
|000056f0| 75 72 6e 20 67 6f 62 61 | 6e 5f 64 6f 28 67 6f 62 |urn goba|n_do(gob|
|00005700| 61 6e 2c 20 67 6f 6e 6f | 64 65 2c 20 66 29 3b 0a |an, gono|de, f);.|
|00005710| 7d 0a 0a 23 75 6e 64 65 | 66 20 50 52 4f 54 4f 0a |}..#unde|f PROTO.|
|00005720| 0a 2f 2a 20 23 5d 67 6f | 62 61 6e 5f 6c 6f 6f 70 |./* #]go|ban_loop|
|00005730| 3a 09 09 2a 2f 20 0a 2f | 2a 20 23 5b 67 6f 62 61 |:..*/ ./|* #[goba|
|00005740| 6e 5f 64 6f 3a 09 09 09 | 2a 2f 0a 0a 23 69 66 64 |n_do:...|*/..#ifd|
|00005750| 65 66 20 5f 5f 53 54 44 | 43 5f 5f 0a 23 09 64 65 |ef __STD|C__.#.de|
|00005760| 66 69 6e 65 20 20 50 52 | 4f 54 4f 28 73 29 20 73 |fine PR|OTO(s) s|
|00005770| 0a 23 65 6c 73 65 0a 23 | 09 64 65 66 69 6e 65 20 |.#else.#|.define |
|00005780| 20 50 52 4f 54 4f 28 73 | 29 20 28 29 0a 23 65 6e | PROTO(s|) ().#en|
|00005790| 64 69 66 0a 0a 73 74 61 | 74 69 63 20 69 6e 74 0a |dif..sta|tic int.|
|000057a0| 67 6f 62 61 6e 5f 64 6f | 28 67 6f 62 61 6e 2c 20 |goban_do|(goban, |
|000057b0| 67 6f 6e 6f 64 65 2c 20 | 66 29 0a 2f 2a 0a 20 2a |gonode, |f)./*. *|
|000057c0| 20 56 69 73 69 74 20 22 | 61 6c 6c 22 20 67 6f 62 | Visit "|all" gob|
|000057d0| 61 6e 20 70 6f 69 6e 74 | 73 20 61 6e 64 20 65 78 |an point|s and ex|
|000057e0| 65 63 75 74 65 20 66 28 | 29 0a 20 2a 2f 0a 47 4f |ecute f(|). */.GO|
|000057f0| 42 41 4e 20 20 2a 67 6f | 62 61 6e 3b 0a 47 4f 4e |BAN *go|ban;.GON|
|00005800| 4f 44 45 20 2a 67 6f 6e | 6f 64 65 3b 0a 69 6e 74 |ODE *gon|ode;.int|
|00005810| 09 28 2a 66 29 50 52 4f | 54 4f 28 28 47 4f 42 41 |.(*f)PRO|TO((GOBA|
|00005820| 4e 20 2a 67 6f 62 61 6e | 2c 20 47 4f 4e 4f 44 45 |N *goban|, GONODE|
|00005830| 20 2a 67 6f 6e 6f 64 65 | 29 29 3b 0a 7b 0a 20 20 | *gonode|));.{. |
|00005840| 20 20 2f 2a 0a 20 20 20 | 20 20 2a 20 4f 6e 20 74 | /*. | * On t|
|00005850| 68 65 20 67 6f 62 61 6e | 3f 0a 20 20 20 20 20 2a |he goban|?. *|
|00005860| 2f 0a 20 20 20 20 69 66 | 20 28 67 6f 6e 6f 64 65 |/. if| (gonode|
|00005870| 20 3d 3d 20 28 47 4f 4e | 4f 44 45 20 2a 29 20 30 | == (GON|ODE *) 0|
|00005880| 29 20 72 65 74 75 72 6e | 20 30 3b 0a 0a 20 20 20 |) return| 0;.. |
|00005890| 20 2f 2a 0a 20 20 20 20 | 20 2a 20 46 69 72 73 74 | /*. | * First|
|000058a0| 20 74 69 6d 65 3f 0a 20 | 20 20 20 20 2a 2f 0a 20 | time?. | */. |
|000058b0| 20 20 20 69 66 20 28 67 | 6f 6e 6f 64 65 2d 3e 67 | if (g|onode->g|
|000058c0| 6e 5f 6c 6f 6f 70 20 3d | 3d 20 67 6f 62 61 6e 2d |n_loop =|= goban-|
|000058d0| 3e 67 62 5f 6c 6f 6f 70 | 29 20 72 65 74 75 72 6e |>gb_loop|) return|
|000058e0| 20 30 3b 0a 0a 20 20 20 | 20 2f 2a 0a 20 20 20 20 | 0;.. | /*. |
|000058f0| 20 2a 20 4d 61 72 6b 20 | 67 6f 62 61 6e 20 70 6f | * Mark |goban po|
|00005900| 69 6e 74 0a 20 20 20 20 | 20 2a 2f 0a 20 20 20 20 |int. | */. |
|00005910| 67 6f 6e 6f 64 65 2d 3e | 67 6e 5f 6c 6f 6f 70 20 |gonode->|gn_loop |
|00005920| 3d 20 67 6f 62 61 6e 2d | 3e 67 62 5f 6c 6f 6f 70 |= goban-|>gb_loop|
|00005930| 3b 0a 0a 20 20 20 20 69 | 66 20 28 21 20 28 2a 66 |;.. i|f (! (*f|
|00005940| 29 28 67 6f 62 61 6e 2c | 20 67 6f 6e 6f 64 65 29 |)(goban,| gonode)|
|00005950| 29 20 72 65 74 75 72 6e | 20 31 3b 0a 0a 20 20 20 |) return| 1;.. |
|00005960| 20 72 65 74 75 72 6e 20 | 28 0a 09 67 6f 62 61 6e | return |(..goban|
|00005970| 5f 64 6f 28 67 6f 62 61 | 6e 2c 20 67 6f 6e 6f 64 |_do(goba|n, gonod|
|00005980| 65 2d 3e 67 6e 5f 6e 2c | 20 66 29 20 2b 0a 09 67 |e->gn_n,| f) +..g|
|00005990| 6f 62 61 6e 5f 64 6f 28 | 67 6f 62 61 6e 2c 20 67 |oban_do(|goban, g|
|000059a0| 6f 6e 6f 64 65 2d 3e 67 | 6e 5f 65 2c 20 66 29 20 |onode->g|n_e, f) |
|000059b0| 2b 0a 09 67 6f 62 61 6e | 5f 64 6f 28 67 6f 62 61 |+..goban|_do(goba|
|000059c0| 6e 2c 20 67 6f 6e 6f 64 | 65 2d 3e 67 6e 5f 73 2c |n, gonod|e->gn_s,|
|000059d0| 20 66 29 20 2b 0a 09 67 | 6f 62 61 6e 5f 64 6f 28 | f) +..g|oban_do(|
|000059e0| 67 6f 62 61 6e 2c 20 67 | 6f 6e 6f 64 65 2d 3e 67 |goban, g|onode->g|
|000059f0| 6e 5f 77 2c 20 66 29 20 | 2b 20 31 0a 20 20 20 20 |n_w, f) |+ 1. |
|00005a00| 29 3b 0a 7d 0a 0a 23 75 | 6e 64 65 66 20 50 52 4f |);.}..#u|ndef PRO|
|00005a10| 54 4f 0a 0a 2f 2a 20 23 | 5d 67 6f 62 61 6e 5f 64 |TO../* #|]goban_d|
|00005a20| 6f 3a 09 09 09 2a 2f 20 | 0a 2f 2a 20 23 5b 63 68 |o:...*/ |./* #[ch|
|00005a30| 61 69 6e 5f 61 6c 6c 6f | 63 3a 09 09 2a 2f 0a 0a |ain_allo|c:..*/..|
|00005a40| 73 74 61 74 69 63 20 43 | 48 41 49 4e 20 2a 0a 63 |static C|HAIN *.c|
|00005a50| 68 61 69 6e 5f 61 6c 6c | 6f 63 28 29 0a 2f 2a 0a |hain_all|oc()./*.|
|00005a60| 20 2a 20 41 6c 6c 6f 63 | 61 74 65 20 61 20 6e 65 | * Alloc|ate a ne|
|00005a70| 77 20 63 68 61 69 6e 0a | 20 2a 2f 0a 7b 0a 20 20 |w chain.| */.{. |
|00005a80| 20 20 43 48 41 49 4e 20 | 2a 63 68 61 69 6e 20 3d | CHAIN |*chain =|
|00005a90| 20 28 43 48 41 49 4e 20 | 2a 29 20 63 61 6c 6c 6f | (CHAIN |*) callo|
|00005aa0| 63 28 31 2c 20 73 69 7a | 65 6f 66 28 43 48 41 49 |c(1, siz|eof(CHAI|
|00005ab0| 4e 29 29 3b 0a 0a 20 20 | 20 20 69 66 20 28 63 68 |N));.. | if (ch|
|00005ac0| 61 69 6e 20 3d 3d 20 28 | 43 48 41 49 4e 20 2a 29 |ain == (|CHAIN *)|
|00005ad0| 20 30 29 20 7b 0a 09 66 | 70 72 69 6e 74 66 28 73 | 0) {..f|printf(s|
|00005ae0| 74 64 65 72 72 2c 20 22 | 4f 75 74 20 6f 66 20 6d |tderr, "|Out of m|
|00005af0| 65 6d 6f 72 79 20 69 6e | 20 63 68 61 69 6e 5f 61 |emory in| chain_a|
|00005b00| 6c 6c 6f 63 28 29 5c 6e | 22 29 3b 0a 09 65 78 69 |lloc()\n|");..exi|
|00005b10| 74 28 31 29 3b 0a 20 20 | 20 20 7d 0a 20 20 20 20 |t(1);. | }. |
|00005b20| 72 65 74 75 72 6e 20 63 | 68 61 69 6e 3b 0a 7d 0a |return c|hain;.}.|
|00005b30| 0a 2f 2a 20 23 5d 63 68 | 61 69 6e 5f 61 6c 6c 6f |./* #]ch|ain_allo|
|00005b40| 63 3a 09 09 2a 2f 20 0a | 2f 2a 20 23 5b 6d 6f 76 |c:..*/ .|/* #[mov|
|00005b50| 65 5f 61 6c 6c 6f 63 3a | 09 09 2a 2f 0a 0a 73 74 |e_alloc:|..*/..st|
|00005b60| 61 74 69 63 20 47 4f 4d | 4f 56 45 20 2a 0a 6d 6f |atic GOM|OVE *.mo|
|00005b70| 76 65 5f 61 6c 6c 6f 63 | 28 29 0a 2f 2a 0a 20 2a |ve_alloc|()./*. *|
|00005b80| 20 41 6c 6c 6f 63 61 74 | 65 20 61 20 6e 65 77 20 | Allocat|e a new |
|00005b90| 6d 6f 76 65 0a 20 2a 2f | 0a 7b 0a 20 20 20 20 47 |move. */|.{. G|
|00005ba0| 4f 4d 4f 56 45 20 2a 6d | 6f 76 65 20 3d 20 28 47 |OMOVE *m|ove = (G|
|00005bb0| 4f 4d 4f 56 45 20 2a 29 | 20 63 61 6c 6c 6f 63 28 |OMOVE *)| calloc(|
|00005bc0| 31 2c 20 73 69 7a 65 6f | 66 28 47 4f 4d 4f 56 45 |1, sizeo|f(GOMOVE|
|00005bd0| 29 29 3b 0a 0a 20 20 20 | 20 69 66 20 28 6d 6f 76 |));.. | if (mov|
|00005be0| 65 20 3d 3d 20 28 47 4f | 4d 4f 56 45 20 2a 29 20 |e == (GO|MOVE *) |
|00005bf0| 30 29 20 7b 0a 09 66 70 | 72 69 6e 74 66 28 73 74 |0) {..fp|rintf(st|
|00005c00| 64 65 72 72 2c 20 22 4f | 75 74 20 6f 66 20 6d 65 |derr, "O|ut of me|
|00005c10| 6d 6f 72 79 20 69 6e 20 | 6d 6f 76 65 5f 61 6c 6c |mory in |move_all|
|00005c20| 6f 63 28 29 5c 6e 22 29 | 3b 0a 09 65 78 69 74 28 |oc()\n")|;..exit(|
|00005c30| 31 29 3b 0a 20 20 20 20 | 7d 0a 20 20 20 20 72 65 |1);. |}. re|
|00005c40| 74 75 72 6e 20 6d 6f 76 | 65 3b 0a 7d 0a 0a 2f 2a |turn mov|e;.}../*|
|00005c50| 20 23 5d 6d 6f 76 65 5f | 61 6c 6c 6f 63 3a 09 09 | #]move_|alloc:..|
|00005c60| 2a 2f 20 0a 2f 2a 20 23 | 5b 6d 6f 76 65 5f 73 74 |*/ ./* #|[move_st|
|00005c70| 6f 72 65 3a 09 09 2a 2f | 0a 0a 76 6f 69 64 0a 6d |ore:..*/|..void.m|
|00005c80| 6f 76 65 5f 73 74 6f 72 | 65 28 67 6f 67 61 6d 65 |ove_stor|e(gogame|
|00005c90| 2c 20 73 69 64 65 2c 20 | 70 6c 61 63 65 29 0a 47 |, side, |place).G|
|00005ca0| 4f 47 41 4d 45 20 2a 67 | 6f 67 61 6d 65 3b 0a 69 |OGAME *g|ogame;.i|
|00005cb0| 6e 74 09 73 69 64 65 3b | 0a 50 4c 41 43 45 09 70 |nt.side;|.PLACE.p|
|00005cc0| 6c 61 63 65 3b 0a 7b 0a | 20 20 20 20 47 4f 4d 4f |lace;.{.| GOMO|
|00005cd0| 56 45 20 2a 6d 6f 76 65 | 3b 0a 20 20 20 20 47 4f |VE *move|;. GO|
|00005ce0| 4d 4f 56 45 20 2a 6c 61 | 73 74 3b 0a 20 20 20 20 |MOVE *la|st;. |
|00005cf0| 63 68 61 72 20 20 20 2a | 65 72 72 6f 72 3b 0a 0a |char *|error;..|
|00005d00| 20 20 20 20 69 66 20 28 | 70 6c 61 63 65 20 3d 3d | if (|place ==|
|00005d10| 20 28 27 74 27 2d 27 61 | 27 29 20 2b 20 28 27 74 | ('t'-'a|') + ('t|
|00005d20| 27 2d 27 61 27 29 20 2a | 20 67 6f 67 61 6d 65 2d |'-'a') *| gogame-|
|00005d30| 3e 67 6d 5f 73 69 7a 65 | 29 20 7b 0a 09 2f 2a 0a |>gm_size|) {../*.|
|00005d40| 09 20 2a 20 54 68 65 20 | 53 47 46 20 66 6f 72 6d |. * The |SGF form|
|00005d50| 61 74 20 75 73 65 73 20 | 5b 74 74 5d 20 66 6f 72 |at uses |[tt] for|
|00005d60| 20 70 61 73 73 65 73 2c | 0a 09 20 2a 20 69 2e 65 | passes,|.. * i.e|
|00005d70| 2e 20 61 20 6d 6f 76 65 | 20 6f 75 74 73 69 64 65 |. a move| outside|
|00005d80| 20 74 68 65 20 62 6f 61 | 72 64 2e 0a 09 20 2a 20 | the boa|rd... * |
|00005d90| 57 65 20 77 69 6c 6c 20 | 6a 75 73 74 20 69 67 6e |We will |just ign|
|00005da0| 6f 72 65 20 74 68 65 6d | 20 66 6f 72 20 74 68 65 |ore them| for the|
|00005db0| 20 6d 6f 6d 65 6e 74 2c | 0a 09 20 2a 20 74 69 6c | moment,|.. * til|
|00005dc0| 6c 20 77 65 20 66 69 67 | 75 72 65 64 20 6f 75 74 |l we fig|ured out|
|00005dd0| 20 68 6f 77 20 74 6f 20 | 64 65 61 6c 20 77 69 74 | how to |deal wit|
|00005de0| 68 20 70 61 73 73 65 73 | 20 70 72 6f 70 65 72 6c |h passes| properl|
|00005df0| 79 2e 0a 09 20 2a 2f 0a | 09 72 65 74 75 72 6e 3b |y... */.|.return;|
|00005e00| 0a 20 20 20 20 7d 0a 0a | 20 20 20 20 6d 6f 76 65 |. }..| move|
|00005e10| 20 3d 20 6d 6f 76 65 5f | 61 6c 6c 6f 63 28 29 3b | = move_|alloc();|
|00005e20| 0a 20 20 20 20 6c 61 73 | 74 20 3d 20 67 6f 67 61 |. las|t = goga|
|00005e30| 6d 65 2d 3e 67 6d 5f 6d | 6f 76 65 6c 61 73 74 3b |me->gm_m|ovelast;|
|00005e40| 0a 20 20 20 20 69 66 20 | 28 67 6f 67 61 6d 65 2d |. if |(gogame-|
|00005e50| 3e 67 6d 5f 6d 6f 76 65 | 20 3d 3d 20 28 47 4f 4d |>gm_move| == (GOM|
|00005e60| 4f 56 45 20 2a 29 20 30 | 29 20 67 6f 67 61 6d 65 |OVE *) 0|) gogame|
|00005e70| 2d 3e 67 6d 5f 6d 6f 76 | 65 09 20 20 20 20 20 20 |->gm_mov|e. |
|00005e80| 3d 20 6d 6f 76 65 3b 0a | 20 20 20 20 65 6c 73 65 |= move;.| else|
|00005e90| 09 09 09 09 20 67 6f 67 | 61 6d 65 2d 3e 67 6d 5f |.... gog|ame->gm_|
|00005ea0| 6d 6f 76 65 6c 61 73 74 | 2d 3e 6d 76 5f 6e 65 78 |movelast|->mv_nex|
|00005eb0| 74 20 3d 20 6d 6f 76 65 | 3b 0a 20 20 20 20 67 6f |t = move|;. go|
|00005ec0| 67 61 6d 65 2d 3e 67 6d | 5f 6d 6f 76 65 6c 61 73 |game->gm|_movelas|
|00005ed0| 74 09 09 09 09 09 09 20 | 20 20 20 20 20 3d 20 6d |t...... | = m|
|00005ee0| 6f 76 65 3b 0a 0a 20 20 | 20 20 6d 6f 76 65 2d 3e |ove;.. | move->|
|00005ef0| 6d 76 5f 70 6c 61 63 65 | 20 3d 20 4e 4f 44 45 28 |mv_place| = NODE(|
|00005f00| 67 6f 67 61 6d 65 2c 70 | 6c 61 63 65 29 3b 0a 20 |gogame,p|lace);. |
|00005f10| 20 20 20 6d 6f 76 65 2d | 3e 6d 76 5f 73 69 64 65 | move-|>mv_side|
|00005f20| 20 20 3d 20 73 69 64 65 | 3b 0a 20 20 20 20 6d 6f | = side|;. mo|
|00005f30| 76 65 2d 3e 6d 76 5f 6e | 72 09 20 20 20 3d 20 2b |ve->mv_n|r. = +|
|00005f40| 2b 28 67 6f 67 61 6d 65 | 2d 3e 67 6d 5f 6d 6f 76 |+(gogame|->gm_mov|
|00005f50| 65 6e 72 29 3b 0a 20 20 | 20 20 6d 6f 76 65 2d 3e |enr);. | move->|
|00005f60| 6d 76 5f 70 72 65 76 20 | 20 3d 20 6c 61 73 74 3b |mv_prev | = last;|
|00005f70| 0a 20 20 20 20 73 77 69 | 74 63 68 20 28 72 75 6c |. swi|tch (rul|
|00005f80| 65 73 5f 63 68 65 63 6b | 28 67 6f 67 61 6d 65 2c |es_check|(gogame,|
|00005f90| 20 70 6c 61 63 65 2c 20 | 73 69 64 65 29 29 20 7b | place, |side)) {|
|00005fa0| 0a 09 63 61 73 65 20 52 | 55 4c 45 53 5f 4c 45 47 |..case R|ULES_LEG|
|00005fb0| 41 4c 3a 20 20 20 20 72 | 65 74 75 72 6e 3b 0a 09 |AL: r|eturn;..|
|00005fc0| 63 61 73 65 20 52 55 4c | 45 53 5f 4f 55 54 53 49 |case RUL|ES_OUTSI|
|00005fd0| 44 45 3a 20 20 65 72 72 | 6f 72 20 3d 20 22 4e 6f |DE: err|or = "No|
|00005fe0| 74 20 6f 6e 20 74 68 65 | 20 62 6f 61 72 64 22 3b |t on the| board";|
|00005ff0| 09 62 72 65 61 6b 3b 0a | 09 63 61 73 65 20 52 55 |.break;.|.case RU|
|00006000| 4c 45 53 5f 53 55 49 43 | 49 44 45 3a 20 20 65 72 |LES_SUIC|IDE: er|
|00006010| 72 6f 72 20 3d 20 22 53 | 75 69 63 69 64 65 20 6d |ror = "S|uicide m|
|00006020| 6f 76 65 22 3b 09 09 62 | 72 65 61 6b 3b 0a 09 63 |ove";..b|reak;..c|
|00006030| 61 73 65 20 52 55 4c 45 | 53 5f 4b 4f 3a 09 20 20 |ase RULE|S_KO:. |
|00006040| 20 20 20 65 72 72 6f 72 | 20 3d 20 22 4b 6f 20 63 | error| = "Ko c|
|00006050| 61 70 74 75 72 65 20 6e | 6f 74 20 61 6c 6c 6f 77 |apture n|ot allow|
|00006060| 65 64 22 3b 09 62 72 65 | 61 6b 3b 0a 09 63 61 73 |ed";.bre|ak;..cas|
|00006070| 65 20 52 55 4c 45 53 5f | 4f 43 43 55 50 49 45 44 |e RULES_|OCCUPIED|
|00006080| 3a 20 65 72 72 6f 72 20 | 3d 20 22 4f 63 63 75 70 |: error |= "Occup|
|00006090| 69 65 64 20 70 6f 69 6e | 74 22 3b 09 09 62 72 65 |ied poin|t";..bre|
|000060a0| 61 6b 3b 0a 09 64 65 66 | 61 75 6c 74 3a 09 20 20 |ak;..def|ault:. |
|000060b0| 20 20 20 65 72 72 6f 72 | 20 3d 20 22 55 6e 6b 6e | error| = "Unkn|
|000060c0| 6f 77 6e 20 65 72 72 6f | 72 22 3b 09 09 62 72 65 |own erro|r";..bre|
|000060d0| 61 6b 3b 0a 20 20 20 20 | 7d 0a 20 20 20 20 2f 2a |ak;. |}. /*|
|000060e0| 0a 20 20 20 20 20 2a 20 | 45 6d 69 74 20 65 72 72 |. * |Emit err|
|000060f0| 6f 72 20 69 6e 66 6f 0a | 20 20 20 20 20 2a 2f 0a |or info.| */.|
|00006100| 20 20 20 20 66 70 72 69 | 6e 74 66 28 73 74 64 65 | fpri|ntf(stde|
|00006110| 72 72 2c 20 22 49 6c 6c | 65 67 61 6c 20 6d 6f 76 |rr, "Ill|egal mov|
|00006120| 65 3a 20 25 73 20 28 6d | 6f 76 65 3a 20 25 64 29 |e: %s (m|ove: %d)|
|00006130| 5c 6e 22 2c 20 65 72 72 | 6f 72 2c 20 6d 6f 76 65 |\n", err|or, move|
|00006140| 2d 3e 6d 76 5f 6e 72 29 | 3b 0a 0a 20 20 20 20 2f |->mv_nr)|;.. /|
|00006150| 2a 0a 20 20 20 20 20 2a | 20 4d 61 6b 65 20 74 68 |*. *| Make th|
|00006160| 65 20 70 6c 61 63 65 20 | 76 61 63 61 6e 74 0a 20 |e place |vacant. |
|00006170| 20 20 20 20 2a 2f 0a 20 | 20 20 20 6d 6f 76 65 2d | */. | move-|
|00006180| 3e 6d 76 5f 73 69 64 65 | 20 20 3d 20 46 52 45 45 |>mv_side| = FREE|
|00006190| 3b 0a 7d 0a 0a 2f 2a 20 | 23 5d 6d 6f 76 65 5f 73 |;.}../* |#]move_s|
|000061a0| 74 6f 72 65 3a 09 09 2a | 2f 20 0a 2f 2a 20 23 5b |tore:..*|/ ./* #[|
|000061b0| 63 61 70 74 75 72 65 5f | 73 74 6f 72 65 3a 09 09 |capture_|store:..|
|000061c0| 2a 2f 0a 0a 76 6f 69 64 | 0a 63 61 70 74 75 72 65 |*/..void|.capture|
|000061d0| 5f 73 74 6f 72 65 28 67 | 6f 67 61 6d 65 2c 20 67 |_store(g|ogame, g|
|000061e0| 6f 6e 6f 64 65 29 0a 2f | 2a 0a 20 2a 20 41 64 64 |onode)./|*. * Add|
|000061f0| 20 74 68 65 20 73 74 6f | 6e 65 20 61 74 20 67 6f | the sto|ne at go|
|00006200| 6e 6f 64 65 20 74 6f 20 | 74 68 65 20 63 61 70 74 |node to |the capt|
|00006210| 75 72 65 64 20 73 74 6f | 6e 65 20 6c 69 73 74 0a |ured sto|ne list.|
|00006220| 20 2a 2f 0a 47 4f 47 41 | 4d 45 20 2a 67 6f 67 61 | */.GOGA|ME *goga|
|00006230| 6d 65 3b 0a 47 4f 4e 4f | 44 45 20 2a 67 6f 6e 6f |me;.GONO|DE *gono|
|00006240| 64 65 3b 0a 7b 0a 20 20 | 20 20 43 48 41 49 4e 20 |de;.{. | CHAIN |
|00006250| 20 2a 63 20 3d 20 63 68 | 61 69 6e 5f 61 6c 6c 6f | *c = ch|ain_allo|
|00006260| 63 28 29 3b 0a 20 20 20 | 20 47 4f 4d 4f 56 45 20 |c();. | GOMOVE |
|00006270| 2a 6d 20 3d 20 67 6f 67 | 61 6d 65 2d 3e 67 6d 5f |*m = gog|ame->gm_|
|00006280| 6d 6f 76 65 6c 61 73 74 | 3b 0a 0a 20 20 20 20 63 |movelast|;.. c|
|00006290| 2d 3e 63 68 5f 73 74 6f | 6e 65 20 3d 20 67 6f 6e |->ch_sto|ne = gon|
|000062a0| 6f 64 65 2d 3e 67 6e 5f | 73 74 6f 6e 65 3b 0a 0a |ode->gn_|stone;..|
|000062b0| 20 20 20 20 2f 2a 0a 20 | 20 20 20 20 2a 20 49 6e | /*. | * In|
|000062c0| 73 65 72 74 20 74 68 65 | 20 73 74 6f 6e 65 0a 20 |sert the| stone. |
|000062d0| 20 20 20 20 2a 2f 0a 20 | 20 20 20 63 2d 3e 63 68 | */. | c->ch|
|000062e0| 5f 6e 65 78 74 09 20 20 | 20 3d 20 6d 2d 3e 6d 76 |_next. | = m->mv|
|000062f0| 5f 63 61 70 74 75 72 65 | 64 3b 0a 20 20 20 20 6d |_capture|d;. m|
|00006300| 2d 3e 6d 76 5f 63 61 70 | 74 75 72 65 64 20 3d 20 |->mv_cap|tured = |
|00006310| 63 3b 0a 7d 0a 0a 2f 2a | 20 23 5d 63 61 70 74 75 |c;.}../*| #]captu|
|00006320| 72 65 5f 73 74 6f 72 65 | 3a 09 09 2a 2f 20 0a 2f |re_store|:..*/ ./|
|00006330| 2a 20 23 5b 67 61 6d 65 | 5f 61 6c 6c 6f 63 3a 09 |* #[game|_alloc:.|
|00006340| 09 2a 2f 0a 0a 47 4f 47 | 41 4d 45 20 2a 0a 67 61 |.*/..GOG|AME *.ga|
|00006350| 6d 65 5f 61 6c 6c 6f 63 | 28 29 0a 2f 2a 0a 20 2a |me_alloc|()./*. *|
|00006360| 20 41 6c 6c 6f 63 61 74 | 65 20 61 20 6e 65 77 20 | Allocat|e a new |
|00006370| 67 61 6d 65 0a 20 2a 2f | 0a 7b 0a 20 20 20 20 47 |game. */|.{. G|
|00006380| 4f 47 41 4d 45 20 2a 67 | 20 3d 20 28 47 4f 47 41 |OGAME *g| = (GOGA|
|00006390| 4d 45 20 2a 29 20 63 61 | 6c 6c 6f 63 28 31 2c 20 |ME *) ca|lloc(1, |
|000063a0| 73 69 7a 65 6f 66 28 47 | 4f 47 41 4d 45 29 29 3b |sizeof(G|OGAME));|
|000063b0| 0a 0a 20 20 20 20 69 66 | 20 28 67 20 3d 3d 20 28 |.. if| (g == (|
|000063c0| 47 4f 47 41 4d 45 20 2a | 29 20 30 29 20 7b 0a 09 |GOGAME *|) 0) {..|
|000063d0| 66 70 72 69 6e 74 66 28 | 73 74 64 65 72 72 2c 20 |fprintf(|stderr, |
|000063e0| 22 4f 75 74 20 6f 66 20 | 6d 65 6d 6f 72 79 20 69 |"Out of |memory i|
|000063f0| 6e 20 67 61 6d 65 5f 61 | 6c 6c 6f 63 28 29 5c 6e |n game_a|lloc()\n|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.