dkl
Full Member
Posts: 234
|
Post by dkl on Jan 23, 2022 1:25:21 GMT -5
Here is the Final Version (hopefully) of my Wordle Clone. I have tested it fairly extensively and added all suggestions made, except tsh73's one to improve the loading time! Partly, because it only seem to minimally improve the load time (probably, the way I did it) and also as it didn't seem really necessary, now that I have added a 'play again' button, which speeds thing up for another game. There are some new graphics and a few extra sounds as well lots of error checks and less chance of crashing/cheating etc. I have included the Collins SCRABBLE Dictionary to supply word definitions rather than the Web Browser function (although it is still there if required). Thanks to tsh73 speedy word seek function its instant and quicker than opening your Browser. I have included a small 'exe' I wrote, called 'winmin.exe', which will auto close your main LB window the moment you run the programme (to get it out the way). It is quite safe and virus few. It should work with other LB programmes provide you are using NOMAINWIN. Warning, it close the window instantly so please don't think the game has crashed - it surprises me every time! I think everything is self explanatory. If there are any problems then please let me know. The one thing I'm not happy with if the random function to choose the 'hidden' word. I find words get repeated quite often which is crazy since there are over 12000 words to choose from! If someone has an improved solution I'd love to hear about it. The File size is a lot larger than before but this is mainly due to the Dictionary being included with the new update. Just download from the link provided ----->> ln5.sync.com/dl/bf38049c0/tyb3hyt3-dhw3tcea-kezvhcjr-zw3yc4d2Hope you enjoy the programme.
|
|
|
Post by Rod on Jan 23, 2022 3:36:09 GMT -5
Distributing a .exe with the file would avoid the need for the winmin.exe then folks can run the .bas if they wish and study the code or simply run the .exe which does not open the ide.
|
|
dkl
Full Member
Posts: 234
|
Post by dkl on Jan 23, 2022 4:02:20 GMT -5
Yes,Rod, that's a good idea. I'll add that.
I've been experimenting with the code below to replace the present random code to choose the hidden word and it seems to come up with more variation.
[playAgain] x= 1:y = 1 start = 1 st = INT(rnd(0)*9)+1 rn = int(rnd(0)*1441) res = rn*st toFind$ = upper$(Wd5$(res)) print st,rn,Wcount,toFind$ wait
It needs to be placed just after [start] and replace the current [playAgain] code
|
|
|
Post by tsh73 on Jan 23, 2022 13:22:51 GMT -5
Re: hidden word choosing 1) I tried series of "give up" in Debug (so I see hidden words in a mainwin) I see no doubles in one run Then I do second run Problem is that since I do not know these words, they all looks pretty much the same to me! Then I savet 10 hidden wirds in Notepad and made third run I get next 10 words. There were no duplicates. Quit and made another run - next 10 words. There were still no duplicates. So I really doubt there is a visible problem with word choosing. (I tried but did not get it) 2)Can't quite get Why don't you just use rn = INT(rnd(0)*Wcount)+1 instead of st = INT(rnd(0)*Wcount)+1 rn = int(rnd(0)*Wcount-st)+st
? Last line makes no sense 'cause you add st and deduct st, so nothing actually happens. Suppose you wanted to select start position (st) and get a word from st upwards. Then it should be st = INT(rnd(0)*Wcount)+1 rn = int(rnd(0)*(Wcount-st))+st
But why simply selecting a word at random from whole dictionary is not enough I do not know. Last posted code st = INT(rnd(0)*9)+1 rn = int(rnd(0)*1441) res = rn*st toFind$ = upper$(Wd5$(res)) obviously will skip all words on prime numbers positions (and on positions factorizing in numbers >9, like 100 or 132 or 10000 ) - lot's of words you will skip!
|
|
|
Post by tsh73 on Jan 23, 2022 13:30:28 GMT -5
Two three more things 1)
It will not work because you run it from absolute path. Few folks have disk L:
2) Your fancy background (really, really good I must add!) does not stay then window is obscured - you wrote
print #gr.gb,"drawbmp MyBmp 00,flush" but it should be
print #gr.gb,"drawbmp MyBmp 00;flush" (actually "drawbmp MyBmp 0 0" but LB just seems not care)
3) Then program is just started, pressing on empty big square make program do something for quite a noticeable time (button does not change back to no-pressed state for a while) After pressing START this delay disappears. EDIT it is "nogo" sound. But visually it takes longer time then sound is played.
|
|
dkl
Full Member
Posts: 234
|
Post by dkl on Jan 23, 2022 18:45:37 GMT -5
Firstly, my apologies to anyone who tried to run Wordle V2 only to find it won't run due to the hardcore coding of winmin.exe!. Either delete line 5 or change to run ".\winmin.exe" At Rod's suggestion, I will add an exe/tkn version in the next update WITH above errors corrected (Hopefully later today) Thank you tsh73 for again taking the time to point out any problems. 1. was a copy n paste mistake!! 2. should where my glasses Glad you pointed them out. The sticky button problem arrived, because I fiddle with the code! I've changed the 'nogo.wav' to 'async' and that has eliminated the problem. The only code I used to prevent unwanted 'clicks' was if start = 0 then exit sub This seems to work fine but is there a better way? Re the random number problem. As I mention in a post earlier I was having problems with the same words appearing - not consecutively or in the same game period, but constantly over a daily basis while I was testing. Not just 2 or 3, but up to 20/30 words that had all appeared in a previous session. I noticed because many of the words were all unusual and I hadn't heard of. I did make a this of words that constantly appeared, but seem to have mislaid it so will have to try again! I pasted the random code line from your wordle game into mine and got exactly the same problem, which made me think that I must have a 'stray' variable that was influencing the outcome. That is why I tried to find a new way by changing the code. Hence the experiments. You are right that there are many strange words in the Dictionary - many I have never heard of either! It's a strange Dictionary, as Rod pointed out too, but I found using a different one caused too many errors when trying to guess words as many acceptable/correct words were not in the dictionary - the 'unixdict' list for example. Thank you for explaining more how the rnd(0) code works. I see that I left out a set of brackets in my 1st code. If I change my recent code (V2) to st = INT(rnd(0)*10)+1 rn = int(rnd(0)*1297) res = rn*st toFind$ = upper$(Wd5$(res)) Will this improve it? As you can see I'm useless at Maths! Thank you all for your time - much appreciated (as always)
|
|
dkl
Full Member
Posts: 234
|
Post by dkl on Jan 23, 2022 19:34:27 GMT -5
The new file has been upload to the link in the first post
All updates have hopefully been implemented correctly. The Winmin.exe file has been eliminated and an exe/tkn file together with the required DLL's has been added. the original '.BAS' file is also there.
ENJOY
|
|
|
Post by tsh73 on Jan 23, 2022 22:22:20 GMT -5
add a code that writes date * time * hidden word to the file. (you can do it after word was uncovered/user give up) This way program will do the list for you, and you will see if words actually duplicate.
|
|
dkl
Full Member
Posts: 234
|
Post by dkl on Jan 25, 2022 19:59:25 GMT -5
Yes, I might try your suggestion I'm definitely much happier with the code I'm using at present, especially with the extra brackets you suggested. The word choice is a vast improvement.
|
|
|
Post by Mark Dunham on Mar 1, 2022 16:40:36 GMT -5
I really like how this clone came out looks really good great job I love seeing these.
|
|