How do I model a chessboard when programming a computer to play chess?

后端 未结 14 2315
夕颜
夕颜 2021-01-31 10:13

What data structures would you use to represent a chessboard for a computer chess program?

14条回答
  •  长情又很酷
    2021-01-31 10:31

    I actually wouldn't model the chess board, I'd just model the position of the pieces. You can have bounds for the chess board then.

    Piece.x= x position of piece
    Piece.y= y position of piece
    

提交回复
热议问题