jeudi 9 avril 2020

too many aurguments in rand function in void initialise

class game
{
    int i,j;
    public:
           void initialise(char board[][SIDE], int moves[]);


void game::initialise(char board[][SIDE],int moves[])
{

    int i,j;

    // Initiate the random number generator so that
    // the same configuration doesn't arises


    // Initially the board is empty
    for ( i=0; i<SIDE; i++)
    {
        for ( j=0; j<SIDE; j++)
            board[i][j] = ' ';
    }

    // Fill the moves with numbers
    for ( i=0; i<SIDE*SIDE; i++)
        moves[i] = i;

    // randomise the moves
    rand(moves, moves + SIDE*SIDE);

    return;
}



Aucun commentaire:

Enregistrer un commentaire