bplus
Full Member
 
Posts: 123
|
Post by bplus on May 25, 2022 11:17:03 GMT -5
Sorry, I didn't see all the new posts. plenty for me to study and learn from. Thank you!  Well to save time, I scouted out tsh73 method and recommend it over everything I posted as being way faster. You can have a list of all words available to player before the player finishes scanning the board and types his first letter! My method almost takes a whole .5 second sometimes, sheez!
|
|
dkl
Full Member
 
Posts: 234
|
Post by dkl on May 26, 2022 2:16:46 GMT -5
Hi bplus.... LOL I haven't broken anything down in the code yet, to try to understand it all. I can't get your first version of the posted BOGGLE code to work at all in JB or LB. I got a RUNTIME Error Subscript out of rage -9 dWord$() - (Not the check word code that was fine)
This puzzled me - it only loads 1 word and then closes
open "unixdict.txt" for input as #1 'load dictionary input #1, wd$ close #1
then it got stuck on for i = topWord-10 to topWord
so I changed for i = topWord-10 to topWord >>>>TO >>>>> for i = topWord-10 to topWord step -1
now it runs,but of course no words as they weren't read in at the beginning. Was there some code missing. Sorry if I'm being a bit dumb! Your second version worked fine As your 2nd version seem quite different from your first posted code, I couldn't see where to add tsh73 new code to speed it all up. I notice tsh73's code found AXE, & AXES and found CAT, but didn't find CATS, but of course it found a lot of extra words. (I'm not trying to be picky  ! It's probably because it had to cut across CA to get to S. as C & A were used it seemed like a 'deadend'? C S X S T A Y E Anyhow, how that's minor. This is the bit I couldn't see where it had to go! However, this has been very enlightening. I will probably try to add a GUI at some point, which wasn't my intention. But first, I really should finish my last Word project, the one I mentioned earlier in this post, before I move onto something else! I was just Really interested in how a problem like this is addressed. So a BIG 'Thank You' to you both for helping out.
|
|
|
Post by tsh73 on May 26, 2022 4:05:34 GMT -5
B+'s code works with original UNIXDICT.TXT, which is LF-delimites So LB loads it as single long string Your version of UNIXDICT.TXT is CR LF delimited (Windows style), so LB reads word by word. That's just beacuse UNICDICT has AXES but has no CATS So no cats for you 
|
|
dkl
Full Member
 
Posts: 234
|
Post by dkl on May 26, 2022 20:58:47 GMT -5
 I see thanks for that explanation , tsh73
|
|