How to format a While... Wend correctly? - Printable Version +- QB64 Phoenix Edition (https://qb64phoenix.com/forum) +-- Forum: QB64 Rising (https://qb64phoenix.com/forum/forumdisplay.php?fid=1) +--- Forum: Code and Stuff (https://qb64phoenix.com/forum/forumdisplay.php?fid=3) +---- Forum: Help Me! (https://qb64phoenix.com/forum/forumdisplay.php?fid=10) +---- Thread: How to format a While... Wend correctly? (/showthread.php?tid=2466) |
RE: How to format a While... Wend correctly? - SMcNeill - 02-29-2024 Attach it in 7z or zip format, if you can. RE: How to format a While... Wend correctly? - PhilOfPerth - 02-29-2024 How 'barrassment! I was shown how to attach files once before, but can't find a way to do this again now! Wasn't there an "attach file" button somewhere? RE: How to format a While... Wend correctly? - Jack - 02-29-2024 PhilOfPerth, use "New Reply" and not the "Quick Reply" at the bottom of a new reply you will see the attachment option RE: How to format a While... Wend correctly? - PhilOfPerth - 02-29-2024 Ah yes! Thanks Jack. Maybe the option should be available in Quick Reply too? Anyway, there it is. Have fun, Steve! RE: How to format a While... Wend correctly? - SMcNeill - 02-29-2024 I submit the following for a starting point for a speed test for folks to compare against: Code: (Select All)
Quick question though: Are you looking for the fastest way to LOAD the file, or the fastest way to SEARCH the file? I didn't really try to push the limits of either here, as I'm certain I can do both load and search faster with just very little effort. I just thought I'd start with a simple OPEN FOR BINARY and LINE INPUT to get our data, and then a simple binary search to find the words, so folks would have a starting point to compete against. Only thing is, I wasn't certain what exactly I was timing, so the above only times search times for me, and on my PC that's 0.0 seconds for 10 word look-ups. Looks like we need a bigger search list to go on as well! LOL! RE: How to format a While... Wend correctly? - SMcNeill - 02-29-2024 I finally have results for how long a binary search method takes! Code: (Select All)
We search for 10 words, 10000 times, for a total of 100,000 word look-ups... and it takes 0.05 seconds on my PC. That's not bad for a starting benchmark, I don't think. RE: How to format a While... Wend correctly? - bplus - 02-29-2024 For me the main concern was not taking anytime to load the word file let alone the word and definitions file at the start of the game. The Binary search does not take a noticable amount of time for a word lookup, the human player is way too slow to need a slew of words searched at once. Maybe different with a spellchecker. RE: How to format a While... Wend correctly? - SpriggsySpriggs - 02-29-2024 I've never been a fan of automatically assuming an array size for a file's contents. I'd rather just count the number of items in the file and then build the array or make it dynamic and resize it for each new item. RE: How to format a While... Wend correctly? - SMcNeill - 02-29-2024 (02-29-2024, 01:09 PM)SpriggsySpriggs Wrote: I've never been a fan of automatically assuming an array size for a file's contents. I'd rather just count the number of items in the file and then build the array or make it dynamic and resize it for each new item. It resizes itself after the DO....LOOP. RE: How to format a While... Wend correctly? - SpriggsySpriggs - 02-29-2024 I'm talking about resizing up to allow for more than 1,000,000. Not that you would ever need to, but I just dislike rigidity in data capture. |