Я пытаюсь создать игру на память в Eclipse.В настоящее время у меня есть доска 4x4, созданная и работающая.Как мне создать доску 6 на 6.
В частности, что я должен изменить s <= 20 на 6x6 </p>
//shuffle the cards
public static int[][] shuf() {
int start[] = {1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8};
int cards[][] = new int[4][4];
Random ran = new Random();
int tmp, i;
for (int s = 0; s <= 20; s++) {
for (int x = 0; x < 16; x++) //randomize the card placements
{
i = ran.nextInt(100000) % 15;
tmp = start[x];
start[x] = start[i];
start[i] = tmp;
}
}
i = 0;
for (int r = 0; r < 4; r++) // put values in cards here
{
for (int c = 0; c < 4; c++) {
cards[r][c] = start[i];
i = i + 1;
}
}
return cards;
}
}