Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^5: Turning A Problem Upside Down

by BrowserUk (Patriarch)
on Aug 22, 2009 at 20:13 UTC ( [id://790608]=note: print w/replies, xml ) Need Help??


in reply to Re^4: Turning A Problem Upside Down
in thread Turning A Problem Upside Down

The nearest wordlist I could find to that was this one. It takes a couple of seconds longer to index than my 90,000 word list, but the time taken to locate the words hardly changes at all as the main oparations remains ORing & AND NOTing 26 bitstrings (essentially O(1)), and then the final filtering:

C:\test>wc -l TWL06.txt 178691 TWL06.txt C:\test>790206.pl apetpxl ale alp alt ape apex app appel apple applet apt ate axe axel axle eat eta exalt expat lap lappet lat late latex lax lea leap leapt lept lepta let lex pal pale palet palp pap pat pate pax pea peal peat pelt pep pepla pet petal plat plate plea pleat plex tae tael tale tap tape tax tea teal tel tela tepa tepal Found 64 words in 0.23

You don't say what the "certain time frame" is, but presumably as this is intended for the human brain rather than computer, it is in the order of minutes rather than sub 1 second? Even if I feed in the entire alphabet--which means it must select all the words via the bitstrings and then filter out all those that contain duplicates. ie. worse case--it only takes just over 8 seconds:

C:\test>790206.pl >nul abcdefghijklmnopqrstuvwxyz Found 36409 words in 8.46

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

Replies are listed 'Best First'.
Re^6: Turning A Problem Upside Down
by Limbic~Region (Chancellor) on Aug 23, 2009 at 23:58 UTC
    BrowserUk,
    Youo don't say what the "certain time frame" is,...

    The time limit is 2 minutes but the majority of the time in my code is with an artificial delay in Win32::GuiTest's SendKeys() to not overwhelm the game.

    I have not used bitmasks in the past quite the way you have here. It obviously has a huge advantage over my approach when the given input length grows. Some day I will pick your brain on this. Thanks again.

    Cheers - L~R

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2024-04-19 10:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found