Re: Generate Random numbers between 0 and 4
Re: Generate Random numbers between 0 and 4
- Subject: Re: Generate Random numbers between 0 and 4
- From: Usama Minegishi <email@hidden>
- Date: Tue, 23 Dec 2003 07:43:29 -0800
How can I generate Random Numbers between 0 and 4?
With the function short Random() is it possible?
int n = (Random() % 4);
For numbers between 0 and 4 inclusive then it should be % 5, not % 4.
or int n = (Random() % 4) + 1; perhaps,
but that would be between 1 and 4 so.you're right!
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.