Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

130 Neutral

About lazyguy123

  • Rank
  1. lazyguy123

    Chess move generation

    I'm creating a chess engine using bitboards and I have a question about legal move generation. Here is what I came up with so far:   - Check if the king is in check      - If not, then generate all possible moves for all pieces           -Check each king move/en-passant/castling/absolute pin (if they result in check after the move is made, remove from list of legal moves)           -If no legal moves, then stalemate      -If in check, generate king moves, captures of piece giving check, or blocks           -Check each move (if they result in check after the move is made, remove from the list of legal moves)           -If no legal moves, then checkmate   I have 2 questions: 1) Is this an efficient way to generate a list of legal moves, or is there a better way? 2) Right now I plan to see if the white king is in check by seeing if the result of (white_king & black_attacks) is 0 or not. Is there a more efficient way to do this?    Thanks!  
  2. lazyguy123

    Connect 4 opening book

    Thanks for your reply. I ran the Fhourstones benchmark with command prompt and I got a printout similar to what is listed on this site:   http://homepages.cwi.nl/~tromp/c4/fhour.html   How can I use the benchmark to generate a database with values for all of the 8-ply positions? Is there a command that I can use to output a text file of all 8-ply positions? I tried looking at the java source code but I don't understand it.
  3. lazyguy123

    Connect 4 opening book

    I'm not saying that John is wrong. On his website he says that he only includes positions where neither player has won yet, and in which the next move isn't forced. I believe this is why there are less positions.   I did take into account transposition and made sure not to count the same position twice. Also my numbers agree with this numberphile video:     If I run into one of these nodes not in the database, should I set its value to + infinity so that the minimizer at depth 7 will cut them off and not look at them?
  4. lazyguy123

    Connect 4 opening book

    Thanks for your reply Alvaro.   So are you saying that for the first 8 moves, if n moves have been played, then i do minimax with a depth of (8-n) and use the database values instead of my evaluation function? And then after 8 moves have been played, then I switch back to my evaluation function and increase depth back to normal?   Also I noticed that the database contains 67557 positions at depth 8, while my perft function returns around 180,000 positions at depth 8. How should I evaluate positions that are not in the database? Should I give them a value so that they won't be considered over the other nodes?   Thanks.
  5. lazyguy123

    Connect 4 opening book

    Hey everybody,   I'm making a connect 4 game and I want to make it stronger by using an opening book. I've looked all over, and the only one I can find is by John Tromp.   http://homepages.cwi.nl/~tromp/c4/c4.html   I thought the book would be a list of moves that I could read into a tree. However, it consists of positions at 8-ply and whether they eventually lead to a win, loss, or draw for the first player. My question is how do I incorporate this into my program?   Any help is appreciated. Thanks.    
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!