Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 08-27-2008, 10:03 PM   #3 (permalink)
spuy767
New Member
 
Join Date: Aug 2008
Posts: 100
spuy767 is on a distinguished road
Default

Quote:
Originally Posted by Groucho View Post
I use random(). I'm pretty sure it's still pseudo-random, but works for what I need. If you want a value between 0 and a number, just use the modulus (%).

Code:
myNewFavoriteRandomNumber = random() % 50; //random number between 0 & 49
Hope this helps!
That's what I've been using, and I've been coming up with the exact same numbers no matter what I do every time I run the app.
spuy767 is offline   Reply With Quote
 

» Advertisements
» Online Users: 480
22 members and 458 guests
ArthurOff, Arty Tales, baja_yu, Bertrand21, bignoggins, David-T, dbramhall, djohnson, fanarin, Feldspar, jbro, kln, lgehrig1, LooN3y, myach, Nobbsy, pbart, revg, shigaugi, skog, stephenmwatts, Thompson22
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,427
Threads: 94,024
Posts: 402,577
Top Poster: BrianSlick (7,978)
Welcome to our newest member, shakiraeb60
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 06:10 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.