If you like the video, share it with your friends on these social sites:

 

Title: C Programming Tutorial - 13 - Seeding Random Numbers

Added: Apr 9, 2009

Author: thenewboston

Duration: 6:45

Description:
How to use a seed. Not the kind you are thinking of either...

Related Videos:

Videos related to 'C Programming Tutorial - 13 - Seeding Random Numbers'

Channel: Howto

Tags: random  number  generator  function  programming  seeding 



random  number  generator  function  programming  seeding 

Youtube Comments: 130

Redukas123 Says:

Dec 4, 2011 - Jumber generator :D love your jokes and tutorials

UmairRazak7 Says:

Dec 5, 2011 - Your C Programming Tutorial 13 about Seeding Random Numbers is really awesome.After watching your video i tried & made my own random number program using your same code.The Problem is i wanted the program to loop, so i did a while loop, by doing this my program generates random numbers only the first time when its executed & not during my while loop.The program outputs the printf statement but without random number just goes to the while loop statement again.

UmairRazak7 Says:

Dec 5, 2011 - Your C Programming Tutorial 13 about Seeding Random Numbers is really awesome.After watching your video i tried & made my own random number program using your same code.The Problem is i wanted the program to loop, so i did a while loop, by doing this my program generates random numbers only the first time when its executed & not during my while loop.The program outputs the printf statement but without random number just goes to the while loop statement again.

SkinnyJeff Says:

Dec 5, 2011 - Bucky, thanks for the tutorials. They are very helpful. I've got a question. In this tut you showed us how to use srand. How do you limit the generated random numbers to a given interval (say, a number between 1 and 100)? In the previous tut, you taught us that the formula 1+rand()%100 would do the trick. But I tried to modify this tut to make the program generate a seed random number between 1 and 100, and I got the same number 15 times.

SuperMulder10 Says:

Dec 10, 2011 - time identifier not found keeps coming up in my program, whats the story with that?

JDOG13596 Says:

Dec 12, 2011 - Make more C tutorials please Bucky!

mjelma31 Says:

Dec 21, 2011 - @ttognala U can always try it, for me it doesn't work

hgfjyrdetryu Says:

Dec 26, 2011 - i love ur jumber numberator :)

hardstylegronne Says:

Jan 27, 2012 - can we make it a random case whileloop?

Traceguy Says:

Jan 30, 2012 - Can a we seed a seed with a seed of a seed????? that would be the absolute best way ever to get a seed. :P

Traceguy Says:

Feb 3, 2012 - to anyone who is interested in setting ranges. rand()%10+1 gives numbers 1-10, where as rand()%11 just gives 0-10

shakaalify Says:

Feb 10, 2012 - The first number is not really random though :/ try to run the program a few times within a short period of time. The first number changes only a little bit.

Traceguy Says:

Feb 14, 2012 - while (myRand > 10) { myRand = rand() }loop until the variable is less then 10. Is that what you meant?

demmah5319 Says:

Mar 3, 2012 - Okay I get what you mean but I have a little question. What about if I'm creating a video game, say like, Pokemon. The internal clock eventually dies. Do the battles which maybe I have randomized by the certain time of day become stagnant? Is there another way to randomize encounters?

TpPacino94 Says:

Mar 6, 2012 - You cannot use the seed multiple times in one program.Use a boolean to check if you already put the seed:bool Seed = false;if(!Seed) { srand(time(0)); Seed = true; }Thumbs up so people can see!

ChaosxShotz Says:

Mar 30, 2012 - "...and now let's run it again and hopefully the numbers will be different.."*runs program*"ahhh wtf not 41 again!!"

dasten123 Says:

Apr 7, 2012 - cool, but there is still the problem that the "random" number is still similar to the number with a similar seed :(

fasantupp Says:

Apr 26, 2012 - the only thing you need to predict theese random numbers is the algotithm for the randomgenerator and the time for the numbers you wish to predict, and i bet you can get the algoritm with a nice little google-search :P

youmair3d Says:

May 13, 2012 - "number sign"include "less than"ctime"greater then"

zeng44u Says:

May 17, 2012 - I'm using C-Free 4.0 and when i type it out it says "implicit declaration of function 'int rand(....)', what does it mean?

ronniemw8 Says:

May 24, 2012 - my library files do not have rand function i m using dev c++

abta0021 Says:

May 28, 2012 - i got only 41, not the list of numbers...

Madnessfromsweets Says:

May 28, 2012 - That's clever.

nicoswow Says:

May 29, 2012 - ok, let's go ahead haahahah x1000 times

Shopping | prank calls | Wholesale products | english movies | prank calls | proxy | links | prank call

Topfacebookvideos funny arabic videos

Privacy Policy