Coding Abalone in Python

nellie.piat Posted messages 1 Status Member -  
yg_be Posted messages 23437 Registration date   Status Contributor Last intervention   -
Bonjour,
we are a group of 4 students in preparatory class and we have to code a game for our competitions. We chose Abalone. Thus, we have coded the board as a matrix, and the balls of each player with numbers. We have also created functions for the 6 types of moves. However, when we move the edge balls, they reappear in the matrix from the opposite side (e.g., a ball from the last row that exits at the bottom comes back in the same column but at the top in the first row). However, we want the balls that exit to disappear from the game (and thus from the matrix).
Do you have a solution or at least some leads to remove a ball from the algorithm in Python?

Thank you in advance.

1 answer

yg_be Posted messages 23437 Registration date   Status Contributor Last intervention   Ambassadeur 1 588
 
Hello,
if you want to show your code, please use the tags, as explained here: https://codes-sources.commentcamarche.net/faq/11288-les-balises-de-code
0