This site requires JavaScript, please enable it in your browser!
Greenfoot back
Mitchr101
Mitchr101 wrote ...

2014/3/24

Storing Used Numbers in a random number generation

Mitchr101 Mitchr101

2014/3/24

#
Hi, I'm looking to make a 'bingo' game, where I generate a random number from 1-99 and it then stores the number, and will not repeat the number. How would I make this? I would assume an array, any help would be great :)
danpost danpost

2014/3/24

#
It might be better (or easier) to use a List instead of an array. That way you can just remove the elements (numbers) from the list as you use them and the list will only contain numbers that are still available to use.
FootLongTurkey FootLongTurkey

2014/5/23

#
What would be the code for that?
FootLongTurkey FootLongTurkey

2014/5/23

#
would this work, because i'm stumped
getImage().setTransparency(0);
    }    public void getButton1()
   {
if(Greenfoot.getRandomNumber(91) == 47) 
{
getImage().setTransparency(255);
}
}
}
danpost danpost

2014/5/23

#
@FootLongTurkey, please start a new discussion for your problem. Explain what you are trying to do, give what you have tried, explain which part you are having trouble with, etc.
You need to login to post a reply.