Welcome to the new platform of Programmers Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use it's exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
Hi, if you're reading this, thanks for taking the time to help me with this.
I have been given an assignment in which I need to remake the game Reversi/Othello in MatLAB using an 8x8 matrix where black is 1 and white is -1, and have a functional GUI.
I have been able to do the GUI etc, by myself, but when I reach the point where I need to allow for only valid moves, I become a little stuck.
I was curious if any of you would know of a way in which that could be done, because I've hit a road block. Essentially I need to scan all 8 directions of the matrix from the centre point, and find a valid combination of player_number*-1, in a row which end in a player_number (where player_number is the current players turn), but I am not sure how to accomplish this.
Again, thanks for your time.