[DGD] File access question
Noah Gibbs
noah_gibbs at yahoo.com
Fri Jul 13 23:48:44 CEST 2007
Do you control the file format? This could make reading 200 random entries
easier.
Yes, you'll probably want to do this over multiple invocations to avoid
running out of ticks. If you have enough privilege it's also possible to do
this within a tick-unlimited rlimits() statement, but that's only possible in
certain cases.
--- Kurt Nordstrom <kurt at blar.net> wrote:
> I've got a situation that I'm trying to figure out the best way to
> approach. I was wondering if maybe any of you could give your thoughts on
> how you might tackle it.
>
> I'm wanting to code a simulated card game, with maybe 1000 unique cards
> (they'll have various words on them), but only 200 of which will be used
> in a given game. So, essentially it will need to read a file of 1000
> entries, pick out 200 by random (which it will store in memory), and then
> close the file.
>
> Is the loading of the entries something that I'd have to do with scheduled
> call outs to avoid a tick overflow? And is there any clever way to pick
> 200 random lines out of a variable length file?
>
> Any input is appreciated. Let me know if I'm not clear on what it is that
> I want to do.
>
> Thanks,
>
> -Kurt
> ___________________________________________
> https://mail.dworkin.nl/mailman/listinfo/dgd
>
____________________________________________________________________________________Ready for the edge of your seat?
Check out tonight's top picks on Yahoo! TV.
http://tv.yahoo.com/
More information about the DGD
mailing list