home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1998 / MacHack 1998.toast / Programming Contest / MacHack Contest.sit / MacHack Contest / Problems Folder / Problem 06 - Legal Chess Moves / Solution.h < prev    next >
MacBinary  |  1998-06-05  |  1.6 KB  |  [TEXT/CWIE]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


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

ConfidenceProgramDetectionMatch TypeSupport
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, Fri Jun 5 01:18:47 1998, modified Fri Jun 5 01:18:47 1998, creator 'CWIE', type ASCII, 1004 bytes "Solution.h" , at 0x46c 410 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[CWIE]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0a 53 6f 6c 75 74 69 | 6f 6e 2e 68 00 00 00 00 |..Soluti|on.h....|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 43 57 49 | 45 00 00 00 00 00 00 00 |.TEXTCWI|E.......|
|00000050| 00 00 00 00 00 03 ec 00 | 00 01 9a b1 9d 30 37 b1 |........|.....07.|
|00000060| 9d 30 37 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |.07.....|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 56 ef 00 00 |........|....V...|
|00000080| 23 69 66 6e 64 65 66 20 | 5f 5f 53 4f 4c 55 54 49 |#ifndef |__SOLUTI|
|00000090| 4f 4e 5f 48 5f 5f 0d 23 | 64 65 66 69 6e 65 20 5f |ON_H__.#|define _|
|000000a0| 5f 53 4f 4c 55 54 49 4f | 4e 5f 48 5f 5f 0d 0d 2f |_SOLUTIO|N_H__../|
|000000b0| 2f 20 44 6f 20 6e 6f 74 | 20 6d 6f 64 69 66 79 20 |/ Do not| modify |
|000000c0| 74 68 69 73 20 66 69 6c | 65 0d 0d 23 69 6e 63 6c |this fil|e..#incl|
|000000d0| 75 64 65 20 3c 4d 61 63 | 54 79 70 65 73 2e 68 3e |ude <Mac|Types.h>|
|000000e0| 0d 23 69 6e 63 6c 75 64 | 65 20 3c 46 69 6c 65 73 |.#includ|e <Files|
|000000f0| 2e 68 3e 0d 0d 23 69 66 | 64 65 66 20 5f 5f 63 70 |.h>..#if|def __cp|
|00000100| 6c 75 73 70 6c 75 73 0d | 65 78 74 65 72 6e 20 22 |lusplus.|extern "|
|00000110| 43 22 20 7b 0d 23 65 6e | 64 69 66 20 2f 2f 20 5f |C" {.#en|dif // _|
|00000120| 5f 63 70 6c 75 73 70 6c | 75 73 0d 0d 74 79 70 65 |_cpluspl|us..type|
|00000130| 64 65 66 20 65 6e 75 6d | 20 7b 6b 45 6d 70 74 79 |def enum| {kEmpty|
|00000140| 3d 30 2c 6b 57 68 69 74 | 65 2c 6b 42 6c 61 63 6b |=0,kWhit|e,kBlack|
|00000150| 7d 20 50 69 65 63 65 43 | 6f 6c 6f 72 3b 0d 74 79 |} PieceC|olor;.ty|
|00000160| 70 65 64 65 66 20 65 6e | 75 6d 20 7b 6b 4e 6f 6e |pedef en|um {kNon|
|00000170| 65 3d 30 2c 6b 50 61 77 | 6e 2c 6b 4b 6e 69 67 68 |e=0,kPaw|n,kKnigh|
|00000180| 74 2c 6b 42 69 73 68 6f | 70 2c 6b 52 6f 6f 6b 2c |t,kBisho|p,kRook,|
|00000190| 6b 51 75 65 65 6e 2c 6b | 4b 69 6e 67 7d 20 50 69 |kQueen,k|King} Pi|
|000001a0| 65 63 65 52 61 6e 6b 3b | 0d 0d 74 79 70 65 64 65 |eceRank;|..typede|
|000001b0| 66 20 73 74 72 75 63 74 | 20 53 71 75 61 72 65 20 |f struct| Square |
|000001c0| 7b 0d 09 55 49 6e 74 31 | 36 20 72 6f 77 3b 09 2f |{..UInt1|6 row;./|
|000001d0| 2a 20 30 2e 2e 37 2c 20 | 77 68 69 74 65 20 69 6e |* 0..7, |white in|
|000001e0| 69 74 69 61 6c 6c 79 20 | 6f 63 63 75 70 69 65 73 |itially |occupies|
|000001f0| 20 72 6f 77 73 20 30 20 | 61 6e 64 20 31 2c 20 62 | rows 0 |and 1, b|
|00000200| 6c 61 63 6b 20 37 20 61 | 6e 64 20 36 20 2a 2f 0d |lack 7 a|nd 6 */.|
|00000210| 09 55 49 6e 74 31 36 20 | 63 6f 6c 3b 09 2f 2a 20 |.UInt16 |col;./* |
|00000220| 30 2e 2e 37 2c 20 77 68 | 69 74 65 20 6b 69 6e 67 |0..7, wh|ite king|
|00000230| 20 73 74 61 72 74 73 20 | 61 74 20 28 72 6f 77 2c | starts |at (row,|
|00000240| 63 6f 6c 29 20 3d 3d 20 | 28 30 2c 34 29 20 2a 2f |col) == |(0,4) */|
|00000250| 0d 7d 20 53 71 75 61 72 | 65 3b 0d 0d 74 79 70 65 |.} Squar|e;..type|
|00000260| 64 65 66 20 73 74 72 75 | 63 74 20 43 68 65 73 73 |def stru|ct Chess|
|00000270| 4d 6f 76 65 20 7b 0d 09 | 53 71 75 61 72 65 20 66 |Move {..|Square f|
|00000280| 72 6f 6d 53 71 75 61 72 | 65 3b 0d 09 53 71 75 61 |romSquar|e;..Squa|
|00000290| 72 65 20 74 6f 53 71 75 | 61 72 65 3b 0d 09 42 6f |re toSqu|are;..Bo|
|000002a0| 6f 6c 65 61 6e 20 63 61 | 70 74 75 72 65 3b 0d 09 |olean ca|pture;..|
|000002b0| 53 71 75 61 72 65 20 63 | 61 70 74 75 72 65 64 53 |Square c|apturedS|
|000002c0| 71 75 61 72 65 3b 09 2f | 2a 20 76 61 6c 69 64 20 |quare;./|* valid |
|000002d0| 6f 6e 6c 79 20 69 66 20 | 63 61 70 74 75 72 65 3d |only if |capture=|
|000002e0| 3d 54 52 55 45 20 2a 2f | 0d 7d 20 43 68 65 73 73 |=TRUE */|.} Chess|
|000002f0| 4d 6f 76 65 3b 0d 0d 74 | 79 70 65 64 65 66 20 73 |Move;..t|ypedef s|
|00000300| 74 72 75 63 74 20 43 68 | 65 73 73 50 69 65 63 65 |truct Ch|essPiece|
|00000310| 20 7b 0d 09 50 69 65 63 | 65 43 6f 6c 6f 72 20 77 | {..Piec|eColor w|
|00000320| 68 69 63 68 43 6f 6c 6f | 72 3b 0d 09 50 69 65 63 |hichColo|r;..Piec|
|00000330| 65 52 61 6e 6b 20 77 68 | 69 63 68 52 61 6e 6b 3b |eRank wh|ichRank;|
|00000340| 0d 09 53 71 75 61 72 65 | 20 70 69 65 63 65 4c 6f |..Square| pieceLo|
|00000350| 63 61 74 69 6f 6e 3b 0d | 7d 20 43 68 65 73 73 50 |cation;.|} ChessP|
|00000360| 69 65 63 65 3b 0d 0d 70 | 61 73 63 61 6c 20 76 6f |iece;..p|ascal vo|
|00000370| 69 64 20 46 69 6e 64 4c | 65 67 61 6c 43 68 65 73 |id FindL|egalChes|
|00000380| 73 4d 6f 76 65 73 28 0d | 09 55 49 6e 74 33 32 20 |sMoves(.|.UInt32 |
|00000390| 6e 75 6d 50 72 69 6f 72 | 4d 6f 76 65 73 2c 0d 09 |numPrior|Moves,..|
|000003a0| 43 68 65 73 73 4d 6f 76 | 65 20 70 72 69 6f 72 4d |ChessMov|e priorM|
|000003b0| 6f 76 65 73 5b 5d 2c 0d | 09 55 49 6e 74 33 32 20 |oves[],.|.UInt32 |
|000003c0| 2a 6e 75 6d 50 69 65 63 | 65 73 52 65 6d 61 69 6e |*numPiec|esRemain|
|000003d0| 69 6e 67 2c 0d 09 43 68 | 65 73 73 50 69 65 63 65 |ing,..Ch|essPiece|
|000003e0| 20 70 69 65 63 65 73 52 | 65 6d 61 69 6e 69 6e 67 | piecesR|emaining|
|000003f0| 5b 5d 2c 0d 09 55 49 6e | 74 33 32 20 2a 6e 75 6d |[],..UIn|t32 *num|
|00000400| 4c 65 67 61 6c 4d 6f 76 | 65 73 2c 0d 09 43 68 65 |LegalMov|es,..Che|
|00000410| 73 73 4d 6f 76 65 20 6c | 65 67 61 6c 4d 6f 76 65 |ssMove l|egalMove|
|00000420| 73 5b 5d 0d 29 3b 0d 0d | 23 69 66 64 65 66 20 5f |s[].);..|#ifdef _|
|00000430| 5f 63 70 6c 75 73 70 6c | 75 73 0d 7d 0d 23 65 6e |_cpluspl|us.}.#en|
|00000440| 64 69 66 20 2f 2f 20 5f | 5f 63 70 6c 75 73 70 6c |dif // _|_cpluspl|
|00000450| 75 73 0d 0d 23 65 6e 64 | 69 66 20 2f 2f 20 5f 5f |us..#end|if // __|
|00000460| 53 4f 4c 55 54 49 4f 4e | 5f 48 5f 5f 00 00 00 00 |SOLUTION|_H__....|
|00000470| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000480| 00 00 01 00 00 00 01 54 | 00 00 00 54 00 00 00 46 |.......T|...T...F|
|00000490| 2b 30 38 30 30 31 35 3a | 35 35 3a 33 32 20 31 39 |+080015:|55:32 19|
|000004a0| 39 38 00 00 00 00 00 00 | 00 00 b1 78 6a 77 00 00 |98......|...xjw..|
|000004b0| 0a 53 6f 6c 75 74 69 6f | 6e 2e 68 4d 61 63 48 61 |.Solutio|n.hMacHa|
|000004c0| 63 6b 20 43 6f 6e 74 65 | 73 74 31 2e 73 69 74 69 |ck Conte|st1.siti|
|000004d0| 02 4a 50 61 72 74 53 49 | 54 21 00 00 00 00 00 00 |.JPartSI|T!......|
|000004e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000004f0| 00 00 b1 b0 40 8d 00 00 | 00 00 00 00 01 9a 00 00 |....@...|........|
|00000500| 00 00 29 bc 7f 92 00 00 | 00 00 20 52 65 3a 20 46 |..).....|.. Re: F|
|00000510| 6f 6c 64 65 72 20 48 69 | 65 72 61 72 63 68 79 20 |older Hi|erarchy |
|00000520| 44 75 70 6c 69 63 61 74 | 69 6f 6e 0d 00 00 00 00 |Duplicat|ion.....|
|00000530| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000540| 00 00 00 00 00 00 00 00 | 00 04 36 35 37 a4 00 00 |........|..657...|
|00000550| 00 00 00 00 00 00 00 00 | 00 01 be ab 00 00 05 f2 |........|........|
|00000560| 00 00 02 90 02 07 31 32 | 2f 35 2f 39 38 34 30 30 |......12|/5/98400|
|00000570| 30 32 31 3a 30 31 3a 35 | 36 20 31 39 39 38 00 00 |021:01:5|6 1998..|
|00000580| 00 00 00 48 00 0a 47 65 | 6e 65 76 61 00 00 00 00 |...H..Ge|neva....|
|00000590| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000005a0| 00 00 00 00 00 00 00 02 | 00 02 00 90 00 34 02 2a |........|.....4.*|
|000005b0| 02 aa 00 90 00 34 02 2a | 02 aa b1 9c e9 e7 00 00 |.....4.*|........|
|000005c0| 03 a7 00 00 03 a7 00 00 | 01 dc 01 00 00 00 00 04 |........|........|
|000005d0| 00 01 00 01 00 00 01 00 | 00 00 01 54 00 00 00 54 |........|...T...T|
|000005e0| 00 00 00 46 00 ce 0d f8 | 25 d4 00 00 00 1c 00 46 |...F....|%......F|
|000005f0| 00 01 4d 50 53 52 00 00 | 00 12 4d 57 42 42 00 00 |..MPSR..|..MWBB..|
|00000600| 00 1e 03 ed ff ff 00 00 | 00 00 00 00 00 00 03 f0 |........|........|
|00000610| ff ff 00 00 00 4c 00 00 | 00 00 00 00 00 00 00 00 |.....L..|........|
|00000620| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000630| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000640| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000650| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000660| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000670| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+