Questions tagged [random]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
91 views

How to spawn sprite on random edge axes

In Scratch, how do I spawn a sprite randomly at any point along any of the four edges of the stage? I have tried using a go to motion block with a pick random operator, but of course this limits the ...
0
votes
1answer
76 views

C random string generator help? cs50

I am trying to implement a function to generate a random string consisting of only a-z characters both upper and lower case.. What is wrong with the code I wrote and how can I fix it? I am constantly ...
0
votes
1answer
88 views

drand error pset3

I ran the following basic code and it came up with an error. I'm not sure why: Thank you.
0
votes
0answers
51 views

Touching Color Issues, Recursion and Pseudo-randoms in Scratch

http://scratch.mit.edu/projects/42012966 Hello All, So I was trying to build this little recursive scribbler that makes random little networks of lines, basically like an ant colony but have run into ...
0
votes
1answer
2k views

implicit declaration of function 'drand48()' is invalid in c99 / generating random numbers

I'm now working on pset4 in edx. The spec requires that the velocity of the ball to be generated from a random number using drand48(). I looked at man drand48() saying this is a double type stuff, ...
0
votes
1answer
412 views

calling srand48 rand vrs srand

I was tinkering with the bounce function in pset4 trying to get the ball the bounce randomly around the window. I am getting stuck with PRNG. I just can't seem to get it to work using the srand48 ...
0
votes
1answer
159 views

drand48() Invalid Operands

This is my code: int min = 6; int max = 9; double x = min + (drand48() * 10) % (max - (min - 1)); Console Error message: Any idea what I am doing wrong?