[comp.lang.c] random i/o

jonas@lkbpyr.UUCP (Jonas Heyman) (11/28/89)

Hello,

I have a problem concerning random i/o.
I want to get random numbers from a file that I read from disk.
The file looks like:    40
			43
			44
			50     # numbers between 40-99 
			51
			.
			.
How do I access the file and pick a number randomly.
I should only pick number that exist in the file,
for instance 43 the first time and then 51 the second time and so on.

Is there a simple solution to this ?
Be glad for some help. 

Sincerely Jonas,

-- 

  jonas@lkbpyr.lkb.se 

bright@Data-IO.COM (Walter Bright) (11/30/89)

In article <111@lkbpyr.UUCP> jonas@lkbpyr.UUCP (Jonas Heyman) writes:
<I want to get random numbers from a file that I read from disk.

Various methods:
1. Spill coke on the floppy.
2. Attach a large (>5HP) electric motor in the next outlet. Turn the motor
   on and off rapidly while reading the disk drive.
3. Use one of those old 20mb disk drives from the early days of the AT.
4. Tap on the drive case with a hammer while it's reading.
5. Wrap a spark plug wire around the cable leading to the disk drive.
   Turn on your car.
6. Expose your computer to one of those virus programs.
7. Operate the computer during a thunderstorm.

:-) :-) :-)