public class test {
public static void main(String args[]) {
//Number of the card which the user own
int card[];
card = new int[11];
card[1] = 0;
card[2] = 1;
card[3] = 0;
card[4] = 1;
card[5] = 0;
card[6] = 1;
card[7] = 0;
card[8] = 1;
card[9] = 0;
card[10] = 1;
//array that save the card no. which the user didn't own
int count = 1;
int newCard[];
newCard = new int[11];
for (int i = 1; i < card.length; i++) {
if (card[i] == 0) {
newCard[count] = i;
count++;
}
}
// drawing a random card from the arry which the user didn't own
int randomCard = 0;
do {
randomCard = (int)(Math.random() * (newCard.length));
} while ( newCard [ randomCard ] == 0);
// 1,3,5,7,9 is expected to be the result
System.out.println("RandomCard from Above:" + newCard[randomCard]);
}
}
[/code:3lskg9ji]
I don't know how to transfer the code above to Construct 2 format, would somebody could help me