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

后端 未结 14 2577
夕颜
夕颜 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:41

    An array would probably be fine. If you wanted more convenient means of "traversing" the board, you could easily build methods to abstract away the details of the data structure implementation.

提交回复
热议问题