{"content":{"sharePage":{"page":0,"digests":[{"id":"30134907","dateCreated":"1289660805","smartDate":"Nov 13, 2010","userCreated":{"username":"joop1","url":"https:\/\/www.wikispaces.com\/user\/view\/joop1","imageUrl":"https:\/\/www.wikispaces.com\/i\/user_none_lg.jpg"},"monitored":false,"locked":false,"links":{"self":"https:\/\/chessprogramming.wikispaces.com\/share\/view\/30134907"},"dateDigested":1531475803,"startDate":null,"sharedType":"discussion","title":"a democratic board representation","description":"hi all,
\ni am working on a representation deemed democratic because all the work is shared by the pieces,where
\npieces are a class hierarchy headed by an Abstract Base Class : Piece.
\npieces do the hard work: move generation and evaluation. The Position class manages Loki::AssocVector<Square,PiecePtr>
\ntypedef Loki::SmartPtr<Piece> PiecePtr
\nLoki is the namespace defined in the Loki library of reusable generic components.Also there is a separate class template for Pawns.
\nInterested or comments?","replyPages":[{"page":0,"digests":[{"id":"40527115","body":"This looks like a good idea. There are a number of locations where this approach would simplify the code, especially where there are switch statements on the enumerated type for pieces. These statements are essentially a manually created virtual table.
\n
\nI also think it would be a good idea to turn squares, in this case 0x88 squares, into their own class. Functions such as IS_SQ can be an inlined member function that returns a bool:
\n
\nclass Square_0x88
\n{
\n public:
\n Square_0x88(S8 s) : square_(s) {}
\n bool is_square() const
\n {
\n return (square_ & 0x88) == 0;
\n }
\n private:
\n S8 square_;
\n};","dateCreated":"1309221498","smartDate":"Jun 27, 2011","userCreated":{"username":"WhiskeySour","url":"https:\/\/www.wikispaces.com\/user\/view\/WhiskeySour","imageUrl":"https:\/\/www.wikispaces.com\/i\/user_none_lg.jpg"}}],"more":0}]},{"id":"4853929","dateCreated":"1215822591","smartDate":"Jul 11, 2008","userCreated":{"username":"EdselApostol","url":"https:\/\/www.wikispaces.com\/user\/view\/EdselApostol","imageUrl":"https:\/\/www.wikispaces.com\/user\/pic\/1202793136\/EdselApostol-lg.jpg"},"monitored":false,"locked":false,"links":{"self":"https:\/\/chessprogramming.wikispaces.com\/share\/view\/4853929"},"dateDigested":1531475803,"startDate":null,"sharedType":"discussion","title":"CPW Engine","description":"Maybe it would be great if we use bitboards for the CPW engine. What do you people think?","replyPages":[{"page":0,"digests":[{"id":"4855747","body":"I prefer to describe the ideas and to provide some atomic routines rather than a complete implementation, which did not encourage people to understand stuff and to implement it on their own, but use copy and paste...
\n
\nBut a small and slow CPW bitboard engine for didactical purpose? Why not.","dateCreated":"1215861628","smartDate":"Jul 12, 2008","userCreated":{"username":"GerdIsenberg","url":"https:\/\/www.wikispaces.com\/user\/view\/GerdIsenberg","imageUrl":"https:\/\/www.wikispaces.com\/user\/pic\/1202793136\/GerdIsenberg-lg.jpg"}},{"id":"4855771","body":"That would be great Gerd. By the way, what do you think of Olithink's bitboard implementation? Is it fast enough?","dateCreated":"1215864496","smartDate":"Jul 12, 2008","userCreated":{"username":"EdselApostol","url":"https:\/\/www.wikispaces.com\/user\/view\/EdselApostol","imageUrl":"https:\/\/www.wikispaces.com\/user\/pic\/1202793136\/EdselApostol-lg.jpg"}},{"id":"4856763","body":"I mean feel free to write one ;-)
\nSorry I don't know about Olithink, I suggest some standard bitboard definition, where one may try several sliding piece approaches as mentioned in Hiding the Implementation<\/a>.","dateCreated":"1215880692","smartDate":"Jul 12, 2008","userCreated":{"username":"GerdIsenberg","url":"https:\/\/www.wikispaces.com\/user\/view\/GerdIsenberg","imageUrl":"https:\/\/www.wikispaces.com\/user\/pic\/1202793136\/GerdIsenberg-lg.jpg"}},{"id":"4951633","body":"Hi,
\n
\nI have just created an external page with the source of a 0x88 CPW-engine and posted a link to it. The page (www.marittima.pl\/cpw) does not contain engine nor source downloads, just html, so copy and paste should become slightly harder.
\n
\nMy tests show that the current version scores about 75-80% against TSCP, so I don't think anybody would be seriously interested in reshaping it into some GM-strength monster. Evaluation function has some deficiencies that I am aware of, but it was meant to show ideas, not the correct weights.
\n
\nSince I am no real programmer, I kindly ask for Your help in simplifying some parts of code. Please post Your ideas here.
\n
\nPawel Koziol","dateCreated":"1216901245","smartDate":"Jul 24, 2008","userCreated":{"username":"Pawel_Koziol","url":"https:\/\/www.wikispaces.com\/user\/view\/Pawel_Koziol","imageUrl":"https:\/\/www.wikispaces.com\/i\/user_none_lg.jpg"}}],"more":0}]}],"more":false},"comments":[]},"http":{"code":200,"status":"OK"},"redirectUrl":null,"javascript":null,"notices":{"warning":[],"error":[],"info":[],"success":[]}}