first 30 repliers: please help me

Page 2 - Seeking answers? Join the AnandTech community: where nearly half-a-million members share solutions and discuss the latest tech.

Mo0o

Lifer
Jul 31, 2001
24,227
3
76
Dont you have a calculator like a TI-83? Those have a random numebr generator. Or you can just get the first several hundred numbers of pi and pick a place to start gathering numbers
 

Spikesoldier

Diamond Member
Oct 15, 2001
6,766
0
0
numbers left are currently:

3, 10, 11, 14, 15, 21, 25, and 27.

please take your remaining picks from those.

thank you
 

Zenmervolt

Elite member
Oct 22, 2000
24,514
44
91
Originally posted by: Spikesoldier
trying to randomize some numbers.

i wish i had the skills to write a computer program to do this.

idea: is it too hard to make one?
Type "=RAND()" (without the quotation marks) into a cell in Excel. That will yield a random number between 0 and 1.

You can create formulae to manipulate these random numbers into random integers between the two extremes that you need.

ZV
 

sciencewhiz

Diamond Member
Jun 30, 2000
5,885
8
81
Here's a program to do what you want, in C. I can provide a linux binary if you want, or else you or someone else can compile it.


and here are the results of 3 runs of it

30 12 22 7 21 17 8 6 25 13 29 10 14 9 27 24 1 18 19 11 23 15 4 26 2 20 28 16 5 3

26 8 15 19 16 11 6 12 28 30 23 17 29 3 9 5 2 10 24 25 1 13 18 7 22 14 20 21 4 27

16 30 9 19 24 21 25 5 1 18 8 2 12 7 20 11 3 15 26 28 14 10 13 27 22 6 23 29 4 17

/*Copyright (c) 2004 Joseph Ross

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */

#include <stdio.h>
#include <stdlib.h>
#include <time.h>

//#define NUMBER 25

int main(int argc, char *argv[])
{
int *array;
int i;
int order = 1;
long number;
int highest_number;

if (argc != 2)
{
printf("usage: random_order <number of items>\n");
return(1);
}
highest_number = atoi(argv[1]);
if (highest_number <= 0)
{
printf("usage: random_order <number of items>\n");
printf("number of items must be greater then 0\n");
return(2);
}

array = malloc(sizeof(int) * highest_number);
if (array == NULL)
{
printf("ran out of memory, try a smaller number\n");
return(3);
}

for(i=0;i<highest_number;i++)
array=0;

srandom(time(NULL));

while(order<=highest_number)
{
number=random() % highest_number;
if (array[number] == 0)
{
array[number] = order++;
printf("%i ", (number+1));
}

}
printf("\n");

free(array);
return(0);
}


Since it's not the software forum, I can't use the code tags.
 

halik

Lifer
Oct 10, 2000
25,696
1
81
Originally posted by: Spikesoldier
trying to randomize some numbers.

i wish i had the skills to write a computer program to do this.

idea: is it too hard to make one?

youll be a billionaire if you can find a way for a computer go generate PURELY random numbers. The cloesest technology right now uses background radio noise from the athosphere