{"content":{"sharePage":{"page":0,"digests":[{"id":"51822858","dateCreated":"1331990063","smartDate":"Mar 17, 2012","userCreated":{"username":"kenshinhere","url":"https:\/\/www.wikispaces.com\/user\/view\/kenshinhere","imageUrl":"https:\/\/www.wikispaces.com\/i\/user_none_lg.jpg"},"monitored":false,"locked":false,"links":{"self":"https:\/\/chessprogramming.wikispaces.com\/share\/view\/51822858"},"dateDigested":1531463320,"startDate":null,"sharedType":"discussion","title":"Need some help","description":"Guys, sorry for the generalized subject, but I need some help in varying areas. First, I am looking forward to creating NOT a strong chess engine, but a chess playing engine which can LEARN how to play over time.
\nI know the idea is far fetched, but instead of calculating best moves according to positional evaluation, I want it to learn recognizing good patterns in chess tactics and start applying them if it finds it a suitable position, and then learn from its mistakes by playing stronger opponents.
\nNo opening books, no endgame tablebases, just learning. Now I dunno how I can successfully TEACH the rules of the game before I let it try out its own moves. Any help would be much appreciated.
\nAnd, before all that I want to create a differently-implemented normal chess engine which doesn't LEARN.
\nI want to create Objects (under classes or structures) having related data members, like a board object has its own related 64 square objects and 2 white knight objects and 1 white light squared bishop object and, I hope you get the idea!
\nWhile the white light squared bishop object also has a propety occupyingSquare, which points to the square occupied by it on the board, say a2, the a2 square object also has the occupiedBy property which points to the white light squared bishop object. Likewise, by applying inter-nesting to all possible relations (board has pieces and squares, squares are empty or have pieces, pieces may be out of board (captured) or on squares, board has a position, score, result, movelist, etc) I want to create a better object-oriented programming concept, instead of using bitboards.
\nNow I dunno if it will have speed improvements over bitboards, but I definitely want to try this out. Hoping someone can help me with the proper nesting idea. :) Thanks!","replyPages":[{"page":0,"digests":[{"id":"51860646","body":"While I don't have a proper nesting idea for you, I hope you'll fine enough suggestions in cpw and it various links, i.e. on Learning. For an OO design with piece- and square-objects etc. - that tends to be slow if you dynamically allocate those objects on the heap. I would prefer a position object and to keep squares, pieces and moves as pre-allocated arrays of integers, aka mailbox, and arrays of moves, and stacks of positions. You'll may post in CCC<\/a> as well for more feedback. Good luck and fun.
\n
\nGerd","dateCreated":"1332139256","smartDate":"Mar 18, 2012","userCreated":{"username":"GerdIsenberg","url":"https:\/\/www.wikispaces.com\/user\/view\/GerdIsenberg","imageUrl":"https:\/\/www.wikispaces.com\/user\/pic\/1202793136\/GerdIsenberg-lg.jpg"}},{"id":"51986432","body":"Hey sry for the late reply, but was having net problems.
\nI'm not wanting to create a very fast, strong chess engine, rather I want to create a solid OO chess engine (fully) so that I can keep building on it. I've started working on the inter-relationships and am hoping to finish by May. Doing a proper OO approach is my priority. Thanks a lot for your response. :)
\nAnd I hope you'll be here for some more help I might need along the way. Judging by your contribution, I KNOW you'll be. Thanks a lot for even having created something like this.
\nAnd, on a special note, I need some help with UCI protocol. Currently I'm running my engine (basic, bitboard, derived from WingletX as didactic) using WinBoard, because that's all I could get from Stef Luijten's website and tutorial on a chess program in 99 steps. Now I don't know how UCI communicates. Any suggestions?","dateCreated":"1332364842","smartDate":"Mar 21, 2012","userCreated":{"username":"kenshinhere","url":"https:\/\/www.wikispaces.com\/user\/view\/kenshinhere","imageUrl":"https:\/\/www.wikispaces.com\/i\/user_none_lg.jpg"}},{"id":"52003580","body":"You are welcome, feel free to ask concrete questions.
\n
\nOn UCI and WinBoard\/XBoard, I am a novice by myself. See
CPW-Engine_com<\/a> or other open sources.
\n
\nGerd","dateCreated":"1332401252","smartDate":"Mar 22, 2012","userCreated":{"username":"GerdIsenberg","url":"https:\/\/www.wikispaces.com\/user\/view\/GerdIsenberg","imageUrl":"https:\/\/www.wikispaces.com\/user\/pic\/1202793136\/GerdIsenberg-lg.jpg"}},{"id":"52055184","body":"Thanks a lot!!! I really don't know how I missed that Page!!! Oh God, I feel as if I don't have enough words to express my gratitude!","dateCreated":"1332479930","smartDate":"Mar 22, 2012","userCreated":{"username":"kenshinhere","url":"https:\/\/www.wikispaces.com\/user\/view\/kenshinhere","imageUrl":"https:\/\/www.wikispaces.com\/i\/user_none_lg.jpg"}}],"more":0}]},{"id":"2176691","dateCreated":"1198987199","smartDate":"Dec 29, 2007","userCreated":{"username":"notosil","url":"https:\/\/www.wikispaces.com\/user\/view\/notosil","imageUrl":"https:\/\/www.wikispaces.com\/i\/user_none_lg.jpg"},"monitored":false,"locked":false,"links":{"self":"https:\/\/chessprogramming.wikispaces.com\/share\/view\/2176691"},"dateDigested":1531463320,"startDate":null,"sharedType":"discussion","title":"about implementing a bitboard ","description":"Hi :I have read some papers about bitboards and i understand the idea,but I don't know how to create a bitboard.
\n By example \u00bfHow implement the allPieces bitboard at initial position?
\n
\nIn c I'm using the uint64_t (stdint.h), I define a bitboard called allPieces, but I don't know how set to it.","replyPages":[{"page":0,"digests":[{"id":"2189903","body":"Hi,
\nI fear I don't exactly get your question.
\nallPieces is the union of all pieces. Thus
\n
\nwhitePieces = whitePawns | whiteKnights | whiteBishops | ...;
\nblackPieces = blackPawns | blackKnights | blackBishops | ...;
\n
\nallPieces = whitePieces | blackPieces;
\n
\nInitialized once as member of a board-structure, you'll likely update those redundant bitboards incrementally during make\/unmake move.
\n
\nAny more questions?
\nFeel free to ask and to make suggestions, where we can explain things better inside this wiki.
\n
\nGerd","dateCreated":"1199292848","smartDate":"Jan 2, 2008","userCreated":{"username":"GerdIsenberg","url":"https:\/\/www.wikispaces.com\/user\/view\/GerdIsenberg","imageUrl":"https:\/\/www.wikispaces.com\/user\/pic\/1202793136\/GerdIsenberg-lg.jpg"}},{"id":"2203035","body":"Perhaps do you mean how to assign constants in C to it?
\n
\nlike you do
\nint a;
\na = 4;
\n
\nFor a bitboard you do the same thing
\n
\nuint64_t a;
\na = 4ULL;
\n
\nThe ULL is just something you have to append to the end of a 64-bit constant (C99 standard) or your compiler might spout out warnings or errors.
\n
\nFor bitboards it's hard to think in decimal so people like to use hexadecimal. Say for example an all pieces bitboard
\n
\n11111111
\n11111111
\n00000000
\n00000000
\n00000000
\n00000000
\n11111111
\n11111111
\n
\nIf say you setup your bitboard like this and you picked A1 = bit0, A8 = bit7; and wrote the whole bitboard in a line it'd look like this:
\n
\n1111111111111111000000000000000000000000000000001111111111111111
\n
\nYou could say the one on the very left is H8 and the one on the very right represents A1. But people don't like to write out such drawn out numbers so they use hexadecimal for shorthand. Hexadecimal digits are as follows:
\nDecimal - Binary - Hexadecimal
\n0 - 0000 - 0
\n1 - 0001 - 1
\n2 - 0010 - 2
\n3 - 0011 - 3
\n4 - 0100 - 4
\n5 - 0101 - 5
\n6 - 0110 - 6
\n7 - 0111 - 7
\n8 - 1000 - 8
\n9 - 1001 - 9
\n10 - 1010 - A
\n11 - 1011 - B
\n12 - 1100 - C
\n13 - 1101 - D
\n14 - 1110 - E
\n15 - 1111 - F
\n
\nSo if you had a binary number like
\n00101011
\nand you wanted to put it in hexadecimal, you'd first split it into fours:
\n0010 | 1011
\n
\nThen you use use the hexadecimal letters to represent each set of 4:
\n2 | B
\n
\nThen you put them together and add suffixes and prefixes. In C, to represent a hexadecimal constant you put "0x" in front of the number. So to write 00101011 as a 64-bit hexadecimal constant in C you'd do:
\n
\n0x2BULL.
\n
\n0x <= Prefix | 2B <= Hexadecimal constant | ULL <= suffix
\nso lets so put the all pieces bitboard as a 64-bit hexadecimal constant, you'd first take the bitboard:
\n
\n11111111
\n11111111
\n00000000
\n00000000
\n00000000
\n00000000
\n11111111
\n11111111
\n
\nput it into a long line of bits:
\n
\n1111111111111111000000000000000000000000000000001111111111111111
\n
\nsplit it up into fours:
\n
\n1111|1111|1111|1111|0000|0000|0000|0000|0000|0000|0000|0000|1111|1111|1111|1111
\n
\nUse hexadecimal digits to represent each set of four:
\n
\nFFFF00000000FFFF
\n
\nand finally add prefixes and suffixes:
\n
\n0xFFFF00000000FFFFULL
\n
\nso if you wanted to initialize an all pieces bitboard:
\n
\nuint64_t AllPieces = 0xFFFF00000000FFFFULL;
\n
\nI hope this helps,
\nPradu","dateCreated":"1199423046","smartDate":"Jan 3, 2008","userCreated":{"username":"Pradu","url":"https:\/\/www.wikispaces.com\/user\/view\/Pradu","imageUrl":"https:\/\/www.wikispaces.com\/user\/pic\/1202793136\/Pradu-lg.jpg"}},{"id":"2203043","body":"Errm.. sorry about the boldface
\n bit0 == A1
\n bit7 == A8
\n
\nit seems the wiki makes ==text== look like =text= if you use 1 equal sign","dateCreated":"1199423151","smartDate":"Jan 3, 2008","userCreated":{"username":"Pradu","url":"https:\/\/www.wikispaces.com\/user\/view\/Pradu","imageUrl":"https:\/\/www.wikispaces.com\/user\/pic\/1202793136\/Pradu-lg.jpg"}}],"more":0}]},{"id":"1566777","dateCreated":"1194349558","smartDate":"Nov 6, 2007","userCreated":{"username":"Pradu","url":"https:\/\/www.wikispaces.com\/user\/view\/Pradu","imageUrl":"https:\/\/www.wikispaces.com\/user\/pic\/1202793136\/Pradu-lg.jpg"},"monitored":false,"locked":false,"links":{"self":"https:\/\/chessprogramming.wikispaces.com\/share\/view\/1566777"},"dateDigested":1531463320,"startDate":null,"sharedType":"discussion","title":"Create new pages","description":"I suggest that new pages be created for the bitboards article. There's just way too much knowledge in this area to fit on one page. Perhaps this page can be a summary of all common techniques and it will serve as a summary and link page for more detailed discussion.","replyPages":[{"page":0,"digests":[{"id":"1573449","body":"Go ahead, good idea. It's a wiki after all. :)","dateCreated":"1194377524","smartDate":"Nov 6, 2007","userCreated":{"username":"zachwegner","url":"https:\/\/www.wikispaces.com\/user\/view\/zachwegner","imageUrl":"https:\/\/www.wikispaces.com\/user\/pic\/1210177506\/zachwegner-lg.jpg"}},{"id":"1624885","body":"Hallo guys,
\n
\nI already started to edit some bitboard techniques...
\nMay be can merge all together somehow - feel free to add your stuff of course. The WYSIWYG-editor is a bit crumsy for me. Vertical spacing is quite different in edit-mode.
\n
\nCheers,
\nGerd","dateCreated":"1194652187","smartDate":"Nov 9, 2007","userCreated":{"username":"GerdIsenberg","url":"https:\/\/www.wikispaces.com\/user\/view\/GerdIsenberg","imageUrl":"https:\/\/www.wikispaces.com\/user\/pic\/1202793136\/GerdIsenberg-lg.jpg"}}],"more":0}]}],"more":false},"comments":[]},"http":{"code":200,"status":"OK"},"redirectUrl":null,"javascript":null,"notices":{"warning":[],"error":[],"info":[],"success":[]}}