samedi 1 juin 2019

How can I use two random numbers generated in a function as matrix coordinates?

I came up with this function to generate two random numbers, r and c, so that I can use them in as coordinates in matrix board[r][c]. Is this even possible?

This is for a chess-like game. The PC is supposed to generate random moves. This function does generate coordinates, I'm just not sure how to make my program treat them as coordinates.

int coordAleatoria()

I hope I can get r and c in board[r][c] to be the values generated in coordAleatoria().




Aucun commentaire:

Enregistrer un commentaire