0

hi i am at uni an i have a project in which i have to create a backgammon game
can anyone give me a helping start on how i would go about creating the board states?

thanks

2
Contributors
1
Reply
2
Views
8 Years
Discussion Span
Last Post by nucleon
0

Let's see. There are 24 places that the pieces could be. There are 15 identical pieces for each player, and only one player's pieces can be in a particular position.

The simplest data structure that fits these requirements is an array of 24 integers. Zero means the space is empty. Positive values indicate black (say) while negative values indiate white. The absolute value indicates how many pieces are in that position.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.