PHP BINGO Need Help

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ShadowSkill
Forum Newbie
Posts: 22
Joined: Sun Jan 01, 2012 5:45 am

PHP BINGO Need Help

Post by ShadowSkill »

My cousin wants me to make a PHP Bingo but my problem is i don't know what method or operator to use on the rand(1,15) to check if the number has already been randomized.
The first line on BINGO is good randomized numbers according to B I N G O but my problem is the second line can repeat itself so i need a solution to not put the first line to the second.
Sorry if my english is very hard to understand


Example : print rand(1,15);
Output : 9

The next random number on the table should be any number except 9.

Thank you very much sirs to those who will read and to those who will help...
PS. I just started my tutorial with my cousin about PHP last 2 days so yeah i am a newbie :(
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: PHP BINGO Need Help

Post by Celauran »

Store the numbers that have already been called in an array and check against it using in_array() when you draw the next numbers.
ShadowSkill
Forum Newbie
Posts: 22
Joined: Sun Jan 01, 2012 5:45 am

Re: PHP BINGO Need Help

Post by ShadowSkill »

Celauran wrote:Store the numbers that have already been called in an array and check against it using in_array() when you draw the next numbers.
How sir? I'm just a newbie can you give me an example please?
Post Reply