Hypothetical: Making a word game and needing to check word..

General discussion about LÖVE, Lua, game development, puns, and unicorns.
User avatar
Taehl
Dreaming in associative arrays
Posts: 1025
Joined: Mon Jan 11, 2010 5:07 am
Location: CA, USA
Contact:

Re: Hypothetical: Making a word game and needing to check wo

Post by Taehl »

Of course. But I thought the goal was to avoid loading everything into memory?
Earliest Love2D supporter who can't Love anymore. Let me disable pixel shaders if I don't use them, dammit!
Lenovo Thinkpad X60 Tablet, built like a tank. But not fancy enough for Love2D 0.10.0+.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Hypothetical: Making a word game and needing to check wo

Post by Robin »

Taehl wrote:Of course. But I thought the goal was to avoid loading everything into memory?
Even loading the full 228,000 words, and if each word took up 10 bytes, it would be 2 MB RAM used. Not enough to write a swapping mechanism for these days, I reckon.
Help us help you: attach a .love.
User avatar
vrld
Party member
Posts: 917
Joined: Sun Apr 04, 2010 9:14 pm
Location: Germany
Contact:

Re: Hypothetical: Making a word game and needing to check wo

Post by vrld »

In the same vain you shouldn't worry about runtime so much. For 250000 entries a hash will work just fine, even if there are collisions. Only when the number of words gets really big (and I mean really big, as in Google's search engine, or the wordnet database) you should invest your time in sophisticated data-structures and algorithms.
I have come here to chew bubblegum and kick ass... and I'm all out of bubblegum.

hump | HC | SUIT | moonshine
User avatar
josefnpat
Inner party member
Posts: 955
Joined: Wed Oct 05, 2011 1:36 am
Location: your basement
Contact:

Re: Hypothetical: Making a word game and needing to check wo

Post by josefnpat »

I have an English regex dictionary that I wrote, and here's the word library, maybe this helps.

I don't remember where I got this :(
words.english.txt
(217.3 KiB) Downloaded 83 times
Missing Sentinel Software | Twitter

FORCIBLY IGNORED.
<leafo> when in doubt delete all of your code
<bartbes> git rm -r *
<bartbes> git commit -m "Fixed all bugs"
<bartbes> git push
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 5 guests