├── Base.lproj ├── About.xib ├── Board.xib └── MainMenu.xib ├── Chess.entitlements ├── Chess.order ├── Chess_SelfTest.scpt ├── English.lproj ├── InfoPlist.strings ├── Localizable.strings ├── Spoken.strings └── Tuner.nib │ ├── classes.nib │ ├── info.nib │ └── keyedobjects.nib ├── MBChess copy-Info.plist ├── MBChess.xcodeproj ├── neeri.mode1v3 ├── neeri.pbxuser └── project.pbxproj ├── README ├── Resources ├── Chess.plist ├── Chess.txt ├── Defaults.plist ├── Icons │ ├── Chess_128x128.png │ ├── Chess_128x128@2x.png │ ├── Chess_16x16.png │ ├── Chess_16x16@2x.png │ ├── Chess_256x256.png │ ├── Chess_256x256@2x.png │ ├── Chess_32x32.png │ ├── Chess_32x32@2x.png │ ├── Chess_512x512.png │ └── Chess_512x512@2x.png ├── Info-ChessTuner.plist ├── Info-MBChess.plist ├── SpeechHelp.plist ├── background.pdf ├── container-migration.plist └── pach ├── Sources ├── MBCAbout.h ├── MBCAbout.mm ├── MBCAnimation.h ├── MBCAnimation.mm ├── MBCBoard.h ├── MBCBoard.mm ├── MBCBoardAnimation.h ├── MBCBoardAnimation.mm ├── MBCBoardView.h ├── MBCBoardView.mm ├── MBCBoardViewAccessibility.h ├── MBCBoardViewAccessibility.mm ├── MBCBoardViewDraw.h ├── MBCBoardViewDraw.mm ├── MBCBoardViewModels.h ├── MBCBoardViewModels.mm ├── MBCBoardViewMouse.h ├── MBCBoardViewMouse.mm ├── MBCBoardViewTextures.h ├── MBCBoardViewTextures.mm ├── MBCBoardWin.h ├── MBCBoardWin.mm ├── MBCController.h ├── MBCController.mm ├── MBCDebug.cp ├── MBCDebug.h ├── MBCDocument.h ├── MBCDocument.mm ├── MBCEngine.h ├── MBCEngine.mm ├── MBCEngineCommands.h ├── MBCEngineCommands.l ├── MBCFloatingBoardWindow.h ├── MBCFloatingBoardWindow.mm ├── MBCGameInfo.h ├── MBCGameInfo.mm ├── MBCInteractivePlayer.h ├── MBCInteractivePlayer.mm ├── MBCLanguageModel.h ├── MBCLanguageModel.mm ├── MBCMoveAnimation.h ├── MBCMoveAnimation.mm ├── MBCMoveGenerator.h ├── MBCMoveGenerator.mm ├── MBCMoveTableView.h ├── MBCMoveTableView.mm ├── MBCMoveTableViewAccessibility.h ├── MBCMoveTableViewAccessibility.mm ├── MBCPlayer.h ├── MBCPlayer.mm ├── MBCRemotePlayer.h ├── MBCRemotePlayer.mm ├── MBCStretchyTextCell.h ├── MBCStretchyTextCell.mm ├── MBCTuner.h ├── MBCTuner.mm ├── MBCUserDefaults.h ├── MBCUserDefaults.mm └── main.mm ├── Styles ├── Fur │ ├── BlackPiece.png │ ├── BlackPiece@2x.png │ ├── Piece.plist │ ├── WhitePiece.png │ └── WhitePiece@2x.png ├── Grass │ ├── BlackBoard.png │ ├── BlackBoard@2x.png │ ├── Board.plist │ ├── Border.png │ ├── Border@2x.png │ ├── WhiteBoard.png │ └── WhiteBoard@2x.png ├── Marble │ ├── BlackBoard.png │ ├── BlackBoard@2x.png │ ├── BlackPiece.png │ ├── BlackPiece@2x.png │ ├── Board.plist │ ├── Border.png │ ├── Border@2x.png │ ├── Piece.plist │ ├── WhiteBoard.png │ ├── WhiteBoard@2x.png │ ├── WhitePiece.png │ └── WhitePiece@2x.png ├── Metal │ ├── BlackBoard.png │ ├── BlackBoard@2x.png │ ├── BlackPiece.png │ ├── BlackPiece@2x.png │ ├── Board.plist │ ├── Border.png │ ├── Border@2x.png │ ├── Piece.plist │ ├── WhiteBoard.png │ ├── WhiteBoard@2x.png │ ├── WhitePiece.png │ └── WhitePiece@2x.png └── Wood │ ├── BlackBoard.png │ ├── BlackBoard@2x.png │ ├── BlackPiece.png │ ├── BlackPiece@2x.png │ ├── Board.plist │ ├── Border.png │ ├── Border@2x.png │ ├── Piece.plist │ ├── WhiteBoard.png │ └── WhitePiece.png ├── Textures ├── Lettering.png ├── Lettering_Blur.png ├── selected_piece_texture.png └── selected_piece_texture@2x.png ├── contributors └── sjeng ├── AUTHORS ├── BUGS ├── ChangeLog ├── English.lproj └── COPYING ├── INSTALL ├── Makefile.am ├── Makefile.in ├── NEWS ├── README ├── THANKS ├── TODO ├── aclocal.m4 ├── attacks.c ├── blob2.c ├── book.c ├── books ├── Makefile ├── Makefile.am ├── Makefile.in ├── bug.opn ├── build-book ├── losers.opn ├── nbook.pgn ├── normal.op2 ├── normal.opn ├── normal.pgn ├── start.pgn ├── suicide.opn └── zhbook.pgn ├── config.h ├── configure ├── configure.in ├── crazy.c ├── depcomp ├── draw.c ├── ecache.c ├── epd.c ├── eval.c ├── extvars.h ├── install-sh ├── learn.c ├── leval.c ├── missing ├── mkinstalldirs ├── moves.c ├── neval.c ├── newbook.c ├── partner.c ├── proof.c ├── protos.h ├── rcfile.c ├── search.c ├── see.c ├── segtb.c ├── seval.c ├── sjeng.ChessEngine.order ├── sjeng.c ├── sjeng.h ├── sjeng.rc ├── squares.h ├── stamp-h ├── stamp-h.in ├── tests ├── Makefile ├── Makefile.am ├── Makefile.in ├── bk.epd ├── bt2630.epd ├── ecm98.epd ├── lct2.epd └── wac.epd ├── ttable.c └── utils.c /Chess.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | com.apple.security.files.user-selected.read-write 8 | 9 | com.apple.developer.game-center 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Chess_SelfTest.scpt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/Chess_SelfTest.scpt -------------------------------------------------------------------------------- /English.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/English.lproj/InfoPlist.strings -------------------------------------------------------------------------------- /English.lproj/Localizable.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/English.lproj/Localizable.strings -------------------------------------------------------------------------------- /English.lproj/Spoken.strings: -------------------------------------------------------------------------------- 1 | /* 2 | File: Spoken.strings 3 | Contains: Localizable strings spoken by chess 4 | Version: 2.0 5 | Copyright: © 2011 by Apple Inc., all rights reserved. 6 | */ 7 | 8 | /* Written rather repetitively, because I'm not sure what gender agreements 9 | are going to be necessary in what languages. 10 | 11 | NOTE TO LOCALIZERS 12 | 13 | All of these strings are meant to be spoken, they will never be used visually, so 14 | don't worry about left-to-right codes etc. 15 | 16 | These translations are NOT triggered by the system locale, but by the language 17 | of the VOICE selected in Chess preferences. On an English system, if Yannick is 18 | selected as a Chess voice, Chess will speak German! 19 | */ 20 | 21 | /* Piece names */ 22 | "king" = "king"; 23 | "queen" = "queen"; 24 | "bishop" = "bishop"; 25 | "knight" = "knight"; 26 | "rook" = "rook"; 27 | "pawn" = "pawn"; 28 | 29 | /* Pawn Promotions ([[emph -]] is a speech synthesis directive to deemphasize a word)*/ 30 | "queen_p" = "[[emph -]] promoting to queen"; 31 | "bishop_p" = "[[emph -]] promoting to bishop"; 32 | "knight_p" = "[[emph -]] promoting to knight"; 33 | "rook_p" = "[[emph -]] promoting to rook"; 34 | 35 | /* Piece drops for crazyhouse ("drop" means to take a piece an insert it somewhere on the board) */ 36 | "queen_d" = "drop queen at"; 37 | "bishop_d" = "drop bishop at"; 38 | "knight_d" = "drop knight at"; 39 | "rook_d" = "drop rook at"; 40 | "pawn_d" = "drop pawn at"; 41 | 42 | /* Move formats ([[emph +]] is a speech synthesis directive to emphasize a word) 43 | * move_fmt -> "knight b 1 to c 3" 44 | * cmove_fmt -> "knight c 3 takes e 5" 45 | * promo_fmt -> "pawn b 7 to b 8, promoting to queen" 46 | * cpromo_fmt -> "pawn b 7 takes a 8, promoting to knight" 47 | * drop_fmt -> "drop queen at f 7" 48 | * kcastle_fmt -> "castle king side" 49 | * qcastle_fmt -> "castle queen side" 50 | * has_check_fmt-> "e 2 to e 4, check!" 51 | * no_check_fmt -> "e 2 to e 4." 52 | */ 53 | "move_fmt" = "%@ %@ %@ to %@ %@"; 54 | "cmove_fmt" = "%@ %@ %@ takes %@ %@"; 55 | "promo_fmt" = "%@ %@ %@ to %@ %@, %@"; 56 | "cpromo_fmt" = "%@ %@ %@ takes %@ %@, %@"; 57 | "drop_fmt" = "%@ %@ %@"; 58 | "kcastle_fmt" = "castle [[emph +]]king side"; 59 | "qcastle_fmt" = "castle [[emph +]]queen side"; 60 | "has_check_fmt" = "%@, %@"; 61 | "no_check_fmt" = "%@."; 62 | 63 | /* Outcomes */ 64 | "white_win" = "white wins!"; 65 | "black_win" = "black wins!"; 66 | "draw" = "the game is a draw!"; 67 | "check" = "check!"; 68 | "check_mate" = "[[emph +]] check mate!"; 69 | 70 | /* Accessibility description in move table */ 71 | "move_table_nr" = "Move %d:"; 72 | "move_table_desc" = "Game Moves"; 73 | 74 | /* Suggestions 75 | * suggest_fmt -> I would suggest "pawn e 2 to e 4" 76 | * last_move_fmt -> The last move was "knight g 8 to f 6" 77 | */ 78 | "suggest_fmt" = "I would suggest \"%@\""; 79 | "last_move_fmt" = "The last move was \"%@\""; 80 | 81 | /* Rank/File, used to form squares like d 5 82 | * This probably does not need to be localized for languages 83 | * using the latin alphabet. 84 | */ 85 | "rank_1" = "1"; 86 | "rank_2" = "2"; 87 | "rank_3" = "3"; 88 | "rank_4" = "4"; 89 | "rank_5" = "5"; 90 | "rank_6" = "6"; 91 | "rank_7" = "7"; 92 | "rank_8" = "8"; 93 | "file_a" = "A"; 94 | "file_b" = "B"; 95 | "file_c" = "C"; 96 | "file_d" = "D"; 97 | "file_e" = "E"; 98 | "file_f" = "F"; 99 | "file_g" = "G"; 100 | "file_h" = "H"; 101 | 102 | -------------------------------------------------------------------------------- /English.lproj/Tuner.nib/classes.nib: -------------------------------------------------------------------------------- 1 | { 2 | IBClasses = ( 3 | {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, 4 | { 5 | ACTIONS = { 6 | saveBoardStyles = id; 7 | savePieceStyles = id; 8 | updateBlackBoardStyle = id; 9 | updateBlackPieceStyle = id; 10 | updateBoardStyle = id; 11 | updateLight = id; 12 | updateWhiteBoardStyle = id; 13 | updateWhitePieceStyle = id; 14 | }; 15 | CLASS = MBCTuner; 16 | LANGUAGE = ObjC; 17 | OUTLETS = { 18 | fAmbient = id; 19 | fBlackBoardStyle = MBCTunerStyle; 20 | fBlackPieceStyle = MBCTunerStyle; 21 | fBoardReflectivity = id; 22 | fBorderStyle = MBCTunerStyle; 23 | fLabelIntensity = id; 24 | fLightParams = id; 25 | fLightPosX = id; 26 | fLightPosY = id; 27 | fLightPosZ = id; 28 | fWhiteBoardStyle = MBCTunerStyle; 29 | fWhitePieceStyle = MBCTunerStyle; 30 | }; 31 | SUPERCLASS = NSWindowController; 32 | }, 33 | { 34 | CLASS = MBCTunerStyle; 35 | LANGUAGE = ObjC; 36 | OUTLETS = {fAlpha = id; fDiffuse = id; fShininess = id; fSpecular = id; }; 37 | SUPERCLASS = NSObject; 38 | } 39 | ); 40 | IBVersion = 1; 41 | } -------------------------------------------------------------------------------- /English.lproj/Tuner.nib/info.nib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IBDocumentLocation 6 | 56 115 407 400 0 0 1440 878 7 | IBFramework Version 8 | 349.0 9 | IBOpenObjects 10 | 11 | 172 12 | 6 13 | 14 | IBSystem Version 15 | 7H63 16 | 17 | 18 | -------------------------------------------------------------------------------- /English.lproj/Tuner.nib/keyedobjects.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/English.lproj/Tuner.nib/keyedobjects.nib -------------------------------------------------------------------------------- /MBChess copy-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleDocumentTypes 8 | 9 | 10 | CFBundleTypeExtensions 11 | 12 | game 13 | 14 | CFBundleTypeIconFile 15 | Game.icns 16 | CFBundleTypeName 17 | game 18 | CFBundleTypeOSTypes 19 | 20 | cfen 21 | 22 | CFBundleTypeRole 23 | Editor 24 | LSItemContentTypes 25 | 26 | com.apple.chess.game 27 | 28 | LSTypeIsPackage 29 | 30 | NSDocumentClass 31 | MBCDocument 32 | NSExportableAs 33 | 34 | moves 35 | 36 | NSExportableTypes 37 | 38 | com.apple.chess.pgn 39 | 40 | NSPersistentStoreTypeKey 41 | Binary 42 | 43 | 44 | CFBundleTypeExtensions 45 | 46 | pgn 47 | 48 | CFBundleTypeIconFile 49 | Moves.icns 50 | CFBundleTypeName 51 | moves 52 | CFBundleTypeOSTypes 53 | 54 | cpgn 55 | 56 | CFBundleTypeRole 57 | None 58 | LSItemContentTypes 59 | 60 | com.apple.chess.pgn 61 | 62 | LSTypeIsPackage 63 | 64 | 65 | 66 | CFBundleExecutable 67 | Chess 68 | CFBundleGetInfoString 69 | 3.0, Copyright 2003-2012 Apple Inc. 70 | MBCBuildTag 71 | Chess-300.21 72 | CFBundleHelpBookFolder 73 | Chess.help 74 | CFBundleHelpBookName 75 | com.apple.Chess.help 76 | CFBundleIconFile 77 | Chess.icns 78 | CFBundleIdentifier 79 | com.apple.Chess 80 | CFBundleInfoDictionaryVersion 81 | 6.0 82 | CFBundleName 83 | Chess 84 | CFBundlePackageType 85 | APPL 86 | CFBundleShortVersionString 87 | 3.0 88 | CFBundleSignature 89 | mbch 90 | CFBundleURLTypes 91 | 92 | CFBundleVersion 93 | 3.0 94 | LSApplicationCategoryType 95 | public.app-category.board-games 96 | LSHasLocalizedDisplayName 97 | 98 | LSMinimumSystemVersion 99 | 10.7.0 100 | NSHumanReadableCopyright 101 | Copyright 2003-2012 Apple Inc. 102 | NSMainNibFile 103 | MainMenu 104 | NSPrincipalClass 105 | NSApplication 106 | NSServices 107 | 108 | NSSupportsSuddenTermination 109 | 110 | UTExportedTypeDeclarations 111 | 112 | 113 | UTTypeConformsTo 114 | 115 | public.utf8-plain-text 116 | 117 | UTTypeIdentifier 118 | com.apple.chess.game 119 | UTTypeTagSpecification 120 | 121 | public.filename-extension 122 | game 123 | 124 | 125 | 126 | UTTypeConformsTo 127 | 128 | public.utf8-plain-text 129 | 130 | UTTypeIdentifier 131 | com.apple.chess.pgn 132 | UTTypeTagSpecification 133 | 134 | public.filename-extension 135 | pgn 136 | 137 | 138 | 139 | UTImportedTypeDeclarations 140 | 141 | 142 | 143 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | This is the source code for Apple's Chess.app Version 3.0, as shipped 2 | in MacOS X 10.8. This project consists of two components: 3 | The Chess engine, "sjeng", and the graphical frontend. 4 | 5 | "sjeng", contained in the "sjeng" subdirectory, is distributed under the 6 | terms of the GNU General Public License. See sjeng/COPYING for 7 | details. 8 | 9 | The graphical frontend, i.e., all files not in the "sjeng" 10 | subdirectory (including files derived from glChess which Apple has 11 | permission to relicense under the following terms), are distributed 12 | under the terms of the Apple Sample Code License: 13 | 14 | IMPORTANT: This Apple software is supplied to you by Apple Computer, 15 | Inc. ("Apple") in consideration of your agreement to the following 16 | terms, and your use, installation, modification or redistribution of 17 | this Apple software constitutes acceptance of these terms. If you do 18 | not agree with these terms, please do not use, install, modify or 19 | redistribute this Apple software. 20 | 21 | In consideration of your agreement to abide by the following terms, 22 | and subject to these terms, Apple grants you a personal, non-exclusive 23 | license, under Apple's copyrights in this original Apple software (the 24 | "Apple Software"), to use, reproduce, modify and redistribute the 25 | Apple Software, with or without modifications, in source and/or binary 26 | forms; provided that if you redistribute the Apple Software in its 27 | entirety and without modifications, you must retain this notice and 28 | the following text and disclaimers in all such redistributions of the 29 | Apple Software. Neither the name, trademarks, service marks or logos 30 | of Apple Computer, Inc. may be used to endorse or promote products 31 | derived from the Apple Software without specific prior written 32 | permission from Apple. Except as expressly stated in this notice, no 33 | other rights or licenses, express or implied, are granted by Apple 34 | herein, including but not limited to any patent rights that may be 35 | infringed by your derivative works or by other works in which the 36 | Apple Software may be incorporated. 37 | 38 | The Apple Software is provided by Apple on an "AS IS" basis. APPLE 39 | MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION 40 | THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND 41 | FITNESS FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS 42 | USE AND OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. 43 | 44 | IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, 45 | INCIDENTAL OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 46 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 47 | PROFITS; OR BUSINESS INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, 48 | REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, 49 | HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING 50 | NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN 51 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 52 | -------------------------------------------------------------------------------- /Resources/Chess.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | OpenSourceImportDate 7 | 2002-08-22 8 | OpenSourceLicense 9 | GPL 10 | OpenSourceLicenseFile 11 | Chess.txt 12 | OpenSourceModifications 13 | 14 | rdar://problem/3381109 15 | rdar://problem/3344423 16 | 17 | OpenSourceProject 18 | sjeng 19 | OpenSourceSHA1 20 | 99f82103ece238d78b8c0c96a943cffc0811d654 21 | OpenSourceURL 22 | http://sjeng.org/ftp/Sjeng-Free-11.2.tar.gz 23 | OpenSourceVersion 24 | 11.2 25 | OpenSourceWebsiteURL 26 | http://sjeng.org/ 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /Resources/Defaults.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | AppleFullScreenEnabled 6 | 7 | MBCAlternateVoice 8 | com.apple.speech.synthesis.voice.Vicki 9 | MBCBoardAngle 10 | 60 11 | MBCBoardSpin 12 | 180 13 | MBCBoardStyle 14 | Wood 15 | MBCEnableVariations 16 | 17 | MBCFloatingBoard 18 | 19 | MBCListenForMoves 20 | 21 | MBCPieceStyle 22 | Wood 23 | MBCSearchTime 24 | 1 25 | MBCShowMoveInTitle 26 | 27 | MBCSpeakHumanMoves 28 | 29 | MBCSpeakMoves 30 | 31 | MBCNewGamePlayers 32 | 1 33 | MBCNewGameVariant 34 | 0 35 | MBCNewGameSides 36 | 2 37 | MBCShowGameLog 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /Resources/Icons/Chess_128x128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/Resources/Icons/Chess_128x128.png -------------------------------------------------------------------------------- /Resources/Icons/Chess_128x128@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/Resources/Icons/Chess_128x128@2x.png -------------------------------------------------------------------------------- /Resources/Icons/Chess_16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/Resources/Icons/Chess_16x16.png -------------------------------------------------------------------------------- /Resources/Icons/Chess_16x16@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/Resources/Icons/Chess_16x16@2x.png -------------------------------------------------------------------------------- /Resources/Icons/Chess_256x256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/Resources/Icons/Chess_256x256.png -------------------------------------------------------------------------------- /Resources/Icons/Chess_256x256@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/Resources/Icons/Chess_256x256@2x.png -------------------------------------------------------------------------------- /Resources/Icons/Chess_32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/Resources/Icons/Chess_32x32.png -------------------------------------------------------------------------------- /Resources/Icons/Chess_32x32@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/Resources/Icons/Chess_32x32@2x.png -------------------------------------------------------------------------------- /Resources/Icons/Chess_512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/Resources/Icons/Chess_512x512.png -------------------------------------------------------------------------------- /Resources/Icons/Chess_512x512@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/Resources/Icons/Chess_512x512@2x.png -------------------------------------------------------------------------------- /Resources/Info-ChessTuner.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleDocumentTypes 8 | 9 | 10 | CFBundleTypeExtensions 11 | 12 | game 13 | 14 | CFBundleTypeIconFile 15 | chess.icns 16 | CFBundleTypeName 17 | game 18 | CFBundleTypeOSTypes 19 | 20 | cfen 21 | 22 | CFBundleTypeRole 23 | Editor 24 | LSItemContentTypes 25 | 26 | com.apple.chess.game 27 | 28 | LSTypeIsPackage 29 | 30 | NSDocumentClass 31 | MBCDocument 32 | NSExportableAs 33 | 34 | moves 35 | 36 | NSExportableTypes 37 | 38 | com.apple.chess.pgn 39 | 40 | NSPersistentStoreTypeKey 41 | Binary 42 | 43 | 44 | CFBundleTypeExtensions 45 | 46 | pgn 47 | 48 | CFBundleTypeIconFile 49 | chess.icns 50 | CFBundleTypeName 51 | moves 52 | CFBundleTypeOSTypes 53 | 54 | cpgn 55 | 56 | CFBundleTypeRole 57 | None 58 | LSItemContentTypes 59 | 60 | com.apple.chess.pgn 61 | 62 | LSTypeIsPackage 63 | 64 | 65 | 66 | CFBundleExecutable 67 | Chess Tuner 68 | CFBundleGetInfoString 69 | 2.4.3, Copyright 2003-2010 Apple Inc. 70 | CFBundleHelpBookFolder 71 | Chess.help 72 | CFBundleHelpBookName 73 | com.apple.Chess.help 74 | CFBundleIconFile 75 | chess.icns 76 | CFBundleIdentifier 77 | com.apple.Chess 78 | CFBundleInfoDictionaryVersion 79 | 6.0 80 | CFBundleName 81 | Chess 82 | CFBundlePackageType 83 | APPL 84 | CFBundleShortVersionString 85 | 2.4.3 86 | CFBundleSignature 87 | mbch 88 | CFBundleVersion 89 | 2.4.3 90 | NSHumanReadableCopyright 91 | Copyright 2003-2010 Apple Inc. 92 | NSMainNibFile 93 | MainMenu 94 | NSPrincipalClass 95 | NSApplication 96 | NSSupportsSuddenTermination 97 | 98 | UTExportedTypeDeclarations 99 | 100 | 101 | UTTypeConformsTo 102 | 103 | public.utf8-plain-text 104 | 105 | UTTypeIdentifier 106 | com.apple.chess.game 107 | UTTypeTagSpecification 108 | 109 | public.filename-extension 110 | game 111 | 112 | 113 | 114 | UTTypeConformsTo 115 | 116 | public.utf8-plain-text 117 | 118 | UTTypeIdentifier 119 | com.apple.chess.pgn 120 | UTTypeTagSpecification 121 | 122 | public.filename-extension 123 | pgn 124 | 125 | 126 | 127 | 128 | 129 | -------------------------------------------------------------------------------- /Resources/Info-MBChess.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleDocumentTypes 8 | 9 | 10 | CFBundleTypeExtensions 11 | 12 | game 13 | 14 | CFBundleTypeIconFile 15 | Game.icns 16 | CFBundleTypeName 17 | game 18 | CFBundleTypeOSTypes 19 | 20 | cfen 21 | 22 | CFBundleTypeRole 23 | Editor 24 | LSItemContentTypes 25 | 26 | com.apple.chess.game 27 | 28 | LSTypeIsPackage 29 | 30 | NSDocumentClass 31 | MBCDocument 32 | NSExportableAs 33 | 34 | moves 35 | 36 | NSExportableTypes 37 | 38 | com.apple.chess.pgn 39 | 40 | NSPersistentStoreTypeKey 41 | Binary 42 | 43 | 44 | CFBundleTypeExtensions 45 | 46 | pgn 47 | 48 | CFBundleTypeIconFile 49 | Moves.icns 50 | CFBundleTypeName 51 | moves 52 | CFBundleTypeOSTypes 53 | 54 | cpgn 55 | 56 | CFBundleTypeRole 57 | None 58 | LSItemContentTypes 59 | 60 | com.apple.chess.pgn 61 | 62 | LSTypeIsPackage 63 | 64 | 65 | 66 | CFBundleExecutable 67 | Chess 68 | CFBundleGetInfoString 69 | 3.10, Copyright 2003-2013 Apple Inc. 70 | CFBundleHelpBookFolder 71 | Chess.help 72 | CFBundleHelpBookName 73 | com.apple.Chess.help 74 | CFBundleIconFile 75 | Chess.icns 76 | CFBundleIdentifier 77 | com.apple.Chess 78 | CFBundleInfoDictionaryVersion 79 | 6.0 80 | CFBundleName 81 | Chess 82 | CFBundlePackageType 83 | APPL 84 | CFBundleShortVersionString 85 | 3.10 86 | CFBundleSignature 87 | mbch 88 | CFBundleVersion 89 | 3.10 90 | LSApplicationCategoryType 91 | public.app-category.board-games 92 | LSHasLocalizedDisplayName 93 | 94 | LSMinimumSystemVersion 95 | 10.9.0 96 | MBCBuildTag 97 | Chess-310.5 98 | NSHumanReadableCopyright 99 | Copyright 2003-2013 Apple Inc. 100 | NSMainNibFile 101 | MainMenu 102 | NSPrincipalClass 103 | NSApplication 104 | NSSupportsSuddenTermination 105 | 106 | UTExportedTypeDeclarations 107 | 108 | 109 | UTTypeConformsTo 110 | 111 | public.utf8-plain-text 112 | 113 | UTTypeIdentifier 114 | com.apple.chess.game 115 | UTTypeTagSpecification 116 | 117 | public.filename-extension 118 | game 119 | 120 | 121 | 122 | UTTypeConformsTo 123 | 124 | public.utf8-plain-text 125 | 126 | UTTypeIdentifier 127 | com.apple.chess.pgn 128 | UTTypeTagSpecification 129 | 130 | public.filename-extension 131 | pgn 132 | 133 | 134 | 135 | 136 | 137 | -------------------------------------------------------------------------------- /Resources/SpeechHelp.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PlacementHint1 6 | CommandInfoArray 7 | 8 | Text<Piece> <Square> to/takes <Square> (e.g. Knight g1 to f3) 9 | TextCastle kingside 10 | TextCastle queenside 11 | TextDrop <Piece> at <Square> (e.g. Drop knight at c7) [Crazyhouse only] 12 | TextTake back move 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /Resources/background.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/Resources/background.pdf -------------------------------------------------------------------------------- /Resources/container-migration.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Move 6 | 7 | ${ApplicationSupport}/Chess 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Resources/pach: -------------------------------------------------------------------------------- 1 | --- Info-ChessTuner.plist 2008-11-20 22:34:05.000000000 +0100 2 | +++ Info-MBChess.plist 2008-11-21 00:07:14.000000000 +0100 3 | @@ -25,8 +25,20 @@ 4 | 5 | com.apple.chess.game 6 | 7 | + LSTypeIsPackage 8 | + 9 | NSDocumentClass 10 | MBCDocument 11 | + NSExportableAs 12 | + 13 | + moves 14 | + 15 | + NSExportableTypes 16 | + 17 | + com.apple.chess.pgn 18 | + 19 | + NSPersistentStoreTypeKey 20 | + Binary 21 | 22 | 23 | CFBundleTypeExtensions 24 | @@ -43,10 +55,22 @@ 25 | 26 | CFBundleTypeRole 27 | None 28 | + LSItemContentTypes 29 | + 30 | + com.apple.chess.pgn 31 | + 32 | + LSTypeIsPackage 33 | + 34 | 35 | 36 | CFBundleExecutable 37 | Chess Tuner 38 | + CFBundleGetInfoString 39 | + 2.4.2, Copyright 2003-2009 Apple Inc. 40 | + CFBundleHelpBookFolder 41 | + ChessHelp 42 | + CFBundleHelpBookName 43 | + Chess Help 44 | CFBundleIconFile 45 | chess.icns 46 | CFBundleIdentifier 47 | @@ -58,14 +82,47 @@ 48 | CFBundlePackageType 49 | APPL 50 | CFBundleShortVersionString 51 | - 2.0 52 | + 2.4.2 53 | CFBundleSignature 54 | mbch 55 | CFBundleVersion 56 | - 2.4 57 | + 2.4.2 58 | + NSHumanReadableCopyright 59 | + Copyright 2003-2009 Apple Inc. 60 | NSMainNibFile 61 | MainMenu 62 | NSPrincipalClass 63 | NSApplication 64 | + NSSupportsSuddenTermination 65 | + 66 | + UTExportedTypeDeclarations 67 | + 68 | + 69 | + UTTypeConformsTo 70 | + 71 | + public.utf8-plain-text 72 | + 73 | + UTTypeIdentifier 74 | + com.apple.chess.game 75 | + UTTypeTagSpecification 76 | + 77 | + public.filename-extension 78 | + game 79 | + 80 | + 81 | + 82 | + UTTypeConformsTo 83 | + 84 | + public.utf8-plain-text 85 | + 86 | + UTTypeIdentifier 87 | + com.apple.chess.pgn 88 | + UTTypeTagSpecification 89 | + 90 | + public.filename-extension 91 | + pgn 92 | + 93 | + 94 | + 95 | 96 | 97 | -------------------------------------------------------------------------------- /Sources/MBCAbout.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/Sources/MBCAbout.h -------------------------------------------------------------------------------- /Sources/MBCAbout.mm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/Sources/MBCAbout.mm -------------------------------------------------------------------------------- /Sources/MBCAnimation.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/Sources/MBCAnimation.h -------------------------------------------------------------------------------- /Sources/MBCAnimation.mm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/Sources/MBCAnimation.mm -------------------------------------------------------------------------------- /Sources/MBCBoard.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/Sources/MBCBoard.h -------------------------------------------------------------------------------- /Sources/MBCBoard.mm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/Sources/MBCBoard.mm -------------------------------------------------------------------------------- /Sources/MBCBoardAnimation.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/Sources/MBCBoardAnimation.h -------------------------------------------------------------------------------- /Sources/MBCBoardAnimation.mm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/Sources/MBCBoardAnimation.mm -------------------------------------------------------------------------------- /Sources/MBCBoardView.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/Sources/MBCBoardView.h -------------------------------------------------------------------------------- /Sources/MBCBoardViewAccessibility.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/Sources/MBCBoardViewAccessibility.h -------------------------------------------------------------------------------- /Sources/MBCBoardViewDraw.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/Sources/MBCBoardViewDraw.h -------------------------------------------------------------------------------- /Sources/MBCBoardViewDraw.mm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/Sources/MBCBoardViewDraw.mm -------------------------------------------------------------------------------- /Sources/MBCBoardViewModels.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/Sources/MBCBoardViewModels.h -------------------------------------------------------------------------------- /Sources/MBCBoardViewModels.mm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/Sources/MBCBoardViewModels.mm -------------------------------------------------------------------------------- /Sources/MBCBoardViewMouse.h: -------------------------------------------------------------------------------- 1 | /* 2 | File: MBCBoardViewMouse.h 3 | Contains: Mouse handling for OpenGL chess board view 4 | Copyright: © 2002-2010 by Apple Inc., all rights reserved. 5 | 6 | IMPORTANT: This Apple software is supplied to you by Apple Computer, 7 | Inc. ("Apple") in consideration of your agreement to the following 8 | terms, and your use, installation, modification or redistribution of 9 | this Apple software constitutes acceptance of these terms. If you do 10 | not agree with these terms, please do not use, install, modify or 11 | redistribute this Apple software. 12 | 13 | In consideration of your agreement to abide by the following terms, 14 | and subject to these terms, Apple grants you a personal, non-exclusive 15 | license, under Apple's copyrights in this original Apple software (the 16 | "Apple Software"), to use, reproduce, modify and redistribute the 17 | Apple Software, with or without modifications, in source and/or binary 18 | forms; provided that if you redistribute the Apple Software in its 19 | entirety and without modifications, you must retain this notice and 20 | the following text and disclaimers in all such redistributions of the 21 | Apple Software. Neither the name, trademarks, service marks or logos 22 | of Apple Inc. may be used to endorse or promote products 23 | derived from the Apple Software without specific prior written 24 | permission from Apple. Except as expressly stated in this notice, no 25 | other rights or licenses, express or implied, are granted by Apple 26 | herein, including but not limited to any patent rights that may be 27 | infringed by your derivative works or by other works in which the 28 | Apple Software may be incorporated. 29 | 30 | The Apple Software is provided by Apple on an "AS IS" basis. APPLE 31 | MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION 32 | THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND 33 | FITNESS FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS 34 | USE AND OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. 35 | 36 | IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, 37 | INCIDENTAL OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 38 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 39 | PROFITS; OR BUSINESS INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, 40 | REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, 41 | HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING 42 | NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN 43 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 44 | */ 45 | 46 | #import "MBCBoardView.h" 47 | 48 | @interface MBCBoardView ( Mouse ) 49 | 50 | - (NSRect) approximateBoundsOfSquare:(MBCSquare)square; 51 | - (MBCPosition) mouseToPosition:(NSPoint)mouse; 52 | - (void) mouseDown:(NSEvent *)event; 53 | - (void) mouseMoved:(NSEvent *)event; 54 | - (void) mouseUp:(NSEvent *)event; 55 | - (void) dragAndRedraw:(NSEvent *)event forceRedraw:(BOOL)force; 56 | 57 | @end 58 | 59 | // Local Variables: 60 | // mode:ObjC 61 | // End: 62 | -------------------------------------------------------------------------------- /Sources/MBCBoardViewTextures.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/Sources/MBCBoardViewTextures.h -------------------------------------------------------------------------------- /Sources/MBCBoardViewTextures.mm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/Sources/MBCBoardViewTextures.mm -------------------------------------------------------------------------------- /Sources/MBCBoardWin.h: -------------------------------------------------------------------------------- 1 | /* 2 | File: MBCBoardWin.h 3 | Contains: Manage the board window 4 | Copyright: © 2002-2012 by Apple Inc., all rights reserved. 5 | 6 | IMPORTANT: This Apple software is supplied to you by Apple Computer, 7 | Inc. ("Apple") in consideration of your agreement to the following 8 | terms, and your use, installation, modification or redistribution of 9 | this Apple software constitutes acceptance of these terms. If you do 10 | not agree with these terms, please do not use, install, modify or 11 | redistribute this Apple software. 12 | 13 | In consideration of your agreement to abide by the following terms, 14 | and subject to these terms, Apple grants you a personal, non-exclusive 15 | license, under Apple's copyrights in this original Apple software (the 16 | "Apple Software"), to use, reproduce, modify and redistribute the 17 | Apple Software, with or without modifications, in source and/or binary 18 | forms; provided that if you redistribute the Apple Software in its 19 | entirety and without modifications, you must retain this notice and 20 | the following text and disclaimers in all such redistributions of the 21 | Apple Software. Neither the name, trademarks, service marks or logos 22 | of Apple Inc. may be used to endorse or promote products 23 | derived from the Apple Software without specific prior written 24 | permission from Apple. Except as expressly stated in this notice, no 25 | other rights or licenses, express or implied, are granted by Apple 26 | herein, including but not limited to any patent rights that may be 27 | infringed by your derivative works or by other works in which the 28 | Apple Software may be incorporated. 29 | 30 | The Apple Software is provided by Apple on an "AS IS" basis. APPLE 31 | MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION 32 | THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND 33 | FITNESS FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS 34 | USE AND OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. 35 | 36 | IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, 37 | INCIDENTAL OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 38 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 39 | PROFITS; OR BUSINESS INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, 40 | REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, 41 | HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING 42 | NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN 43 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 44 | */ 45 | 46 | #import 47 | #import 48 | 49 | @class MBCBoard; 50 | @class MBCBoardView; 51 | @class MBCEngine; 52 | @class MBCInteractivePlayer; 53 | @class MBCGameInfo; 54 | @class MBCRemotePlayer; 55 | @class MBCAnimation; 56 | 57 | @interface MBCBoardWin : NSWindowController 60 | { 61 | NSMutableArray * fObservers; 62 | GKAchievementViewController * fAchievements; 63 | MBCAnimation * fCurAnimation; 64 | } 65 | 66 | @property (nonatomic, assign) IBOutlet MBCBoardView * gameView; 67 | @property (nonatomic, assign) IBOutlet NSPanel * gameNewSheet; 68 | @property (nonatomic, assign) IBOutlet NSBox * logContainer; 69 | @property (nonatomic, assign) IBOutlet NSView * logView; 70 | @property (nonatomic, assign) IBOutlet MBCBoard * board; 71 | @property (nonatomic, assign) IBOutlet MBCEngine * engine; 72 | @property (nonatomic, assign) IBOutlet MBCInteractivePlayer * interactive; 73 | @property (nonatomic, assign) IBOutlet MBCGameInfo * gameInfo; 74 | @property (nonatomic, assign) IBOutlet MBCRemotePlayer * remote; 75 | @property (nonatomic, assign) IBOutlet NSLayoutConstraint * logViewRightEdgeConstraint; 76 | @property (nonatomic, assign) IBOutlet GKDialogController * dialogController; 77 | @property (nonatomic, readonly) NSSpeechSynthesizer * primarySynth; 78 | @property (nonatomic, readonly) NSSpeechSynthesizer * alternateSynth; 79 | @property (nonatomic, readonly) NSDictionary * primaryLocalization; 80 | @property (nonatomic, readonly) NSDictionary * alternateLocalization; 81 | 82 | - (void) removeChessObservers; 83 | - (IBAction)takeback:(id)sender; 84 | - (void) requestTakeback; 85 | - (void) requestDraw; 86 | - (IBAction)resign:(id)sender; 87 | - (IBAction)showHint:(id)sender; 88 | - (IBAction)showLastMove:(id)sender; 89 | - (IBAction)toggleLogView:(id)sender; 90 | - (IBAction) startNewGame:(id)sender; 91 | - (IBAction) cancelNewGame:(id)sender; 92 | - (IBAction) showAchievements:(id)sender; 93 | - (IBAction) profileDraw:(id)sender; 94 | - (void)adjustLogView; 95 | - (BOOL)listenForMoves; 96 | - (NSString *)speakOpponentTitle; 97 | - (BOOL)speakMoves; 98 | - (BOOL)speakHumanMoves; 99 | - (IBAction) updatePlayers:(id)sender; 100 | - (BOOL)hideEngineStrength; 101 | - (BOOL)hideNewGameSides; 102 | - (BOOL)hideSpeakMoves; 103 | - (BOOL)hideSpeakHumanMoves; 104 | - (BOOL)hideEngineProperties; 105 | - (BOOL)hideRemoteProperties; 106 | - (NSString *)engineStrength; 107 | + (NSSet *) keyPathsForValuesAffectingEngineStrength; 108 | - (IBAction) showPreferences:(id)sender; 109 | - (void)setAngle:(float)angle spin:(float)spin; 110 | - (void)handleRemoteResponse:(NSString *)response; 111 | - (void)endAnimation; 112 | 113 | @end 114 | -------------------------------------------------------------------------------- /Sources/MBCController.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/Sources/MBCController.h -------------------------------------------------------------------------------- /Sources/MBCController.mm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/Sources/MBCController.mm -------------------------------------------------------------------------------- /Sources/MBCDebug.cp: -------------------------------------------------------------------------------- 1 | /* 2 | File: MBCDebug.cp 3 | Contains: Debug flags 4 | Copyright: © 2011 by Apple Inc., all rights reserved. 5 | 6 | IMPORTANT: This Apple software is supplied to you by Apple Computer, 7 | Inc. ("Apple") in consideration of your agreement to the following 8 | terms, and your use, installation, modification or redistribution of 9 | this Apple software constitutes acceptance of these terms. If you do 10 | not agree with these terms, please do not use, install, modify or 11 | redistribute this Apple software. 12 | 13 | In consideration of your agreement to abide by the following terms, 14 | and subject to these terms, Apple grants you a personal, non-exclusive 15 | license, under Apple's copyrights in this original Apple software (the 16 | "Apple Software"), to use, reproduce, modify and redistribute the 17 | Apple Software, with or without modifications, in source and/or binary 18 | forms; provided that if you redistribute the Apple Software in its 19 | entirety and without modifications, you must retain this notice and 20 | the following text and disclaimers in all such redistributions of the 21 | Apple Software. Neither the name, trademarks, service marks or logos 22 | of Apple Inc. may be used to endorse or promote products 23 | derived from the Apple Software without specific prior written 24 | permission from Apple. Except as expressly stated in this notice, no 25 | other rights or licenses, express or implied, are granted by Apple 26 | herein, including but not limited to any patent rights that may be 27 | infringed by your derivative works or by other works in which the 28 | Apple Software may be incorporated. 29 | 30 | The Apple Software is provided by Apple on an "AS IS" basis. APPLE 31 | MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION 32 | THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND 33 | FITNESS FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS 34 | USE AND OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. 35 | 36 | IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, 37 | INCIDENTAL OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 38 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 39 | PROFITS; OR BUSINESS INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, 40 | REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, 41 | HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING 42 | NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN 43 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 44 | */ 45 | 46 | #include "MBCDebug.h" 47 | 48 | #include 49 | 50 | int MBCDebug::sDebugFlags; 51 | 52 | void 53 | MBCDebug::Update() 54 | { 55 | if (const char * dbg = getenv("MBC_DEBUG")) 56 | sDebugFlags = atoi(dbg); 57 | else 58 | sDebugFlags = 0; 59 | } 60 | 61 | void 62 | MBCDebug::SetDebugFlags(int flag, bool val) 63 | { 64 | if (val) 65 | sDebugFlags |= flag; 66 | else 67 | sDebugFlags &= ~flag; 68 | } 69 | -------------------------------------------------------------------------------- /Sources/MBCDebug.h: -------------------------------------------------------------------------------- 1 | /* 2 | File: MBCDebug.h 3 | Contains: Debug flags 4 | Copyright: © 2011-2012 by Apple Inc., all rights reserved. 5 | 6 | IMPORTANT: This Apple software is supplied to you by Apple Computer, 7 | Inc. ("Apple") in consideration of your agreement to the following 8 | terms, and your use, installation, modification or redistribution of 9 | this Apple software constitutes acceptance of these terms. If you do 10 | not agree with these terms, please do not use, install, modify or 11 | redistribute this Apple software. 12 | 13 | In consideration of your agreement to abide by the following terms, 14 | and subject to these terms, Apple grants you a personal, non-exclusive 15 | license, under Apple's copyrights in this original Apple software (the 16 | "Apple Software"), to use, reproduce, modify and redistribute the 17 | Apple Software, with or without modifications, in source and/or binary 18 | forms; provided that if you redistribute the Apple Software in its 19 | entirety and without modifications, you must retain this notice and 20 | the following text and disclaimers in all such redistributions of the 21 | Apple Software. Neither the name, trademarks, service marks or logos 22 | of Apple Inc. may be used to endorse or promote products 23 | derived from the Apple Software without specific prior written 24 | permission from Apple. Except as expressly stated in this notice, no 25 | other rights or licenses, express or implied, are granted by Apple 26 | herein, including but not limited to any patent rights that may be 27 | infringed by your derivative works or by other works in which the 28 | Apple Software may be incorporated. 29 | 30 | The Apple Software is provided by Apple on an "AS IS" basis. APPLE 31 | MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION 32 | THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND 33 | FITNESS FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS 34 | USE AND OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. 35 | 36 | IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, 37 | INCIDENTAL OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 38 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 39 | PROFITS; OR BUSINESS INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, 40 | REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, 41 | HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING 42 | NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN 43 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 44 | */ 45 | 46 | class MBCDebug { 47 | public: 48 | static void Update(); 49 | static bool ShowDebugMenu() { return DebugFlags() & 1; } 50 | static bool LogMouse() { return DebugFlags() & 2; } 51 | static void SetLogMouse(bool val) { SetDebugFlags(2, val); } 52 | static bool LogStart() { return DebugFlags() & 4; } 53 | static bool DumpLanguageModels() { return DebugFlags() & 8; } 54 | static void SetDumpLanguageModels(bool val) { SetDebugFlags(8, val); } 55 | static bool Use1xTextures() { return DebugFlags() & 16; } 56 | private: 57 | static int DebugFlags() { return sDebugFlags; } 58 | static void SetDebugFlags(int flag, bool val); 59 | static int sDebugFlags; 60 | }; 61 | -------------------------------------------------------------------------------- /Sources/MBCDocument.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/Sources/MBCDocument.h -------------------------------------------------------------------------------- /Sources/MBCEngine.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/Sources/MBCEngine.h -------------------------------------------------------------------------------- /Sources/MBCEngineCommands.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/Sources/MBCEngineCommands.h -------------------------------------------------------------------------------- /Sources/MBCEngineCommands.l: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/Sources/MBCEngineCommands.l -------------------------------------------------------------------------------- /Sources/MBCFloatingBoardWindow.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/Sources/MBCFloatingBoardWindow.h -------------------------------------------------------------------------------- /Sources/MBCFloatingBoardWindow.mm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/Sources/MBCFloatingBoardWindow.mm -------------------------------------------------------------------------------- /Sources/MBCGameInfo.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/Sources/MBCGameInfo.h -------------------------------------------------------------------------------- /Sources/MBCInteractivePlayer.h: -------------------------------------------------------------------------------- 1 | /* 2 | File: MBCInteractivePlayer.h 3 | Contains: An agent representing a local human player 4 | Copyright: © 2002-2014 by Apple Inc., all rights reserved. 5 | 6 | IMPORTANT: This Apple software is supplied to you by Apple Computer, 7 | Inc. ("Apple") in consideration of your agreement to the following 8 | terms, and your use, installation, modification or redistribution of 9 | this Apple software constitutes acceptance of these terms. If you do 10 | not agree with these terms, please do not use, install, modify or 11 | redistribute this Apple software. 12 | 13 | In consideration of your agreement to abide by the following terms, 14 | and subject to these terms, Apple grants you a personal, non-exclusive 15 | license, under Apple's copyrights in this original Apple software (the 16 | "Apple Software"), to use, reproduce, modify and redistribute the 17 | Apple Software, with or without modifications, in source and/or binary 18 | forms; provided that if you redistribute the Apple Software in its 19 | entirety and without modifications, you must retain this notice and 20 | the following text and disclaimers in all such redistributions of the 21 | Apple Software. Neither the name, trademarks, service marks or logos 22 | of Apple Inc. may be used to endorse or promote products 23 | derived from the Apple Software without specific prior written 24 | permission from Apple. Except as expressly stated in this notice, no 25 | other rights or licenses, express or implied, are granted by Apple 26 | herein, including but not limited to any patent rights that may be 27 | infringed by your derivative works or by other works in which the 28 | Apple Software may be incorporated. 29 | 30 | The Apple Software is provided by Apple on an "AS IS" basis. APPLE 31 | MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION 32 | THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND 33 | FITNESS FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS 34 | USE AND OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. 35 | 36 | IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, 37 | INCIDENTAL OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 38 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 39 | PROFITS; OR BUSINESS INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, 40 | REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, 41 | HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING 42 | NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN 43 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 44 | */ 45 | 46 | #import 47 | #import 48 | 49 | #import "MBCPlayer.h" 50 | #import "MBCMoveGenerator.h" 51 | 52 | @class MBCBoardWin; 53 | @class MBCLanguageModel; 54 | 55 | // 56 | // MBCInteractivePlayer represents humans playing locally 57 | // 58 | @interface MBCInteractivePlayer : MBCPlayer 59 | { 60 | IBOutlet MBCBoardWin * fController; 61 | MBCLanguageModel * fLanguageModel; 62 | MBCSide fLastSide; 63 | MBCSide fSide; 64 | MBCVariant fVariant; 65 | MBCSquare fFromSquare; 66 | bool fStartingSR; 67 | bool fAnnounceCheck; 68 | SRRecognitionSystem fRecSystem; 69 | SRRecognizer fRecognizer; 70 | SRLanguageModel fModel; 71 | NSData * fSpeechHelp; 72 | BOOL fHasObservers; 73 | BOOL fPendingMouseUpdate; 74 | } 75 | 76 | - (void) startGame:(MBCVariant)variant playing:(MBCSide)sideToPlay; 77 | - (void) updateNeedMouse:(id)arg; 78 | - (void) doUpdateNeedMouse; 79 | - (void) allowedToListen:(BOOL)allowed; 80 | 81 | // 82 | // The board view translates coordinates into board squares and handles 83 | // dragging. 84 | // 85 | - (void) startSelection:(MBCSquare)square; 86 | - (void) endSelection:(MBCSquare)square animate:(BOOL)animate; 87 | 88 | // 89 | // If we recognize a move, we have to broadcast it 90 | // 91 | - (void) recognized:(SRRecognitionResult)result; 92 | 93 | // 94 | // Announce hint / last move 95 | // 96 | - (void) announceHint:(MBCMove *) move; 97 | - (void) announceLastMove:(MBCMove *) move; 98 | 99 | - (void) removeController; 100 | 101 | @end 102 | 103 | // Local Variables: 104 | // mode:ObjC 105 | // End: 106 | -------------------------------------------------------------------------------- /Sources/MBCLanguageModel.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/Sources/MBCLanguageModel.h -------------------------------------------------------------------------------- /Sources/MBCLanguageModel.mm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/Sources/MBCLanguageModel.mm -------------------------------------------------------------------------------- /Sources/MBCMoveAnimation.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/Sources/MBCMoveAnimation.h -------------------------------------------------------------------------------- /Sources/MBCMoveAnimation.mm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/Sources/MBCMoveAnimation.mm -------------------------------------------------------------------------------- /Sources/MBCMoveGenerator.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/Sources/MBCMoveGenerator.h -------------------------------------------------------------------------------- /Sources/MBCMoveGenerator.mm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/Sources/MBCMoveGenerator.mm -------------------------------------------------------------------------------- /Sources/MBCMoveTableView.h: -------------------------------------------------------------------------------- 1 | /* 2 | File: MBCMoveTableView.h 3 | Contains: Table view that selectively draws column separators 4 | Copyright: © 2002-2011 by Apple Inc., all rights reserved. 5 | 6 | IMPORTANT: This Apple software is supplied to you by Apple Computer, 7 | Inc. ("Apple") in consideration of your agreement to the following 8 | terms, and your use, installation, modification or redistribution of 9 | this Apple software constitutes acceptance of these terms. If you do 10 | not agree with these terms, please do not use, install, modify or 11 | redistribute this Apple software. 12 | 13 | In consideration of your agreement to abide by the following terms, 14 | and subject to these terms, Apple grants you a personal, non-exclusive 15 | license, under Apple's copyrights in this original Apple software (the 16 | "Apple Software"), to use, reproduce, modify and redistribute the 17 | Apple Software, with or without modifications, in source and/or binary 18 | forms; provided that if you redistribute the Apple Software in its 19 | entirety and without modifications, you must retain this notice and 20 | the following text and disclaimers in all such redistributions of the 21 | Apple Software. Neither the name, trademarks, service marks or logos 22 | of Apple Inc. may be used to endorse or promote products 23 | derived from the Apple Software without specific prior written 24 | permission from Apple. Except as expressly stated in this notice, no 25 | other rights or licenses, express or implied, are granted by Apple 26 | herein, including but not limited to any patent rights that may be 27 | infringed by your derivative works or by other works in which the 28 | Apple Software may be incorporated. 29 | 30 | The Apple Software is provided by Apple on an "AS IS" basis. APPLE 31 | MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION 32 | THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND 33 | FITNESS FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS 34 | USE AND OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. 35 | 36 | IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, 37 | INCIDENTAL OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 38 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 39 | PROFITS; OR BUSINESS INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, 40 | REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, 41 | HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING 42 | NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN 43 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 44 | */ 45 | 46 | #import 47 | 48 | @interface MBCMoveTableView : NSTableView { 49 | bool fInGridDrawing; 50 | } 51 | 52 | @end 53 | -------------------------------------------------------------------------------- /Sources/MBCMoveTableView.mm: -------------------------------------------------------------------------------- 1 | /* 2 | File: MBCMoveTableView.mm 3 | Contains: Table view that selectively draws column separators 4 | Copyright: © 2002-2011 by Apple Inc., all rights reserved. 5 | 6 | IMPORTANT: This Apple software is supplied to you by Apple Computer, 7 | Inc. ("Apple") in consideration of your agreement to the following 8 | terms, and your use, installation, modification or redistribution of 9 | this Apple software constitutes acceptance of these terms. If you do 10 | not agree with these terms, please do not use, install, modify or 11 | redistribute this Apple software. 12 | 13 | In consideration of your agreement to abide by the following terms, 14 | and subject to these terms, Apple grants you a personal, non-exclusive 15 | license, under Apple's copyrights in this original Apple software (the 16 | "Apple Software"), to use, reproduce, modify and redistribute the 17 | Apple Software, with or without modifications, in source and/or binary 18 | forms; provided that if you redistribute the Apple Software in its 19 | entirety and without modifications, you must retain this notice and 20 | the following text and disclaimers in all such redistributions of the 21 | Apple Software. Neither the name, trademarks, service marks or logos 22 | of Apple Inc. may be used to endorse or promote products 23 | derived from the Apple Software without specific prior written 24 | permission from Apple. Except as expressly stated in this notice, no 25 | other rights or licenses, express or implied, are granted by Apple 26 | herein, including but not limited to any patent rights that may be 27 | infringed by your derivative works or by other works in which the 28 | Apple Software may be incorporated. 29 | 30 | The Apple Software is provided by Apple on an "AS IS" basis. APPLE 31 | MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION 32 | THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND 33 | FITNESS FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS 34 | USE AND OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. 35 | 36 | IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, 37 | INCIDENTAL OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 38 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 39 | PROFITS; OR BUSINESS INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, 40 | REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, 41 | HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING 42 | NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN 43 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 44 | */ 45 | 46 | #import "MBCMoveTableView.h" 47 | 48 | @implementation MBCMoveTableView 49 | 50 | - (void)drawGridInClipRect:(NSRect)clipRect 51 | { 52 | fInGridDrawing = true; 53 | [super drawGridInClipRect:clipRect]; 54 | fInGridDrawing = false; 55 | } 56 | 57 | - (NSIndexSet *)columnIndexesInRect:(NSRect)rect 58 | { 59 | // 60 | // We only want to draw certain columns 61 | // 62 | NSIndexSet * origColumns = [super columnIndexesInRect:rect]; 63 | if (fInGridDrawing) { 64 | NSMutableIndexSet * filtered = [origColumns mutableCopy]; 65 | if ([[[[self tableColumns] objectAtIndex:0] identifier] isEqual:@"Move"]) { 66 | // 67 | // Left to right languages, move # is first 68 | // 69 | [filtered removeIndex:2]; 70 | [filtered removeIndex:3]; 71 | [filtered removeIndex:5]; 72 | [filtered removeIndex:6]; 73 | } else { 74 | // 75 | // Right to left languages, move # is last 76 | // 77 | [filtered removeIndex:1]; 78 | [filtered removeIndex:2]; 79 | [filtered removeIndex:4]; 80 | [filtered removeIndex:5]; 81 | } 82 | return [filtered autorelease]; 83 | } else { 84 | return origColumns; 85 | } 86 | } 87 | 88 | @end 89 | -------------------------------------------------------------------------------- /Sources/MBCMoveTableViewAccessibility.h: -------------------------------------------------------------------------------- 1 | /* 2 | File: MBCBoardViewDraw.h 3 | Contains: Accessibility navigation for chess board 4 | Copyright: � 2004 by Apple Inc., all rights reserved. 5 | 6 | IMPORTANT: This Apple software is supplied to you by Apple Computer, 7 | Inc. ("Apple") in consideration of your agreement to the following 8 | terms, and your use, installation, modification or redistribution of 9 | this Apple software constitutes acceptance of these terms. If you do 10 | not agree with these terms, please do not use, install, modify or 11 | redistribute this Apple software. 12 | 13 | In consideration of your agreement to abide by the following terms, 14 | and subject to these terms, Apple grants you a personal, non-exclusive 15 | license, under Apple's copyrights in this original Apple software (the 16 | "Apple Software"), to use, reproduce, modify and redistribute the 17 | Apple Software, with or without modifications, in source and/or binary 18 | forms; provided that if you redistribute the Apple Software in its 19 | entirety and without modifications, you must retain this notice and 20 | the following text and disclaimers in all such redistributions of the 21 | Apple Software. Neither the name, trademarks, service marks or logos 22 | of Apple Inc. may be used to endorse or promote products 23 | derived from the Apple Software without specific prior written 24 | permission from Apple. Except as expressly stated in this notice, no 25 | other rights or licenses, express or implied, are granted by Apple 26 | herein, including but not limited to any patent rights that may be 27 | infringed by your derivative works or by other works in which the 28 | Apple Software may be incorporated. 29 | 30 | The Apple Software is provided by Apple on an "AS IS" basis. APPLE 31 | MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION 32 | THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND 33 | FITNESS FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS 34 | USE AND OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. 35 | 36 | IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, 37 | INCIDENTAL OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 38 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 39 | PROFITS; OR BUSINESS INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, 40 | REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, 41 | HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING 42 | NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN 43 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 44 | */ 45 | 46 | #import "MBCGameInfo.h" 47 | 48 | @interface MBCMoveAccessibilityProxy : NSObject 49 | { 50 | @public 51 | MBCGameInfo * fInfo; 52 | int fMove; 53 | } 54 | 55 | + (id) proxyWithInfo:(MBCGameInfo *)info move:(int)move; 56 | - (id) initWithInfo:(MBCGameInfo *)info move:(int)move; 57 | 58 | @end 59 | 60 | // Local Variables: 61 | // mode:ObjC 62 | // End: 63 | -------------------------------------------------------------------------------- /Sources/MBCPlayer.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/Sources/MBCPlayer.h -------------------------------------------------------------------------------- /Sources/MBCPlayer.mm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/Sources/MBCPlayer.mm -------------------------------------------------------------------------------- /Sources/MBCRemotePlayer.h: -------------------------------------------------------------------------------- 1 | /* 2 | File: MBCRemotePlayer.h 3 | Contains: Proxy for GameKit remote player participating in game 4 | Copyright: © 2011 by Apple Inc., all rights reserved. 5 | 6 | IMPORTANT: This Apple software is supplied to you by Apple Computer, 7 | Inc. ("Apple") in consideration of your agreement to the following 8 | terms, and your use, installation, modification or redistribution of 9 | this Apple software constitutes acceptance of these terms. If you do 10 | not agree with these terms, please do not use, install, modify or 11 | redistribute this Apple software. 12 | 13 | In consideration of your agreement to abide by the following terms, 14 | and subject to these terms, Apple grants you a personal, non-exclusive 15 | license, under Apple's copyrights in this original Apple software (the 16 | "Apple Software"), to use, reproduce, modify and redistribute the 17 | Apple Software, with or without modifications, in source and/or binary 18 | forms; provided that if you redistribute the Apple Software in its 19 | entirety and without modifications, you must retain this notice and 20 | the following text and disclaimers in all such redistributions of the 21 | Apple Software. Neither the name, trademarks, service marks or logos 22 | of Apple Inc. may be used to endorse or promote products 23 | derived from the Apple Software without specific prior written 24 | permission from Apple. Except as expressly stated in this notice, no 25 | other rights or licenses, express or implied, are granted by Apple 26 | herein, including but not limited to any patent rights that may be 27 | infringed by your derivative works or by other works in which the 28 | Apple Software may be incorporated. 29 | 30 | The Apple Software is provided by Apple on an "AS IS" basis. APPLE 31 | MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION 32 | THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND 33 | FITNESS FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS 34 | USE AND OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. 35 | 36 | IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, 37 | INCIDENTAL OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 38 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 39 | PROFITS; OR BUSINESS INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, 40 | REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, 41 | HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING 42 | NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN 43 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 44 | */ 45 | 46 | #import 47 | 48 | #import "MBCPlayer.h" 49 | 50 | @interface MBCRemotePlayer : MBCPlayer { 51 | BOOL fHasObservers; 52 | } 53 | 54 | - (void) startGame:(MBCVariant)variant playing:(MBCSide)sideToPlay; 55 | 56 | @end 57 | 58 | // Local Variables: 59 | // mode:ObjC 60 | // End: 61 | -------------------------------------------------------------------------------- /Sources/MBCRemotePlayer.mm: -------------------------------------------------------------------------------- 1 | /* 2 | File: MBCRemotePlayer.mm 3 | Contains: Proxy for GameKit remote player participating in game 4 | Copyright: © 2011 by Apple Inc., all rights reserved. 5 | 6 | IMPORTANT: This Apple software is supplied to you by Apple Computer, 7 | Inc. ("Apple") in consideration of your agreement to the following 8 | terms, and your use, installation, modification or redistribution of 9 | this Apple software constitutes acceptance of these terms. If you do 10 | not agree with these terms, please do not use, install, modify or 11 | redistribute this Apple software. 12 | 13 | In consideration of your agreement to abide by the following terms, 14 | and subject to these terms, Apple grants you a personal, non-exclusive 15 | license, under Apple's copyrights in this original Apple software (the 16 | "Apple Software"), to use, reproduce, modify and redistribute the 17 | Apple Software, with or without modifications, in source and/or binary 18 | forms; provided that if you redistribute the Apple Software in its 19 | entirety and without modifications, you must retain this notice and 20 | the following text and disclaimers in all such redistributions of the 21 | Apple Software. Neither the name, trademarks, service marks or logos 22 | of Apple Inc. may be used to endorse or promote products 23 | derived from the Apple Software without specific prior written 24 | permission from Apple. Except as expressly stated in this notice, no 25 | other rights or licenses, express or implied, are granted by Apple 26 | herein, including but not limited to any patent rights that may be 27 | infringed by your derivative works or by other works in which the 28 | Apple Software may be incorporated. 29 | 30 | The Apple Software is provided by Apple on an "AS IS" basis. APPLE 31 | MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION 32 | THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND 33 | FITNESS FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS 34 | USE AND OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. 35 | 36 | IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, 37 | INCIDENTAL OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 38 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 39 | PROFITS; OR BUSINESS INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, 40 | REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, 41 | HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING 42 | NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN 43 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 44 | */ 45 | 46 | /* 47 | */ 48 | 49 | #import "MBCRemotePlayer.h" 50 | #import "MBCDocument.h" 51 | 52 | @implementation MBCRemotePlayer 53 | 54 | - (void) removeChessObservers 55 | { 56 | if (!fHasObservers) 57 | return; 58 | 59 | NSNotificationCenter * notificationCenter = [NSNotificationCenter defaultCenter]; 60 | [notificationCenter removeObserver:self name:MBCWhiteMoveNotification object:nil]; 61 | [notificationCenter removeObserver:self name:MBCBlackMoveNotification object:nil]; 62 | [notificationCenter removeObserver:self name:MBCGameEndNotification object:nil]; 63 | [notificationCenter removeObserver:self name:MBCTakebackNotification object:nil]; 64 | 65 | fHasObservers = NO; 66 | } 67 | 68 | - (void)dealloc 69 | { 70 | [self removeChessObservers]; 71 | [super dealloc]; 72 | } 73 | 74 | - (void) startGame:(MBCVariant)variant playing:(MBCSide)sideToPlay 75 | { 76 | [self removeChessObservers]; 77 | NSNotificationCenter * notificationCenter = [NSNotificationCenter defaultCenter]; 78 | switch (sideToPlay) { 79 | default: 80 | case kWhiteSide: 81 | [notificationCenter 82 | addObserver:self 83 | selector:@selector(opponentMoved:) 84 | name:MBCBlackMoveNotification 85 | object:fDocument]; 86 | break; 87 | case kBlackSide: 88 | [notificationCenter 89 | addObserver:self 90 | selector:@selector(opponentMoved:) 91 | name:MBCWhiteMoveNotification 92 | object:fDocument]; 93 | break; 94 | } 95 | [notificationCenter 96 | addObserver:self 97 | selector:@selector(takeback:) 98 | name:MBCTakebackNotification 99 | object:fDocument]; 100 | [notificationCenter 101 | addObserver:self 102 | selector:@selector(endOfGame:) 103 | name:MBCGameEndNotification 104 | object:fDocument]; 105 | fHasObservers = YES; 106 | } 107 | 108 | - (void)opponentMoved:(NSNotification *)n 109 | { 110 | dispatch_async(dispatch_get_main_queue(), ^{ 111 | [fDocument updateMatchForLocalMove]; 112 | }); 113 | } 114 | 115 | - (void)takeback:(NSNotification *)n 116 | { 117 | } 118 | 119 | - (void)endOfGame:(NSNotification *)n 120 | { 121 | dispatch_async(dispatch_get_main_queue(), ^{ 122 | [fDocument updateMatchForEndOfGame:((MBCMove *)[n userInfo])->fCommand]; 123 | }); 124 | } 125 | 126 | @end 127 | 128 | // Local Variables: 129 | // mode:ObjC 130 | // End: 131 | -------------------------------------------------------------------------------- /Sources/MBCStretchyTextCell.h: -------------------------------------------------------------------------------- 1 | /* 2 | File: MBCStretchyTextCell.h 3 | Contains: Text cell that can draw outside its boundary 4 | Copyright: © 2002-2011 by Apple Inc., all rights reserved. 5 | 6 | IMPORTANT: This Apple software is supplied to you by Apple Computer, 7 | Inc. ("Apple") in consideration of your agreement to the following 8 | terms, and your use, installation, modification or redistribution of 9 | this Apple software constitutes acceptance of these terms. If you do 10 | not agree with these terms, please do not use, install, modify or 11 | redistribute this Apple software. 12 | 13 | In consideration of your agreement to abide by the following terms, 14 | and subject to these terms, Apple grants you a personal, non-exclusive 15 | license, under Apple's copyrights in this original Apple software (the 16 | "Apple Software"), to use, reproduce, modify and redistribute the 17 | Apple Software, with or without modifications, in source and/or binary 18 | forms; provided that if you redistribute the Apple Software in its 19 | entirety and without modifications, you must retain this notice and 20 | the following text and disclaimers in all such redistributions of the 21 | Apple Software. Neither the name, trademarks, service marks or logos 22 | of Apple Inc. may be used to endorse or promote products 23 | derived from the Apple Software without specific prior written 24 | permission from Apple. Except as expressly stated in this notice, no 25 | other rights or licenses, express or implied, are granted by Apple 26 | herein, including but not limited to any patent rights that may be 27 | infringed by your derivative works or by other works in which the 28 | Apple Software may be incorporated. 29 | 30 | The Apple Software is provided by Apple on an "AS IS" basis. APPLE 31 | MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION 32 | THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND 33 | FITNESS FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS 34 | USE AND OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. 35 | 36 | IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, 37 | INCIDENTAL OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 38 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 39 | PROFITS; OR BUSINESS INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, 40 | REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, 41 | HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING 42 | NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN 43 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 44 | */ 45 | 46 | #import 47 | 48 | @interface MBCStretchyTextCell : NSTextFieldCell { 49 | } 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /Sources/MBCStretchyTextCell.mm: -------------------------------------------------------------------------------- 1 | /* 2 | File: MBCStretchyTextCell.mm 3 | Contains: Text cell that can draw outside its boundary 4 | Copyright: © 2002-2011 by Apple Inc., all rights reserved. 5 | 6 | IMPORTANT: This Apple software is supplied to you by Apple Computer, 7 | Inc. ("Apple") in consideration of your agreement to the following 8 | terms, and your use, installation, modification or redistribution of 9 | this Apple software constitutes acceptance of these terms. If you do 10 | not agree with these terms, please do not use, install, modify or 11 | redistribute this Apple software. 12 | 13 | In consideration of your agreement to abide by the following terms, 14 | and subject to these terms, Apple grants you a personal, non-exclusive 15 | license, under Apple's copyrights in this original Apple software (the 16 | "Apple Software"), to use, reproduce, modify and redistribute the 17 | Apple Software, with or without modifications, in source and/or binary 18 | forms; provided that if you redistribute the Apple Software in its 19 | entirety and without modifications, you must retain this notice and 20 | the following text and disclaimers in all such redistributions of the 21 | Apple Software. Neither the name, trademarks, service marks or logos 22 | of Apple Inc. may be used to endorse or promote products 23 | derived from the Apple Software without specific prior written 24 | permission from Apple. Except as expressly stated in this notice, no 25 | other rights or licenses, express or implied, are granted by Apple 26 | herein, including but not limited to any patent rights that may be 27 | infringed by your derivative works or by other works in which the 28 | Apple Software may be incorporated. 29 | 30 | The Apple Software is provided by Apple on an "AS IS" basis. APPLE 31 | MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION 32 | THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND 33 | FITNESS FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS 34 | USE AND OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. 35 | 36 | IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, 37 | INCIDENTAL OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 38 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 39 | PROFITS; OR BUSINESS INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, 40 | REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, 41 | HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING 42 | NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN 43 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 44 | */ 45 | 46 | #import "MBCStretchyTextCell.h" 47 | 48 | 49 | @implementation MBCStretchyTextCell 50 | 51 | - (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView *)controlView 52 | { 53 | if ([[self stringValue] length] > 2) { 54 | cellFrame.origin.x -= 50; 55 | cellFrame.size.width += 100; 56 | } else { 57 | cellFrame.origin.x -= 3; 58 | cellFrame.size.width += 6; 59 | } 60 | [super drawInteriorWithFrame:cellFrame inView:controlView]; 61 | } 62 | 63 | @end 64 | -------------------------------------------------------------------------------- /Sources/MBCTuner.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/Sources/MBCTuner.h -------------------------------------------------------------------------------- /Sources/MBCTuner.mm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/Sources/MBCTuner.mm -------------------------------------------------------------------------------- /Sources/MBCUserDefaults.h: -------------------------------------------------------------------------------- 1 | /* 2 | File: MBCUserDefaults.h 3 | Contains: User defaults keys 4 | Copyright: © 2002-2012 by Apple Inc., all rights reserved. 5 | 6 | IMPORTANT: This Apple software is supplied to you by Apple Computer, 7 | Inc. ("Apple") in consideration of your agreement to the following 8 | terms, and your use, installation, modification or redistribution of 9 | this Apple software constitutes acceptance of these terms. If you do 10 | not agree with these terms, please do not use, install, modify or 11 | redistribute this Apple software. 12 | 13 | In consideration of your agreement to abide by the following terms, 14 | and subject to these terms, Apple grants you a personal, non-exclusive 15 | license, under Apple's copyrights in this original Apple software (the 16 | "Apple Software"), to use, reproduce, modify and redistribute the 17 | Apple Software, with or without modifications, in source and/or binary 18 | forms; provided that if you redistribute the Apple Software in its 19 | entirety and without modifications, you must retain this notice and 20 | the following text and disclaimers in all such redistributions of the 21 | Apple Software. Neither the name, trademarks, service marks or logos 22 | of Apple Inc. may be used to endorse or promote products 23 | derived from the Apple Software without specific prior written 24 | permission from Apple. Except as expressly stated in this notice, no 25 | other rights or licenses, express or implied, are granted by Apple 26 | herein, including but not limited to any patent rights that may be 27 | infringed by your derivative works or by other works in which the 28 | Apple Software may be incorporated. 29 | 30 | The Apple Software is provided by Apple on an "AS IS" basis. APPLE 31 | MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION 32 | THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND 33 | FITNESS FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS 34 | USE AND OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. 35 | 36 | IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, 37 | INCIDENTAL OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 38 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 39 | PROFITS; OR BUSINESS INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, 40 | REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, 41 | HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING 42 | NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN 43 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 44 | */ 45 | 46 | #import 47 | 48 | extern NSString * const kMBCBoardStyle; 49 | extern NSString * const kMBCListenForMoves; 50 | extern NSString * const kMBCPieceStyle; 51 | extern NSString * const kMBCNewGamePlayers; 52 | extern NSString * const kMBCNewGameVariant; 53 | extern NSString * const kMBCNewGameSides; 54 | extern NSString * const kMBCSearchTime; 55 | extern NSString * const kMBCMinSearchTime; 56 | extern NSString * const kMBCSpeakMoves; 57 | extern NSString * const kMBCSpeakHumanMoves; 58 | extern NSString * const kMBCDefaultVoice; 59 | extern NSString * const kMBCAlternateVoice; 60 | extern NSString * const kMBCGameCity; 61 | extern NSString * const kMBCGameCountry; 62 | extern NSString * const kMBCGameEvent; 63 | extern NSString * const kMBCHumanName; 64 | extern NSString * const kMBCBattleScars; 65 | extern NSString * const kMBCBoardAngle; 66 | extern NSString * const kMBCBoardSpin; 67 | extern NSString * const kMBCCastleSides; 68 | extern NSString * const kMBCGCVictories; 69 | extern NSString * const kMBCShowGameLog; 70 | -------------------------------------------------------------------------------- /Sources/MBCUserDefaults.mm: -------------------------------------------------------------------------------- 1 | /* 2 | File: MBCUserDefaults.mm 3 | Contains: User defaults keys 4 | Copyright: © 2002-2012 by Apple Inc., all rights reserved. 5 | 6 | IMPORTANT: This Apple software is supplied to you by Apple Computer, 7 | Inc. ("Apple") in consideration of your agreement to the following 8 | terms, and your use, installation, modification or redistribution of 9 | this Apple software constitutes acceptance of these terms. If you do 10 | not agree with these terms, please do not use, install, modify or 11 | redistribute this Apple software. 12 | 13 | In consideration of your agreement to abide by the following terms, 14 | and subject to these terms, Apple grants you a personal, non-exclusive 15 | license, under Apple's copyrights in this original Apple software (the 16 | "Apple Software"), to use, reproduce, modify and redistribute the 17 | Apple Software, with or without modifications, in source and/or binary 18 | forms; provided that if you redistribute the Apple Software in its 19 | entirety and without modifications, you must retain this notice and 20 | the following text and disclaimers in all such redistributions of the 21 | Apple Software. Neither the name, trademarks, service marks or logos 22 | of Apple Inc. may be used to endorse or promote products 23 | derived from the Apple Software without specific prior written 24 | permission from Apple. Except as expressly stated in this notice, no 25 | other rights or licenses, express or implied, are granted by Apple 26 | herein, including but not limited to any patent rights that may be 27 | infringed by your derivative works or by other works in which the 28 | Apple Software may be incorporated. 29 | 30 | The Apple Software is provided by Apple on an "AS IS" basis. APPLE 31 | MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION 32 | THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND 33 | FITNESS FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS 34 | USE AND OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. 35 | 36 | IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, 37 | INCIDENTAL OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 38 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 39 | PROFITS; OR BUSINESS INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, 40 | REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, 41 | HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING 42 | NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN 43 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 44 | */ 45 | 46 | #import 47 | 48 | #import "MBCUserDefaults.h" 49 | 50 | NSString * const kMBCBoardStyle = @"MBCBoardStyle"; 51 | NSString * const kMBCListenForMoves = @"MBCListenForMoves"; 52 | NSString * const kMBCPieceStyle = @"MBCPieceStyle"; 53 | NSString * const kMBCNewGamePlayers = @"MBCNewGamePlayers"; 54 | NSString * const kMBCNewGameVariant = @"MBCNewGameVariant"; 55 | NSString * const kMBCNewGameSides = @"MBCNewGameSides"; 56 | NSString * const kMBCSearchTime = @"MBCSearchTime"; 57 | NSString * const kMBCMinSearchTime = @"MBCMinSearchTime"; 58 | NSString * const kMBCSpeakMoves = @"MBCSpeakMoves"; 59 | NSString * const kMBCSpeakHumanMoves = @"MBCSpeakHumanMoves"; 60 | NSString * const kMBCDefaultVoice = @"MBCDefaultVoice"; 61 | NSString * const kMBCAlternateVoice = @"MBCAlternateVoice"; 62 | NSString * const kMBCGameCity = @"MBCGameCity"; 63 | NSString * const kMBCGameCountry = @"MBCGameCountry"; 64 | NSString * const kMBCGameEvent = @"MBCGameEvent"; 65 | NSString * const kMBCHumanName = @"MBCHumanName"; 66 | NSString * const kMBCBattleScars = @"MBCBattleScars"; 67 | NSString * const kMBCBoardAngle = @"MBCBoardAngle"; 68 | NSString * const kMBCBoardSpin = @"MBCBoardSpin"; 69 | NSString * const kMBCCastleSides = @"MBCCastleSides"; 70 | NSString * const kMBCGCVictories = @"MBCGCVictories"; 71 | NSString * const kMBCShowGameLog = @"MBCShowGameLog"; 72 | 73 | -------------------------------------------------------------------------------- /Sources/main.mm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/Sources/main.mm -------------------------------------------------------------------------------- /Styles/Fur/BlackPiece.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/Styles/Fur/BlackPiece.png -------------------------------------------------------------------------------- /Styles/Fur/BlackPiece@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/Styles/Fur/BlackPiece@2x.png -------------------------------------------------------------------------------- /Styles/Fur/Piece.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BlackAlpha 6 | 1 7 | BlackDiffuse 8 | 0.6798245906829834 9 | BlackShininess 10 | 74.666664123535156 11 | BlackSpecular 12 | 0.36403509974479675 13 | WhiteAlpha 14 | 1 15 | WhiteDiffuse 16 | 0.53947371244430542 17 | WhiteShininess 18 | 60.070175170898438 19 | WhiteSpecular 20 | 0.20614035427570343 21 | 22 | 23 | -------------------------------------------------------------------------------- /Styles/Fur/WhitePiece.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/Styles/Fur/WhitePiece.png -------------------------------------------------------------------------------- /Styles/Fur/WhitePiece@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/Styles/Fur/WhitePiece@2x.png -------------------------------------------------------------------------------- /Styles/Grass/BlackBoard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/Styles/Grass/BlackBoard.png -------------------------------------------------------------------------------- /Styles/Grass/BlackBoard@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/Styles/Grass/BlackBoard@2x.png -------------------------------------------------------------------------------- /Styles/Grass/Board.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BlackAlpha 6 | 1 7 | BlackDiffuse 8 | 0.61842107772827148 9 | BlackShininess 10 | 24.140350341796875 11 | BlackSpecular 12 | 0.065789476037025452 13 | BorderAlpha 14 | 1 15 | BorderDiffuse 16 | 0.58333331346511841 17 | BorderShininess 18 | 60.070175170898438 19 | BorderSpecular 20 | 0.18859648704528809 21 | LabelIntensity 22 | 0.65350878238677979 23 | Reflectivity 24 | 0.0 25 | WhiteAlpha 26 | 1 27 | WhiteDiffuse 28 | 0.6798245906829834 29 | WhiteShininess 30 | 27.508771896362305 31 | WhiteSpecular 32 | 0.36403509974479675 33 | 34 | 35 | -------------------------------------------------------------------------------- /Styles/Grass/Border.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/Styles/Grass/Border.png -------------------------------------------------------------------------------- /Styles/Grass/Border@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/Styles/Grass/Border@2x.png -------------------------------------------------------------------------------- /Styles/Grass/WhiteBoard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/Styles/Grass/WhiteBoard.png -------------------------------------------------------------------------------- /Styles/Grass/WhiteBoard@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/Styles/Grass/WhiteBoard@2x.png -------------------------------------------------------------------------------- /Styles/Marble/BlackBoard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/Styles/Marble/BlackBoard.png -------------------------------------------------------------------------------- /Styles/Marble/BlackBoard@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/Styles/Marble/BlackBoard@2x.png -------------------------------------------------------------------------------- /Styles/Marble/BlackPiece.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/Styles/Marble/BlackPiece.png -------------------------------------------------------------------------------- /Styles/Marble/BlackPiece@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/Styles/Marble/BlackPiece@2x.png -------------------------------------------------------------------------------- /Styles/Marble/Board.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BlackAlpha 6 | 1 7 | BlackDiffuse 8 | 0.2850877046585083 9 | BlackShininess 10 | 25.263158798217773 11 | BlackSpecular 12 | 0.21491228044033051 13 | BorderAlpha 14 | 1 15 | BorderDiffuse 16 | 0.73245614767074585 17 | BorderShininess 18 | 0.0 19 | BorderSpecular 20 | 0.0 21 | LabelIntensity 22 | 0.61842107772827148 23 | Reflectivity 24 | 0.62719297409057617 25 | WhiteAlpha 26 | 1 27 | WhiteDiffuse 28 | 1 29 | WhiteShininess 30 | 78.035087585449219 31 | WhiteSpecular 32 | 0.76754385232925415 33 | 34 | 35 | -------------------------------------------------------------------------------- /Styles/Marble/Border.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/Styles/Marble/Border.png -------------------------------------------------------------------------------- /Styles/Marble/Border@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/Styles/Marble/Border@2x.png -------------------------------------------------------------------------------- /Styles/Marble/Piece.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BlackAlpha 6 | 1 7 | BlackDiffuse 8 | 0.66228067874908447 9 | BlackShininess 10 | 3.9298245906829834 11 | BlackSpecular 12 | 0.52192980051040649 13 | WhiteAlpha 14 | 1 15 | WhiteDiffuse 16 | 1 17 | WhiteShininess 18 | 1.6842105388641357 19 | WhiteSpecular 20 | 0.30263158679008484 21 | 22 | 23 | -------------------------------------------------------------------------------- /Styles/Marble/WhiteBoard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/Styles/Marble/WhiteBoard.png -------------------------------------------------------------------------------- /Styles/Marble/WhiteBoard@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/Styles/Marble/WhiteBoard@2x.png -------------------------------------------------------------------------------- /Styles/Marble/WhitePiece.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/Styles/Marble/WhitePiece.png -------------------------------------------------------------------------------- /Styles/Marble/WhitePiece@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/Styles/Marble/WhitePiece@2x.png -------------------------------------------------------------------------------- /Styles/Metal/BlackBoard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/Styles/Metal/BlackBoard.png -------------------------------------------------------------------------------- /Styles/Metal/BlackBoard@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/Styles/Metal/BlackBoard@2x.png -------------------------------------------------------------------------------- /Styles/Metal/BlackPiece.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/Styles/Metal/BlackPiece.png -------------------------------------------------------------------------------- /Styles/Metal/BlackPiece@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/Styles/Metal/BlackPiece@2x.png -------------------------------------------------------------------------------- /Styles/Metal/Board.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BlackAlpha 6 | 1 7 | BlackDiffuse 8 | 0.51315790414810181 9 | BlackShininess 10 | 21.894737243652344 11 | BlackSpecular 12 | 0.25 13 | BorderAlpha 14 | 1 15 | BorderDiffuse 16 | 0.66228067874908447 17 | BorderShininess 18 | 81.403511047363281 19 | BorderSpecular 20 | 0.22368420660495758 21 | LabelIntensity 22 | 0.89035087823867798 23 | Reflectivity 24 | 0.69736844301223755 25 | WhiteAlpha 26 | 1 27 | WhiteDiffuse 28 | 0.61842107772827148 29 | WhiteShininess 30 | 40.982456207275391 31 | WhiteSpecular 32 | 0.44298246502876282 33 | 34 | 35 | -------------------------------------------------------------------------------- /Styles/Metal/Border.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/Styles/Metal/Border.png -------------------------------------------------------------------------------- /Styles/Metal/Border@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/Styles/Metal/Border@2x.png -------------------------------------------------------------------------------- /Styles/Metal/Piece.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BlackAlpha 6 | 1 7 | BlackDiffuse 8 | 0.0 9 | BlackShininess 10 | 7.2982454299926758 11 | BlackSpecular 12 | 0.82894736528396606 13 | WhiteAlpha 14 | 1 15 | WhiteDiffuse 16 | 0.79385966062545776 17 | WhiteShininess 18 | 17.403509140014648 19 | WhiteSpecular 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Styles/Metal/WhiteBoard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/Styles/Metal/WhiteBoard.png -------------------------------------------------------------------------------- /Styles/Metal/WhiteBoard@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/Styles/Metal/WhiteBoard@2x.png -------------------------------------------------------------------------------- /Styles/Metal/WhitePiece.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/Styles/Metal/WhitePiece.png -------------------------------------------------------------------------------- /Styles/Metal/WhitePiece@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/Styles/Metal/WhitePiece@2x.png -------------------------------------------------------------------------------- /Styles/Wood/BlackBoard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/Styles/Wood/BlackBoard.png -------------------------------------------------------------------------------- /Styles/Wood/BlackBoard@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/Styles/Wood/BlackBoard@2x.png -------------------------------------------------------------------------------- /Styles/Wood/BlackPiece.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/Styles/Wood/BlackPiece.png -------------------------------------------------------------------------------- /Styles/Wood/BlackPiece@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/Styles/Wood/BlackPiece@2x.png -------------------------------------------------------------------------------- /Styles/Wood/Board.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BlackAlpha 6 | 1 7 | BlackDiffuse 8 | 0.61842107772827148 9 | BlackShininess 10 | 5 11 | BlackSpecular 12 | 0.17982456088066101 13 | BorderAlpha 14 | 1 15 | BorderDiffuse 16 | 0.6798245906829834 17 | BorderShininess 18 | 36.491226196289062 19 | BorderSpecular 20 | 0.20000000298023224 21 | LabelIntensity 22 | 0.89912283420562744 23 | Reflectivity 24 | 0.48684209585189819 25 | WhiteAlpha 26 | 1 27 | WhiteDiffuse 28 | 0.75 29 | WhiteShininess 30 | 5 31 | WhiteSpecular 32 | 0.20000000298023224 33 | 34 | 35 | -------------------------------------------------------------------------------- /Styles/Wood/Border.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/Styles/Wood/Border.png -------------------------------------------------------------------------------- /Styles/Wood/Border@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/Styles/Wood/Border@2x.png -------------------------------------------------------------------------------- /Styles/Wood/Piece.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BlackAlpha 6 | 1 7 | BlackDiffuse 8 | 0.66228067874908447 9 | BlackShininess 10 | 10.666666984558105 11 | BlackSpecular 12 | 0.43421053886413574 13 | WhiteAlpha 14 | 1 15 | WhiteDiffuse 16 | 0.75 17 | WhiteShininess 18 | 75.789474487304688 19 | WhiteSpecular 20 | 0.46052631735801697 21 | 22 | 23 | -------------------------------------------------------------------------------- /Styles/Wood/WhiteBoard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/Styles/Wood/WhiteBoard.png -------------------------------------------------------------------------------- /Styles/Wood/WhitePiece.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/Styles/Wood/WhitePiece.png -------------------------------------------------------------------------------- /Textures/Lettering.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/Textures/Lettering.png -------------------------------------------------------------------------------- /Textures/Lettering_Blur.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/Textures/Lettering_Blur.png -------------------------------------------------------------------------------- /Textures/selected_piece_texture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/Textures/selected_piece_texture.png -------------------------------------------------------------------------------- /Textures/selected_piece_texture@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unofficial-opensource-apple/Chess/311c6ceff8aa87444a5b9b157ab7854557a76805/Textures/selected_piece_texture@2x.png -------------------------------------------------------------------------------- /contributors: -------------------------------------------------------------------------------- 1 | neeri:Matthias Neeracher x43683 2 | -------------------------------------------------------------------------------- /sjeng/AUTHORS: -------------------------------------------------------------------------------- 1 | Sjeng is written by Gian-Carlo Pascutto (gcp@sjeng.org), 2 | based on work done by Adrien Regimbald (adrien@gpu.srv.ualberta.ca) 3 | -------------------------------------------------------------------------------- /sjeng/BUGS: -------------------------------------------------------------------------------- 1 | ------------------------------------------ 2 | Please submit bug reports to gcp@sjeng.org 3 | ------------------------------------------ 4 | 5 | KNOWN 6 | ----- 7 | 8 | Trouble detecting variants and partner tells on chess.net. This is 9 | an XBoard/WinBoard Zippy problem, not related to Sjeng itself. 10 | 11 | The 'ping' command interrupts the search. 12 | 13 | 'white' and 'black' do not always work as intended. 14 | 15 | A condition which ends the game will stop the program when in analysis 16 | mode. 17 | 18 | Loses sometimes. 19 | -------------------------------------------------------------------------------- /sjeng/INSTALL: -------------------------------------------------------------------------------- 1 | Basic Installation 2 | ================== 3 | 4 | These are generic installation instructions. 5 | 6 | The `configure' shell script attempts to guess correct values for 7 | various system-dependent variables used during compilation. It uses 8 | those values to create a `Makefile' in each directory of the package. 9 | It may also create one or more `.h' files containing system-dependent 10 | definitions. Finally, it creates a shell script `config.status' that 11 | you can run in the future to recreate the current configuration, a file 12 | `config.cache' that saves the results of its tests to speed up 13 | reconfiguring, and a file `config.log' containing compiler output 14 | (useful mainly for debugging `configure'). 15 | 16 | If you need to do unusual things to compile the package, please try 17 | to figure out how `configure' could check whether to do them, and mail 18 | diffs or instructions to the address given in the `README' so they can 19 | be considered for the next release. If at some point `config.cache' 20 | contains results you don't want to keep, you may remove or edit it. 21 | 22 | The file `configure.in' is used to create `configure' by a program 23 | called `autoconf'. You only need `configure.in' if you want to change 24 | it or regenerate `configure' using a newer version of `autoconf'. 25 | 26 | The simplest way to compile this package is: 27 | 28 | 1. `cd' to the directory containing the package's source code and type 29 | `./configure' to configure the package for your system. If you're 30 | using `csh' on an old version of System V, you might need to type 31 | `sh ./configure' instead to prevent `csh' from trying to execute 32 | `configure' itself. 33 | 34 | Running `configure' takes awhile. While running, it prints some 35 | messages telling which features it is checking for. 36 | 37 | 2. Type `make' to compile the package. 38 | 39 | 3. Optionally, type `make check' to run any self-tests that come with 40 | the package. 41 | 42 | 4. Type `make install' to install the programs and any data files and 43 | documentation. 44 | 45 | 5. You can remove the program binaries and object files from the 46 | source code directory by typing `make clean'. To also remove the 47 | files that `configure' created (so you can compile the package for 48 | a different kind of computer), type `make distclean'. There is 49 | also a `make maintainer-clean' target, but that is intended mainly 50 | for the package's developers. If you use it, you may have to get 51 | all sorts of other programs in order to regenerate files that came 52 | with the distribution. 53 | -------------------------------------------------------------------------------- /sjeng/Makefile.am: -------------------------------------------------------------------------------- 1 | noinst_PROGRAMS = sjeng 2 | sjeng_SOURCES = attacks.c crazy.c epd.c learn.c partner.c seval.c \ 3 | ttable.c book.c ecache.c eval.c moves.c search.c \ 4 | sjeng.c utils.c newbook.c proof.c neval.c rcfile.c\ 5 | leval.c draw.c see.c segtb.c\ 6 | protos.h extvars.h sjeng.h squares.h 7 | EXTRA_DIST = TODO NEWS ChangeLog COPYING BUGS THANKS blob2.c sjeng.rc 8 | SUBDIRS = . books tests 9 | 10 | # 11 | # Strip before installing 12 | # 13 | install-exec-local: 14 | strip sjeng 15 | 16 | # 17 | # Ignore whatever other target ProjectBuilder throws at us 18 | # 19 | .DEFAULT: 20 | @echo "Ignoring request for unknown target" $@ 21 | -------------------------------------------------------------------------------- /sjeng/THANKS: -------------------------------------------------------------------------------- 1 | The following people helped a lot during Sjeng 2 | development, either by testing, giving usefull 3 | suggestions or contributing code: 4 | 5 | Adrien Regimbald 6 | Daniel Clausen 7 | Dann Corbit 8 | Lenny Taelman 9 | David Dawson 10 | Ben Nye (aka angrim@FICS) 11 | Ronald De Man (aka Syzygy@FICS) 12 | Eugene Nalimov -------------------------------------------------------------------------------- /sjeng/TODO: -------------------------------------------------------------------------------- 1 | TODO 2 | 3 | Nothing. This thing is getting messier, buggier, 4 | slower and less maintainable with each release. 5 | 6 | Time to move on. 7 | -------------------------------------------------------------------------------- /sjeng/blob2.c: -------------------------------------------------------------------------------- 1 | /* Compile this file for a faster Sjeng */ 2 | 3 | /* e.g. gcc -O9 -lgdbm -o sjeng blob2.c */ 4 | 5 | #include "rcfile.c" 6 | #include "attacks.c" 7 | #include "book.c" 8 | #include "crazy.c" 9 | #include "epd.c" 10 | #include "learn.c" 11 | #include "newbook.c" 12 | #include "partner.c" 13 | #include "moves.c" 14 | #include "ttable.c" 15 | #include "ecache.c" 16 | #include "draw.c" 17 | #include "see.c" 18 | #include "search.c" 19 | #include "seval.c" 20 | #include "neval.c" 21 | #include "eval.c" 22 | #include "sjeng.c" 23 | #include "utils.c" 24 | #include "proof.c" 25 | #include "leval.c" 26 | #include "segtb.c" 27 | 28 | -------------------------------------------------------------------------------- /sjeng/books/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile.in generated by automake 1.6.3 from Makefile.am. 2 | # books/Makefile. Generated from Makefile.in by configure. 3 | 4 | # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 5 | # Free Software Foundation, Inc. 6 | # This Makefile.in is free software; the Free Software Foundation 7 | # gives unlimited permission to copy and/or distribute it, 8 | # with or without modifications, as long as this notice is preserved. 9 | 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY, to the extent permitted by law; without 12 | # even the implied warranty of MERCHANTABILITY or FITNESS FOR A 13 | # PARTICULAR PURPOSE. 14 | 15 | 16 | SHELL = /bin/sh 17 | 18 | srcdir = . 19 | top_srcdir = .. 20 | 21 | prefix = /usr/local 22 | exec_prefix = ${prefix} 23 | 24 | bindir = ${exec_prefix}/bin 25 | sbindir = ${exec_prefix}/sbin 26 | libexecdir = ${exec_prefix}/libexec 27 | datadir = ${prefix}/share 28 | sysconfdir = ${prefix}/etc 29 | sharedstatedir = ${prefix}/com 30 | localstatedir = ${prefix}/var 31 | libdir = ${exec_prefix}/lib 32 | infodir = ${prefix}/info 33 | mandir = ${prefix}/man 34 | includedir = ${prefix}/include 35 | oldincludedir = /usr/include 36 | pkgdatadir = $(datadir)/Sjeng-Free 37 | pkglibdir = $(libdir)/Sjeng-Free 38 | pkgincludedir = $(includedir)/Sjeng-Free 39 | top_builddir = .. 40 | 41 | ACLOCAL = aclocal-1.6 42 | AUTOCONF = autoconf 43 | AUTOMAKE = automake-1.6 44 | AUTOHEADER = autoheader 45 | 46 | am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 47 | INSTALL = /sw/bin/install -c 48 | INSTALL_PROGRAM = ${INSTALL} 49 | INSTALL_DATA = ${INSTALL} -m 644 50 | install_sh_DATA = $(install_sh) -c -m 644 51 | install_sh_PROGRAM = $(install_sh) -c 52 | install_sh_SCRIPT = $(install_sh) -c 53 | INSTALL_SCRIPT = ${INSTALL} 54 | INSTALL_HEADER = $(INSTALL_DATA) 55 | transform = s,x,x, 56 | NORMAL_INSTALL = : 57 | PRE_INSTALL = : 58 | POST_INSTALL = : 59 | NORMAL_UNINSTALL = : 60 | PRE_UNINSTALL = : 61 | POST_UNINSTALL = : 62 | 63 | EXEEXT = 64 | OBJEXT = o 65 | PATH_SEPARATOR = : 66 | AMTAR = tar 67 | AWK = gawk 68 | CC = gcc 69 | CXX = g++ 70 | DEPDIR = .deps 71 | INSTALL_STRIP_PROGRAM = ${SHELL} $(install_sh) -c -s 72 | PACKAGE = Sjeng-Free 73 | STRIP = 74 | VERSION = 11.2 75 | am__include = include 76 | am__quote = 77 | install_sh = $(top_builddir)/install-sh 78 | noinst_DIST = bug.opn suicide.opn losers.opn 79 | noinst_DATA = nbook.db zbook.db 80 | subdir = books 81 | mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs 82 | CONFIG_HEADER = $(top_builddir)/config.h 83 | CONFIG_CLEAN_FILES = 84 | depcomp = 85 | am__depfiles_maybe = 86 | DIST_SOURCES = 87 | DATA = $(noinst_DATA) 88 | 89 | DIST_COMMON = Makefile.am Makefile.in 90 | all: all-am 91 | 92 | .SUFFIXES: 93 | uninstall-info-am: 94 | tags: TAGS 95 | TAGS: 96 | 97 | DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 98 | 99 | top_distdir = .. 100 | distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) 101 | 102 | distdir: $(DISTFILES) 103 | @list='$(DISTFILES)'; for file in $$list; do \ 104 | if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ 105 | dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ 106 | if test "$$dir" != "$$file" && test "$$dir" != "."; then \ 107 | dir="/$$dir"; \ 108 | $(mkinstalldirs) "$(distdir)$$dir"; \ 109 | else \ 110 | dir=''; \ 111 | fi; \ 112 | if test -d $$d/$$file; then \ 113 | if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ 114 | cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ 115 | fi; \ 116 | cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ 117 | else \ 118 | test -f $(distdir)/$$file \ 119 | || cp -p $$d/$$file $(distdir)/$$file \ 120 | || exit 1; \ 121 | fi; \ 122 | done 123 | check-am: all-am 124 | check: check-am 125 | all-am: Makefile $(DATA) 126 | 127 | installdirs: 128 | 129 | install: install-am 130 | install-exec: install-exec-am 131 | install-data: install-data-am 132 | uninstall: uninstall-am 133 | 134 | install-am: all-am 135 | @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am 136 | 137 | installcheck: installcheck-am 138 | install-strip: 139 | $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ 140 | INSTALL_STRIP_FLAG=-s \ 141 | `test -z '$(STRIP)' || \ 142 | echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 143 | mostlyclean-generic: 144 | 145 | clean-generic: 146 | 147 | distclean-generic: 148 | -rm -f Makefile $(CONFIG_CLEAN_FILES) 149 | 150 | maintainer-clean-generic: 151 | @echo "This command is intended for maintainers to use" 152 | @echo "it deletes files that may require special tools to rebuild." 153 | clean: clean-am 154 | 155 | clean-am: clean-generic mostlyclean-am 156 | 157 | distclean: distclean-am 158 | 159 | distclean-am: clean-am distclean-generic 160 | 161 | dvi: dvi-am 162 | 163 | dvi-am: 164 | 165 | info: info-am 166 | 167 | info-am: 168 | 169 | install-data-am: 170 | 171 | install-exec-am: 172 | 173 | install-info: install-info-am 174 | 175 | install-man: 176 | 177 | installcheck-am: 178 | 179 | maintainer-clean: maintainer-clean-am 180 | 181 | maintainer-clean-am: distclean-am maintainer-clean-generic 182 | 183 | mostlyclean: mostlyclean-am 184 | 185 | mostlyclean-am: mostlyclean-generic 186 | 187 | uninstall-am: uninstall-info-am 188 | 189 | .PHONY: all all-am check check-am clean clean-generic distclean \ 190 | distclean-generic distdir dvi dvi-am info info-am install \ 191 | install-am install-data install-data-am install-exec \ 192 | install-exec-am install-info install-info-am install-man \ 193 | install-strip installcheck installcheck-am installdirs \ 194 | maintainer-clean maintainer-clean-generic mostlyclean \ 195 | mostlyclean-generic uninstall uninstall-am uninstall-info-am 196 | 197 | 198 | nbook.db: nbook.pgn 199 | ./build-book normal $< 200 | 201 | zbook.db: zhbook.pgn 202 | ./build-book crazyhouse $< 203 | 204 | # 205 | # Ignore whatever other target ProjectBuilder throws at us 206 | # 207 | .DEFAULT: 208 | @echo "Ignoring request for unknown target" $@ 209 | # Tell versions [3.59,3.63) of GNU make to not export all variables. 210 | # Otherwise a system limit (for SysV at least) may be exceeded. 211 | .NOEXPORT: 212 | -------------------------------------------------------------------------------- /sjeng/books/Makefile.am: -------------------------------------------------------------------------------- 1 | noinst_DIST = bug.opn suicide.opn losers.opn 2 | noinst_DATA = nbook.db zbook.db 3 | 4 | nbook.db: nbook.pgn 5 | ./build-book normal $< 6 | 7 | zbook.db: zhbook.pgn 8 | ./build-book crazyhouse $< 9 | 10 | # 11 | # Ignore whatever other target ProjectBuilder throws at us 12 | # 13 | .DEFAULT: 14 | @echo "Ignoring request for unknown target" $@ 15 | -------------------------------------------------------------------------------- /sjeng/books/Makefile.in: -------------------------------------------------------------------------------- 1 | # Makefile.in generated by automake 1.6.3 from Makefile.am. 2 | # @configure_input@ 3 | 4 | # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 5 | # Free Software Foundation, Inc. 6 | # This Makefile.in is free software; the Free Software Foundation 7 | # gives unlimited permission to copy and/or distribute it, 8 | # with or without modifications, as long as this notice is preserved. 9 | 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY, to the extent permitted by law; without 12 | # even the implied warranty of MERCHANTABILITY or FITNESS FOR A 13 | # PARTICULAR PURPOSE. 14 | 15 | @SET_MAKE@ 16 | SHELL = @SHELL@ 17 | 18 | srcdir = @srcdir@ 19 | top_srcdir = @top_srcdir@ 20 | VPATH = @srcdir@ 21 | prefix = @prefix@ 22 | exec_prefix = @exec_prefix@ 23 | 24 | bindir = @bindir@ 25 | sbindir = @sbindir@ 26 | libexecdir = @libexecdir@ 27 | datadir = @datadir@ 28 | sysconfdir = @sysconfdir@ 29 | sharedstatedir = @sharedstatedir@ 30 | localstatedir = @localstatedir@ 31 | libdir = @libdir@ 32 | infodir = @infodir@ 33 | mandir = @mandir@ 34 | includedir = @includedir@ 35 | oldincludedir = /usr/include 36 | pkgdatadir = $(datadir)/@PACKAGE@ 37 | pkglibdir = $(libdir)/@PACKAGE@ 38 | pkgincludedir = $(includedir)/@PACKAGE@ 39 | top_builddir = .. 40 | 41 | ACLOCAL = @ACLOCAL@ 42 | AUTOCONF = @AUTOCONF@ 43 | AUTOMAKE = @AUTOMAKE@ 44 | AUTOHEADER = @AUTOHEADER@ 45 | 46 | am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 47 | INSTALL = @INSTALL@ 48 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ 49 | INSTALL_DATA = @INSTALL_DATA@ 50 | install_sh_DATA = $(install_sh) -c -m 644 51 | install_sh_PROGRAM = $(install_sh) -c 52 | install_sh_SCRIPT = $(install_sh) -c 53 | INSTALL_SCRIPT = @INSTALL_SCRIPT@ 54 | INSTALL_HEADER = $(INSTALL_DATA) 55 | transform = @program_transform_name@ 56 | NORMAL_INSTALL = : 57 | PRE_INSTALL = : 58 | POST_INSTALL = : 59 | NORMAL_UNINSTALL = : 60 | PRE_UNINSTALL = : 61 | POST_UNINSTALL = : 62 | 63 | EXEEXT = @EXEEXT@ 64 | OBJEXT = @OBJEXT@ 65 | PATH_SEPARATOR = @PATH_SEPARATOR@ 66 | AMTAR = @AMTAR@ 67 | AWK = @AWK@ 68 | CC = @CC@ 69 | CXX = @CXX@ 70 | DEPDIR = @DEPDIR@ 71 | INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ 72 | PACKAGE = @PACKAGE@ 73 | STRIP = @STRIP@ 74 | VERSION = @VERSION@ 75 | am__include = @am__include@ 76 | am__quote = @am__quote@ 77 | install_sh = @install_sh@ 78 | noinst_DIST = bug.opn suicide.opn losers.opn 79 | noinst_DATA = nbook.db zbook.db 80 | subdir = books 81 | mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs 82 | CONFIG_HEADER = $(top_builddir)/config.h 83 | CONFIG_CLEAN_FILES = 84 | depcomp = 85 | am__depfiles_maybe = 86 | DIST_SOURCES = 87 | DATA = $(noinst_DATA) 88 | 89 | DIST_COMMON = Makefile.am Makefile.in 90 | all: all-am 91 | 92 | .SUFFIXES: 93 | $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) 94 | cd $(top_srcdir) && \ 95 | $(AUTOMAKE) --gnu --ignore-deps books/Makefile 96 | Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status 97 | cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) 98 | uninstall-info-am: 99 | tags: TAGS 100 | TAGS: 101 | 102 | DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 103 | 104 | top_distdir = .. 105 | distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) 106 | 107 | distdir: $(DISTFILES) 108 | @list='$(DISTFILES)'; for file in $$list; do \ 109 | if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ 110 | dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ 111 | if test "$$dir" != "$$file" && test "$$dir" != "."; then \ 112 | dir="/$$dir"; \ 113 | $(mkinstalldirs) "$(distdir)$$dir"; \ 114 | else \ 115 | dir=''; \ 116 | fi; \ 117 | if test -d $$d/$$file; then \ 118 | if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ 119 | cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ 120 | fi; \ 121 | cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ 122 | else \ 123 | test -f $(distdir)/$$file \ 124 | || cp -p $$d/$$file $(distdir)/$$file \ 125 | || exit 1; \ 126 | fi; \ 127 | done 128 | check-am: all-am 129 | check: check-am 130 | all-am: Makefile $(DATA) 131 | 132 | installdirs: 133 | 134 | install: install-am 135 | install-exec: install-exec-am 136 | install-data: install-data-am 137 | uninstall: uninstall-am 138 | 139 | install-am: all-am 140 | @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am 141 | 142 | installcheck: installcheck-am 143 | install-strip: 144 | $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ 145 | INSTALL_STRIP_FLAG=-s \ 146 | `test -z '$(STRIP)' || \ 147 | echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 148 | mostlyclean-generic: 149 | 150 | clean-generic: 151 | 152 | distclean-generic: 153 | -rm -f Makefile $(CONFIG_CLEAN_FILES) 154 | 155 | maintainer-clean-generic: 156 | @echo "This command is intended for maintainers to use" 157 | @echo "it deletes files that may require special tools to rebuild." 158 | clean: clean-am 159 | 160 | clean-am: clean-generic mostlyclean-am 161 | 162 | distclean: distclean-am 163 | 164 | distclean-am: clean-am distclean-generic 165 | 166 | dvi: dvi-am 167 | 168 | dvi-am: 169 | 170 | info: info-am 171 | 172 | info-am: 173 | 174 | install-data-am: 175 | 176 | install-exec-am: 177 | 178 | install-info: install-info-am 179 | 180 | install-man: 181 | 182 | installcheck-am: 183 | 184 | maintainer-clean: maintainer-clean-am 185 | 186 | maintainer-clean-am: distclean-am maintainer-clean-generic 187 | 188 | mostlyclean: mostlyclean-am 189 | 190 | mostlyclean-am: mostlyclean-generic 191 | 192 | uninstall-am: uninstall-info-am 193 | 194 | .PHONY: all all-am check check-am clean clean-generic distclean \ 195 | distclean-generic distdir dvi dvi-am info info-am install \ 196 | install-am install-data install-data-am install-exec \ 197 | install-exec-am install-info install-info-am install-man \ 198 | install-strip installcheck installcheck-am installdirs \ 199 | maintainer-clean maintainer-clean-generic mostlyclean \ 200 | mostlyclean-generic uninstall uninstall-am uninstall-info-am 201 | 202 | 203 | nbook.db: nbook.pgn 204 | ./build-book normal $< 205 | 206 | zbook.db: zhbook.pgn 207 | ./build-book crazyhouse $< 208 | 209 | # 210 | # Ignore whatever other target ProjectBuilder throws at us 211 | # 212 | .DEFAULT: 213 | @echo "Ignoring request for unknown target" $@ 214 | # Tell versions [3.59,3.63) of GNU make to not export all variables. 215 | # Otherwise a system limit (for SysV at least) may be exceeded. 216 | .NOEXPORT: 217 | -------------------------------------------------------------------------------- /sjeng/books/bug.opn: -------------------------------------------------------------------------------- 1 | /* The various tags: 2 | ! best 3 | !? interesting 4 | = unusual but solid 5 | ?! murky - meant for surprise 6 | ? plain bad 7 | */ 8 | 9 | /* Various bad first moves - don't play these! */ 10 | 11 | a2a3? e7e5! 12 | a2a4? e7e5! 13 | b1a3? e7e5! 14 | b1c3? e7e6! 15 | 16 | /* Now, 1. b3 is an interesting and OK slow move that can be used for surprise. 1. b4 is an interesting wild move planning to put pressure on the long diagonal and hit a N on c6 with b4-b5 */ 17 | 18 | b2b3!? 19 | b2b4?! 20 | 21 | /* 1. c3 is too committal to be used as surprise weapon, but 1. c4 is better than it looks. 1. d3 has the same problem as 1.c3: it is likely to transpose to some slow reversed system but without giving black any head aches with move orders. */ 22 | 23 | c2c3? e7e5! 24 | c2c4?! e7e5! 25 | d2d3? e7e5! 26 | 27 | /* 1. d4 is a good, calm move which often leads to semi-blocked positions. I'm interested in seeing how well the program can be taught to handle those. */ 28 | 29 | d2d4= 30 | 31 | /* 1. e3 can be used as a surprise weapon intending to make a reversed set up or something slow like Ng1-f3 and b2-b3. */ 32 | 33 | e2e3?! e7e5! 34 | 35 | /* 1. e4! Best by test! */ 36 | 37 | /* Queen's fianchetto */ 38 | 39 | e2e4 b7b6?! d2d4! 40 | 41 | /* Queen's knight - most likely to transpose */ 42 | 43 | e2e4 b8c6= 44 | 45 | /* C-line crap lines */ 46 | 47 | e2e4 c7c5? b1c3! 48 | e2e4 c7c6? d2d4! d7d5 e4d5 c6d5 c1f4 49 | 50 | /* The leaf - God I hate this shitty line. */ 51 | 52 | e2e4 d7d5? 53 | 54 | /* 1... d6 - transposing to the Wall most likely, but also some independant lines. */ 55 | 56 | e2e4 d7d6= 57 | 58 | /* I would expect the program to handle the tactics in the Kamikaze pretty well. */ 59 | 60 | e2e4 e7e5!? 61 | 62 | /* On with the main bulk of opening theory. */ 63 | 64 | e2e4 e7e6! 65 | 66 | /* The Dog will suit the computer well. */ 67 | 68 | e2e4 g8f6! 69 | 70 | /* 1. f3 is simply bad but 1.f4 is a whole lot better than it looks - an interesting surprise weapon maybe. */ 71 | 72 | f2f3? e7e5! 73 | f2f4?! g8f6! 74 | 75 | /* 1. Nf3 is a good second string first move along with 1. d4. */ 76 | 77 | g1f3= 78 | 79 | /* The rest is just crap. */ 80 | 81 | g1h3? e7e5! 82 | g2g3? e7e5! 83 | g2g4? e7e5! 84 | h2h3? e7e5! 85 | h2h4? e7e5! h4h5 d7d5 P@g6 h7g6 h5g6 h8h1 g6f7 e8f7 86 | -------------------------------------------------------------------------------- /sjeng/books/build-book: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Build a sjeng opening book 4 | # 5 | cat < header file. */ 11 | #define HAVE_INTTYPES_H 1 12 | 13 | /* Define to 1 if you have the `gdbm' library (-lgdbm). */ 14 | /* #undef HAVE_LIBGDBM */ 15 | 16 | /* Define to 1 if you have the `m' library (-lm). */ 17 | #define HAVE_LIBM 1 18 | 19 | /* Define to 1 if you have the header file. */ 20 | #define HAVE_MEMORY_H 1 21 | 22 | /* Define to 1 if you have the `select' function. */ 23 | #define HAVE_SELECT 1 24 | 25 | /* Define to 1 if you have the header file. */ 26 | #define HAVE_STDINT_H 1 27 | 28 | /* Define to 1 if you have the header file. */ 29 | #define HAVE_STDLIB_H 1 30 | 31 | /* Define to 1 if you have the header file. */ 32 | #define HAVE_STRINGS_H 1 33 | 34 | /* Define to 1 if you have the header file. */ 35 | #define HAVE_STRING_H 1 36 | 37 | /* Define to 1 if you have the `strstr' function. */ 38 | #define HAVE_STRSTR 1 39 | 40 | /* Define to 1 if you have the header file. */ 41 | #define HAVE_SYS_STAT_H 1 42 | 43 | /* Define to 1 if you have the header file. */ 44 | #define HAVE_SYS_TIMEB_H 1 45 | 46 | /* Define to 1 if you have the header file. */ 47 | #define HAVE_SYS_TIME_H 1 48 | 49 | /* Define to 1 if you have the header file. */ 50 | #define HAVE_SYS_TYPES_H 1 51 | 52 | /* Define to 1 if you have the header file. */ 53 | #define HAVE_UNISTD_H 1 54 | 55 | /* Name of package */ 56 | #define PACKAGE "Sjeng-Free" 57 | 58 | /* Define to the address where bug reports for this package should be sent. */ 59 | #define PACKAGE_BUGREPORT "" 60 | 61 | /* Define to the full name of this package. */ 62 | #define PACKAGE_NAME "" 63 | 64 | /* Define to the full name and version of this package. */ 65 | #define PACKAGE_STRING "" 66 | 67 | /* Define to the one symbol short name of this package. */ 68 | #define PACKAGE_TARNAME "" 69 | 70 | /* Define to the version of this package. */ 71 | #define PACKAGE_VERSION "" 72 | 73 | /* Define as the return type of signal handlers (`int' or `void'). */ 74 | #define RETSIGTYPE void 75 | 76 | /* Define to 1 if you have the ANSI C header files. */ 77 | #define STDC_HEADERS 1 78 | 79 | /* Define to 1 if you can safely include both and . */ 80 | #define TIME_WITH_SYS_TIME 1 81 | 82 | /* Version number of package */ 83 | #define VERSION "11.2" 84 | 85 | /* Define to empty if `const' does not conform to ANSI C. */ 86 | /* #undef const */ 87 | -------------------------------------------------------------------------------- /sjeng/configure.in: -------------------------------------------------------------------------------- 1 | dnl Process this file with autoconf to produce a configure script. 2 | AC_INIT(sjeng.c) 3 | 4 | AM_INIT_AUTOMAKE(Sjeng-Free, 11.2) 5 | AM_CONFIG_HEADER(config.h) 6 | 7 | dnl Checks for programs. 8 | AC_PROG_CC 9 | AC_PROG_CXX 10 | 11 | dnl Checks for libraries. 12 | AC_CHECK_LIB(gdbm, gdbm_open) 13 | 14 | dnl Check for floor() in the math library 15 | AC_CHECK_LIB(m, floor) 16 | 17 | dnl Checks for header files. 18 | AC_HEADER_STDC 19 | AC_CHECK_HEADERS(sys/time.h sys/timeb.h unistd.h) 20 | 21 | dnl Checks for typedefs, structures, and compiler characteristics. 22 | AC_C_CONST 23 | AC_HEADER_TIME 24 | 25 | dnl Checks for library functions. 26 | AC_TYPE_SIGNAL 27 | AC_CHECK_FUNCS(ftime select strstr gettimeofday) 28 | 29 | AC_OUTPUT(Makefile tests/Makefile books/Makefile) 30 | -------------------------------------------------------------------------------- /sjeng/draw.c: -------------------------------------------------------------------------------- 1 | /* 2 | Sjeng - a chess variants playing program 3 | Copyright (C) 2000-2001 Gian-Carlo Pascutto 4 | Originally based on Faile, Copyright (c) 2000 Adrien M. Regimbald 5 | 6 | This program is free software; you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation; either version 2 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | 20 | File: draw.c 21 | Purpose: Detect draws 22 | 23 | */ 24 | 25 | #include "config.h" 26 | #include "sjeng.h" 27 | #include "extvars.h" 28 | #include "protos.h" 29 | 30 | bool is_draw (void) 31 | { 32 | /* GCP: this is straigth from Faile but converted to Sjeng internals */ 33 | 34 | /* is_draw () is used to see if a position is a draw. Some notes: 35 | * - the 2 repetition trick is attempted first: if we have already seen a 36 | * position in the search history (not game history), we haven't found 37 | * anything better to do than repeat, and searching the position again would 38 | * be a waste of time 39 | * - if there is no match on the 2 repetition check, we look for an actual 40 | * 3 fold repetition 41 | * - we can't check for the 50 move rule here, since the 50 move rule must be 42 | * checked at the end of a search node due to mates on the 50th move, yet 43 | * we want to check for a draw by repetition before we waste any time 44 | * searching the position or generating moves 45 | * - is_draw () can be used in both search () and search_root () as the 46 | * for loop for the 2 repetition trick will exit immediately at the root */ 47 | 48 | int i, repeats = 0, end, start; 49 | 50 | /* Check on the 2 repetition trick. Some notes: 51 | * - a position can't possibly have occurred once before if fifty isn't 52 | * at least 4 53 | * - the end point is picked to look at the least number of positions, ie 54 | * if going to the last capture is shorter than looking at the whole search 55 | * history, we will do only that much */ 56 | if (fifty >= 4) 57 | { 58 | if ((move_number) < (move_number + ply - 1 - fifty)) 59 | { 60 | end = move_number + ply - 1 - fifty; 61 | } 62 | else 63 | { 64 | end = move_number; 65 | } 66 | for (i = (move_number + ply - 3); i >= 0 && i >= end; i -= 2) 67 | { 68 | if (hash == hash_history[i]) 69 | { 70 | return TRUE; 71 | } 72 | } 73 | } 74 | 75 | /* Check for actual 3 repetition match. Some notes: 76 | * - a position can't possibly have occurred twice before if fifty isn't 77 | * at least 6 78 | * - there is no need for us to consider positions encountered during search, 79 | * as if there was a match on any of them, it would have been found above 80 | * - we need to adjust the starting point here based on who's turn it is: 81 | * if it's the same as at the root, we need to subtract one extra */ 82 | if (fifty >= 6) 83 | { 84 | start = move_number - 1 - (ply % 2); 85 | end = move_number + ply - 1 - fifty; 86 | 87 | for (i = start; i >= 0 && i >= end; i -= 2) 88 | { 89 | if (hash == hash_history[i]) 90 | { 91 | repeats++; 92 | } 93 | if (repeats >= 2) 94 | { 95 | return TRUE; 96 | } 97 | } 98 | } 99 | 100 | return FALSE; 101 | 102 | }; 103 | -------------------------------------------------------------------------------- /sjeng/ecache.c: -------------------------------------------------------------------------------- 1 | /* 2 | Sjeng - a chess variants playing program 3 | Copyright (C) 2000 Gian-Carlo Pascutto 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | 19 | File: ecache.c 20 | Purpose: handling of the evaluation cache 21 | 22 | */ 23 | 24 | #include "sjeng.h" 25 | #include "protos.h" 26 | #include "extvars.h" 27 | 28 | typedef struct 29 | { 30 | uint32_t stored_hash; 31 | uint32_t hold_hash; 32 | int32_t score; 33 | } ECacheType; 34 | 35 | /*ECacheType ECache[ECACHESIZE];*/ 36 | ECacheType *ECache; 37 | 38 | uint32_t ECacheProbes; 39 | uint32_t ECacheHits; 40 | 41 | void storeECache(int32_t score) 42 | { 43 | int index; 44 | 45 | index = hash % ECacheSize; 46 | 47 | ECache[index].stored_hash = hash; 48 | ECache[index].hold_hash = hold_hash; 49 | ECache[index].score = score; 50 | } 51 | 52 | void checkECache(int32_t *score, int *in_cache) 53 | { 54 | int index; 55 | 56 | ECacheProbes++; 57 | 58 | index = hash % ECacheSize; 59 | 60 | if(ECache[index].stored_hash == hash && 61 | ECache[index].hold_hash == hold_hash) 62 | 63 | { 64 | ECacheHits++; 65 | 66 | *in_cache = 1; 67 | *score = ECache[index].score; 68 | } 69 | } 70 | 71 | void reset_ecache(void) 72 | { 73 | memset(ECache, 0, sizeof(ECacheType)*ECacheSize); 74 | return; 75 | } 76 | 77 | void alloc_ecache(void) 78 | { 79 | ECache = (ECacheType*)malloc(sizeof(ECacheType)*ECacheSize); 80 | 81 | if (ECache == NULL) 82 | { 83 | printf("Out of memory allocating ECache.\n"); 84 | exit(EXIT_FAILURE); 85 | } 86 | 87 | printf("Allocated %u eval cache entries, totalling %u bytes.\n", 88 | (uint32_t)ECacheSize, (uint32_t)(sizeof(ECacheType)*ECacheSize)); 89 | return; 90 | } 91 | 92 | void free_ecache(void) 93 | { 94 | free(ECache); 95 | return; 96 | } 97 | -------------------------------------------------------------------------------- /sjeng/extvars.h: -------------------------------------------------------------------------------- 1 | /* 2 | Sjeng - a chess variants playing program 3 | Copyright (C) 2000 Gian-Carlo Pascutto 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | 19 | File: extvars.h 20 | Purpose: global data definitions 21 | 22 | */ 23 | 24 | #include 25 | 26 | extern char divider[50]; 27 | 28 | extern int board[144], moved[144], ep_square, white_to_move, wking_loc, 29 | bking_loc, white_castled, black_castled, result, ply, pv_length[PV_BUFF], 30 | squares[144], num_pieces, i_depth, comp_color, fifty, piece_count; 31 | 32 | extern int32_t nodes, raw_nodes, qnodes, killer_scores[PV_BUFF], 33 | killer_scores2[PV_BUFF], killer_scores3[PV_BUFF], moves_to_tc, min_per_game, 34 | sec_per_game, inc, time_left, opp_time, time_cushion, time_for_move, cur_score; 35 | 36 | extern uint32_t history_h[144][144]; 37 | 38 | extern bool captures, searching_pv, post, time_exit, time_failure; 39 | extern int xb_mode, maxdepth; 40 | 41 | extern move_s pv[PV_BUFF][PV_BUFF], dummy, killer1[PV_BUFF], killer2[PV_BUFF], 42 | killer3[PV_BUFF]; 43 | 44 | extern move_x path_x[PV_BUFF]; 45 | extern move_s path[PV_BUFF]; 46 | 47 | extern rtime_t start_time; 48 | 49 | extern int holding[2][16]; 50 | extern int num_holding[2]; 51 | 52 | extern int white_hand_eval; 53 | extern int black_hand_eval; 54 | 55 | extern int drop_piece; 56 | 57 | extern int pieces[62]; 58 | extern int is_promoted[62]; 59 | 60 | extern int num_makemoves; 61 | extern int num_unmakemoves; 62 | extern int num_playmoves; 63 | extern int num_pieceups; 64 | extern int num_piecedowns; 65 | extern int max_moves; 66 | 67 | /* piece types range form 0..16 */ 68 | extern uint32_t zobrist[17][144]; 69 | extern uint32_t hash; 70 | 71 | extern uint32_t ECacheProbes; 72 | extern uint32_t ECacheHits; 73 | 74 | extern uint32_t TTProbes; 75 | extern uint32_t TTHits; 76 | extern uint32_t TTStores; 77 | 78 | extern uint32_t hold_hash; 79 | 80 | extern char book[4000][161]; 81 | extern int num_book_lines; 82 | extern int book_ply; 83 | extern int use_book; 84 | extern char opening_history[STR_BUFF]; 85 | extern uint32_t bookpos[400], booktomove[400], bookidx; 86 | 87 | extern int Material; 88 | extern int material[17]; 89 | extern int zh_material[17]; 90 | extern int std_material[17]; 91 | extern int suicide_material[17]; 92 | extern int losers_material[17]; 93 | 94 | extern int NTries, NCuts, TExt; 95 | 96 | extern char ponder_input[STR_BUFF]; 97 | 98 | extern bool is_pondering; 99 | 100 | extern uint32_t FH, FHF, PVS, FULL, PVSF; 101 | extern uint32_t ext_check, ext_recap, ext_onerep; 102 | extern uint32_t razor_drop, razor_material; 103 | 104 | extern uint32_t total_moves; 105 | extern uint32_t total_movegens; 106 | 107 | extern const int rank[144], file[144], diagl[144], diagr[144], sqcolor[144]; 108 | 109 | extern int Variant; 110 | extern int Giveaway; 111 | extern int forcedwin; 112 | 113 | extern bool is_analyzing; 114 | 115 | extern char my_partner[STR_BUFF]; 116 | extern bool have_partner; 117 | extern bool must_sit; 118 | extern int must_go; 119 | extern bool go_fast; 120 | extern bool piecedead; 121 | extern bool partnerdead; 122 | extern int tradefreely; 123 | 124 | extern char true_i_depth; 125 | 126 | extern int32_t fixed_time; 127 | 128 | extern int hand_value[]; 129 | 130 | extern int numb_moves; 131 | 132 | extern int phase; 133 | 134 | FILE *lrn_standard; 135 | FILE *lrn_zh; 136 | FILE *lrn_suicide; 137 | FILE *lrn_losers; 138 | extern int bestmovenum; 139 | 140 | extern int ugly_ep_hack; 141 | 142 | extern int root_to_move; 143 | 144 | extern int kingcap; 145 | 146 | extern int pn_time; 147 | extern move_s pn_move; 148 | extern move_s pn_saver; 149 | extern bool kibitzed; 150 | extern int rootlosers[PV_BUFF]; 151 | extern int alllosers; 152 | extern int s_threat; 153 | 154 | extern int cfg_booklearn; 155 | extern int cfg_devscale; 156 | extern int cfg_razordrop; 157 | extern int cfg_cutdrop; 158 | extern int cfg_futprune; 159 | extern int cfg_onerep; 160 | extern int cfg_recap; 161 | extern int cfg_smarteval; 162 | extern int cfg_attackeval; 163 | extern float cfg_scalefac; 164 | extern int cfg_ksafety[15][9]; 165 | extern int cfg_tropism[5][7]; 166 | extern int havercfile; 167 | extern int TTSize; 168 | extern int PBSize; 169 | extern int ECacheSize; 170 | 171 | extern int my_rating, opp_rating; 172 | extern int userealholdings; 173 | extern char realholdings[255]; 174 | 175 | extern int move_number; 176 | extern uint32_t hash_history[600]; 177 | 178 | extern int moveleft; 179 | extern int movetotal; 180 | extern char searching_move[20]; 181 | 182 | extern char setcode[30]; 183 | 184 | extern int EGTBProbes; 185 | extern int EGTBHits; 186 | extern int SEGTB; 187 | 188 | 189 | 190 | 191 | 192 | 193 | -------------------------------------------------------------------------------- /sjeng/install-sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # install - install a program, script, or datafile 4 | # This comes from X11R5. 5 | # 6 | # Calling this script install-sh is preferred over install.sh, to prevent 7 | # `make' implicit rules from creating a file called install from it 8 | # when there is no Makefile. 9 | # 10 | # This script is compatible with the BSD install script, but was written 11 | # from scratch. 12 | # 13 | 14 | 15 | # set DOITPROG to echo to test this script 16 | 17 | # Don't use :- since 4.3BSD and earlier shells don't like it. 18 | doit="${DOITPROG-}" 19 | 20 | 21 | # put in absolute paths if you don't have them in your path; or use env. vars. 22 | 23 | mvprog="${MVPROG-mv}" 24 | cpprog="${CPPROG-cp}" 25 | chmodprog="${CHMODPROG-chmod}" 26 | chownprog="${CHOWNPROG-chown}" 27 | chgrpprog="${CHGRPPROG-chgrp}" 28 | stripprog="${STRIPPROG-strip}" 29 | rmprog="${RMPROG-rm}" 30 | mkdirprog="${MKDIRPROG-mkdir}" 31 | 32 | tranformbasename="" 33 | transform_arg="" 34 | instcmd="$mvprog" 35 | chmodcmd="$chmodprog 0755" 36 | chowncmd="" 37 | chgrpcmd="" 38 | stripcmd="" 39 | rmcmd="$rmprog -f" 40 | mvcmd="$mvprog" 41 | src="" 42 | dst="" 43 | dir_arg="" 44 | 45 | while [ x"$1" != x ]; do 46 | case $1 in 47 | -c) instcmd="$cpprog" 48 | shift 49 | continue;; 50 | 51 | -d) dir_arg=true 52 | shift 53 | continue;; 54 | 55 | -m) chmodcmd="$chmodprog $2" 56 | shift 57 | shift 58 | continue;; 59 | 60 | -o) chowncmd="$chownprog $2" 61 | shift 62 | shift 63 | continue;; 64 | 65 | -g) chgrpcmd="$chgrpprog $2" 66 | shift 67 | shift 68 | continue;; 69 | 70 | -s) stripcmd="$stripprog" 71 | shift 72 | continue;; 73 | 74 | -t=*) transformarg=`echo $1 | sed 's/-t=//'` 75 | shift 76 | continue;; 77 | 78 | -b=*) transformbasename=`echo $1 | sed 's/-b=//'` 79 | shift 80 | continue;; 81 | 82 | *) if [ x"$src" = x ] 83 | then 84 | src=$1 85 | else 86 | # this colon is to work around a 386BSD /bin/sh bug 87 | : 88 | dst=$1 89 | fi 90 | shift 91 | continue;; 92 | esac 93 | done 94 | 95 | if [ x"$src" = x ] 96 | then 97 | echo "install: no input file specified" 98 | exit 1 99 | else 100 | true 101 | fi 102 | 103 | if [ x"$dir_arg" != x ]; then 104 | dst=$src 105 | src="" 106 | 107 | if [ -d $dst ]; then 108 | instcmd=: 109 | else 110 | instcmd=mkdir 111 | fi 112 | else 113 | 114 | # Waiting for this to be detected by the "$instcmd $src $dsttmp" command 115 | # might cause directories to be created, which would be especially bad 116 | # if $src (and thus $dsttmp) contains '*'. 117 | 118 | if [ -f $src -o -d $src ] 119 | then 120 | true 121 | else 122 | echo "install: $src does not exist" 123 | exit 1 124 | fi 125 | 126 | if [ x"$dst" = x ] 127 | then 128 | echo "install: no destination specified" 129 | exit 1 130 | else 131 | true 132 | fi 133 | 134 | # If destination is a directory, append the input filename; if your system 135 | # does not like double slashes in filenames, you may need to add some logic 136 | 137 | if [ -d $dst ] 138 | then 139 | dst="$dst"/`basename $src` 140 | else 141 | true 142 | fi 143 | fi 144 | 145 | ## this sed command emulates the dirname command 146 | dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` 147 | 148 | # Make sure that the destination directory exists. 149 | # this part is taken from Noah Friedman's mkinstalldirs script 150 | 151 | # Skip lots of stat calls in the usual case. 152 | if [ ! -d "$dstdir" ]; then 153 | defaultIFS=' 154 | ' 155 | IFS="${IFS-${defaultIFS}}" 156 | 157 | oIFS="${IFS}" 158 | # Some sh's can't handle IFS=/ for some reason. 159 | IFS='%' 160 | set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` 161 | IFS="${oIFS}" 162 | 163 | pathcomp='' 164 | 165 | while [ $# -ne 0 ] ; do 166 | pathcomp="${pathcomp}${1}" 167 | shift 168 | 169 | if [ ! -d "${pathcomp}" ] ; 170 | then 171 | $mkdirprog "${pathcomp}" 172 | else 173 | true 174 | fi 175 | 176 | pathcomp="${pathcomp}/" 177 | done 178 | fi 179 | 180 | if [ x"$dir_arg" != x ] 181 | then 182 | $doit $instcmd $dst && 183 | 184 | if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && 185 | if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && 186 | if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && 187 | if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi 188 | else 189 | 190 | # If we're going to rename the final executable, determine the name now. 191 | 192 | if [ x"$transformarg" = x ] 193 | then 194 | dstfile=`basename $dst` 195 | else 196 | dstfile=`basename $dst $transformbasename | 197 | sed $transformarg`$transformbasename 198 | fi 199 | 200 | # don't allow the sed command to completely eliminate the filename 201 | 202 | if [ x"$dstfile" = x ] 203 | then 204 | dstfile=`basename $dst` 205 | else 206 | true 207 | fi 208 | 209 | # Make a temp file name in the proper directory. 210 | 211 | dsttmp=$dstdir/#inst.$$# 212 | 213 | # Move or copy the file name to the temp name 214 | 215 | $doit $instcmd $src $dsttmp && 216 | 217 | trap "rm -f ${dsttmp}" 0 && 218 | 219 | # and set any options; do chmod last to preserve setuid bits 220 | 221 | # If any of these fail, we abort the whole thing. If we want to 222 | # ignore errors from any of these, just make sure not to ignore 223 | # errors from the above "$doit $instcmd $src $dsttmp" command. 224 | 225 | if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && 226 | if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && 227 | if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && 228 | if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && 229 | 230 | # Now rename the file to the real destination. 231 | 232 | $doit $rmcmd -f $dstdir/$dstfile && 233 | $doit $mvcmd $dsttmp $dstdir/$dstfile 234 | 235 | fi && 236 | 237 | 238 | exit 0 239 | -------------------------------------------------------------------------------- /sjeng/learn.c: -------------------------------------------------------------------------------- 1 | /* 2 | Sjeng - a chess variants playing program 3 | Copyright (C) 2000 Gian-Carlo Pascutto 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | 19 | File: learn.c 20 | Purpose: remembering of positions 21 | 22 | */ 23 | 24 | #include "sjeng.h" 25 | #include "protos.h" 26 | #include "extvars.h" 27 | #include 28 | 29 | typedef struct 30 | { 31 | signed Depth:7; 32 | unsigned OnMove:1; 33 | unsigned char Bestmove; 34 | uint32_t Hash; 35 | uint32_t Hold_hash; 36 | int32_t Bound; 37 | } 38 | LearnType; 39 | 40 | void Learn(int score, int best, int depth) 41 | { 42 | int number = 0, next = 0; 43 | LearnType draft; 44 | FILE **lrnfile; 45 | 46 | printf("Learning score: %d best: %d depth:%d hash: %X\n", score, best, depth, hash); 47 | 48 | if (Variant == Normal) 49 | { 50 | lrnfile = &lrn_standard; 51 | } 52 | else if ((Variant == Crazyhouse) || (Variant == Bughouse)) 53 | { 54 | lrnfile = &lrn_zh; 55 | } 56 | else if (Variant == Suicide) 57 | { 58 | lrnfile = &lrn_suicide; 59 | } 60 | else if (Variant == Losers) 61 | { 62 | lrnfile = &lrn_losers; 63 | } 64 | else 65 | return; 66 | 67 | fseek(*lrnfile, 0, SEEK_SET); 68 | fread(&number, sizeof(int), 1, *lrnfile); 69 | fread(&next, sizeof(int), 1, *lrnfile); 70 | 71 | if (number < 50000) number++; 72 | 73 | fseek(*lrnfile, 0, SEEK_SET); 74 | fwrite(&number, sizeof(int), 1, *lrnfile); 75 | 76 | next++; 77 | if (next == 50000) next = 1; 78 | 79 | fwrite(&next, sizeof(int), 1, *lrnfile); 80 | 81 | fseek(*lrnfile, (2*sizeof(int)) + ((next-1)*sizeof(LearnType)), SEEK_SET); 82 | 83 | draft.Depth = depth; 84 | draft.OnMove = ToMove; 85 | draft.Hash = hash; 86 | draft.Hold_hash = hold_hash; 87 | draft.Bound = score; 88 | draft.Bestmove = best; 89 | 90 | fwrite(&draft, sizeof(draft), 1, *lrnfile); 91 | 92 | fflush(*lrnfile); 93 | } 94 | 95 | void LoadLearn(void) 96 | { 97 | int number = 0, posloop; 98 | LearnType draft; 99 | FILE **lrnfile; 100 | 101 | if (((Variant == Crazyhouse) || (Variant == Bughouse)) && (!lrn_zh)) 102 | return; 103 | else if ((Variant == Normal) && !lrn_standard) 104 | return; 105 | else if (Variant == Suicide && !lrn_suicide) 106 | return; 107 | else if (Variant == Losers && !lrn_losers) 108 | return; 109 | 110 | if (Variant == Normal) 111 | { 112 | lrnfile = &lrn_standard; 113 | } 114 | else if ((Variant == Crazyhouse) || (Variant == Bughouse)) 115 | { 116 | lrnfile = &lrn_zh; 117 | } 118 | else if (Variant == Suicide) 119 | { 120 | lrnfile = &lrn_suicide; 121 | } 122 | else if (Variant == Losers) 123 | { 124 | lrnfile = &lrn_losers; 125 | } 126 | 127 | fseek(*lrnfile, 0, SEEK_SET); 128 | fread(&number, sizeof(int), 1, *lrnfile); 129 | fseek(*lrnfile, 2*sizeof(int), SEEK_SET); 130 | 131 | for (posloop = 0; posloop < number; posloop++) 132 | { 133 | fread(&draft, sizeof(LearnType), 1, *lrnfile); 134 | LearnStoreTT(draft.Bound, draft.Hash, draft.Hold_hash, 135 | draft.OnMove, draft.Bestmove, draft.Depth); 136 | } 137 | 138 | return; 139 | } 140 | -------------------------------------------------------------------------------- /sjeng/missing: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # Common stub for a few missing GNU programs while installing. 3 | # Copyright (C) 1996, 1997 Free Software Foundation, Inc. 4 | # Franc,ois Pinard , 1996. 5 | 6 | # This program is free software; you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License as published by 8 | # the Free Software Foundation; either version 2, or (at your option) 9 | # any later version. 10 | 11 | # This program is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | 16 | # You should have received a copy of the GNU General Public License 17 | # along with this program; if not, write to the Free Software 18 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 19 | # 02111-1307, USA. 20 | 21 | if test $# -eq 0; then 22 | echo 1>&2 "Try \`$0 --help' for more information" 23 | exit 1 24 | fi 25 | 26 | case "$1" in 27 | 28 | -h|--h|--he|--hel|--help) 29 | echo "\ 30 | $0 [OPTION]... PROGRAM [ARGUMENT]... 31 | 32 | Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an 33 | error status if there is no known handling for PROGRAM. 34 | 35 | Options: 36 | -h, --help display this help and exit 37 | -v, --version output version information and exit 38 | 39 | Supported PROGRAM values: 40 | aclocal touch file \`aclocal.m4' 41 | autoconf touch file \`configure' 42 | autoheader touch file \`config.h.in' 43 | automake touch all \`Makefile.in' files 44 | bison create \`y.tab.[ch]', if possible, from existing .[ch] 45 | flex create \`lex.yy.c', if possible, from existing .c 46 | lex create \`lex.yy.c', if possible, from existing .c 47 | makeinfo touch the output file 48 | yacc create \`y.tab.[ch]', if possible, from existing .[ch]" 49 | ;; 50 | 51 | -v|--v|--ve|--ver|--vers|--versi|--versio|--version) 52 | echo "missing - GNU libit 0.0" 53 | ;; 54 | 55 | -*) 56 | echo 1>&2 "$0: Unknown \`$1' option" 57 | echo 1>&2 "Try \`$0 --help' for more information" 58 | exit 1 59 | ;; 60 | 61 | aclocal) 62 | echo 1>&2 "\ 63 | WARNING: \`$1' is missing on your system. You should only need it if 64 | you modified \`acinclude.m4' or \`configure.in'. You might want 65 | to install the \`Automake' and \`Perl' packages. Grab them from 66 | any GNU archive site." 67 | touch aclocal.m4 68 | ;; 69 | 70 | autoconf) 71 | echo 1>&2 "\ 72 | WARNING: \`$1' is missing on your system. You should only need it if 73 | you modified \`configure.in'. You might want to install the 74 | \`Autoconf' and \`GNU m4' packages. Grab them from any GNU 75 | archive site." 76 | touch configure 77 | ;; 78 | 79 | autoheader) 80 | echo 1>&2 "\ 81 | WARNING: \`$1' is missing on your system. You should only need it if 82 | you modified \`acconfig.h' or \`configure.in'. You might want 83 | to install the \`Autoconf' and \`GNU m4' packages. Grab them 84 | from any GNU archive site." 85 | files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' configure.in` 86 | test -z "$files" && files="config.h" 87 | touch_files= 88 | for f in $files; do 89 | case "$f" in 90 | *:*) touch_files="$touch_files "`echo "$f" | 91 | sed -e 's/^[^:]*://' -e 's/:.*//'`;; 92 | *) touch_files="$touch_files $f.in";; 93 | esac 94 | done 95 | touch $touch_files 96 | ;; 97 | 98 | automake) 99 | echo 1>&2 "\ 100 | WARNING: \`$1' is missing on your system. You should only need it if 101 | you modified \`Makefile.am', \`acinclude.m4' or \`configure.in'. 102 | You might want to install the \`Automake' and \`Perl' packages. 103 | Grab them from any GNU archive site." 104 | find . -type f -name Makefile.am -print | 105 | sed 's/\.am$/.in/' | 106 | while read f; do touch "$f"; done 107 | ;; 108 | 109 | bison|yacc) 110 | echo 1>&2 "\ 111 | WARNING: \`$1' is missing on your system. You should only need it if 112 | you modified a \`.y' file. You may need the \`Bison' package 113 | in order for those modifications to take effect. You can get 114 | \`Bison' from any GNU archive site." 115 | rm -f y.tab.c y.tab.h 116 | if [ $# -ne 1 ]; then 117 | eval LASTARG="\${$#}" 118 | case "$LASTARG" in 119 | *.y) 120 | SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` 121 | if [ -f "$SRCFILE" ]; then 122 | cp "$SRCFILE" y.tab.c 123 | fi 124 | SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` 125 | if [ -f "$SRCFILE" ]; then 126 | cp "$SRCFILE" y.tab.h 127 | fi 128 | ;; 129 | esac 130 | fi 131 | if [ ! -f y.tab.h ]; then 132 | echo >y.tab.h 133 | fi 134 | if [ ! -f y.tab.c ]; then 135 | echo 'main() { return 0; }' >y.tab.c 136 | fi 137 | ;; 138 | 139 | lex|flex) 140 | echo 1>&2 "\ 141 | WARNING: \`$1' is missing on your system. You should only need it if 142 | you modified a \`.l' file. You may need the \`Flex' package 143 | in order for those modifications to take effect. You can get 144 | \`Flex' from any GNU archive site." 145 | rm -f lex.yy.c 146 | if [ $# -ne 1 ]; then 147 | eval LASTARG="\${$#}" 148 | case "$LASTARG" in 149 | *.l) 150 | SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` 151 | if [ -f "$SRCFILE" ]; then 152 | cp "$SRCFILE" lex.yy.c 153 | fi 154 | ;; 155 | esac 156 | fi 157 | if [ ! -f lex.yy.c ]; then 158 | echo 'main() { return 0; }' >lex.yy.c 159 | fi 160 | ;; 161 | 162 | makeinfo) 163 | echo 1>&2 "\ 164 | WARNING: \`$1' is missing on your system. You should only need it if 165 | you modified a \`.texi' or \`.texinfo' file, or any other file 166 | indirectly affecting the aspect of the manual. The spurious 167 | call might also be the consequence of using a buggy \`make' (AIX, 168 | DU, IRIX). You might want to install the \`Texinfo' package or 169 | the \`GNU make' package. Grab either from any GNU archive site." 170 | file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` 171 | if test -z "$file"; then 172 | file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` 173 | file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` 174 | fi 175 | touch $file 176 | ;; 177 | 178 | *) 179 | echo 1>&2 "\ 180 | WARNING: \`$1' is needed, and you do not seem to have it handy on your 181 | system. You might have modified some files without having the 182 | proper tools for further handling them. Check the \`README' file, 183 | it often tells you about the needed prerequirements for installing 184 | this package. You may also peek at any GNU archive site, in case 185 | some other package would contain this missing \`$1' program." 186 | exit 1 187 | ;; 188 | esac 189 | 190 | exit 0 191 | -------------------------------------------------------------------------------- /sjeng/mkinstalldirs: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # mkinstalldirs --- make directory hierarchy 3 | # Author: Noah Friedman 4 | # Created: 1993-05-16 5 | # Last modified: 1994-03-25 6 | # Public domain 7 | 8 | errstatus=0 9 | 10 | for file in ${1+"$@"} ; do 11 | set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` 12 | shift 13 | 14 | pathcomp= 15 | for d in ${1+"$@"} ; do 16 | pathcomp="$pathcomp$d" 17 | case "$pathcomp" in 18 | -* ) pathcomp=./$pathcomp ;; 19 | esac 20 | 21 | if test ! -d "$pathcomp"; then 22 | echo "mkdir $pathcomp" 1>&2 23 | mkdir "$pathcomp" || errstatus=$? 24 | fi 25 | 26 | pathcomp="$pathcomp/" 27 | done 28 | done 29 | 30 | exit $errstatus 31 | 32 | # mkinstalldirs ends here 33 | -------------------------------------------------------------------------------- /sjeng/protos.h: -------------------------------------------------------------------------------- 1 | /* 2 | Sjeng - a chess variants playing program 3 | Copyright (C) 2000 Gian-Carlo Pascutto 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | 19 | File: protos.h 20 | Purpose: function prototypes 21 | 22 | */ 23 | 24 | #ifndef PROTOS_H 25 | #define PROTOS_H 26 | 27 | #include 28 | 29 | int32_t allocate_time (void); 30 | bool check_legal (move_s moves[], int m, int incheck); 31 | void comp_to_coord (move_s move, char str[]); 32 | void display_board (FILE *stream, int color); 33 | int32_t end_eval (void); 34 | int32_t seval(void); 35 | int32_t std_eval (void); 36 | int32_t suicide_eval (void); 37 | int32_t losers_eval (void); 38 | int32_t eval (void); 39 | void gen (move_s moves[]); 40 | void ics_game_end (void); 41 | bool in_check (void); 42 | bool f_in_check (move_s moves[], int m); 43 | int extended_in_check (void); 44 | void init_game (void); 45 | bool is_attacked (int square, int color); 46 | bool nk_attacked (int square, int color); 47 | bool is_move (char str[]); 48 | void make (move_s moves[], int i); 49 | void order_moves (move_s moves[], int32_t move_ordering[], int32_t see_values[], int num_moves, int best); 50 | int32_t mid_eval (void); 51 | int32_t opn_eval (void); 52 | int32_t suicide_mid_eval(void); 53 | void check_phase(void); 54 | void perft (int depth); 55 | void speed_test(void); 56 | void perft_debug (void); 57 | void post_thinking (int32_t score); 58 | void post_fl_thinking (int32_t score, move_s *failmove); 59 | void post_fh_thinking (int32_t score, move_s *failmove); 60 | void post_fail_thinking(int32_t score, move_s *failmove); 61 | void print_move (move_s moves[], int m, FILE *stream); 62 | void push_pawn (int target, bool is_ep); 63 | void push_king_castle (int target, int castle_type); 64 | void push_pawn_simple (int target); 65 | void push_king (int target); 66 | void push_knighT (int target); 67 | 68 | void try_drop (int ptype); 69 | 70 | 71 | void push_slidE (int target); 72 | int32_t qsearch (int alpha, int beta, int depth); 73 | void rdelay (int time_in_s); 74 | int32_t rdifftime (rtime_t end, rtime_t start); 75 | bool remove_one (int *marker, int32_t move_ordering[], int num_moves); 76 | void reset_piece_square (void); 77 | void check_piece_square (void); 78 | void rinput (char str[], int n, FILE *stream); 79 | rtime_t rtime (void); 80 | int32_t search (int alpha, int beta, int depth, int is_null); 81 | move_s search_root (int alpha, int beta, int depth); 82 | void start_up (void); 83 | move_s think (void); 84 | void toggle_bool (bool *var); 85 | void tree (int depth, int indent, FILE *output, char *disp_b); 86 | void tree_debug (void); 87 | void unmake (move_s moves[], int i); 88 | bool verify_coord (char input[], move_s *move); 89 | 90 | bool is_draw(void); 91 | 92 | void ProcessHoldings(char line[]); 93 | void addHolding(int what, int who); 94 | void removeHolding(int what, int who); 95 | void DropaddHolding(int what, int who); 96 | void DropremoveHolding(int what, int who); 97 | 98 | void printHolding(void); 99 | 100 | int SwitchColor(int piece); 101 | int SwitchPromoted(int piece); 102 | 103 | int evalHolding(void); 104 | 105 | void initialize_zobrist(void); 106 | void initialize_hash(void); 107 | void initialize_eval(void); 108 | 109 | void checkECache(int32_t *score, int *in_cache); 110 | void storeECache(int32_t score); 111 | 112 | int init_book(void); 113 | move_s choose_book_move(void); 114 | move_s choose_binary_book_move(void); 115 | 116 | void StoreTT(int score, int alpha, int beta, int best , int threat, int depth); 117 | void QStoreTT(int score, int alpha, int beta, int best); 118 | int ProbeTT(int *score, int alpha, int beta, int *best, int *threat, int *donull, int depth); 119 | int QProbeTT(int *score, int alpha, int beta, int *best); 120 | void LearnStoreTT(int score, unsigned nhash, unsigned hhash, int tomove, int best, int depth); 121 | 122 | void LoadLearn(void); 123 | void Learn(int score, int best, int depth); 124 | 125 | void pinput (int n, FILE *stream); 126 | 127 | int calc_attackers(int square, int color); 128 | 129 | int interrupt(void); 130 | 131 | void PutPiece(int color, char piece, char file, int rank); 132 | void reset_board(void); 133 | 134 | void reset_ecache(void); 135 | 136 | void HandlePartner(char *input); 137 | void HandlePtell(char *input); 138 | void BegForPartner(void); 139 | void CheckBadFlow(bool reset); 140 | 141 | void run_epd_testsuite(void); 142 | 143 | void ResetHandValue(void); 144 | 145 | void build_book(void); 146 | void comp_to_san (move_s move, char str[]); 147 | void stringize_pv (char str[]); 148 | 149 | void clear_tt(void); 150 | void clear_dp_tt(void); 151 | 152 | move_s proofnumbercheck(move_s compmove); 153 | void proofnumbersearch(void); 154 | void proofnumberscan(void); 155 | 156 | void alloc_hash(void); 157 | void alloc_ecache(void); 158 | void free_hash(void); 159 | void free_ecache(void); 160 | void read_rcfile(void); 161 | 162 | void book_learning(int result); 163 | void seedMT(uint32_t seed); 164 | uint32_t randomMT(void); 165 | 166 | void setup_epd_line(char* inbuff); 167 | 168 | int see(int color, int square, int from); 169 | 170 | void gen_all_tables(void); 171 | int egtb(int s); 172 | 173 | #endif 174 | 175 | -------------------------------------------------------------------------------- /sjeng/rcfile.c: -------------------------------------------------------------------------------- 1 | /* 2 | Sjeng - a chess variants playing program 3 | Copyright (C) 2000 Gian-Carlo Pascutto 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | 19 | File: rcfile.c 20 | Purpose: Read in config file, allocate hash/caches 21 | 22 | */ 23 | 24 | #include "sjeng.h" 25 | #include "protos.h" 26 | #include "extvars.h" 27 | #include "config.h" 28 | 29 | FILE *rcfile; 30 | char line[STR_BUFF]; 31 | 32 | int TTSize; 33 | int ECacheSize; 34 | int PBSize; 35 | 36 | int cfg_booklearn; 37 | int cfg_razordrop; 38 | int cfg_cutdrop; 39 | int cfg_ksafety[15][9]; 40 | int cfg_tropism[5][7]; 41 | int havercfile; 42 | int cfg_futprune; 43 | int cfg_devscale; 44 | int cfg_onerep; 45 | int cfg_recap; 46 | int cfg_smarteval; 47 | int cfg_attackeval; 48 | float cfg_scalefac; 49 | 50 | void read_rcfile (void) 51 | { 52 | int i; 53 | unsigned int setc; 54 | 55 | if ((rcfile = fopen ("sjeng.rc", "r")) == NULL) 56 | { 57 | printf("No configuration file!\n"); 58 | 59 | TTSize = 300000; 60 | ECacheSize = 200000; 61 | PBSize = 200000; 62 | 63 | cfg_devscale = 1; 64 | cfg_scalefac = 1.0f; 65 | cfg_razordrop = 1; 66 | cfg_cutdrop = 0; 67 | cfg_futprune = 1; 68 | cfg_smarteval = 1; 69 | cfg_attackeval = 0; 70 | 71 | havercfile = 0; 72 | 73 | setc = havercfile 74 | + (cfg_devscale << 1) 75 | + (((cfg_scalefac == 1.0) ? 1 : 0) << 2) 76 | + (cfg_razordrop << 3) 77 | + (cfg_cutdrop << 4) 78 | + (cfg_futprune << 5) 79 | + (cfg_smarteval << 6) 80 | + (cfg_attackeval << 7); 81 | 82 | 83 | sprintf(setcode, "%u", setc); 84 | 85 | initialize_eval(); 86 | alloc_hash(); 87 | alloc_ecache(); 88 | 89 | return; 90 | } 91 | 92 | havercfile = 1; 93 | 94 | /* read in values, possibly seperated by # commented lines */ 95 | fgets(line, STR_BUFF, rcfile); 96 | while (line[0] == '#') fgets(line, STR_BUFF, rcfile); 97 | sscanf(line, "%d", &TTSize); 98 | 99 | fgets(line, STR_BUFF, rcfile); 100 | while (line[0] == '#') fgets(line, STR_BUFF, rcfile); 101 | sscanf(line, "%d", &ECacheSize); 102 | 103 | fgets(line, STR_BUFF, rcfile); 104 | while (line[0] == '#') fgets(line, STR_BUFF, rcfile); 105 | sscanf(line, "%d", &PBSize); 106 | 107 | fgets(line, STR_BUFF, rcfile); 108 | while (line[0] == '#') fgets(line, STR_BUFF, rcfile); 109 | sscanf(line, "%f", &cfg_scalefac); 110 | 111 | fgets(line, STR_BUFF, rcfile); 112 | while (line[0] == '#') fgets(line, STR_BUFF, rcfile); 113 | sscanf(line, "%d", &cfg_devscale); 114 | 115 | fgets(line, STR_BUFF, rcfile); 116 | while (line[0] == '#') fgets(line, STR_BUFF, rcfile); 117 | sscanf(line, "%d", &cfg_razordrop); 118 | 119 | fgets(line, STR_BUFF, rcfile); 120 | while (line[0] == '#') fgets(line, STR_BUFF, rcfile); 121 | sscanf(line, "%d", &cfg_cutdrop); 122 | 123 | fgets(line, STR_BUFF, rcfile); 124 | while (line[0] == '#') fgets(line, STR_BUFF, rcfile); 125 | sscanf(line, "%d", &cfg_booklearn); 126 | 127 | fgets(line, STR_BUFF, rcfile); 128 | while (line[0] == '#') fgets(line, STR_BUFF, rcfile); 129 | sscanf(line, "%d", &cfg_futprune); 130 | 131 | fgets(line, STR_BUFF, rcfile); 132 | while (line[0] == '#') fgets(line, STR_BUFF, rcfile); 133 | sscanf(line, "%d", &cfg_onerep); 134 | 135 | fgets(line, STR_BUFF, rcfile); 136 | while (line[0] == '#') fgets(line, STR_BUFF, rcfile); 137 | sscanf(line, "%d", &cfg_recap); 138 | 139 | fgets(line, STR_BUFF, rcfile); 140 | while (line[0] == '#') fgets(line, STR_BUFF, rcfile); 141 | sscanf(line, "%d", &cfg_smarteval); 142 | 143 | fgets(line, STR_BUFF, rcfile); 144 | while (line[0] == '#') fgets(line, STR_BUFF, rcfile); 145 | sscanf(line, "%d", &cfg_attackeval); 146 | 147 | fgets(line, STR_BUFF, rcfile); 148 | while (line[0] == '#') fgets(line, STR_BUFF, rcfile); 149 | 150 | for(i = 0; i < 5; i++) 151 | { 152 | sscanf(line, "%d %d %d %d %d %d %d", 153 | &cfg_tropism[i][0], &cfg_tropism[i][1], &cfg_tropism[i][2],&cfg_tropism[i][3], 154 | &cfg_tropism[i][4], &cfg_tropism[i][5], &cfg_tropism[i][6]); 155 | 156 | do { fgets(line, STR_BUFF, rcfile);} while (line[0] == '#'); 157 | } 158 | 159 | 160 | for(i = 0; i < 15; i++) 161 | { 162 | sscanf(line, "%d %d %d %d %d %d %d %d %d", 163 | &cfg_ksafety[i][0], &cfg_ksafety[i][1],&cfg_ksafety[i][2],&cfg_ksafety[i][3], 164 | &cfg_ksafety[i][4], &cfg_ksafety[i][5],&cfg_ksafety[i][6],&cfg_ksafety[i][7], 165 | &cfg_ksafety[i][8]); 166 | 167 | do {fgets(line, STR_BUFF, rcfile);} while ((line[0] == '#') && !feof(rcfile)); 168 | } 169 | 170 | setc = havercfile 171 | + (cfg_devscale << 1) 172 | + (((cfg_scalefac == 1.0) ? 1 : 0) << 2) 173 | + (cfg_razordrop << 3) 174 | + (cfg_cutdrop << 4) 175 | + (cfg_futprune << 5) 176 | + (cfg_smarteval << 6) 177 | + (cfg_attackeval << 7); 178 | 179 | 180 | sprintf(setcode, "%u", setc); 181 | 182 | initialize_eval(); 183 | alloc_hash(); 184 | alloc_ecache(); 185 | 186 | return; 187 | 188 | } 189 | -------------------------------------------------------------------------------- /sjeng/sjeng.ChessEngine.order: -------------------------------------------------------------------------------- 1 | start 2 | _main 3 | _read_rcfile 4 | _initialize_eval 5 | _alloc_hash 6 | _alloc_ecache 7 | _initialize_zobrist 8 | _randomMT 9 | _reloadMT 10 | _init_book 11 | _learn_open 12 | _init_game 13 | _reset_piece_square 14 | _clear_tt 15 | _init_segtb 16 | _load_2piece 17 | _display_board 18 | _rinput 19 | _is_move 20 | _reset_ecache 21 | _CheckBadFlow 22 | _verify_coord 23 | _gen 24 | _push_slidE 25 | _push_knighT 26 | _push_king 27 | _push_pawn 28 | _add_capture 29 | _comp_to_coord 30 | _make 31 | _check_legal 32 | _is_attacked 33 | _unmake 34 | _think 35 | _interrupt 36 | _rtime 37 | _in_check 38 | _choose_book_move 39 | _choose_binary_book_move 40 | _is_draw 41 | _comp_to_san 42 | _eval 43 | _std_eval 44 | _opn_eval 45 | _LoadLearn 46 | _LearnStoreTT 47 | _clear_dp_tt 48 | _search_root 49 | _order_moves 50 | _f_in_check 51 | _search 52 | _qsearch 53 | _QProbeTT 54 | _see 55 | _setup_attackers 56 | _QStoreTT 57 | _stringize_pv 58 | _hash_extract_pv 59 | _ProbeTT 60 | _StoreTT 61 | _post_thinking 62 | _post_fail_thinking 63 | _free_hash 64 | -------------------------------------------------------------------------------- /sjeng/sjeng.h: -------------------------------------------------------------------------------- 1 | /* 2 | Sjeng - a chess variants playing program 3 | Copyright (C) 2000 Gian-Carlo Pascutto 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | 19 | File: sjeng.h 20 | Purpose: global definitions 21 | 22 | */ 23 | 24 | #ifndef SJENG_H 25 | #define SJENG_H 26 | 27 | #include "config.h" 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | 35 | #ifdef HAVE_SYS_TIMEB_H 36 | #include 37 | #endif 38 | 39 | #define NDEBUG 40 | #include 41 | 42 | #define DIE (*(int *)(NULL) = 0) 43 | 44 | /* GCP : my code uses WHITE=0 and BLACK=1 so reverse this */ 45 | 46 | #define WHITE 0 47 | #define BLACK 1 48 | 49 | #define ToMove (white_to_move ? 0 : 1) 50 | #define NotToMove (white_to_move ? 1 : 0) 51 | 52 | #define Hash(x,y) (hash ^= zobrist[(x)][(y)]) 53 | 54 | #define Crazyhouse 0 55 | #define Bughouse 1 56 | #define Normal 2 57 | #define Suicide 3 58 | #define Losers 4 59 | 60 | #define Opening 0 61 | #define Middlegame 1 62 | #define Endgame 2 63 | 64 | #define mindepth 2 65 | 66 | /* define names for piece constants: */ 67 | #define frame 0 68 | #define wpawn 1 69 | #define bpawn 2 70 | #define wknight 3 71 | #define bknight 4 72 | #define wking 5 73 | #define bking 6 74 | #define wrook 7 75 | #define brook 8 76 | #define wqueen 9 77 | #define bqueen 10 78 | #define wbishop 11 79 | #define bbishop 12 80 | #define npiece 13 81 | 82 | /* result flags: */ 83 | #define no_result 0 84 | #define stalemate 1 85 | #define white_is_mated 2 86 | #define black_is_mated 3 87 | #define draw_by_fifty 4 88 | #define draw_by_rep 5 89 | 90 | /* arrays maybe ? */ 91 | #undef FASTCALC 92 | #ifdef FASTCALC 93 | #define rank(square) ((((square)-26)/12)+1) 94 | #define file(square) ((((square)-26)%12)+1) 95 | #else 96 | #define rank(square) (rank[(square)]) 97 | #define file(square) (file[(square)]) 98 | #endif 99 | #define diagl(square) (diagl[(square)]) 100 | #define diagr(square) (diagr[(square)]) 101 | 102 | #ifndef INPROBECODE 103 | typedef enum {FALSE, TRUE} bool; 104 | #endif 105 | 106 | /* castle flags: */ 107 | #define no_castle 0 108 | #define wck 1 109 | #define wcq 2 110 | #define bck 3 111 | #define bcq 4 112 | 113 | typedef struct { 114 | int from; 115 | int target; 116 | int captured; 117 | int promoted; 118 | int castled; 119 | int ep; 120 | } move_s; 121 | 122 | typedef struct { 123 | int cap_num; 124 | int was_promoted; 125 | int epsq; 126 | int fifty; 127 | } move_x; 128 | 129 | #if defined(HAVE_SYS_TIMEB_H) && (defined(HAVE_FTIME) || defined(HAVE_GETTIMEOFDAY)) 130 | typedef struct timeb rtime_t; 131 | #else 132 | typedef time_t rtime_t; 133 | #endif 134 | 135 | #define STR_BUFF 256 136 | #define MOVE_BUFF 512 137 | #define INF 1000000 138 | #define PV_BUFF 300 139 | 140 | #define AddMaterial(x) Material += material[(x)] 141 | #define RemoveMaterial(x) Material -= material[(x)] 142 | 143 | #define UPPER 1 144 | #define LOWER 2 145 | #define EXACT 3 146 | #define HMISS 4 147 | #define DUMMY 0 148 | 149 | #define LOSS 0 150 | #define WIN 1 151 | #define DRAW 2 152 | 153 | #define max(x, y) ((x) > (y) ? (x) : (y)) 154 | #define mix(x, y) ((x) < (y) ? (x) : (y)) 155 | 156 | #endif 157 | -------------------------------------------------------------------------------- /sjeng/sjeng.rc: -------------------------------------------------------------------------------- 1 | # Sample rcfile for Sjeng 11.x 2 | # 3 | # First number is size of hash table (transposition table) 4 | # An entry is about 16 bytes, and there are three tables, 5 | # so the total hash size is the number below times 48. 6 | # Normal, Bughouse, Crazyhouse, Losers 7 | # 8 | 100000 9 | # 10 | # Evaluation cache entries 11 | # An entry is normally about 8 bytes 12 | # Normal, Bughouse, Crazyhouse, Losers 13 | # 14 | 4000 15 | # 16 | # Proofnumber search buffer 17 | # In suicide/giveaway and losers Sjeng uses proofnumbersearch instead 18 | # of the more common alpha-beta search. If the buffer is filled 19 | # Sjeng will have to stop searching. Make this a large 20 | # number if you will play suicide or losers at slow timecontrols. 21 | # You can safely set this to 0 if you do not play suicide/giveaway 22 | # or losers. 23 | # Each entry is about 28 bytes. 24 | # Suicide/Giveaway and Losers only 25 | # 26 | 500000 27 | # 28 | # Kingsafety scalefactor (range 0<->2.5) 29 | # This controls how much emphasis Sjeng will 30 | # put on kingattacks vs material gain. 31 | # The eval can be completely finetuned below. 32 | # Crazyhouse/bughouse only 33 | # 34 | 1.0 35 | # 36 | # Development scaling (1=enabled/0=disabled) 37 | # Sjeng will put less emphasis on trying to 38 | # get pieces on good squares if it does not 39 | # have much material in hand. 40 | # Crazyhouse/bughouse only 41 | 1 42 | # 43 | # Razor drop moves (1=enabled/0=disabled) 44 | # Sjeng will look less deep at 45 | # drop moves that seem passive. 46 | # Crazyhouse/bughouse only 47 | 1 48 | # 49 | # Cut drop moves (1=enabled/0=disabled) 50 | # Sjeng will try to avoid looking at drop moves 51 | # where the dropped piece can be captured immediately. 52 | # EXPERIMENTAL 53 | # Crazyhouse/bughouse only 54 | 1 55 | # 56 | # Book learning 57 | # Sjeng will adjust the openings it plays 58 | # depending on the outcome of the game. 59 | # All variants 60 | 1 61 | # 62 | # Futility pruning/Limited Razoring (1=enabled/0=disabled) 63 | # Sjeng will try to avoid looking at positions 64 | # where it is materially lost, or will look at 65 | # them less deeply. 66 | # All variants 67 | 1 68 | # 69 | # One-reply extension (1=enabled/0=disabeled) 70 | # Sjeng will loop deeper at very forcing lines. 71 | # This can cause Sjeng to see some tactics faster, 72 | # but it may reduce overall search depth. 73 | # Normal/Crazyhouse/Bughouse 74 | 1 75 | # 76 | # Recapture extension (1=enabled/0=disabled) 77 | # Sjeng will treat a recapture like a forced move. 78 | # Normal/Crazyhouse/Bughouse 79 | 1 80 | # 81 | # Use Smarteval (1=enabled/0=disabled) 82 | # This enables the use of an evalution 83 | # which can detect some typical threats, 84 | # but which will also slow the search down. 85 | # Crazyhouse and Bughouse only 86 | 1 87 | # 88 | # Use Attackeval (1=enabled/0=disabled) 89 | # Sjeng will do a full calculation of 90 | # which squares near the king are threatened. 91 | # This will increase its awareness of 92 | # kingsafety, but will also cause it 93 | # to search slower, and hence look less deeply. 94 | # Crazyhouse and Bughouse only 95 | 1 96 | # 97 | # Kingsafety (Crazyhouse/Bughouse only) 98 | # 99 | # The following tables are the 'tropisms'. 100 | # They are basically bonusses for having pieces 101 | # close to the opposing king. The closer our 102 | # pieces are, the better. First number is a 103 | # maximum distance of 1 file/rank. Second 2 etc... 104 | # 105 | # Pawn tropisms 106 | 40 20 10 3 1 1 0 107 | # Bishop tropisms 108 | 50 25 15 5 2 2 2 109 | # Knight tropisms 110 | 50 70 35 10 2 1 0 111 | # Rook tropisms 112 | 50 40 15 5 1 1 0 113 | # Queen tropisms 114 | 100 60 20 5 2 0 0 115 | # 116 | # 117 | # KingAttacks table (Crazyhouse/Bughouse only) 118 | # 119 | # The following table is used to give penalties 120 | # depending on the number of squares around our 121 | # king that are attacked, taking into account 122 | # the pieces in our opponents hand. 123 | # 124 | # It is only used if AttackEval is also enabled 125 | # 126 | # 127 | # Columns are the number of squares that are attacked. 128 | # Rows are the number of points in the opponents hand. 129 | # 130 | -5 5 10 15 50 80 150 150 150 131 | -5 15 20 25 70 150 200 200 200 132 | -5 15 30 30 100 200 300 300 300 133 | -10 20 40 40 100 200 300 300 400 134 | -10 30 50 80 150 300 400 400 500 135 | -10 35 60 100 200 250 400 400 500 136 | -10 40 70 110 210 300 500 500 600 137 | -10 45 75 125 215 300 500 600 700 138 | -10 60 90 130 240 350 500 600 700 139 | -15 60 95 145 260 350 500 600 700 140 | -15 60 100 150 270 350 500 600 700 141 | -15 60 110 160 280 400 600 700 800 142 | -20 70 115 165 290 400 600 700 800 143 | -20 80 120 170 300 450 700 800 900 144 | -20 80 125 175 310 450 700 800 900 145 | -------------------------------------------------------------------------------- /sjeng/squares.h: -------------------------------------------------------------------------------- 1 | /* 2 | Sjeng - a chess variants playing program 3 | Copyright (C) 2000-2001 Gian-Carlo Pascutto 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | 19 | File: squares.h 20 | Purpose: contains squares definitions 21 | 22 | */ 23 | 24 | #define A1 26 25 | #define B1 27 26 | #define C1 28 27 | #define D1 29 28 | #define E1 30 29 | #define F1 31 30 | #define G1 32 31 | #define H1 33 32 | 33 | #define A2 38 34 | #define B2 39 35 | #define C2 40 36 | #define D2 41 37 | #define E2 42 38 | #define F2 43 39 | #define G2 44 40 | #define H2 45 41 | 42 | #define A3 50 43 | #define B3 51 44 | #define C3 52 45 | #define D3 53 46 | #define E3 54 47 | #define F3 55 48 | #define G3 56 49 | #define H3 57 50 | 51 | #define A4 62 52 | #define B4 63 53 | #define C4 64 54 | #define D4 65 55 | #define E4 66 56 | #define F4 67 57 | #define G4 68 58 | #define H4 69 59 | 60 | #define A5 74 61 | #define B5 75 62 | #define C5 76 63 | #define D5 77 64 | #define E5 78 65 | #define F5 79 66 | #define G5 80 67 | #define H5 81 68 | #define A6 86 69 | #define B6 87 70 | #define C6 88 71 | #define D6 89 72 | #define E6 90 73 | #define F6 91 74 | #define G6 92 75 | #define H6 93 76 | 77 | #define A7 98 78 | #define B7 99 79 | #define C7 100 80 | #define D7 101 81 | #define E7 102 82 | #define F7 103 83 | #define G7 104 84 | #define H7 105 85 | 86 | #define A8 110 87 | #define B8 111 88 | #define C8 112 89 | #define D8 113 90 | #define E8 114 91 | #define F8 115 92 | #define G8 116 93 | #define H8 117 94 | -------------------------------------------------------------------------------- /sjeng/stamp-h: -------------------------------------------------------------------------------- 1 | timestamp 2 | -------------------------------------------------------------------------------- /sjeng/stamp-h.in: -------------------------------------------------------------------------------- 1 | timestamp 2 | -------------------------------------------------------------------------------- /sjeng/tests/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile.in generated by automake 1.6.3 from Makefile.am. 2 | # tests/Makefile. Generated from Makefile.in by configure. 3 | 4 | # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 5 | # Free Software Foundation, Inc. 6 | # This Makefile.in is free software; the Free Software Foundation 7 | # gives unlimited permission to copy and/or distribute it, 8 | # with or without modifications, as long as this notice is preserved. 9 | 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY, to the extent permitted by law; without 12 | # even the implied warranty of MERCHANTABILITY or FITNESS FOR A 13 | # PARTICULAR PURPOSE. 14 | 15 | 16 | SHELL = /bin/sh 17 | 18 | srcdir = . 19 | top_srcdir = .. 20 | 21 | prefix = /usr/local 22 | exec_prefix = ${prefix} 23 | 24 | bindir = ${exec_prefix}/bin 25 | sbindir = ${exec_prefix}/sbin 26 | libexecdir = ${exec_prefix}/libexec 27 | datadir = ${prefix}/share 28 | sysconfdir = ${prefix}/etc 29 | sharedstatedir = ${prefix}/com 30 | localstatedir = ${prefix}/var 31 | libdir = ${exec_prefix}/lib 32 | infodir = ${prefix}/info 33 | mandir = ${prefix}/man 34 | includedir = ${prefix}/include 35 | oldincludedir = /usr/include 36 | pkgdatadir = $(datadir)/Sjeng-Free 37 | pkglibdir = $(libdir)/Sjeng-Free 38 | pkgincludedir = $(includedir)/Sjeng-Free 39 | top_builddir = .. 40 | 41 | ACLOCAL = aclocal-1.6 42 | AUTOCONF = autoconf 43 | AUTOMAKE = automake-1.6 44 | AUTOHEADER = autoheader 45 | 46 | am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 47 | INSTALL = /sw/bin/install -c 48 | INSTALL_PROGRAM = ${INSTALL} 49 | INSTALL_DATA = ${INSTALL} -m 644 50 | install_sh_DATA = $(install_sh) -c -m 644 51 | install_sh_PROGRAM = $(install_sh) -c 52 | install_sh_SCRIPT = $(install_sh) -c 53 | INSTALL_SCRIPT = ${INSTALL} 54 | INSTALL_HEADER = $(INSTALL_DATA) 55 | transform = s,x,x, 56 | NORMAL_INSTALL = : 57 | PRE_INSTALL = : 58 | POST_INSTALL = : 59 | NORMAL_UNINSTALL = : 60 | PRE_UNINSTALL = : 61 | POST_UNINSTALL = : 62 | 63 | EXEEXT = 64 | OBJEXT = o 65 | PATH_SEPARATOR = : 66 | AMTAR = tar 67 | AWK = gawk 68 | CC = gcc 69 | CXX = g++ 70 | DEPDIR = .deps 71 | INSTALL_STRIP_PROGRAM = ${SHELL} $(install_sh) -c -s 72 | PACKAGE = Sjeng-Free 73 | STRIP = 74 | VERSION = 11.2 75 | am__include = include 76 | am__quote = 77 | install_sh = $(top_builddir)/install-sh 78 | EXTRA_DIST = bk.epd bt2630.epd lct2.epd wac.epd ecm98.epd 79 | subdir = tests 80 | mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs 81 | CONFIG_HEADER = $(top_builddir)/config.h 82 | CONFIG_CLEAN_FILES = 83 | depcomp = 84 | am__depfiles_maybe = 85 | DIST_SOURCES = 86 | DIST_COMMON = Makefile.am Makefile.in 87 | all: all-am 88 | 89 | .SUFFIXES: 90 | $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) 91 | cd $(top_srcdir) && \ 92 | $(AUTOMAKE) --gnu --ignore-deps tests/Makefile 93 | Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status 94 | cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) 95 | uninstall-info-am: 96 | tags: TAGS 97 | TAGS: 98 | 99 | DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 100 | 101 | top_distdir = .. 102 | distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) 103 | 104 | distdir: $(DISTFILES) 105 | @list='$(DISTFILES)'; for file in $$list; do \ 106 | if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ 107 | dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ 108 | if test "$$dir" != "$$file" && test "$$dir" != "."; then \ 109 | dir="/$$dir"; \ 110 | $(mkinstalldirs) "$(distdir)$$dir"; \ 111 | else \ 112 | dir=''; \ 113 | fi; \ 114 | if test -d $$d/$$file; then \ 115 | if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ 116 | cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ 117 | fi; \ 118 | cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ 119 | else \ 120 | test -f $(distdir)/$$file \ 121 | || cp -p $$d/$$file $(distdir)/$$file \ 122 | || exit 1; \ 123 | fi; \ 124 | done 125 | check-am: all-am 126 | check: check-am 127 | all-am: Makefile 128 | 129 | installdirs: 130 | 131 | install: install-am 132 | install-exec: install-exec-am 133 | install-data: install-data-am 134 | uninstall: uninstall-am 135 | 136 | install-am: all-am 137 | @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am 138 | 139 | installcheck: installcheck-am 140 | install-strip: 141 | $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ 142 | INSTALL_STRIP_FLAG=-s \ 143 | `test -z '$(STRIP)' || \ 144 | echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 145 | mostlyclean-generic: 146 | 147 | clean-generic: 148 | 149 | distclean-generic: 150 | -rm -f Makefile $(CONFIG_CLEAN_FILES) 151 | 152 | maintainer-clean-generic: 153 | @echo "This command is intended for maintainers to use" 154 | @echo "it deletes files that may require special tools to rebuild." 155 | clean: clean-am 156 | 157 | clean-am: clean-generic mostlyclean-am 158 | 159 | distclean: distclean-am 160 | 161 | distclean-am: clean-am distclean-generic 162 | 163 | dvi: dvi-am 164 | 165 | dvi-am: 166 | 167 | info: info-am 168 | 169 | info-am: 170 | 171 | install-data-am: 172 | 173 | install-exec-am: 174 | 175 | install-info: install-info-am 176 | 177 | install-man: 178 | 179 | installcheck-am: 180 | 181 | maintainer-clean: maintainer-clean-am 182 | 183 | maintainer-clean-am: distclean-am maintainer-clean-generic 184 | 185 | mostlyclean: mostlyclean-am 186 | 187 | mostlyclean-am: mostlyclean-generic 188 | 189 | uninstall-am: uninstall-info-am 190 | 191 | .PHONY: all all-am check check-am clean clean-generic distclean \ 192 | distclean-generic distdir dvi dvi-am info info-am install \ 193 | install-am install-data install-data-am install-exec \ 194 | install-exec-am install-info install-info-am install-man \ 195 | install-strip installcheck installcheck-am installdirs \ 196 | maintainer-clean maintainer-clean-generic mostlyclean \ 197 | mostlyclean-generic uninstall uninstall-am uninstall-info-am 198 | 199 | # Tell versions [3.59,3.63) of GNU make to not export all variables. 200 | # Otherwise a system limit (for SysV at least) may be exceeded. 201 | .NOEXPORT: 202 | -------------------------------------------------------------------------------- /sjeng/tests/Makefile.am: -------------------------------------------------------------------------------- 1 | EXTRA_DIST = bk.epd bt2630.epd lct2.epd wac.epd ecm98.epd 2 | -------------------------------------------------------------------------------- /sjeng/tests/Makefile.in: -------------------------------------------------------------------------------- 1 | # Makefile.in generated by automake 1.6.3 from Makefile.am. 2 | # @configure_input@ 3 | 4 | # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 5 | # Free Software Foundation, Inc. 6 | # This Makefile.in is free software; the Free Software Foundation 7 | # gives unlimited permission to copy and/or distribute it, 8 | # with or without modifications, as long as this notice is preserved. 9 | 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY, to the extent permitted by law; without 12 | # even the implied warranty of MERCHANTABILITY or FITNESS FOR A 13 | # PARTICULAR PURPOSE. 14 | 15 | @SET_MAKE@ 16 | SHELL = @SHELL@ 17 | 18 | srcdir = @srcdir@ 19 | top_srcdir = @top_srcdir@ 20 | VPATH = @srcdir@ 21 | prefix = @prefix@ 22 | exec_prefix = @exec_prefix@ 23 | 24 | bindir = @bindir@ 25 | sbindir = @sbindir@ 26 | libexecdir = @libexecdir@ 27 | datadir = @datadir@ 28 | sysconfdir = @sysconfdir@ 29 | sharedstatedir = @sharedstatedir@ 30 | localstatedir = @localstatedir@ 31 | libdir = @libdir@ 32 | infodir = @infodir@ 33 | mandir = @mandir@ 34 | includedir = @includedir@ 35 | oldincludedir = /usr/include 36 | pkgdatadir = $(datadir)/@PACKAGE@ 37 | pkglibdir = $(libdir)/@PACKAGE@ 38 | pkgincludedir = $(includedir)/@PACKAGE@ 39 | top_builddir = .. 40 | 41 | ACLOCAL = @ACLOCAL@ 42 | AUTOCONF = @AUTOCONF@ 43 | AUTOMAKE = @AUTOMAKE@ 44 | AUTOHEADER = @AUTOHEADER@ 45 | 46 | am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 47 | INSTALL = @INSTALL@ 48 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ 49 | INSTALL_DATA = @INSTALL_DATA@ 50 | install_sh_DATA = $(install_sh) -c -m 644 51 | install_sh_PROGRAM = $(install_sh) -c 52 | install_sh_SCRIPT = $(install_sh) -c 53 | INSTALL_SCRIPT = @INSTALL_SCRIPT@ 54 | INSTALL_HEADER = $(INSTALL_DATA) 55 | transform = @program_transform_name@ 56 | NORMAL_INSTALL = : 57 | PRE_INSTALL = : 58 | POST_INSTALL = : 59 | NORMAL_UNINSTALL = : 60 | PRE_UNINSTALL = : 61 | POST_UNINSTALL = : 62 | 63 | EXEEXT = @EXEEXT@ 64 | OBJEXT = @OBJEXT@ 65 | PATH_SEPARATOR = @PATH_SEPARATOR@ 66 | AMTAR = @AMTAR@ 67 | AWK = @AWK@ 68 | CC = @CC@ 69 | CXX = @CXX@ 70 | DEPDIR = @DEPDIR@ 71 | INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ 72 | PACKAGE = @PACKAGE@ 73 | STRIP = @STRIP@ 74 | VERSION = @VERSION@ 75 | am__include = @am__include@ 76 | am__quote = @am__quote@ 77 | install_sh = @install_sh@ 78 | EXTRA_DIST = bk.epd bt2630.epd lct2.epd wac.epd ecm98.epd 79 | subdir = tests 80 | mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs 81 | CONFIG_HEADER = $(top_builddir)/config.h 82 | CONFIG_CLEAN_FILES = 83 | depcomp = 84 | am__depfiles_maybe = 85 | DIST_SOURCES = 86 | DIST_COMMON = Makefile.am Makefile.in 87 | all: all-am 88 | 89 | .SUFFIXES: 90 | $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) 91 | cd $(top_srcdir) && \ 92 | $(AUTOMAKE) --gnu --ignore-deps tests/Makefile 93 | Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status 94 | cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) 95 | uninstall-info-am: 96 | tags: TAGS 97 | TAGS: 98 | 99 | DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 100 | 101 | top_distdir = .. 102 | distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) 103 | 104 | distdir: $(DISTFILES) 105 | @list='$(DISTFILES)'; for file in $$list; do \ 106 | if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ 107 | dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ 108 | if test "$$dir" != "$$file" && test "$$dir" != "."; then \ 109 | dir="/$$dir"; \ 110 | $(mkinstalldirs) "$(distdir)$$dir"; \ 111 | else \ 112 | dir=''; \ 113 | fi; \ 114 | if test -d $$d/$$file; then \ 115 | if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ 116 | cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ 117 | fi; \ 118 | cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ 119 | else \ 120 | test -f $(distdir)/$$file \ 121 | || cp -p $$d/$$file $(distdir)/$$file \ 122 | || exit 1; \ 123 | fi; \ 124 | done 125 | check-am: all-am 126 | check: check-am 127 | all-am: Makefile 128 | 129 | installdirs: 130 | 131 | install: install-am 132 | install-exec: install-exec-am 133 | install-data: install-data-am 134 | uninstall: uninstall-am 135 | 136 | install-am: all-am 137 | @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am 138 | 139 | installcheck: installcheck-am 140 | install-strip: 141 | $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ 142 | INSTALL_STRIP_FLAG=-s \ 143 | `test -z '$(STRIP)' || \ 144 | echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 145 | mostlyclean-generic: 146 | 147 | clean-generic: 148 | 149 | distclean-generic: 150 | -rm -f Makefile $(CONFIG_CLEAN_FILES) 151 | 152 | maintainer-clean-generic: 153 | @echo "This command is intended for maintainers to use" 154 | @echo "it deletes files that may require special tools to rebuild." 155 | clean: clean-am 156 | 157 | clean-am: clean-generic mostlyclean-am 158 | 159 | distclean: distclean-am 160 | 161 | distclean-am: clean-am distclean-generic 162 | 163 | dvi: dvi-am 164 | 165 | dvi-am: 166 | 167 | info: info-am 168 | 169 | info-am: 170 | 171 | install-data-am: 172 | 173 | install-exec-am: 174 | 175 | install-info: install-info-am 176 | 177 | install-man: 178 | 179 | installcheck-am: 180 | 181 | maintainer-clean: maintainer-clean-am 182 | 183 | maintainer-clean-am: distclean-am maintainer-clean-generic 184 | 185 | mostlyclean: mostlyclean-am 186 | 187 | mostlyclean-am: mostlyclean-generic 188 | 189 | uninstall-am: uninstall-info-am 190 | 191 | .PHONY: all all-am check check-am clean clean-generic distclean \ 192 | distclean-generic distdir dvi dvi-am info info-am install \ 193 | install-am install-data install-data-am install-exec \ 194 | install-exec-am install-info install-info-am install-man \ 195 | install-strip installcheck installcheck-am installdirs \ 196 | maintainer-clean maintainer-clean-generic mostlyclean \ 197 | mostlyclean-generic uninstall uninstall-am uninstall-info-am 198 | 199 | # Tell versions [3.59,3.63) of GNU make to not export all variables. 200 | # Otherwise a system limit (for SysV at least) may be exceeded. 201 | .NOEXPORT: 202 | -------------------------------------------------------------------------------- /sjeng/tests/bk.epd: -------------------------------------------------------------------------------- 1 | 1k1r4/pp1b1R2/3q2pp/4p3/2B5/4Q3/PPP2B2/2K5 b - - bm Qd1+; id "position 01"; 2 | 3r1k2/4npp1/1ppr3p/p6P/P2PPPP1/1NR5/5K2/2R5 w - - bm d5; id "position 02"; 3 | 2q1rr1k/3bbnnp/p2p1pp1/2pPp3/PpP1P1P1/1P2BNNP/2BQ1PRK/7R b - - bm f5; id "position 03"; 4 | rnbqkb1r/p3pppp/1p6/2ppP3/3N4/2P5/PPP1QPPP/R1B1KB1R w KQkq - bm e6; id "position 04"; 5 | r1b2rk1/2q1b1pp/p2ppn2/1p6/3QP3/1BN1B3/PPP3PP/R4RK1 w - - bm Nd5 a4; id "position 05"; 6 | 2r3k1/pppR1pp1/4p3/4P1P1/5P2/1P4K1/P1P5/8 w - - bm g6; id "position 06"; 7 | 1nk1r1r1/pp2n1pp/4p3/q2pPp1N/b1pP1P2/B1P2R2/2P1B1PP/R2Q2K1 w - - bm Nf6; id "position 07"; 8 | 4b3/p3kp2/6p1/3pP2p/2pP1P2/4K1P1/P3N2P/8 w - - bm f5; id "position 08"; 9 | 2kr1bnr/pbpq4/2n1pp2/3p3p/3P1P1B/2N2N1Q/PPP3PP/2KR1B1R w - - bm f5; id "position 09"; 10 | 3rr1k1/pp3pp1/1qn2np1/8/3p4/PP1R1P2/2P1NQPP/R1B3K1 b - - bm Ne5; id "position 10"; 11 | 2r1nrk1/p2q1ppp/bp1p4/n1pPp3/P1P1P3/2PBB1N1/4QPPP/R4RK1 w - - bm f4; id "position 11"; 12 | r3r1k1/ppqb1ppp/8/4p1NQ/8/2P5/PP3PPP/R3R1K1 b - - bm Bf5; id "position 12"; 13 | r2q1rk1/4bppp/p2p4/2pP4/3pP3/3Q4/PP1B1PPP/R3R1K1 w - - bm b4; id "position 13"; 14 | rnb2r1k/pp2p2p/2pp2p1/q2P1p2/8/1Pb2NP1/PB2PPBP/R2Q1RK1 w - - bm Qd2; id "position 14"; 15 | 2r3k1/1p2q1pp/2b1pr2/p1pp4/6Q1/1P1PP1R1/P1PN2PP/5RK1 w - - bm Qxg7+; id "position 15"; 16 | r1bqkb1r/4npp1/p1p4p/1p1pP1B1/8/1B6/PPPN1PPP/R2Q1RK1 W kq - bm Ne4; id "position 16"; 17 | r2q1rk1/1ppnbppp/p2p1nb1/3Pp3/2P1P1P1/2N2N1P/PPB1QP2/R1B2RK1 b - - bm h5; id "position 17"; 18 | r1bq1rk1/pp2ppbp/2np2p1/2n5/P3PP2/N1P2N2/1PB3PP/R1B1QRK1 b - - bm Nb3; id "position 18"; 19 | 3rr3/2pq2pk/p2p1pnp/8/2QBPP2/1P6/P5PP/4RRK1 b - - bm Rxe4; id "position 19"; 20 | r4k2/pb2bp1r/1p1qp2p/3pNp2/3P1P2/2N3P1/PPP1Q2P/2KRR3 w - - bm g4; id "position 20"; 21 | 3rn2k/ppb2rpp/2ppqp2/5N2/2P1P3/1P5Q/PB3PPP/3RR1K1 w - - bm Nh6; id "position 21"; 22 | 2r2rk1/1bqnbpp1/1p1ppn1p/pP6/N1P1P3/P2B1N1P/1B2QPP1/R2R2K1 b - - bm Bxe4; id "position 22"; 23 | r1bqk2r/pp2bppp/2p5/3pP3/P2Q1P2/2N1B3/1PP3PP/R4RK1 b kq - bm f6; id "position 23"; 24 | r2qnrnk/p2b2b1/1p1p2pp/2pPpp2/1PP1P3/PRNBB3/3QNPPP/5RK1 w - - bm f4; id "position 24"; 25 | -------------------------------------------------------------------------------- /sjeng/tests/bt2630.epd: -------------------------------------------------------------------------------- 1 | rq2r1k1/5pp1/p7/4bNP1/1p2P2P/5Q2/PP4K1/5R1R w - - bm Nxg7; id "test 1"; 2 | 6k1/2b2p1p/ppP3p1/4p3/PP1B4/5PP1/7P/7K w - - bm Bxb6; id "test 2"; 3 | 5r1k/p1q2pp1/1pb4p/n3R1NQ/7P/3B1P2/2P3P1/7K w - - bm Re6; id "test 3"; 4 | 5r1k/1P4pp/3P1p2/4p3/1P5P/3q2P1/Q2b2K1/B3R3 w - - bm Qf7; id "test 4"; 5 | 3B4/8/2B5/1K6/8/8/3p4/3k4 w - - bm Ka6; id "test 5"; 6 | 1k1r4/1pp4p/2n5/P6R/2R1p1r1/2P2p2/1PP2B1P/4K3 b - - bm e3; id "test 6"; 7 | 6k1/p3q2p/1nr3pB/8/3Q1P2/6P1/PP5P/3R2K1 b - - bm Rd6; id "test 7"; 8 | 2krr3/1p4pp/p1bRpp1n/2p5/P1B1PP2/8/1PP3PP/R1K3B1 w - - bm Rxc6+; id "test 8"; 9 | r5k1/pp2p1bp/6p1/n1p1P3/2qP1NP1/2PQB3/P5PP/R4K2 b - - bm g5; id "test 9"; 10 | 2r3k1/1qr1b1p1/p2pPn2/nppPp3/8/1PP1B2P/P1BQ1P2/5KRR w - - bm Rxg7+; id "test 10"; 11 | 1br3k1/p4p2/2p1r3/3p1b2/3Bn1p1/1P2P1Pq/P3Q1BP/2R1NRK1 b - - bm Qxh2+; id "test 11"; 12 | 8/pp3k2/2p1qp2/2P5/5P2/1R2p1rp/PP2R3/4K2Q b - - bm Qe4; id "test 12"; 13 | 2bq3k/2p4p/p2p4/7P/1nBPPQP1/r1p5/8/1K1R2R1 b - - bm Be6; id "test 13"; 14 | 3r1rk1/1p3pnp/p3pBp1/1qPpP3/1P1P2R1/P2Q3R/6PP/6K1 w - - bm Rxh7; id "test 14"; 15 | 2b1q3/p7/1p1p2kb/nPpN3p/P1P1P2P/6P1/5R1K/5Q2 w - - bm e5; id "test 15"; 16 | 2krr3/pppb1ppp/3b4/3q4/3P3n/2P2N1P/PP2B1P1/R1BQ1RK1 b - - bm Nxg2; id "test 16"; 17 | 4r1k1/p1qr1p2/2pb1Bp1/1p5p/3P1n1R/3B1P2/PP3PK1/2Q4R w - - bm Qxf4; id "test 17"; 18 | 8/4p3/8/3P3p/P2pK3/6P1/7b/3k4 w - - bm d6; id "test 18"; 19 | 3r2k1/pp4B1/6pp/PP1Np2n/2Pp1p2/3P2Pq/3QPPbP/R4RK1 b - - bm f3; id "test 19"; 20 | r4rk1/5p2/1n4pQ/2p5/p5P1/P4N2/1qb1BP1P/R3R1K1 w - - bm Ra2; id "test 20"; 21 | k7/8/PP1b2P1/K2Pn2P/4R3/8/6np/8 w - - bm Re1; id "test 21"; 22 | rnb1k2r/pp2qppp/3p1n2/2pp2B1/1bP5/2N1P3/PP2NPPP/R2QKB1R w KQkq - bm a3; id "test 22"; 23 | 8/7p/8/p4p2/5K2/Bpk3P1/4P2P/8 w - - bm g4; id "test 23"; 24 | R7/3p3p/8/3P2P1/3k4/1p5p/1P1NKP1P/7q w - - bm g6; id "test 24"; 25 | 8/8/3k1p2/p2BnP2/4PN2/1P2K1p1/8/5b2 b - - bm Nd3; id "test 25"; 26 | 2r3k1/pbr1q2p/1p2pnp1/3p4/3P1P2/1P1BR3/PB1Q2PP/5RK1 w - - bm f5; id "test 26"; 27 | 3r2k1/p2r2p1/1p1B2Pp/4PQ1P/2b1p3/P3P3/7K/8 w - - bm e6; id "test 27"; 28 | rnb1k1nr/p2p1ppp/3B4/1p1N1N1P/4P1P1/3P1Q2/PqP5/R4Kb1 w kq - bm e5; id "test 28"; 29 | r1b1kb1r/pp1n1ppp/2q5/2p3B1/Q1B5/2p2N2/PP3PPP/R3K2R w KQkq - bm O-O-O; id "test 29"; 30 | 2k5/2p3Rp/p1pb4/1p2p3/4P3/PN1P1P2/1P2KP1r/8 w - - bm f4; id "test 30"; 31 | 32 | -------------------------------------------------------------------------------- /sjeng/tests/lct2.epd: -------------------------------------------------------------------------------- 1 | r3kb1r/3n1pp1/p6p/2pPp2q/Pp2N3/3B2PP/1PQ2P2/R3K2R w KQkq - bm d6; id "POS-01"; 2 | 1k1r3r/pp2qpp1/3b1n1p/3pNQ2/2pP1P2/2N1P3/PP4PP/1K1RR3 b - - bm Bb4; id "POS-02"; 3 | r6k/pp4p1/2p1b3/3pP3/7q/P2B3r/1PP2Q1P/2K1R1R1 w - - bm Qc5; id "POS-03"; 4 | 1nr5/2rbkppp/p3p3/Np6/2PRPP2/8/PKP1B1PP/3R4 b - - bm e5; id "POS-04"; 5 | 2r2rk1/1p1bq3/p3p2p/3pPpp1/1P1Q4/P7/2P2PPP/2R1RBK1 b - - bm Bb5; id "POS-05"; 6 | 3r1bk1/p4ppp/Qp2p3/8/1P1B4/Pq2P1P1/2r2P1P/R3R1K1 b - - bm e5; id "POS-06"; 7 | r1b2r1k/pp2q1pp/2p2p2/2p1n2N/4P3/1PNP2QP/1PP2RP1/5RK1 w - - bm Nd1; id "POS-07"; 8 | r2qrnk1/pp3ppb/3b1n1p/1Pp1p3/2P1P2N/P5P1/1B1NQPBP/R4RK1 w - - bm Bh3; id "POS-08"; 9 | 5nk1/Q4bpp/5p2/8/P1n1PN2/q4P2/6PP/1R4K1 w - - bm Qd4; id "POS-09"; 10 | r3k2r/3bbp1p/p1nppp2/5P2/1p1NP3/5NP1/PPPK3P/3R1B1R b kq - bm Bf8; id "POS-10"; 11 | bn6/1q4n1/1p1p1kp1/2pPp1pp/1PP1P1P1/3N1P1P/4B1K1/2Q2N2 w - - bm h4; id "POS-11"; 12 | 3r2k1/pp2npp1/2rqp2p/8/3PQ3/1BR3P1/PP3P1P/3R2K1 b - - bm Rd6; id "POS-12"; 13 | 1r2r1k1/4ppbp/B5p1/3P4/pp1qPB2/2n2Q1P/P4PP1/4RRK1 b - - bm Na2; id "POS-13"; 14 | r2qkb1r/1b3ppp/p3pn2/1p6/1n1P4/1BN2N2/PP2QPPP/R1BR2K1 w kq - bm d5; id "POS-14"; 15 | 1r4k1/1q2bp2/3p2p1/2pP4/p1N4R/2P2QP1/1P3PK1/8 w - - bm Nd6; id "CMB-01"; 16 | rn3rk1/pbppq1pp/1p2pb2/4N2Q/3PN3/3B4/PPP2PPP/R3K2R w KQ - bm Qh7; id "CMB-02"; 17 | 4r1k1/3b1p2/5qp1/1BPpn2p/7n/r3P1N1/2Q1RPPP/1R3NK1 b - - bm Qf3; id "CMB-03"; 18 | 2k2b1r/1pq3p1/2p1pp2/p1n1PnNp/2P2B2/2N4P/PP2QPP1/3R2K1 w - - bm ef6; id "CMB-04"; 19 | 2r2r2/3qbpkp/p3n1p1/2ppP3/6Q1/1P1B3R/PBP3PP/5R1K w - - bm Rh7; id "CMB-05"; 20 | 2r1k2r/2pn1pp1/1p3n1p/p3PP2/4q2B/P1P5/2Q1N1PP/R4RK1 w q - bm ef6; id "CMB-06"; 21 | 2rr2k1/1b3ppp/pb2p3/1p2P3/1P2BPnq/P1N3P1/1B2Q2P/R4R1K b - - bm Rc3; id "CMB-07"; 22 | 2b1r1k1/r4ppp/p7/2pNP3/4Q3/q6P/2P2PP1/3RR1K1 w - - bm Nf6; id "CMB-08"; 23 | 6k1/5p2/3P2p1/7n/3QPP2/7q/r2N3P/6RK b - - bm Rd2; id "CMB-09"; 24 | rq2rbk1/6p1/p2p2Pp/1p1Rn3/4PB2/6Q1/PPP1B3/2K3R1 w - - bm Bh6; id "CMB-10"; 25 | rnbq2k1/p1r2p1p/1p1p1Pp1/1BpPn1N1/P7/2P5/6PP/R1B1QRK1 w - - bm Nh7; id "CMB-11"; 26 | r2qrb1k/1p1b2p1/p2ppn1p/8/3NP3/1BN5/PPP3QP/1K3RR1 w - - bm e5; id "CMB-12"; 27 | 8/1p3pp1/7p/5P1P/2k3P1/8/2K2P2/8 w - - bm f6; id "FIN-01"; 28 | 8/pp2r1k1/2p1p3/3pP2p/1P1P1P1P/P5KR/8/8 w - - bm f5; id "FIN-02"; 29 | 8/3p4/p1bk3p/Pp6/1Kp1PpPp/2P2P1P/2P5/5B2 b - - bm Be4; id "FIN-03"; 30 | 5k2/7R/4P2p/5K2/p1r2P1p/8/8/8 b - - bm h3; id "FIN-04"; 31 | 6k1/6p1/7p/P1N5/1r3p2/7P/1b3PP1/3bR1K1 w - - bm a6; id "FIN-05"; 32 | 8/3b4/5k2/2pPnp2/1pP4N/pP1B2P1/P3K3/8 b - - bm f4; id "FIN-06"; 33 | 6k1/4pp1p/3p2p1/P1pPb3/R7/1r2P1PP/3B1P2/6K1 w - - bm Bb4 ; id "FIN-07"; 34 | 2k5/p7/Pp1p1b2/1P1P1p2/2P2P1p/3K3P/5B2/8 w - - bm c5; id "FIN-08"; 35 | 8/5Bp1/4P3/6pP/1b1k1P2/5K2/8/8 w - - bm Kg4; id "FIN-09"; 36 | --------------------------------------------------------------------------------