I already have a code to test if the given values in the square is a magicsquare The game involves a hexadecimal square will be displayed after that 8 out of those 16 numbers will randomly "disappear" or becomes "0:s" Then the user has to input 8 new numbers on those positions.
srand(time(NULL));
int magiskKvadrat[4][4] ={0xF,0x4,0x8,0x3,0x1,0xA,0x6,0xD.....etc};
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 4; j++) {
printf("%x", magiskKvadrat[i][j]);
}
printf("\n");
}
for (int i = 0; i < 8; i++)
{
magiskKvadrat[4][4] = srand(?) // Here is where i need help.
};
}
Aucun commentaire:
Enregistrer un commentaire