mercredi 23 novembre 2016

Decrement down from 10,000 and generate a random amount of 0s or 1s in a certain order

So I'm making a simple program that goes down from 10,000->0 and it takes turn return a 1 or a 0. A random number is generated and it will return 1 (to begin with) that many times then another random number is generated, and it will print 0 that many times, then it will loop. This is the code I have right now, anyone care to help?

private Random rng = new Random();
int temp;

@Override
public void startNewHand(int position, int handsToGo, int currentScore) {
    // TODO Auto-generated method stub
    int raise = rng.nextInt(4);
    int normal = rng.nextInt(4);
    for (int i = 9999; i >= 0; i--)
    {
        for(int j = raise; j >= 0; j--)
        {
            temp = 1;
        }

        for(int k = normal; k >= 0; k--)
        {
            temp = 0;
        }   
    }   

}




Aucun commentaire:

Enregistrer un commentaire