I need a random number generator
I'm looking for a random number generating program, but to my surprise, I didn't find one in Synaptic. My graphing calculator had that function, but I gave it away some time ago.
|
Language ? - everybody has one, even bash "echo $RANDOM"
|
LInux has a built in random number generator. It may need to be initialized on your system.
See: http://linux.die.net/man/4/random |
Quote:
|
There is a bunch of things you can use, especially on linux.
The kernels random number generator can be accessed through the device /dev/random. The pseudo-randoms are initiallized by the kernel at boottime, so they should be fairly irregular. A couple of examples: in bash, try Code:
head -c 1 /dev/random | hexdump -d | gawk '{print $2}' Code:
cat /dev/random You can also directly you awk to diplay randoms. Just go for Code:
gawk '{print rand()*100}' If you are into c or c++, i would suggest you read up on the manpage for rand (just type "man rand" without the quotes). For example: Code:
#include <stdlib.h> |
For anyone who reads this, I later found a website called random.org that has a simple random number generator.
|
All times are GMT -5. The time now is 06:59 PM. |