Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: Re: Re: Fast wordlist lookup for game

by agentv (Friar)
on Oct 29, 2002 at 23:02 UTC ( [id://208911]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Fast wordlist lookup for game
in thread Fast wordlist lookup for game

...oops, I guess I finished my post after you'd already seen a similar answer.

You're right that it's expensive to keep the list in memory, but it will be the fastest, and we're not talking a lot of memory here (given a list with words on average the size of the words in the Unix dictionary).

Reading things into the hash is not he most elegant solution, and someone will no doubt come along here in a moment with a suggestion for a module that does more closely what you desire, but I wouldn't discount the simplest approach, unless your program will have other memory intensive techniques that cannot be avoided.

...All the world looks like -well- all the world, when your hammer is Perl.
---v

Replies are listed 'Best First'.
Re: Fast wordlist lookup for game
by jerrygarciuh (Curate) on Oct 29, 2002 at 23:06 UTC
    Thanks agentv,
    I will keep an open mind on this. I will be using this as the backend of a Flash game and since that will mean repeatedly incurring the memory penalty I doubt it will be the way I go. Guess it would have been much smarter of me to have said so in my original post, eh?
    Thanks for the replies!
    jg

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://208911]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (5)
As of 2024-03-28 11:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found