dkl
Full Member
Posts: 234
|
Post by dkl on Nov 27, 2021 17:34:25 GMT -5
This is a works in progress and an extension of the work I was doing on the Anagram programme. It was inspired after seeing a post by tenochtitlanuk about a word puzzle he enjoys and gave me a reason to extend the project further and hopefully learn more.
The LB programme is quite small, as it includes 4 dictionaries (SCRABBLE, SOWPODS, TWL06 & UNIXDICT), as well as BMPs/WAVs, it has grown in size and I have had to upload it to the 'Cloud'. I have used www.sync.com which is a cloud service I haven't used before, so hope that the link works correctly.(See link below) Please let me know if there are any problems trying to access it.
There is info about playing the game/scoring etc included in the zipfile. I've attached a pic to give an idea of the game.
Known bugs - nothing too serious - most of them are graphics/display related, but include:-
*If you shuffle letters during letter/word input of an incomplete word, the letters change place but the buttons already 'disabled' 'receive new letters which you cannot access - simply reshuffle again .
*If you use the keyboard to input letters the Wheelie Word graphics letters (that have been used) don't get disabled - working on that.
*It takes a bit longer than necessary to process available words to find, due to a programming glitch, but it doesn't affect the gameplay.
**Biggest problem is :- I'm having trouble with 'Reset' at present, so you have to close the game and start again to play another game.
I have recently change the scoring to SCRABBLE Word Tile Values and forgot to update the scoring comments (but that's minor)
I'd be interested in feedback and comments to improve the experience. (NB This is coded only for my own experience and no other reason - Not going Commercial!! )
Enjoy
NB. I have just tested the link and it seems to work fine. Attachments:
|
|
|
Post by tenochtitlanuk on Nov 28, 2021 3:53:26 GMT -5
Downloaded fine and it is impressive. The GUI front-end makes it very easily useable. I'll be playing with it when I have time. johnf PS thanks for the mention! LB and this forum have always been great places to share, help and admire!
|
|
|
Post by Rod on Nov 28, 2021 5:43:07 GMT -5
I use Liberty BASIC Pro, it baulks on inputcsv() so I have to use Liberty BASIC v4.5.1. Neither did I read the first few lines :) DefaultDir$+"\" will fill in the project directory path automatically. You can run the default browser without knowing the path. I will need to look up that example code. You use Let$() as an array which is a reserved word, I got one runtime error because of this but I don't know what I clicked to cause it.
My main problem is that when I press START the program just keeps finding words and locks up. 300+ words or more then it goes quiet and it won't respond to keys or mouse. I have to use CtrlAltDel to close it.
|
|
dkl
Full Member
Posts: 234
|
Post by dkl on Nov 28, 2021 6:56:34 GMT -5
hmm... that's strange Rod. I have no problems at all with Let$ or anything else.It works perfectly well. no freezes or anything. I have made your changes - just changed inputcsv #w to input #w and changed all Let$ to Letr$ (about30+)
still working fine
yes it can churn out a lot of words depending on how many it can make from the word it chooses up to 600+ sometimes. After it finds all the words it can take about 10 secs to reload the GUI.
Don't know it anyone else has had a problem. I'll see what the response is and then upload any necessary changes in the meantime here is the new version I made which hopefully should work for you. But I didn't have time to fully test it, but it did foire up and I started to play a game.
'Inspired after seeing a post by tenochtitlanuk about a word puzzle he enjoys
path3$ = "L:\_New Projects\WheelieWord\" '<--------SET YOUR PROGRAMME PATH & FOLDER HERE WBPath$ = "C:\Users\kleth\AppData\Local\Programs\Opera\launcher.exe " '<--------SET YOUR WEB BROWSER PATH & FOLDER HERE
dct$ = path3$+"dictionary.ini":gosub [Dictionary]
dictionary$ = "Collins Scrabble Words (2019) with definitions.txt":DwordCount = 279494'321719 d$ = path3$+"Dictionaries\"+dictionary$
Dim diction$(162500),Wd3$(wc3),Wd4$(wc4),Wd5$(wc5),Wd6$(wc6),Wd7$(wc7),Wd8$(wc8),Wd9$(wc9) Dim W3$(100),W4$(100),W5$(100),W6$(100),W7$(100),W8$(100),W9$(100) Dim D3$(2000),D4$(2000),D5$(2000),D6$(2000),D7$(2000),D8$(2000),D9$(2000) Dim holdword$(1500),Letr$(11),bn$(500),bn1$(500),wr$(30)
LdDict = dict
if dict = 1 then gosub [Dictionary1] if dict = 2 then gosub [Dictionary2] if dict = 3 then gosub [Dictionary3] if dict = 4 then gosub [Dictionary4]
print "Dictionary "+path$; " is loading by default"
WH$ = "#w" ' used in random control of Wheelie Word letters/button to disable them once chosen lbsh = 2:hw = 1:BN = 0:w2f = 0:sc = 0:ic = 2 '<-input control = 2/mouse(default) z3 = 0:z4 = 0:z5 = 0:z6 = 0:z7 = 0:z8 = 0:z9 = 0 shuffle = 0
Ts$ = path3$+"tap.wav" Trs$ = path3$+"trill.wav" Wrs$ = path3$+"wrong.wav" Dds$ = path3$+"Dding.wav" Cds$ = path3$+"countdown.wav" pls$ = path3$+"plop.wav" Can$ = path3$+"cancel.wav" Sfl$ = path3$+"shuffle.wav" sec5$ = path3$+"5sec_Click.wav" clue$ = path3$+"clue.wav" bon$ = path3$+"bonus.wav" snpk$ = path3$+"snpk.wav" jkpt$ = path3$+"jackpot.wav"
f3$ = path$+doc3$:f4$ = path$+doc4$:f5$ = path$+doc5$:f6$ = path$+doc6$:f7$ = path$+doc7$:f8$ = path$+doc8$:f9$ = path$+doc9$
[loadDict]'load and store words in their categories 3 - 9 letters open f3$ for input as #rd print "loading word file 3........" for rd = 1 to wordCount3 input #rd,data3$:ct3 = ct3 +1:Wd3$(ct3) = data3$:d1 = d1 +1:diction$(d1) = lower$(trim$(data3$)) if data$ = "-2" then exit for next rd close #rd ld = 1
open f4$ for input as #rd print "loading word file 4........" for rd = 1 to wordCount4 inputcsv #rd,data4$:ct4 = ct4 +1:Wd4$(ct4) = data4$:d1 = d1 +1:diction$(d1) = lower$(trim$(data4$)) if data$ = "-2" then exit for next rd close #rd ld = 1
open f5$ for input as #rd print "loading word file 5........" for rd = 1 to wordCount5 input #rd,data5$:ct5 = ct5 +1:Wd5$(ct5) = data5$:d1 = d1 +1:diction$(d1) = lower$(trim$(data5$)) if data$ = "-2" then exit for next rd close #rd ld = 1
open f6$ for input as #rd print "loading word file 6........" for rd = 1 to wordCount6 input #rd,data6$:ct6 = ct6 +1:Wd6$(ct6) = data6$:d1 = d1 +1:diction$(d1) = lower$(trim$(data6$)) if data$ = "-2" then exit for next rd close #rd ld = 1
open f7$ for input as #rd print "loading word file 7........" for rd = 1 to wordCount7 input #rd,data7$:ct7 = ct7 +1:Wd7$(ct7) = data7$:d1 = d1 +1:diction$(d1) = lower$(trim$(data7$)) if data$ = "-2" then exit for next rd close #rd ld = 1
open f8$ for input as #rd print "loading word file 8........" for rd = 1 to wordCount8 input #rd,data8$:ct8 = ct8 +1:Wd8$(ct8) = data8$:d1 = d1 +1:diction$(d1) = lower$(trim$(data8$)) if data$ = "-2" then exit for next rd close #rd ld = 1
open f9$ for input as #rd print "loading word file 9........" for rd = 1 to wordCount9 input #rd,data9$:ct9 = ct9 +1:Wd9$(ct9) = data9$:d1 = d1 +1:diction$(d1) = lower$(trim$(data9$)) if data$ = "-2" then exit for next rd close #rd ld = 1
ln = 9:r = 1 [start] z3 = 0:z4 = 0:z5 = 0:z6 = 0:z7 = 0:z8 = 0:z9 = 0 DL3 = 5:DL4 = 5:DL5 = 5:DL6 = 5:DL7 = 3:DL8 = 2:DL9 = 1:max = 26:difLvl = 1 '<- default difficuly level (EASY) st = 0
[startOver]
'============================================================================================================================== [open]'load GUI t = 10:ty = -432 'hidden ok button co-ordinates for keyboard input 'nomainwin WindowWidth = 800:WindowHeight = 920 ww = WindowWidth:wh = WindowHeight x=266:y=46
'MAIN GUI==================== graphicbox #w.ww,266,40,260,260 bmpfile2$ = path3$+"wheelieword.bmp" graphicbox #w.bg,0,0,900,1000 bmpfile1$ = path3$+"backgroundGray.bmp" BackgroundColor$ = "darkgray" ForegroundColor$ = "black" ListboxColor$ = "palegray" TextboxColor$ = "palegray"
'MENU==================================== menu #w, "Change Dictionary","1. SOWPODS",[Dictionary1],"2. TWL06",[Dictionary2],"3. SCRABBLE",[Dictionary3],"4. UNIXDICT",[Dictionary4] menu #w, "Change Difficulty Level","Easy",[Easy],"Medium",[Medium],"Hard",[Hard]',"User Choices",[userChoice] menu #w, "Input Control","Mouse",[useMouse],"Keyboard",[useKeyboard] menu #w, "Help","How to play",[help],"Difficuly Level Info",[info],"Scoring",[scoring],"SCRABBLE Tile Values",[scrabble] menu #w, "EXIT", "Quit Game",[quit] menu #w, " "," ",[showListbox] menu #w, " "," ",[9letter] graphicbox #w.gb1, x, y, 260, 260 w = 30:h = 30
'TOP CENTRE====================================== textbox #w.inf, 266, 5, 260, 30 stylebits #w.inf, _ES_CENTER, 0, 0, 0 textbox #w.inp, 266, 310, 225, 30 stylebits #w.inp, _ES_CENTER, 0, 0, 0 textbox #w.ln, 495, 310, 32, 30 stylebits #w.ln, _ES_CENTER, 0, 0, 0 button #w.ok, " ",[CH],UL,-40, -40, 30, 30 'hidden 'OK' input button (when using keyboard) stylebits #w.ok, _BS_DEFPUSHBUTTON, 0, 0, 0
'LEFT SIDE=================================================== Dlvl1$ = path3$+"easy mode.bmp" Dlvl2$ = path3$+"medium mode.bmp" Dlvl3$ = path3$+"hard mode.bmp" bmpbutton #w.lvl1,Dlvl1$,[EH],UL,48,5 bmpbutton #w.lvl2,Dlvl2$,[EH],UL,48,5 bmpbutton #w.lvl3,Dlvl3$,[EH],UL,48,5
button #w.eg, "End Game", [endGame],UL, 145, 45, 100, 30'320 stylebits #w.eg,_WS_DLGFRAME, 0, 0, 0 button #w.sp, "Sneek Peek", [SneekPeek],UL, 10, 45, 110, 30 stylebits #w.sp,_WS_DLGFRAME, 0, 0, 0
button #w.gc1, "Get Clue 1", [getClue1],UL, 10, 85, 120, 30'550,320 stylebits #w.gc1,_WS_DLGFRAME, 0, 0, 0 button #w.gc2, "Get Clue 2", [getClue2],UL, 10, 85, 120, 30 stylebits #w.gc2,_WS_DLGFRAME, 0, 0, 0 button #w.gc3, "Get Clue 3", [getClue3],UL, 10, 85, 120, 30 stylebits #w.gc3,_WS_DLGFRAME, 0, 0, 0 button #w.gc4, "Get Answer", [clue],UL, 10, 85, 120, 30 stylebits #w.gc4,_WS_DLGFRAME, 0, 0, 0 button #w.6a,"6",[6l],UL, 145, 85, 20, 30 stylebits #w.6a,_WS_DLGFRAME, 0, 0, 0 button #w.7a,"7",[7l],UL, 185, 85, 20, 30 stylebits #w.7a,_WS_DLGFRAME, 0, 0, 0 button #w.8a,"8",[8l],UL, 225, 85,20, 30 stylebits #w.8a,_WS_DLGFRAME, 0, 0, 0
button #w.s, "Show words", [showListbox],UL, 70, 130, 120, 30 stylebits #w.s,_WS_DLGFRAME, 0, 0, 0 button #w.h, "Hide words", [hideListbox],UL, 70, 130, 120, 30 stylebits #w.h,_WS_DLGFRAME, 0, 0, 0
bmpbutton #w.sc,path3$+"SCORING.bmp",[EH],UL,25,170 textbox #w.scpt, 45, 190, 50, 30 stylebits #w.scpt, _ES_CENTER, 0, 0, 0 bmpbutton #w.pt,path3$+"points.bmp",[EH],UL,40,225
bmpbutton #w.scbn,path3$+"BONUS.bmp",[EH],UL,155,170 textbox #w.SCbn, 165, 190, 50, 30 stylebits #w.SCbn, _ES_CENTER, 0, 0, 0 bmpbutton #w.SCpt,path3$+"points.bmp",[EH],UL,160,225
textbox #w.mw, 10, 260, 40, 30 stylebits #w.mw, _ES_CENTER, 0, 0, 0 bmpbutton #w.mwst,path3$+"maxwords.bmp",[EH],UL,55,270 textbox #w.wfd, 10, 300, 40, 30 stylebits #w.wfd, _ES_CENTER, 0, 0, 0 bmpbutton #w.fdst,path3$+"found.bmp",[EH],UL,55,310 textbox #w.w2f, 10, 340, 40, 30 stylebits #w.w2fstt, _ES_CENTER, 0, 0, 0 bmpbutton #w.w2fstt,path3$+"to find.bmp",[EH],UL,55,350
'Right Side================================================= bmpbutton #w.rw,path3$+"rejected words.bmp",[EH],UL,550,5 textbox #w.tbwr, 550,46,110,260 Stylebits #w.tbwr, _ES_MULTILINE, _ES_AUTOHSCROLL, 0, 0 textbox #w.rw2, 550,310,50,30 stylebits #w.rw2, _ES_CENTER, 0, 0, 0 bmpbutton #w.rwst,path3$+"words.bmp",[EH],UL,550,345
bmpbutton #w.bn,path3$+"bonus words.bmp",[EH],UL,670,5 textbox #w.tbbn, 670,46,110,260 stylebits #w.tbbn, _ES_CENTER, 0, 0, 0 textbox #w.bnb, 670,310,50,30 Stylebits #w.tbbn, _ES_MULTILINE, _ES_AUTOHSCROLL, 0, 0 bmpbutton #w.bn,path3$+"words.bmp",[EH],UL,670,345 textbox #w.bnbsc, 730,310,50,30 Stylebits #w.bnbsc, _ES_MULTILINE, _ES_AUTOHSCROLL, 0, 0 bmpbutton #w.bnst,path3$+"score.bmp",[EH],UL,730,348
'WHEELIE WORD GRAPHIC BUTTONS========================================== button #w.1,Letr$(1), buttonClick,UL, (x+160)-t,(y+50)-t,w,h'160,50, w,h button #w.2,Letr$(2), buttonClick,UL, (x+205)-t, (y+100)-t, w,h button #w.3,Letr$(3), buttonClick,UL, (x+205)-t, (y+156)-t, w,h button #w.4,Letr$(4), buttonClick,UL, (x+160)-t, (y+206)-t, w,h button #w.5,Letr$(5), buttonClick,UL, (x+90)-t, (y+206)-t, w,h button #w.6,Letr$(6), buttonClick,UL, (x+50)-t, (y+156)-t, w,h button #w.7,Letr$(7), buttonClick,UL, (x+50)-t, (y+100)-t, w,h button #w.8,Letr$(8), buttonClick,UL, (x+90)-t, (y+50)-t, w,h button #w.9,Letr$(9), buttonClick,UL, (x+127)-t, (y+123)-t, w,h
'Minions======================================= ex = 40:ey = 40 bmpbutton #w.ul, path3$+"minULg.bmp", [CH],UL, (x+12)-t, (y+12)-t', ex, ey '12,12 bmpbutton #w.ll, path3$+"minLLg.bmp", [CH],LL, (x+12)-t, (y+58)-ty', ex, ey '12,-45 bmpbutton #w.ur, path3$+"minURg.bmp", [CH],UR, (x+3)-t, (y+12)-t', ex, ey '38,12 bmpbutton #w.lr, path3$+"minLRg.bmp", [CH],LR, (x-22)-t, (y+58)-ty', ex, ey '15,-28
'LOWER BUTTONS================================== button #w.cw, "Cancel Word",[CancelWord],UL,266,345,125,30 stylebits #w.cw,_WS_DLGFRAME, 0, 0, 0 button #w.sl, "Shuffle Letters",[getLetters],UL,402,345,125,30 stylebits #w.sl,_WS_DLGFRAME, 0, 0, 0
bmpbutton #w.last,path3$+"last.bmp",[EH],UL,342,388 bmpbutton #w.word,path3$+"word.bmp",[EH],UL,376,413 bmpbutton #w.score,path3$+"score.bmp",[EH],UL,422,390 textbox #w.lwsc,380, 380, 40, 30 stylebits #w.lwsc, _ES_CENTER, 0, 0, 0 button #w.st, "Start", [selectWord],UL,370, 380, 60, 30 stylebits #w.st,_WS_DLGFRAME, 0, 0, 0 button #w.sut, "Setting Up and Thinking..........", [selectWord],UL,245, 380, 300, 30
'Lower GUI============================================== yfd = 440:fd3$ = " ";z3;"/";DL3:fd4$ = " ";z4;"/";DL4:fd5$ = " ";z5;"/";DL5:fd6$ = " ";z6;"/";DL6:fd7$ = " ";z7;"/";DL7:fd8$ = " ";z8;"/";DL8:fd9$ = " ";z9;"/";DL9 statictext #w.fd3,fd3$, 10, yfd, 40, 20 statictext #w.fd4,fd4$, 10+(80), yfd, 40, 20 statictext #w.fd5,fd5$, 10+(170), yfd, 40, 20 statictext #w.fd6,fd6$, 10+(270), yfd, 40, 20 statictext #w.fd7,fd7$, 10+(380), yfd, 40, 20 statictext #w.fd8,fd8$, 10+(500), yfd, 40, 20 statictext #w.fd9,fd9$, 10+(630), yfd, 40, 20
'Display no of words found xwl = 10:ysc = 460:wwl = 50:hwl = 30':xwlgap = wwl+10 textbox #w.sc3,x3,ysc,wwl,hwl textbox #w.sc4,x3+(80),ysc,wwl,hwl textbox #w.sc5,x3+(170),ysc,wwl,hwl textbox #w.sc6,x3+(270),ysc,wwl,hwl textbox #w.sc7,x3+(380),ysc,wwl,hwl textbox #w.sc8,x3+(500),ysc,wwl,hwl textbox #w.sc9,x3+(630),ysc,wwl,hwl
x3 = 10:yst = 499
'LETTERS bmpbutton #w.st3,path3$+"3 Letters.bmp",[dm],UL x3, yst', 70, 16 bmpbutton #w.st4,path3$+"4 Letters.bmp",[dm],UL x3+(80), yst', 70, 16 bmpbutton #w.st5,path3$+"5 Letters.bmp",[dm],UL x3+(170), yst', 70, 16 bmpbutton #w.st6,path3$+"6 Letters.bmp",[dm],UL x3+(270), yst', 70, 16 bmpbutton #w.st7,path3$+"7 Letters.bmp",[dm],UL x3+(380), yst', 70, 16 bmpbutton #w.st8,path3$+"8 Letters.bmp",[dm],UL x3+(500), yst', 70, 16 bmpbutton #w.st9,path3$+"9 Letters.bmp",[dm],UL x3+(630), yst', 70, 16
'Display words found x3 = 10:y3 = 520: w3 = 110:h3 = 135:x3gap = 10 'h3 = 125 = space for 12 words listbox #w.l3,W3$(),[EH3], x3, y3, 70, h3 'stylebits #w.l3, _LBS_DISABLENOSCROLL, 0, 0, 0 listbox #w.l4,W4$(),[EH4], x3+(80), y3, 80, h3 listbox #w.l5,W5$(),[EH5], x3+(170), y3, 90, h3 listbox #w.l6,W6$(),[EH6], x3+(270), y3, 100, h3 listbox #w.l7,W7$(),[EH7], x3+(380), y3, 110, h3 listbox #w.l8,W8$(),[EH8], x3+(500), y3, 120, h3 listbox #w.l9,W9$(),[EH9], x3+(630), y3, 130, h3
'Display no of words available xwl = 10:ywl = 670:wwl = 40:hwl = 30':xwlgap = wwl+10 textbox #w.wl3,x3,ywl,wwl,hwl textbox #w.wl4,x3+(80),ywl,wwl,hwl textbox #w.wl5,x3+(170),ywl,wwl,hwl textbox #w.wl6,x3+(270),ywl,wwl,hwl textbox #w.wl7,x3+(380),ywl,wwl,hwl textbox #w.wl8,x3+(500),ywl,wwl,hwl textbox #w.wl9,x3+(630),ywl,wwl,hwl
'Display Words available x4 = 10:y4 = 720: w4 = 110:h4 = 125:x4gap = 10 listbox #w.d3,D3$(),[EH3], x4, y4, 70, h4 listbox #w.d4,D4$(),[EH4], x4+(80), y4, 80, h4 listbox #w.d5,D5$(),[EH5], x4+(170), y4, 90, h4 listbox #w.d6,D6$(),[EH6], x4+(270), y4, 100, h4 listbox #w.d7,D7$(),[EH7], x4+(380), y4, 110, h4 listbox #w.d8,D8$(),[EH8], x4+(500), y4, 120, h4 listbox #w.d9,D9$(),[EH9], x4+(630), y4, 130, h4
[main] global SearchValue,st,tsc,Alen global A$,toFind$,MC$,WH$,Ts$,Trs$,Wrs$,Drs$,Cds$,Clue$,sec5$,jkpt$
if WW = 0 then open space$(80)+"Wheelie Word with ";name$;" Loaded" for window as #w :WW = 1'OPEN GUI with 9 letter word #w "font georgia 11 bold" 'affects ALL buttons if sp = 1 then [getLetters] goto [next]
[getLetters] 'display letter on Wheelie Word buttons if shuffle = 1 then #w.1,"!hide":#w.2,"!hide":#w.3,"!hide":#w.4,"!hide":#w.5,"!hide":#w.6,"!hide":#w.7,"!hide":#w.8,"!hide":#w.9,"!hide":#w.inf,"!hide":call shuffle Sfl$:gosub [clear]:goto [next]
#w.1,Letr$(1) #w.2,Letr$(2) #w.3,Letr$(3) #w.4,Letr$(4) #w.5,Letr$(5) #w.6,Letr$(6) #w.7,Letr$(7) #w.8,Letr$(8) #w.9,Letr$(9) #w.inf,Letr$(1);" - ";Letr$(2);" - ";Letr$(3);" - ";Letr$(4);" - ";Letr$(5);" - ";Letr$(6);" - ";Letr$(7);" - ";Letr$(8);" - ";Letr$(9)
[begin] if shuffle = 0 then #w.1,"!show":#w.2,"!show":#w.3,"!show":#w.4,"!show":#w.5,"!show":#w.6,"!show":#w.7,"!show":#w.8,"!show":#w.9,"!show":#w.inf,"!show"
' print #w.gb1, "when characterInput [keyinp]" print #w.gb1, "setfocus" #w.h, "!hide":#w.s, "!hide":#w.sut,"!hide":#w.sp,"!show":#w.lwsc,"!hide":#w.last,"hide":#w.word,"hide":#w.score,"hide" if ic = 1 then #w.inp, "!setfocus" 're keyboard input #w.gc1,"!show":#w.gc2,"!hide":#w.gc3,"!hide":#w.gc4,"!hide" ' re Get Clue
'WheelieWord image loadbmp "MyBmp", bmpfile2$ print #w.ww, "down" print #w.ww, "drawbmp MyBmp 0 0" ' print #w.ww, "flush" 'Background image loadbmp "MyBmp", bmpfile1$ print #w.bg, "down" print #w.bg, "drawbmp MyBmp 0 0" ' print #w.bg, "flush"
'Display buttons if lbsh = 0 then #w.h, "!hide":#w.s, "!hide":#w.sp,"!show":#w.eg,"!show" if lbsh = 1 then #w.h, "!show":#w.s, "!hide":#w.sp,"!hide"
'Display statictext & set font '#w.st3,"!font 12 Georgia bold":#w.st4,"!font 12 Georgia bold":#w.st5,"!font 12 Georgia bold":#w.st6,"!font 12 Georgia bold":#w.st7,"!font 12 Georgia bold":#w.st8,"!font 12 Georgia bold":#w.st9,"!font 12 Georgia bold" #w.inf,"!font 14 Georgia bold"
#w.1,"!font Georgia 16 bold":#w.2,"!font Georgia 16 bold":#w.3,"!font Georgia 16 bold":#w.4,"!font Georgia 16 bold":#w.5,"!font Georgia 16 bold":#w.6,"!font Georgia 16 bold" #w.7,"!font Georgia 16 bold":#w.8,"!font Georgia 16 bold":#w.9,"!font Georgia 16 bold":#w.mw,"!font Georgia 10 bold" 'disable bmpbuttons #w.w2fstt,"disable":#w.fdst,"disable":#w.mwst,"disable":#w.SCpt,"disable":#w.scbn,"disable":#w.pt,"disable" 'disable bmpbuttons #w.sc,"disable":#w.rw,"disable":#w.bn,"disable":#w.last,"disable":#w.word,"disable":#w.score,"disable" 'disable bmpbuttons
'#w.scpt,"disable"
if difLvl = 1 then #w.lvl1,"show":#w.lvl2,"hide":#w.lvl3,"hide" if difLvl = 2 then #w.lvl1,"hide":#w.lvl2,"show":#w.lvl3,"hide" if difLvl = 3 then #w.lvl1,"hide":#w.lvl2,"hide":#w.lvl3,"show"
if dc = 1 then #w.mw,Wcount:#w.lwsc,"!show":#w.last,"show":#w.word,"show":#w.score,"show"'Dcount 'show max words available
#w.fd3,fd3$:#w.fd4,fd4$:#w.fd5,fd5$:#w.fd6,fd6$:#w.fd7,fd7$:#w.fd8,fd8$:#w.fd9,fd9$ #w.fd3,"!show":#w.fd4,"!show":#w.fd5,"!show":#w.fd6,"!show":#w.fd7,"!show":#w.fd8,"!show":#w.fd9,"!show"
shuffle = shuffle + 1 maxsc = (DL3*3)+(DL4*4)+(DL5*5)+(DL6*6)+(DL7*7)+(DL8*8)+(DL9*9) 'MAXIMUM SCORE POSSIBLE wait 'end of mainloop/opening GUI=================================================================================================
[next]'mixup letters randomly z = int( 1+ln *rnd( 0)) Letr$(r) = mid$(toFind$,z,1):r = r +1 b1$ = mid$(toFind$,1,z-1) b2$ = mid$(toFind$,(z+1),len(toFind$)) toFind$ = b1$+b2$:print z,toFind$ ln = ln -1:if ln = 0 then shuffle = 0:goto [getLetters] goto [next]
[keyinp] '====================INKEYS ' key$ = Inkey$ ' if len(key$) = 1 then close #w ' if val(key$) >= 97 and val(key$) <= 122 then call buttonClick handle$'#w.inp,key$;'[result] ' if key$ = "n" then [result] ' if key$ = "r" then [reset] ' if key$ = "x" then [quit] ' 'if key$ = " " then [next] ' if key$ = "h" then goto [hideListbox] ' if key$ = "s" then gosub [showListbox] redim Letr$(11) r = 1:ln = 9 wait goto [startOver]
[result] #w.s,"!show"
[clear]'clear found word - goto next word input redim Letr$(11) r = 1:ln = 9':cls:print if shuffle = 1 then toFind$ = Uword$ return
'get letter from WheelieWord and put into input box (mouse version) only ? sub buttonClick handle$ SearchValue=val(right$(handle$, 1)) CH$ = str$(SearchValue):MC$ = WH$;".";CH$ print MC$ #MC$ "!disable" print Letr$(SearchValue) call assign A$ end sub
sub assign byref A$ A$ = A$ + Letr$(SearchValue):#w.inp,A$:print "Length of Input -> ";len(A$):#w.ln,len(A$) print "A$ = ";A$ call tap Ts$ end sub
[CH] 'establish word length is >= 3 + KEYBOARD INPUT (FULL WORD) if ic = 1 then #w.inp,"!contents? A$"':CH$ = str$(SearchValue):MC$ = WH$;".";CH$:print MC$:#MC$ "!disable"
if len(A$) <= 2 then A$ = "": notice "Word must be 3 or more letters - START AGAIN":goto [CancelWord] else goto [checkWord] end if wait
[checkWord] 'establish word length print "Checking word....." Alen = len(A$):print Alen gosub [checkDuplicate]:if dup = 1 then dup = 0:goto [clearIt] if Alen = 3 then [checkWord3] if Alen = 4 then [checkWord4] if Alen = 5 then [checkWord5] if Alen = 6 then [checkWord6] if Alen = 7 then [checkWord7] if Alen = 8 then [checkWord8] if Alen = 9 then [checkWord9]
[checkWord3] 'search for validity of word for sch = 1 to wordCount3 if lower$(Wd3$(sch)) = lower$(A$) then fd = 1:call plop pls$:print A$:gosub [w3]:exit for next goto [clearIt]
[checkWord4] for sch = 1 to wordCount4 if lower$(Wd4$(sch)) = lower$(A$) then fd = 1:call plop pls$:print A$:gosub [w4]:exit for next goto [clearIt]
[checkWord5] for sch = 1 to wordCount5 if Alen = 5 and lower$(Wd5$(sch)) = lower$(A$) then fd = 1:call plop pls$:print A$:gosub [w5]:exit for next goto [clearIt]
[checkWord6] for sch = 1 to wordCount6 if Alen = 6 and lower$(Wd6$(sch)) = lower$(A$) then fd = 1:call plop pls$:print A$:gosub [w6]:exit for next if lower$(A$) = lower$(Clword$) then wr = wr + clue:clue = 0 goto [clearIt]
[checkWord7] for sch = 1 to wordCount7 if Alen = 7 and lower$(Wd7$(sch)) = lower$(A$) then fd = 1:call plop pls$:print A$:gosub [w7]:exit for next if lower$(A$) = lower$(Clword$) then wr = wr + clue:clue = 0 goto [clearIt]
[checkWord8] for sch = 1 to wordCount8 if Alen = 8 and lower$(Wd8$(sch)) = lower$(A$) then fd = 1:call plop pls$:print A$:gosub [w8]:exit for next if lower$(A$) = lower$(Clword$) then wr = wr + clue:clue = 0 goto [clearIt]
[checkWord9] for sch = 1 to wordCount9 if Alen = 9 and lower$(Wd9$(sch)) = lower$(A$) then fd = 1:call plop pls$:print A$:gosub [w9]:exit for next goto [clearIt]
[clearIt]'if incorrect reject it ' ---- clear word - goto next word input print "FD ->";fd if fd = 0 then print "NOT FOUND - Word Rejected":call wrong Wrs$:wr$ = wr$ +" "+A$:rw2 = rw2 +1:#w.rw2,rw2:#w.tbwr,wr$;
're-enable letters - display new 'found word' total if fd >0 and fd <2 then max = max -1: #w.w2f,max:w2f = w2f+1:#w.wfd, w2f A$ = "":fd = 0:#w.1,"!enable":#w.2,"!enable":#w.3,"!enable":#w.4,"!enable":#w.5,"!enable":#w.6,"!enable":#w.7,"!enable":#w.8,"!enable":#w.9,"!enable" fd3$ = z3;"/";DL3:print fd3$:#w.fd3,fd3$ fd4$ = z4;"/";DL4:print fd4$:#w.fd4,fd4$ fd5$ = z5;"/";DL5:print fd5$:#w.fd5,fd5$ fd6$ = z6;"/";DL6:print fd6$:#w.fd6,fd6$ fd7$ = z7;"/";DL7:print fd7$:#w.fd7,fd7$ fd8$ = z8;"/";DL8:print fd8$:#w.fd8,fd8$ fd9$ = z9;"/";DL9:print fd9$:#w.fd9,fd9$ Alen = 0:#w.inp,"":#w.ln,"":if ic = 1 then #w.inp,"!setfocus" wait
[selectWord]'get User Word call tap Ts$ call tap Ts$ #w.st,"!hide":#w.sut,"!show" redim Letr$(11):r = 1:ln = 9
'CLEAR all LISTBOXES/VARIABLES/STRINGS/ARRAYS ETC......to be done?? sw = INT(rnd(1)*wordCount9):print sw toFind$ = lower$(trim$(Wd9$(sw))) Uword$ = toFind$ print toFind$ gosub [findSelection] goto [startOver]
[loadLists] 'put correct length word into listbox and count number of words + ADD SCORE [w3] if z3>=DL3 then gosub [checkDuplicate] if dup = 1 then return else gosub [bonus]:return '<-change DL3 - DL9 to adjust difficulty level (more words to find) end if end if W3$(z3) = A$:z3 = z3 +1:holdword$(hw) = A$:hw = hw +1:print z3,W3$(z3):#w.l3,"reload":fd3$ = " ";z3;"/";DL3:#w.fd3,fd3$ if z3>= DL3 then #w.l3,"disable":sect = 1:call dding Dds$'<-change DL3 to adjust difficulty level (more words to find) gosub [score] return
[w4] if z4>= DL4 then gosub [checkDuplicate] if dup = 1 then return else gosub [bonus]:return '<-change DL3 - DL9 to adjust difficulty level (more words to find) end if end if W4$(z4) = A$:z4 = z4 +1:holdword$(hw) = A$:hw = hw +1:print z4,W4$(z4):#w.l4,"reload":fd4$ = " ";z4;"/";DL4:#w.fd4,fd4$ if z4>= DL4 then #w.l4,"disable":sect = 1:call dding Dds$ gosub [score] return
[w5] if z5>= DL5 then gosub [checkDuplicate] if dup = 1 then return else gosub [bonus]:return '<-change DL3 - DL9 to adjust difficulty level (more words to find) end if end if W5$(z5) = A$:z5 = z5 +1:holdword$(hw) = A$:hw = hw +1:print z5,W5$(z5):#w.l5,"reload":fd5$ = " ";z5;"/";DL5:#w.fd5,fd5$ if z5>= DL5 then #w.l5,"disable":sect = 1:call dding Dds$ gosub [score] return
[w6] if z6>= DL6 then gosub [checkDuplicate] if dup = 1 then return else gosub [bonus]:return '<-change DL3 - DL9 to adjust difficulty level (more words to find) end if end if W6$(z6) = A$:z6 = z6 +1:holdword$(hw) = A$:hw = hw +1:print z6,W6$(z6):#w.l6,"reload":fd6$ = " ";z6;"/";DL6:#w.fd6,fd6$ if z6>= DL6 then #w.l6,"disable":sect = 1:call dding Dds$ gosub [score] return
[w7] if z7>= DL7 then gosub [checkDuplicate] if dup = 1 then return else gosub [bonus]:return '<-change DL3 - DL9 to adjust difficulty level (more words to find) end if end if W7$(z7) = A$:z7 = z7 +1:holdword$(hw) = A$:hw = hw +1:print z7,W7$(z7):#w.l7,"reload":fd7$ = " ";z7;"/";DL7:#w.fd7,fd7$ if z7>= DL7 then #w.l7,"disable":sect = 1:call dding Dds$ gosub [score] return
[w8] if z8>= DL8 then gosub [checkDuplicate] if dup = 1 then return else gosub [bonus]:return '<-change DL3 - DL9 to adjust difficulty level (more words to find) end if end if W8$(z8) = A$:z8 = z8 +1:holdword$(hw) = A$:hw = hw +1:print z8,W8$(z8):#w.l8,"reload":fd8$ = " ";z8;"/";DL8:#w.fd8,fd8$ if z8>= DL8 then #w.l8,"disable":sect = 1:call dding Dds$ sect = 1:gosub [score] return
[w9] if z9>= DL9 then gosub [checkDuplicate] if dup = 1 then return else gosub [bonus]:return '<-change DL3 - DL9 to adjust difficulty level (more words to find) end if end if W9$(z9) = A$:z9 = z9 +1:holdword$(hw) = A$:hw = hw +1:print z9,W9$(z9):#w.l9,"reload":fd9$ = " ";z9;"/";DL9:#w.fd9,fd9$ if z9>= DL9 then #w.l9,"disable":sect = 1:call dding Dds$ gosub [score] return
[findSelection] lnwd = len(toFind$) print d1 Dcount = ct3+ct4+ct5+ct6+ct7+ct8+ct9
'print d1;" words loaded from ";Dcount;" words available"
[split] 'seperate letters in dictionary Word(dict$) lnDct = len(diction$(c)) 'len of dictionary word if lnDct > lnwd or lnDct < 3 then [nextWord] for a = 1 to lnDct Letr$(a) = mid$(diction$(c),a,1) next a
[srch] 'compare letters in Uword$ with dict$ word for b = 1 to lnwd 'Uword$ loop pos = instr(toFind$,Letr$(b)) if pos = 0 then exit for if pos <> 0 then Lct = Lct + 1:toFind$ = mid$(toFind$,1,pos-1) + mid$(toFind$,pos+1,len(toFind$)) next b if Lct = lnDct then goto [store] else goto [nextWord] end if
[store] ' store words in categories if lnDct = 3 then D3$(st3) = diction$(c):st3 = st3 +1':print "AT STORE";lnDct,diction$(c),st3 if lnDct = 4 then D4$(st4) = diction$(c):st4 = st4 +1':print "AT STORE";lnDct,diction$(c),st4 if lnDct = 5 then D5$(st5) = diction$(c):st5 = st5 +1':print "AT STORE";lnDct,diction$(c),st5 if lnDct = 6 then D6$(st6) = diction$(c):st6 = st6 +1':print "AT STORE";lnDct,diction$(c),st6 if lnDct = 7 then D7$(st7) = diction$(c):st7 = st7 +1':print "AT STORE";lnDct,diction$(c),st7 if lnDct = 8 then D8$(st8) = diction$(c):st8 = st8 +1':print "AT STORE";lnDct,diction$(c),st8 if lnDct = 9 then D9$(st9) = diction$(c):st9 = st9 +1':print "AT STORE";lnDct,diction$(c),st9
Wcount = st3+st4+st5+st6+st7+st8+st9 '-7? print Wcount;" words found in total"
[nextWord] Lct = 0:lnDct = 0:pos = 0 redim Letr$(11):ln=9:r=1 toFind$ = Uword$ c = c + 1:if c >= d1-1 then c = 1:gosub [loadListbox]: goto [startOver] goto [split]
[CancelWord] call cancel Can$ #w.inp,"":#w.ln,"":LAlen = 0:A$ = "" #w.1,"!enable":#w.2,"!enable":#w.3,"!enable":#w.4,"!enable":#w.5,"!enable":#w.6,"!enable":#w.7,"!enable":#w.8,"!enable":#w.9,"!enable" if ic = 1 then #w.inp,"!setfocus" wait
[loadListbox] #w.d3,"reload": #w.d4,"reload": #w.d5,"reload": #w.d6,"reload": #w.d7,"reload": #w.d8,"reload": #w.d9,"reload" #w.d3,"hide": #w.d4,"hide": #w.d5,"hide": #w.d6,"hide": #w.d7,"hide": #w.d8,"hide": #w.d9,"hide":lbsh = 0 #w.s, "!show":#w.h, "!hide":#w.sut,"!hide" ':#w.last,"!show":#w.word,"!show":#w.score,"!show": #w.wl3,st3:#w.wl4,st4:#w.wl5,st5:#w.wl6,st6:#w.wl7,st7:#w.wl8,st8:#w.wl9,st9:#w.lwsc,"!show" dc = 1 call countdown Cds$ return
[hideListbox] #w.d3,"hide": #w.d4,"hide": #w.d5,"hide": #w.d6,"hide": #w.d7,"hide": #w.d8,"hide": #w.d9,"hide":lbsh = 0 #w.s, "!show":#w.h, "!hide"':lbsh = 1 wait
[showListbox] #w.d3,"show": #w.d4,"show": #w.d5,"show": #w.d6,"show": #w.d7,"show": #w.d8,"show": #w.d9,"show":lbsh = 1 #w.s, "!hide":#w.h, "!show"':lbsh = 0 wait
[9letter] notice Uword$ wait
'SOUNDS----------------------------------- sub tap Ts$ playwave Ts$, async end sub sub trill Trs$ playwave Trs$, async end sub sub wrong Wrs$ playwave Wrs$, async end sub sub dding Dds$ playwave Dds$, async end sub sub countdown Cds$ playwave Cds$, async end sub sub plop pls$ playwave pls$, async end sub sub cancel Can$ playwave Can$, async end sub sub shuffle Sfl$ if st <> 1 then playwave Sfl$, async end sub sub tim sec5$ playwave sec5$, async end sub sub hint clue$ playwave clue$, async end sub sub bonus bonus$ playwave bonus$, async end sub sub sneekpeek snpk$ playwave snpk$, async end sub sub jackpot jkpt$ playwave jkpt$ end sub
'INPUT CONTROL------------------------------------------ [useKeyboard] ic = 1 wait [useMouse] ic = 2 wait
[SneekPeek] print "->";difLvl if difLvl = 1 and z3 >= DL3 and z4 >= DL4 and z5 >= DL5 then #w.d3,"show": #w.d4,"show": #w.d5,"show": #w.d6,"show": #w.d7,"show": #w.d8,"show": #w.d9,"show":lbsh = 1 #w.s, "!hide":#w.h, "!show" timer, 500, [closeSneekPeek] wait else
if difLvl = 2 and z3 >= DL3 and z4 >= DL4 and z5 >= DL5 then #w.d3,"show": #w.d4,"show": #w.d5,"show": #w.d6,"show": #w.d7,"show": #w.d8,"show": #w.d9,"show":lbsh = 1 #w.s, "!hide":#w.h, "!show" timer, 500, [closeSneekPeek] wait else
if difLvl = 3 and z3 >= DL3 and z4 >= DL4 and z5 >= DL5 then #w.d3,"show": #w.d4,"show": #w.d5,"show": #w.d6,"show": #w.d7,"show": #w.d8,"show": #w.d9,"show":lbsh = 1 #w.s, "!hide":#w.h, "!show" timer, 500, [closeSneekPeek] wait else redim Letr$(11):r = 1:ln = 9:sp = 1:goto [main]
[closeSneekPeek] 'for a = 1 to 2 'add for/next loop if longer time required playwave "L:\_WAV\5sec_Click.wav" 'next a timer, 0 playwave "" #w.d3,"hide": #w.d4,"hide": #w.d5,"hide": #w.d6,"hide": #w.d7,"hide": #w.d8,"hide": #w.d9,"hide":lbsh = 0 #w.s, "!show":#w.h, "!hide" SP = SP + 1:gosub [score]: call sneekpeek snpk$:notice "10 points deducted for using Sneek Peek!" end if end if end if
redim Letr$(11):r = 1:ln = 9:sp = 1:goto [main] wait
[endGame] '#w.eg,"!hide" if tsc < 20 then comment$ = "Whoops! Vocab Needs Some Work" if tsc >= 20 then comment$ = "Not bad" if tsc >= 35 then comment$ = "Pretty Good" if tsc >= 60 then comment$ = "Very Good" if tsc >= 78 then comment$ = "Almost an Expert!" if tsc >= 92 then comment$ = "Expert!" if tsc >= 101 then comment$ = "Brilliant!" c$ = c$ + "Your score is ";tsc;chr$(13);chr$(13) c$ = c$ +"You found ";BN;" Bonus words and received ";bonusScore;" Extra points"+ chr$(13);chr$(13) if SP > 0 then c$ = c$ +"You lost ";(10*SP);" points for ";SP;" SneekPeek"+ chr$(13);chr$(13) if sc9 <> 0 then c$ = c$ +"You received ";(50*sp9);" Bonus points for ";sp9;" Nine Letter Word"+ chr$(13);chr$(13) c$ = c$ +"Your Total Score is ";(tsc + bonusScore + SCbn - (10*SP));" (";tsc;" + ";bonusScore;" + ";SCbn;" - ";(10*SP);")";chr$(13);chr$(13) c$ = c$ + comment$+chr$(13);chr$(13);chr$(13) c$ = c$ +"Do you want another game?"+ chr$(13);chr$(13)
confirm c$; answer$ if answer$ = "yes" then c$ = "":goto [resetAll] if answer$ = "no" then '[quit] #w.d3,"show": #w.d4,"show": #w.d5,"show": #w.d6,"show": #w.d7,"show": #w.d8,"show": #w.d9,"show":lbsh = 0:eg = 1 end if wait
'CLUES------------------------------------------ [6l] sz = 6:goto [getClue1a] wait [7l] sz = 7:goto [getClue1a] wait [8l] sz = 8:goto [getClue1a] wait
[getClue1] if sz = 0 then print "Which level"
[getClue1a] call hint clue$ clue = 1 if sz = 6 then print sz:wd = INT(rnd(1)*st6-1)+1:print wd:Clword$=D6$(wd):print Clword$:Clhint$ = left$(Clword$,1):for a = 2 to 6:Clhint$ = Clhint$+"*":next if sz = 7 then print sz:wd = INT(rnd(1)*st7-1)+1:print wd:Clword$= D7$(wd):print Clword$:Clhint$ = left$(Clword$,1):for a = 2 to 7:Clhint$ = Clhint$+"*":next if sz = 8 then print sz:wd = INT(rnd(1)*st8-1)+1:print wd:Clword$= D8$(wd):print Clword$:Clhint$ = left$(Clword$,1):for a = 2 to 8:Clhint$ = Clhint$+"*":next #w.gc1,"!hide":#w.gc2,"!show":#w.gc3,"!hide":#w.gc4,"!hide" print Clhint$ goto [clue] wait
[getClue2] clue = 2 if sz = 6 then Clhint$ = mid$(Clhint$,1,5)+right$(Clword$,1)':for a = 2 to 6:Clhint$ = Clhint$+"*":next if sz = 7 then Clhint$ = mid$(Clhint$,1,6)+right$(Clword$,1)':for a = 2 to 7:Clhint$ = Clhint$+"*":next if sz = 8 then Clhint$ = mid$(Clhint$,1,7)+right$(Clword$,1)':for a = 2 to 8:Clhint$ = Clhint$+"*":next #w.gc1,"!hide":#w.gc2,"!hide":#w.gc3,"!show":#w.gc4,"!hide" print Clhint$ goto [clue] wait [getClue3] clue = 3 if sz = 6 then Clhint$ = mid$(Clhint$,1,2)+mid$(Clword$,3,1)+mid$(Clhint$,4,2)+right$(Clword$,1)':for a = 2 to 6:Clhint$ = Clhint$+"*":next if sz = 7 then Clhint$ = mid$(Clhint$,1,3)+mid$(Clword$,4,1)+mid$(Clhint$,5,2)+right$(Clword$,1)''':for a = 2 to 7:Clhint$ = Clhint$+"*":next if sz = 8 then Clhint$ = mid$(Clhint$,1,4)+mid$(Clword$,5,1)+mid$(Clhint$,6,1)+right$(Clword$,1)':'':for a = 2 to 8:Clhint$ = Clhint$+"*":next #w.gc1,"!hide":#w.gc2,"!hide":#w.gc3,"!hide":#w.gc4,"!show" print Clhint$ goto [clue] wait
[clue]'CLUE GUI------------- 'nomainwin WindowWidth = 280 WindowHeight = 200 UpperLeftX=int((DisplayWidth-WindowWidth)/2) UpperLeftY=int((DisplayHeight-WindowHeight)/2) BackgroundColor$ = "darkblue" ForegroundColor$ = "yellow" stylebits #cl.ok, _BS_DEFPUSHBUTTON, 0, 0, 0 button #cl.ok, "OK", [clueOK],UL, 200, 10, 20, 20 button #cl.gu, "GIVE UP!", [giveUp],UL, 220, 60, 80, 20 statictext #cl.st, Clhint$, 10 , 10, 170, 50 statictext #cl.st2, Clword$, 10 , 60, 170, 50 statictext #cl.st3, "No Score", 10 , 110, 200, 50
open " " for Window as #cl call hint clue$ #cl.st2, "!hide":#cl.st3, "!hide" on error goto [clueOK] #cl.st,"!font georgia 30 bold" #cl.st2,"!font georgia 30 bold" #cl.st3,"!font georgia 30 bold" if clue = 3 then [giveUp] wait
[giveUp] #cl.st2, "!show":#cl.st3, "!show":clue = 0 call wrong Wr$ wait
[clueOK] close #cl wait
'DICTIONARIES-------------------------------------- [Dictionary] open dct$ for input as #dct for wcct = 1 to 9 input #dct, data1$ if data1$ = "-2" then [pathInfo] data$(wcct) = data1$ next [pathInfo] dict = val(data$(1)) wc3 = val(data$(2)) wc4 = val(data$(3)) wc5 = val(data$(4)) wc6 = val(data$(5)) wc7 = val(data$(6)) wc8 = val(data$(7)) wc9 = val(data$(8)) close #dct return
[Dictionary1] dict = 1:name$ = "SOWPODS Dictionary" path$ = path3$+"Dictionaries\SOWPODS\" doc3$ = "3 letter words - SOWPODS.txt":wordCount3 = 1292 doc4$ = "4 letter words - SOWPODS.txt":wordCount4 = 5453 doc5$ = "5 letter words - SOWPODS.txt":wordCount5 = 12477 doc6$ = "6 letter words - SOWPODS.txt":wordCount6 = 22157 doc7$ = "7 letter words - SOWPODS.txt":wordCount7 = 32909 doc8$ = "8 letter words - SOWPODS.txt":wordCount8 = 40161 doc9$ = "9 letter words - SOWPODS.txt":wordCount9 = 40727 totalwords1 = 155176 if LdDict <> 1 then goto [newDict] return
[Dictionary2] dict = 2:name$ = "TWL06 Dictionary" path$ = path3$+"Dictionaries\TWL06\" doc3$ = "3 letter words - TWL06.txt":wordCount3 = 1014 doc4$ = "4 letter words - TWL06.txt":wordCount4 = 4029 doc5$ = "5 letter words - TWL06.txt":wordCount5 = 8937 doc6$ = "6 letter words - TWL06.txt":wordCount6 = 15787 doc7$ = "7 letter words - TWL06.txt":wordCount7 = 24028 doc8$ = "8 letter words - TWL06.txt":wordCount8 = 29765 doc9$ = "9 letter words - TWL06.txt":wordCount9 = 29149 totalwords2 = 112709 if LdDict <> 2 then goto [newDict] return
[Dictionary3] dict = 3: name$ = "Collins SCRABBLE Dictionary" path$ = path3$+"Dictionaries\SCRABBLE\" doc3$ = "3 letter words - Collins Scrabble Words.txt":wordCount3 = 1346 doc4$ = "4 letter words - Collins Scrabble Words.txt":wordCount4 = 5637 doc5$ = "5 letter words - Collins Scrabble Words.txt":wordCount5 = 12971 doc6$ = "6 letter words - Collins Scrabble Words.txt":wordCount6 = 23032 doc7$ = "7 letter words - Collins Scrabble Words.txt":wordCount7 = 34341 doc8$ = "8 letter words - Collins Scrabble Words.txt":wordCount8 = 42149 doc9$ = "9 letter words - Collins Scrabble Words.txt":wordCount9 = 42932 totalwords3 = 162409 if LdDict <> 3 then goto [newDict] return
[Dictionary4] dict = 4:name$ = "UNIXDICT Dictionary" path$ = path3$+"Dictionaries\UNIXDICT\" doc3$ = "3 letter words - unixdict.txt":wordCount3 = 759 doc4$ = "4 letter words - unixdict.txt":wordCount4 = 2186 doc5$ = "5 letter words - unixdict.txt":wordCount5 = 3160 doc6$ = "6 letter words - unixdict.txt":wordCount6 = 3872 doc7$ = "7 letter words - unixdict.txt":wordCount7 = 4059 doc8$ = "8 letter words - unixdict.txt":wordCount8 = 3617 doc9$ = "9 letter words - unixdict.txt":wordCount9 = 3091 totalwords5 = 20744 if LdDict <> 4 then goto [newDict] return
[newDict] open path3$+"dictionary.ini" for output as #wr #wr, dict #wr,wordCount3 #wr,wordCount4 #wr,wordCount5 #wr,wordCount6 #wr,wordCount7 #wr,wordCount8 #wr,wordCount9 #wr,"-2" close #wr notice "Restart for new Dictionary" close #w end
[difficultyLevel] [Easy] DL3 = 5:DL4 = 5:DL5 = 5:DL6 = 4:DL7 = 3:DL8 = 1:DL9 = 1:max = 24 c$ = c$ + "Three Letter Words =";DL3;chr$(13) c$ = c$ +"Four Letter Words =";DL4;chr$(13) c$ = c$ +"Five Letter Words =";DL5;chr$(13) c$ = c$ +"Six Letter Words =";DL6;chr$(13) c$ = c$ +"Seven Letter Words =";DL7;chr$(13) c$ = c$ +"Eight Letter Words =";DL8;chr$(13) c$ = c$ +"Nine Letter Words =";DL9;chr$(13) confirm c$; ans$ if ans$ = "yes" then DL3 = 5:DL4 = 5:DL5 = 5:DL6 = 4:DL7 = 3:DL8 = 1:DL9 = 1:max = 24:difLvl = 1:c$ = "" #w.lvl1 "show":#w.lvl2 "hide":#w.lvl3 "hide":wait else if ans$ = "no" then c$ = "" end if wait
[Medium] DL3 = 10:DL4 = 10:DL5 = 8:DL6 = 5:DL7 = 4:DL8 = 2:DL9 = 1:max = 40 c$ = c$ + "Three Letter Words =";DL3;chr$(13) c$ = c$ +"Four Letter Words =";DL4;chr$(13) c$ = c$ +"Five Letter Words =";DL5;chr$(13) c$ = c$ +"Six Letter Words =";DL6;chr$(13) c$ = c$ +"Seven Letter Words =";DL7;chr$(13) c$ = c$ +"Eight Letter Words =";DL8;chr$(13) c$ = c$ +"Nine Letter Words =";DL9;chr$(13) confirm c$; ans$ if ans$ = "yes" then DL3 = 10:DL4 = 10:DL5 = 8:DL6 = 5:DL7 = 4:DL8 = 2:DL9 = 1:max = 40:difLvl = 2:c$ = "" #w.lvl1 "hide":#w.lvl2 "show":#w.lvl3 "hide":wait else if ans$ = "no" then c$ = "" end if wait
[Hard] DL3 = 12:DL4 = 12:DL5 = 10:DL6 = 5:DL7 = 5:DL8 = 3:DL9 = 1:max = 48 c$ = c$ + "Three Letter Words =";DL3;chr$(13) c$ = c$ +"Four Letter Words =";DL4;chr$(13) c$ = c$ +"Five Letter Words =";DL5;chr$(13) c$ = c$ +"Six Letter Words =";DL6;chr$(13) c$ = c$ +"Seven Letter Words =";DL7;chr$(13) c$ = c$ +"Eight Letter Words =";DL8;chr$(13) c$ = c$ +"Nine Letter Words =";DL9;chr$(13) confirm c$; ans$ if ans$ = "yes" then DL3 = 12:DL4 = 12:DL5 = 10:DL6 = 5:DL7 = 5:DL8 = 3:DL9 = 1:max = 48:difLvl = 3:c$ = "" #w.lvl1 "hide":#w.lvl2 "hide":#w.lvl3 "show":wait else if ans$ = "no" then c$ = "" end if wait
wait [userChoice] notice "Not yet implimented - Sorry" wait
[bonus] bn$ = bn$ + " " + A$ 'concatenate bonus word for display bn1$(BN) = A$ 'save bonus word #w.tbbn,bn$ 'print bonus word (concatenated) gosub [determine] bonusScore = bonusScore + int(score)/2:#w.bnbsc,bonusScore 'int(len(A$))/2 BN = BN + 1:fd = 2 'bonus word counter 'found bonus word/fd=2 #w.bnb,BN 'print no of bonus words Wcount = Wcount - 1:#w.mw,Wcount'deduct from total available word count #w.lwsc,score 'show last word score call bonus bon$ 'sound score = 0 return
[score] if Alen = 3 then gosub [determine]:sc3 = sc3 + score:#w.sc3,sc3'word total after scrabble score added if Alen = 4 then gosub [determine]:sc4 = sc4 + score:#w.sc4,sc4 if Alen = 5 then gosub [determine]:sc5 = sc5 + score:#w.sc5,sc5 if Alen = 6 then gosub [determine]:sc6 = sc6 + score:#w.sc6,sc6 if Alen = 7 then gosub [determine]:sc7 = sc7 + score:#w.sc7,sc7 if Alen = 8 then gosub [determine]:sc8 = sc8 + score:#w.sc8,sc8 if Alen = 9 then gosub [determine]:sc9 = sc9 + score:#w.sc9,sc9:sp9 = sp9 + 1:SCbn = SCbn + 50:#w.SCbn,SCbn:call jackpot jkpt$ ' add 50 bonus points for 9 letter word if sect = 1 then SCbn = SCbn + 5:sect = 0:#w.SCbn,SCbn 'SCbn = bonus score tracker: add bonus for end ofscetion finished Wcount = Wcount - 1:#w.mw,Wcount 'deduct from total available word count tsc = tsc + (score):#w.scpt, tsc:#w.lwsc,score 'total score & last word score if SP > 0 then tsc = tsc - 10:#w.scpt, tsc 'sneekpeek - deduct 10 points if z3 = DL3 and z4 = DL4 and z5 = DL5 and z6 = DL7 and z7 = DL7 and z8 = DL8 and z9 = DL9 then [endGame] score = 0 return
[help] run "notepad How To Play.txt" wait
[info] run "notepad Difficulty Levels.txt" wait
[scoring] run "notepad Scoring.txt" wait
[scrabble] run "notepad SCRABBLE Tile Values.txt" wait
[checkDuplicate] for a = 1 to hw pos = instr(holdword$(a),A$):if pos <> 0 and len(holdword$(a)) = len(A$) then notice "This is a Duplicate":dup = 1:fd = 2 print "hold-> ";pos,holdword$(a),A$ next a for a = 1 to BN pos = instr(bn1$(a),A$):if pos <> 0 and len(bn1$(a)) = len(A$) then notice "This is a Duplicate":dup = 1:fd = 2 print "bonus-> ";pos,BN,bn1$(a),A$ next a
return
[determine] for rd = 1 to Alen value = asc(mid$(A$,rd,1)):gosub [getValue] print mid$(A$,rd,1) total = total +asc(mid$(A$,rd,1)) 'print total next score = score +Alen print "Word Score -> ";score return 'wait [getValue] 'print "here" if value = 100 or value = 103 then '+2 points D/G score = score + 1 else
if value = 98 or value = 99 or value = 109 or value = 112 then '+3 points B/C/M/P score = score + 2 else
if value = 102 or value = 104 or value = 118 or value = 119 or value = 121 then '+4 points F/H/V/X/Y score = score + 3 else
if value = 107 then '+5 points K score = score + 4 else
if value = 106 or value = 120 then '+8 points J/X score = score + 7 else
if value = 106 or value = 122 then '+10 points Q/Z score = score + 9 'else end if end if end if end if end if end if return
'DICTIONARY====================================== [EH3] sel = 3:goto [CSD] [EH4] sel = 4:goto [CSD] [EH5] sel = 5:goto [CSD] [EH6] sel = 6:goto [CSD] [EH7] sel = 7:goto [CSD] [EH8] sel = 8:goto [CSD] [EH9] sel = 9:goto [CSD] [EH10] sel = 10:goto [CSD]
[CSD] if sel = 3 then #w.l3,"selection? selected$" if sel = 3 and eg = 1 then #w.d3,"selection? selected$" if sel = 4 then #w.l4,"selection? selected$" if sel = 4 and eg = 1 then #w.d4,"selection? selected$" if sel = 5 then #w.l5,"selection? selected$" if sel = 5 and eg = 1 then #w.d5,"selection? selected$" if sel = 6 then #w.l6,"selection? selected$" if sel = 6 and eg = 1 then #w.d6,"selection? selected$" if sel = 7 then #w.l7,"selection? selected$" if sel = 7 and eg = 1 then #w.d7,"selection? selected$" if sel = 8 then #w.l8,"selection? selected$" if sel = 8 and eg = 1 then #w.d8,"selection? selected$" if sel = 9 then #w.l9,"selection? selected$" if sel = 9 and eg = 1 then #w.d9,"selection? selected$" 'if sel = 10 then #1.10,"selection? selected$" Sword$ = selected$:sel = len(Sword$)
t0=time$("seconds")
open d$ for input as #dic for rd = 1 to DwordCount' <------- here line input #dic,dictData$:dd = dd + 1 if lower$(left$(dictData$,sel)) = Sword$ then exit for if dictData$ = "" then exit for next rd close #dic
t1=time$("seconds") print "Time taken ";t1-t0;" secs" print print upper$(Sword$);" - ";mid$(dictData$,sel+1,len(dictData$))
[dictInfo] WindowWidth = 660 WindowHeight = 45 UpperLeftX=int((DisplayWidth-WindowWidth)/2)'706 UpperLeftY=int((DisplayHeight-WindowHeight)/2) '485 BackgroundColor$ = "darkred" TextboxColor$ = "palegray" textbox #inf1.tb, 10, 10, 550, 25 stylebits #inf1.ok1, _BS_DEFPUSHBUTTON, 0, 0, 0 button #inf1.wb, "WB", [web],UR, 15, 10, 30, 25 button #inf1.ok1, "OK", [OK1],UR, 55, 10, 30, 25 on error goto [OK1] open " " for Window_popup as #inf1 #inf1.tb, "!font georgia 10 bold" #inf1.tb,upper$(Sword$);" - ";mid$(dictData$,sel+1,len(dictData$)) wait [OK1] close #inf1 #w.l3,"select 0":#w.l4,"select 0":#w.l5,"select 0":#w.l6,"select 0":#w.l7,"select 0":#w.l8,"select 0":#w.l9,"select 0" #w.d3,"select 0":#w.d4,"select 0":#w.d5,"select 0":#w.d6,"select 0":#w.d7,"select 0":#w.d8,"select 0":#w.d9,"select 0" selected$ = "":sel = 0:dd = 0 wait
[web] sel = len(selected$) if sel = 3 then #w.l3,"selection? selected$" if sel = 3 and eg = 1 then #w.d3,"selection? selected$" if sel = 4 then #w.l4,"selection? selected$" if sel = 4 and eg = 1 then #w.d4,"selection? selected$" if sel = 5 then #w.l5,"selection? selected$" if sel = 5 and eg = 1 then #w.d5,"selection? selected$" if sel = 6 then #w.l6,"selection? selected$" if sel = 6 and eg = 1 then #w.d6,"selection? selected$" if sel = 7 then #w.l7,"selection? selected$" if sel = 7 and eg = 1 then #w.d7,"selection? selected$" if sel = 8 then #w.l8,"selection? selected$" if sel = 8 and eg = 1 then #w.d8,"selection? selected$" if sel = 9 then #w.l9,"selection? selected$" if sel = 9 and eg = 1 then #w.d9,"selection? selected$" 'if sel = 10 then #1.10,"selection? selected$" Sword$ = selected$:sel = len(Sword$)
WB$ = WBPath$+"www.dictionary.com/browse/"+selected$
Run WB$ wait
[resetAll] 'Wd3$-9 = loaded Dictionary:ct3-9 = Dictionary counters: diction$ = FULL Dictionary:d1 = diction$ counter redim holdword$(1300):redim bn$(500):redim bn1$(500):redim Letr$(11):redim wr$(30) redim W3$(100):redim W4$(100):redim W5$(100):redim W6$(100):redim W7$(100):redim W8$(100):redim W9$(100) 'LISTBOX - words found redim D3$(2000):redim D4$(2000):redim D5$(2000):redim D6$(2000):redim D7$(2000):redim D8$(2000):redim D9$(2000) 'LISTBOX - Available words to find
#w.l3, "reload":#w.l4, "reload":#w.l5, "reload":#w.l6, "reload":#w.l7, "reload":#w.l8, "reload":#w.l9, "reload" 'LISTBOX - words found #w.d3, "reload":#w.d4, "reload":#w.d5, "reload":#w.d6, "reload":#w.d7, "reload":#w.d8, "reload":#w.d9, "reload" 'LISTBOX - Available words to find
#w.inf,"":#w.inp,"":#w.ln,"":#w.scpt,"":#w.wfd,"":#w.w2f,"":#w.tbwr,"":#w.rw2,"":#w.tbbn,"":#w.bnb,"":#w.SCbn,"":#w.mw,"" '<-info boxes #w.wl3,"":#w.wl4,"":#w.wl5,"":#w.wl6,"":#w.wl7,"":#w.wl8,"":#w.wl9,"" 'TEXTBOX - no of words found #w.sc3,"":#w.sc4,"":#w.sc5,"":#w.sc6,"":#w.sc7,"":#w.sc8,"":#w.sc9,"" 'TEXTBOX -
lbsh = 2:hw = 1:BN = 0:w2f = 0:sc = 0:ic = 2 '<-input control = 2/mouse(default) z3 = 0:z4 = 0:z5 = 0:z6 = 0:z7 = 0:z8 = 0:z9 = 0 'no words to find sc3 = 0:sc4 = 0:sc5 = 0:sc6 = 0:sc7 = 0:sc8 = 0:sc9 = 0'SCORE for no words to find 'DL3 = 5:DL4 = 5:DL5 = 5:DL6 = 5:DL7 = 3:DL8 = 2:DL9 = 1:max = 26:difLvl = 1 '<- default difficuly level (EASY)
dc = 1:maxsc = 0:Alen = 0:dup = 0:fd = 0:sw = 0:hw = 0 Lct = 0:lnDct = 0:pos = 0:c = 0:d1 = 0:LAlen = 0:tsc = 0:SP = 0:sp9 = 0:sz = 0:clue = 0:BN9 = 0 'W3$ = "":W4$ = "":W5$ = "":W6$ = "":W7$ = "":W8$ = "":W9$ = "" 'LISTBOX - words found 'D3$ = "":D4$ = "":D5$ = "":D6$ = "":D7$ = "":D8$ = "":D9$ = "":A$ = "" 'LISTBOX - Available words to find
fd3$ = "":fd4$ = "":fd5$ = "":fd6$ = "":fd7$ = "":fd8$ = "":fd9$ = "" '1/5 etc words out of lvl found
SearchValue = 0:tsc = 0:Alen = 0:st = 0:shuffle = 0:ln = 9:r = 1:sp = 1 A$ = "":toFind$ = "":MC$ = "":c$ = "":comment$ = "" 'st = 1 #w.st,"!show" goto [startOver]
[quit] close #w end
|
|
dkl
Full Member
Posts: 234
|
Post by dkl on Nov 28, 2021 7:01:43 GMT -5
tenochtitlanuk - thanks for your comments and inspiration. Is it working OK for you? Rod was having problems I have added above a slightly altered version.
|
|
|
Post by tsh73 on Nov 28, 2021 7:30:36 GMT -5
I keep getting "Branch label not found: [startOver]" error in LB 4.5.1
after getting second version to run I switched to Unixdict (it shows me definitions of words I hardly supposed to know) - and now first version works too. Why are so many "weevil"s in the dictionary? Very attractive (and time consuming ) Sounds are nice. Definitions search takes really long.
|
|
|
Post by tsh73 on Nov 28, 2021 13:47:48 GMT -5
Fix for faster search of definitions. Used computed letter start positions for given file It works for me, most words is for letter S, so words like "super" will search longest Works like "?a" for any letter will come instantly.
instead of
t0=time$("seconds")
open d$ for input as #dic for rd = 1 to DwordCount' <------- here line input #dic,dictData$:dd = dd + 1 if lower$(left$(dictData$,sel)) = Sword$ then exit for if dictData$ = "" then exit for next rd close #dic
t1=time$("seconds")
paste this
'seek works from 0 'start letter pos for supplied file "Collins Scrabble Words (2019) with definitions.txt" letterPos$= "0 1085412 2028136 3705698 4767053 5514221 6165110 6781748 7494274 8108438 8255046 8498623 9014692 10077960 10486032 11030220 12711529 12808300 13696310 15778517 16749970 17240464 17545147 17909377 17935667 17998650" firstLtr$=upper$(left$(Sword$,1)) seekPos=val(word$(letterPos$, asc(firstLtr$)-asc("A")+1)) print firstLtr$, seekPos 'input "Press Enter to close"; a$ 'end foundData$=Sword$;" ";" -not found in the dictionary"
t0=time$("seconds")
open d$ for input as #dic seek #dic,seekPos 'dd=0 while 1 if eof(#dic) then exit while line input #dic,dictData$ 'dd=dd+1 'print dd, dictData$ 'if dd>10 then exit while if left$(dictData$,1)<> firstLtr$ then exit while if lower$(left$(dictData$,sel)) = Sword$ then foundData$=dictData$: exit while if dictData$ = "" then exit while wend close #dic
dictData$=foundData$ t1=time$("seconds")
|
|
dkl
Full Member
Posts: 234
|
Post by dkl on Nov 28, 2021 18:14:33 GMT -5
tsh73 - Thank you for taking time to fix problems you found. Glad you got it going - didn't understand why you got the [startover] problem. I'm surprised you say that the definitions search is Very slow, I found it only took a few seconds, which I thought was quite good considering its not loaded into memory, like the game files. Rod seemed to have speed issues too when loading, (I'm running an i7 kaby lake). It freezes up on Rod - at least it didn't freeze on you. I'm wondering if it's a memory issue? I have 48Gb - more than sensible! For some reason (I can't remember why) I have load all words into their respective categories (3-9) AND loaded everything into a single file, which means approx (168000)*2 words in memory! Many Thanks for your new code and it will not doubt speed thing up I'm sure, but I have to admit I have no idea how it works! Sorry LOL. However, I will study it to try to figure it out. Seek is a Command I have never used, but will certainly learn about now. I don't understand the digits in letterPos$. Is it a 'set code one uses for this type of search? Standard Industry Computer code? I find the UNIXDICT vocabulary too small within the game as the list of words is limited and I found that many common words were not recognised. That's why I prefer the SCRABBLE Dictionary, although as you say there are many words most of us have never heard of or are never likely to use!! Although the keyboard input does work I have been working on a version using 'Inkeys' and disabling the letters, but I have a query. However, that's for another time. I need to make sure what I've presented is fully functionable first.
|
|
dkl
Full Member
Posts: 234
|
Post by dkl on Nov 28, 2021 21:12:10 GMT -5
Well, tsh73... I certainly cannot argue with the speed of that search code. I understand now what all the digit are in letterPos$ - its the 1st position of each new letter of the alphabet, so the code goes to that position immediately instead of ploughing through each word one by one! Clever! I hope Newbies get to see this so they can make use of that logic Thank you for integrating your code with mine Out of curiosity? Is a while/loop faster than a for/next loop or does it depend on the action/function type required?
|
|
|
Post by tsh73 on Nov 29, 2021 4:32:30 GMT -5
Here's results I got on some 33000 lines text file
You can see that on my machine, FOR is faster but things inside loop take most of the time anyway
So I used WHILE because 1) I do not have number of lines I should read 2) I do not need number of current line (commented
'dd=dd+1 'print dd, dictData$ 'if dd>10 then exit while
was used only for debugging, to cut after 10 lines)
counting num lines... n=33239 reading with WHILE loop, condition in WHILE dt 422 reading with WHILE loop, EXIT on EOF in IF dt 344 reading with WHILE loop, counting lines, EXIT in IF dt 313 reading with FOR loop dt 234 Empty FOR loop dt 47
'put your own path fname$ = "C:\Users\username\some 1 Mb 33000 lines text file.txt"
print "counting num lines..." n = 0 open fname$ for input as #1 while not(eof(#1)) line input #1,a$ n=n+1 wend close #1
print "n=";n
print "reading with WHILE loop, condition in WHILE" t00=time$("ms") open fname$ for input as #1 while not(eof(#1)) '422 'while eof(#1)=0 '422 ' do until eof(#1) '422 line input #1,a$ wend ' loop close #1 t01=time$("ms") print "dt ";t01-t00
print "reading with WHILE loop, EXIT on EOF in IF" t10=time$("ms") open fname$ for input as #1 while 1 line input #1,a$ if eof(#1) THEN EXIT WHILE wend close #1 t11=time$("ms") print "dt ";t11-t10
print "reading with WHILE loop, counting lines, EXIT in IF" t10=time$("ms") open fname$ for input as #1 i = 0 while 1 '313 line input #1,a$ i=i+1 if i>=n THEN EXIT WHILE wend close #1 t11=time$("ms") print "dt ";t11-t10
print "reading with FOR loop" t20=time$("ms") open fname$ for input as #1 for i = 1 to n line input #1,a$ next close #1 t21=time$("ms") print "dt ";t21-t20
print "Empty FOR loop" t30=time$("ms") open fname$ for input as #1 for i = 1 to n 'line input #1,a$ next close #1 t31=time$("ms") print "dt ";t31-t30
|
|
|
Post by tsh73 on Nov 29, 2021 8:16:52 GMT -5
I suggest modifications of initial lines that will work without changing paths
path3$ = ".\" 'means "current directory", where EXE resides WBPath$ = "explorer http://" 'so we just call explorer passing it an URL starting with "http://" - so it just opens it with default browser
Also I don't see any reason to use INPUTCSV if your files just column of letters, without any delimiters.
|
|
dkl
Full Member
Posts: 234
|
Post by dkl on Nov 29, 2021 17:43:21 GMT -5
Thank you for taking the time to produce all that info. It's good to know all the variations The info re 'path' and browser are really good to know as I have always had a problem with that and having to change to path routes! re:- inputcsv - that was simply left over from a different version I used to initially read the data. I changed the code and didn't change the input type. My mistake I'll adjust the word game code with your 'search' update and 'path' changes and upload a new version. I have already done Rod's suggestions. Have a good day
|
|
dkl
Full Member
Posts: 234
|
Post by dkl on Nov 30, 2021 20:21:06 GMT -5
This is an update of the 2nd version posted above with the excellent search code added by tsh73 for when using the definitions search
Also you shouldn't need to alter path$/folder info now. Any problems....please let me know
'Inspired after seeing a post by tenochtitlanuk about a word puzzle he enjoys
path3$ = ".\"'<--------Default PATH & FOLDER HERE WBPath$ = "explorer http://" '<--------Default WEB BROWSER PATH & FOLDER HERE
dct$ = path3$+"dictionary.ini":gosub [Dictionary]
dictionary$ = "Collins Scrabble Words (2019) with definitions.txt":DwordCount = 279494'321719 d$ = path3$+"Dictionaries\"+dictionary$
Dim diction$(162500),Wd3$(wc3),Wd4$(wc4),Wd5$(wc5),Wd6$(wc6),Wd7$(wc7),Wd8$(wc8),Wd9$(wc9) Dim W3$(100),W4$(100),W5$(100),W6$(100),W7$(100),W8$(100),W9$(100) Dim D3$(2000),D4$(2000),D5$(2000),D6$(2000),D7$(2000),D8$(2000),D9$(2000) Dim holdword$(1500),Letr$(11),bn$(500),bn1$(500),wr$(30)
LdDict = dict
if dict = 1 then gosub [Dictionary1] if dict = 2 then gosub [Dictionary2] if dict = 3 then gosub [Dictionary3] if dict = 4 then gosub [Dictionary4]
print "Dictionary "+path$; " is loading by default"
WH$ = "#w" ' used in random control of Wheelie Word letters/button to disable them once chosen lbsh = 2:hw = 1:BN = 0:w2f = 0:sc = 0:ic = 2 '<-input control = 2/mouse(default) z3 = 0:z4 = 0:z5 = 0:z6 = 0:z7 = 0:z8 = 0:z9 = 0 shuffle = 0
Ts$ = path3$+"tap.wav" Trs$ = path3$+"trill.wav" Wrs$ = path3$+"wrong.wav" Dds$ = path3$+"Dding.wav" Cds$ = path3$+"countdown.wav" pls$ = path3$+"plop.wav" Can$ = path3$+"cancel.wav" Sfl$ = path3$+"shuffle.wav" sec5$ = path3$+"5sec_Click.wav" clue$ = path3$+"clue.wav" bon$ = path3$+"bonus.wav" snpk$ = path3$+"snpk.wav" jkpt$ = path3$+"jackpot.wav"
f3$ = path$+doc3$:f4$ = path$+doc4$:f5$ = path$+doc5$:f6$ = path$+doc6$:f7$ = path$+doc7$:f8$ = path$+doc8$:f9$ = path$+doc9$
[loadDict]'load and store words in their categories 3 - 9 letters open f3$ for input as #rd print "loading word file 3........" for rd = 1 to wordCount3 input #rd,data3$:ct3 = ct3 +1:Wd3$(ct3) = data3$:d1 = d1 +1:diction$(d1) = lower$(trim$(data3$)) if data$ = "-2" then exit for next rd close #rd ld = 1
open f4$ for input as #rd print "loading word file 4........" for rd = 1 to wordCount4 input #rd,data4$:ct4 = ct4 +1:Wd4$(ct4) = data4$:d1 = d1 +1:diction$(d1) = lower$(trim$(data4$)) if data$ = "-2" then exit for next rd close #rd ld = 1
open f5$ for input as #rd print "loading word file 5........" for rd = 1 to wordCount5 input #rd,data5$:ct5 = ct5 +1:Wd5$(ct5) = data5$:d1 = d1 +1:diction$(d1) = lower$(trim$(data5$)) if data$ = "-2" then exit for next rd close #rd ld = 1
open f6$ for input as #rd print "loading word file 6........" for rd = 1 to wordCount6 input #rd,data6$:ct6 = ct6 +1:Wd6$(ct6) = data6$:d1 = d1 +1:diction$(d1) = lower$(trim$(data6$)) if data$ = "-2" then exit for next rd close #rd ld = 1
open f7$ for input as #rd print "loading word file 7........" for rd = 1 to wordCount7 input #rd,data7$:ct7 = ct7 +1:Wd7$(ct7) = data7$:d1 = d1 +1:diction$(d1) = lower$(trim$(data7$)) if data$ = "-2" then exit for next rd close #rd ld = 1
open f8$ for input as #rd print "loading word file 8........" for rd = 1 to wordCount8 input #rd,data8$:ct8 = ct8 +1:Wd8$(ct8) = data8$:d1 = d1 +1:diction$(d1) = lower$(trim$(data8$)) if data$ = "-2" then exit for next rd close #rd ld = 1
open f9$ for input as #rd print "loading word file 9........" for rd = 1 to wordCount9 input #rd,data9$:ct9 = ct9 +1:Wd9$(ct9) = data9$:d1 = d1 +1:diction$(d1) = lower$(trim$(data9$)) if data$ = "-2" then exit for next rd close #rd ld = 1
ln = 9:r = 1 [start] z3 = 0:z4 = 0:z5 = 0:z6 = 0:z7 = 0:z8 = 0:z9 = 0 DL3 = 5:DL4 = 5:DL5 = 5:DL6 = 5:DL7 = 3:DL8 = 2:DL9 = 1:max = 26:difLvl = 1 '<- default difficuly level (EASY) st = 0
[startOver]
'============================================================================================================================== [open]'load GUI t = 10:ty = -432 'hidden ok button co-ordinates for keyboard input 'nomainwin WindowWidth = 800:WindowHeight = 920 ww = WindowWidth:wh = WindowHeight x=266:y=46
'MAIN GUI==================== graphicbox #w.ww,266,40,260,260 bmpfile2$ = path3$+"wheelieword.bmp" graphicbox #w.bg,0,0,900,1000 bmpfile1$ = path3$+"backgroundGray.bmp" BackgroundColor$ = "darkgray" ForegroundColor$ = "black" ListboxColor$ = "palegray" TextboxColor$ = "palegray"
'MENU==================================== menu #w, "Change Dictionary","1. SOWPODS",[Dictionary1],"2. TWL06",[Dictionary2],"3. SCRABBLE",[Dictionary3],"4. UNIXDICT",[Dictionary4] menu #w, "Change Difficulty Level","Easy",[Easy],"Medium",[Medium],"Hard",[Hard]',"User Choices",[userChoice] menu #w, "Input Control","Mouse",[useMouse],"Keyboard",[useKeyboard] menu #w, "Help","How to play",[help],"Difficuly Level Info",[info],"Scoring",[scoring],"SCRABBLE Tile Values",[scrabble] menu #w, "EXIT", "Quit Game",[quit] menu #w, " "," ",[showListbox] menu #w, " "," ",[9letter] graphicbox #w.gb1, x, y, 260, 260 w = 30:h = 30
'TOP CENTRE====================================== textbox #w.inf, 266, 5, 260, 30 stylebits #w.inf, _ES_CENTER, 0, 0, 0 textbox #w.inp, 266, 310, 225, 30 stylebits #w.inp, _ES_CENTER, 0, 0, 0 textbox #w.ln, 495, 310, 32, 30 stylebits #w.ln, _ES_CENTER, 0, 0, 0 button #w.ok, " ",[CH],UL,-40, -40, 30, 30 'hidden 'OK' input button (when using keyboard) stylebits #w.ok, _BS_DEFPUSHBUTTON, 0, 0, 0
'LEFT SIDE=================================================== Dlvl1$ = path3$+"easy mode.bmp" Dlvl2$ = path3$+"medium mode.bmp" Dlvl3$ = path3$+"hard mode.bmp" bmpbutton #w.lvl1,Dlvl1$,[EH],UL,48,5 bmpbutton #w.lvl2,Dlvl2$,[EH],UL,48,5 bmpbutton #w.lvl3,Dlvl3$,[EH],UL,48,5
button #w.eg, "End Game", [endGame],UL, 145, 45, 100, 30'320 stylebits #w.eg,_WS_DLGFRAME, 0, 0, 0 button #w.sp, "Sneek Peek", [SneekPeek],UL, 10, 45, 110, 30 stylebits #w.sp,_WS_DLGFRAME, 0, 0, 0
button #w.gc1, "Get Clue 1", [getClue1],UL, 10, 85, 120, 30'550,320 stylebits #w.gc1,_WS_DLGFRAME, 0, 0, 0 button #w.gc2, "Get Clue 2", [getClue2],UL, 10, 85, 120, 30 stylebits #w.gc2,_WS_DLGFRAME, 0, 0, 0 button #w.gc3, "Get Clue 3", [getClue3],UL, 10, 85, 120, 30 stylebits #w.gc3,_WS_DLGFRAME, 0, 0, 0 button #w.gc4, "Get Answer", [clue],UL, 10, 85, 120, 30 stylebits #w.gc4,_WS_DLGFRAME, 0, 0, 0 button #w.6a,"6",[6l],UL, 145, 85, 20, 30 stylebits #w.6a,_WS_DLGFRAME, 0, 0, 0 button #w.7a,"7",[7l],UL, 185, 85, 20, 30 stylebits #w.7a,_WS_DLGFRAME, 0, 0, 0 button #w.8a,"8",[8l],UL, 225, 85,20, 30 stylebits #w.8a,_WS_DLGFRAME, 0, 0, 0
button #w.s, "Show words", [showListbox],UL, 70, 130, 120, 30 stylebits #w.s,_WS_DLGFRAME, 0, 0, 0 button #w.h, "Hide words", [hideListbox],UL, 70, 130, 120, 30 stylebits #w.h,_WS_DLGFRAME, 0, 0, 0
bmpbutton #w.sc,path3$+"SCORING.bmp",[EH],UL,25,170 textbox #w.scpt, 45, 190, 50, 30 stylebits #w.scpt, _ES_CENTER, 0, 0, 0 bmpbutton #w.pt,path3$+"points.bmp",[EH],UL,40,225
bmpbutton #w.scbn,path3$+"BONUS.bmp",[EH],UL,155,170 textbox #w.SCbn, 165, 190, 50, 30 stylebits #w.SCbn, _ES_CENTER, 0, 0, 0 bmpbutton #w.SCpt,path3$+"points.bmp",[EH],UL,160,225
textbox #w.mw, 10, 260, 40, 30 stylebits #w.mw, _ES_CENTER, 0, 0, 0 bmpbutton #w.mwst,path3$+"maxwords.bmp",[EH],UL,55,270 textbox #w.wfd, 10, 300, 40, 30 stylebits #w.wfd, _ES_CENTER, 0, 0, 0 bmpbutton #w.fdst,path3$+"found.bmp",[EH],UL,55,310 textbox #w.w2f, 10, 340, 40, 30 stylebits #w.w2fstt, _ES_CENTER, 0, 0, 0 bmpbutton #w.w2fstt,path3$+"to find.bmp",[EH],UL,55,350
'Right Side================================================= bmpbutton #w.rw,path3$+"rejected words.bmp",[EH],UL,550,5 textbox #w.tbwr, 550,46,110,260 Stylebits #w.tbwr, _ES_MULTILINE, _ES_AUTOHSCROLL, 0, 0 textbox #w.rw2, 550,310,50,30 stylebits #w.rw2, _ES_CENTER, 0, 0, 0 bmpbutton #w.rwst,path3$+"words.bmp",[EH],UL,550,345
bmpbutton #w.bn,path3$+"bonus words.bmp",[EH],UL,670,5 textbox #w.tbbn, 670,46,110,260 stylebits #w.tbbn, _ES_CENTER, 0, 0, 0 textbox #w.bnb, 670,310,50,30 Stylebits #w.tbbn, _ES_MULTILINE, _ES_AUTOHSCROLL, 0, 0 bmpbutton #w.bn,path3$+"words.bmp",[EH],UL,670,345 textbox #w.bnbsc, 730,310,50,30 Stylebits #w.bnbsc, _ES_MULTILINE, _ES_AUTOHSCROLL, 0, 0 bmpbutton #w.bnst,path3$+"score.bmp",[EH],UL,730,348
'WHEELIE WORD GRAPHIC BUTTONS========================================== button #w.1,Letr$(1), buttonClick,UL, (x+160)-t,(y+50)-t,w,h'160,50, w,h button #w.2,Letr$(2), buttonClick,UL, (x+205)-t, (y+100)-t, w,h button #w.3,Letr$(3), buttonClick,UL, (x+205)-t, (y+156)-t, w,h button #w.4,Letr$(4), buttonClick,UL, (x+160)-t, (y+206)-t, w,h button #w.5,Letr$(5), buttonClick,UL, (x+90)-t, (y+206)-t, w,h button #w.6,Letr$(6), buttonClick,UL, (x+50)-t, (y+156)-t, w,h button #w.7,Letr$(7), buttonClick,UL, (x+50)-t, (y+100)-t, w,h button #w.8,Letr$(8), buttonClick,UL, (x+90)-t, (y+50)-t, w,h button #w.9,Letr$(9), buttonClick,UL, (x+127)-t, (y+123)-t, w,h
'Minions======================================= ex = 40:ey = 40 bmpbutton #w.ul, path3$+"minULg.bmp", [CH],UL, (x+12)-t, (y+12)-t', ex, ey '12,12 bmpbutton #w.ll, path3$+"minLLg.bmp", [CH],LL, (x+12)-t, (y+58)-ty', ex, ey '12,-45 bmpbutton #w.ur, path3$+"minURg.bmp", [CH],UR, (x+3)-t, (y+12)-t', ex, ey '38,12 bmpbutton #w.lr, path3$+"minLRg.bmp", [CH],LR, (x-22)-t, (y+58)-ty', ex, ey '15,-28
'LOWER BUTTONS================================== button #w.cw, "Cancel Word",[CancelWord],UL,266,345,125,30 stylebits #w.cw,_WS_DLGFRAME, 0, 0, 0 button #w.sl, "Shuffle Letters",[getLetters],UL,402,345,125,30 stylebits #w.sl,_WS_DLGFRAME, 0, 0, 0
bmpbutton #w.last,path3$+"last.bmp",[EH],UL,342,388 bmpbutton #w.word,path3$+"word.bmp",[EH],UL,376,413 bmpbutton #w.score,path3$+"score.bmp",[EH],UL,422,390 textbox #w.lwsc,380, 380, 40, 30 stylebits #w.lwsc, _ES_CENTER, 0, 0, 0 button #w.st, "Start", [selectWord],UL,370, 380, 60, 30 stylebits #w.st,_WS_DLGFRAME, 0, 0, 0 button #w.sut, "Setting Up and Thinking..........", [selectWord],UL,245, 380, 300, 30
'Lower GUI============================================== yfd = 440:fd3$ = " ";z3;"/";DL3:fd4$ = " ";z4;"/";DL4:fd5$ = " ";z5;"/";DL5:fd6$ = " ";z6;"/";DL6:fd7$ = " ";z7;"/";DL7:fd8$ = " ";z8;"/";DL8:fd9$ = " ";z9;"/";DL9 statictext #w.fd3,fd3$, 10, yfd, 40, 20 statictext #w.fd4,fd4$, 10+(80), yfd, 40, 20 statictext #w.fd5,fd5$, 10+(170), yfd, 40, 20 statictext #w.fd6,fd6$, 10+(270), yfd, 40, 20 statictext #w.fd7,fd7$, 10+(380), yfd, 40, 20 statictext #w.fd8,fd8$, 10+(500), yfd, 40, 20 statictext #w.fd9,fd9$, 10+(630), yfd, 40, 20
'Display no of words found xwl = 10:ysc = 460:wwl = 50:hwl = 30':xwlgap = wwl+10 textbox #w.sc3,x3,ysc,wwl,hwl textbox #w.sc4,x3+(80),ysc,wwl,hwl textbox #w.sc5,x3+(170),ysc,wwl,hwl textbox #w.sc6,x3+(270),ysc,wwl,hwl textbox #w.sc7,x3+(380),ysc,wwl,hwl textbox #w.sc8,x3+(500),ysc,wwl,hwl textbox #w.sc9,x3+(630),ysc,wwl,hwl
x3 = 10:yst = 499
'LETTERS bmpbutton #w.st3,path3$+"3 Letters.bmp",[dm],UL x3, yst', 70, 16 bmpbutton #w.st4,path3$+"4 Letters.bmp",[dm],UL x3+(80), yst', 70, 16 bmpbutton #w.st5,path3$+"5 Letters.bmp",[dm],UL x3+(170), yst', 70, 16 bmpbutton #w.st6,path3$+"6 Letters.bmp",[dm],UL x3+(270), yst', 70, 16 bmpbutton #w.st7,path3$+"7 Letters.bmp",[dm],UL x3+(380), yst', 70, 16 bmpbutton #w.st8,path3$+"8 Letters.bmp",[dm],UL x3+(500), yst', 70, 16 bmpbutton #w.st9,path3$+"9 Letters.bmp",[dm],UL x3+(630), yst', 70, 16
'Display words found x3 = 10:y3 = 520: w3 = 110:h3 = 135:x3gap = 10 'h3 = 125 = space for 12 words listbox #w.l3,W3$(),[EH3], x3, y3, 70, h3 'stylebits #w.l3, _LBS_DISABLENOSCROLL, 0, 0, 0 listbox #w.l4,W4$(),[EH4], x3+(80), y3, 80, h3 listbox #w.l5,W5$(),[EH5], x3+(170), y3, 90, h3 listbox #w.l6,W6$(),[EH6], x3+(270), y3, 100, h3 listbox #w.l7,W7$(),[EH7], x3+(380), y3, 110, h3 listbox #w.l8,W8$(),[EH8], x3+(500), y3, 120, h3 listbox #w.l9,W9$(),[EH9], x3+(630), y3, 130, h3
'Display no of words available xwl = 10:ywl = 670:wwl = 40:hwl = 30':xwlgap = wwl+10 textbox #w.wl3,x3,ywl,wwl,hwl textbox #w.wl4,x3+(80),ywl,wwl,hwl textbox #w.wl5,x3+(170),ywl,wwl,hwl textbox #w.wl6,x3+(270),ywl,wwl,hwl textbox #w.wl7,x3+(380),ywl,wwl,hwl textbox #w.wl8,x3+(500),ywl,wwl,hwl textbox #w.wl9,x3+(630),ywl,wwl,hwl
'Display Words available x4 = 10:y4 = 720: w4 = 110:h4 = 125:x4gap = 10 listbox #w.d3,D3$(),[EH3], x4, y4, 70, h4 listbox #w.d4,D4$(),[EH4], x4+(80), y4, 80, h4 listbox #w.d5,D5$(),[EH5], x4+(170), y4, 90, h4 listbox #w.d6,D6$(),[EH6], x4+(270), y4, 100, h4 listbox #w.d7,D7$(),[EH7], x4+(380), y4, 110, h4 listbox #w.d8,D8$(),[EH8], x4+(500), y4, 120, h4 listbox #w.d9,D9$(),[EH9], x4+(630), y4, 130, h4
[main] global SearchValue,st,tsc,Alen global A$,toFind$,MC$,WH$,Ts$,Trs$,Wrs$,Drs$,Cds$,Clue$,sec5$,jkpt$
if WW = 0 then open space$(80)+"Wheelie Word with ";name$;" Loaded" for window as #w :WW = 1'OPEN GUI with 9 letter word #w "font georgia 11 bold" 'affects ALL buttons if sp = 1 then [getLetters] goto [next]
[getLetters] 'display letter on Wheelie Word buttons if shuffle = 1 then #w.1,"!hide":#w.2,"!hide":#w.3,"!hide":#w.4,"!hide":#w.5,"!hide":#w.6,"!hide":#w.7,"!hide":#w.8,"!hide":#w.9,"!hide":#w.inf,"!hide":call shuffle Sfl$:gosub [clear]:goto [next]
#w.1,Letr$(1) #w.2,Letr$(2) #w.3,Letr$(3) #w.4,Letr$(4) #w.5,Letr$(5) #w.6,Letr$(6) #w.7,Letr$(7) #w.8,Letr$(8) #w.9,Letr$(9) #w.inf,Letr$(1);" - ";Letr$(2);" - ";Letr$(3);" - ";Letr$(4);" - ";Letr$(5);" - ";Letr$(6);" - ";Letr$(7);" - ";Letr$(8);" - ";Letr$(9)
[begin] if shuffle = 0 then #w.1,"!show":#w.2,"!show":#w.3,"!show":#w.4,"!show":#w.5,"!show":#w.6,"!show":#w.7,"!show":#w.8,"!show":#w.9,"!show":#w.inf,"!show"
' print #w.gb1, "when characterInput [keyinp]" print #w.gb1, "setfocus" #w.h, "!hide":#w.s, "!hide":#w.sut,"!hide":#w.sp,"!show":#w.lwsc,"!hide":#w.last,"hide":#w.word,"hide":#w.score,"hide" if ic = 1 then #w.inp, "!setfocus" 're keyboard input #w.gc1,"!show":#w.gc2,"!hide":#w.gc3,"!hide":#w.gc4,"!hide" ' re Get Clue
'WheelieWord image loadbmp "MyBmp", bmpfile2$ print #w.ww, "down" print #w.ww, "drawbmp MyBmp 0 0" ' print #w.ww, "flush" 'Background image loadbmp "MyBmp", bmpfile1$ print #w.bg, "down" print #w.bg, "drawbmp MyBmp 0 0" ' print #w.bg, "flush"
'Display buttons if lbsh = 0 then #w.h, "!hide":#w.s, "!hide":#w.sp,"!show":#w.eg,"!show" if lbsh = 1 then #w.h, "!show":#w.s, "!hide":#w.sp,"!hide"
'Display statictext & set font '#w.st3,"!font 12 Georgia bold":#w.st4,"!font 12 Georgia bold":#w.st5,"!font 12 Georgia bold":#w.st6,"!font 12 Georgia bold":#w.st7,"!font 12 Georgia bold":#w.st8,"!font 12 Georgia bold":#w.st9,"!font 12 Georgia bold" #w.inf,"!font 14 Georgia bold"
#w.1,"!font Georgia 16 bold":#w.2,"!font Georgia 16 bold":#w.3,"!font Georgia 16 bold":#w.4,"!font Georgia 16 bold":#w.5,"!font Georgia 16 bold":#w.6,"!font Georgia 16 bold" #w.7,"!font Georgia 16 bold":#w.8,"!font Georgia 16 bold":#w.9,"!font Georgia 16 bold":#w.mw,"!font Georgia 10 bold" 'disable bmpbuttons #w.w2fstt,"disable":#w.fdst,"disable":#w.mwst,"disable":#w.SCpt,"disable":#w.scbn,"disable":#w.pt,"disable" 'disable bmpbuttons #w.sc,"disable":#w.rw,"disable":#w.bn,"disable":#w.last,"disable":#w.word,"disable":#w.score,"disable" 'disable bmpbuttons
'#w.scpt,"disable"
if difLvl = 1 then #w.lvl1,"show":#w.lvl2,"hide":#w.lvl3,"hide" if difLvl = 2 then #w.lvl1,"hide":#w.lvl2,"show":#w.lvl3,"hide" if difLvl = 3 then #w.lvl1,"hide":#w.lvl2,"hide":#w.lvl3,"show"
if dc = 1 then #w.mw,Wcount:#w.lwsc,"!show":#w.last,"show":#w.word,"show":#w.score,"show"'Dcount 'show max words available
#w.fd3,fd3$:#w.fd4,fd4$:#w.fd5,fd5$:#w.fd6,fd6$:#w.fd7,fd7$:#w.fd8,fd8$:#w.fd9,fd9$ #w.fd3,"!show":#w.fd4,"!show":#w.fd5,"!show":#w.fd6,"!show":#w.fd7,"!show":#w.fd8,"!show":#w.fd9,"!show"
shuffle = shuffle + 1 maxsc = (DL3*3)+(DL4*4)+(DL5*5)+(DL6*6)+(DL7*7)+(DL8*8)+(DL9*9) 'MAXIMUM SCORE POSSIBLE wait 'end of mainloop/opening GUI=================================================================================================
[next]'mixup letters randomly z = int( 1+ln *rnd( 0)) Letr$(r) = mid$(toFind$,z,1):r = r +1 b1$ = mid$(toFind$,1,z-1) b2$ = mid$(toFind$,(z+1),len(toFind$)) toFind$ = b1$+b2$:print z,toFind$ ln = ln -1:if ln = 0 then shuffle = 0:goto [getLetters] goto [next]
[keyinp] '====================INKEYS ' key$ = Inkey$ ' if len(key$) = 1 then close #w ' if val(key$) >= 97 and val(key$) <= 122 then call buttonClick handle$'#w.inp,key$;'[result] ' if key$ = "n" then [result] ' if key$ = "r" then [reset] ' if key$ = "x" then [quit] ' 'if key$ = " " then [next] ' if key$ = "h" then goto [hideListbox] ' if key$ = "s" then gosub [showListbox] redim Letr$(11) r = 1:ln = 9 wait goto [startOver]
[result] #w.s,"!show"
[clear]'clear found word - goto next word input redim Letr$(11) r = 1:ln = 9':cls:print if shuffle = 1 then toFind$ = Uword$ return
'get letter from WheelieWord and put into input box (mouse version) only ? sub buttonClick handle$ SearchValue=val(right$(handle$, 1)) CH$ = str$(SearchValue):MC$ = WH$;".";CH$ print MC$ #MC$ "!disable" print Letr$(SearchValue) call assign A$ end sub
sub assign byref A$ A$ = A$ + Letr$(SearchValue):#w.inp,A$:print "Length of Input -> ";len(A$):#w.ln,len(A$) print "A$ = ";A$ call tap Ts$ end sub
[CH] 'establish word length is >= 3 + KEYBOARD INPUT (FULL WORD) if ic = 1 then #w.inp,"!contents? A$"':CH$ = str$(SearchValue):MC$ = WH$;".";CH$:print MC$:#MC$ "!disable"
if len(A$) <= 2 then A$ = "": notice "Word must be 3 or more letters - START AGAIN":goto [CancelWord] else goto [checkWord] end if wait
[checkWord] 'establish word length print "Checking word....." Alen = len(A$):print Alen gosub [checkDuplicate]:if dup = 1 then dup = 0:goto [clearIt] if Alen = 3 then [checkWord3] if Alen = 4 then [checkWord4] if Alen = 5 then [checkWord5] if Alen = 6 then [checkWord6] if Alen = 7 then [checkWord7] if Alen = 8 then [checkWord8] if Alen = 9 then [checkWord9]
[checkWord3] 'search for validity of word for sch = 1 to wordCount3 if lower$(Wd3$(sch)) = lower$(A$) then fd = 1:call plop pls$:print A$:gosub [w3]:exit for next goto [clearIt]
[checkWord4] for sch = 1 to wordCount4 if lower$(Wd4$(sch)) = lower$(A$) then fd = 1:call plop pls$:print A$:gosub [w4]:exit for next goto [clearIt]
[checkWord5] for sch = 1 to wordCount5 if Alen = 5 and lower$(Wd5$(sch)) = lower$(A$) then fd = 1:call plop pls$:print A$:gosub [w5]:exit for next goto [clearIt]
[checkWord6] for sch = 1 to wordCount6 if Alen = 6 and lower$(Wd6$(sch)) = lower$(A$) then fd = 1:call plop pls$:print A$:gosub [w6]:exit for next if lower$(A$) = lower$(Clword$) then wr = wr + clue:clue = 0 goto [clearIt]
[checkWord7] for sch = 1 to wordCount7 if Alen = 7 and lower$(Wd7$(sch)) = lower$(A$) then fd = 1:call plop pls$:print A$:gosub [w7]:exit for next if lower$(A$) = lower$(Clword$) then wr = wr + clue:clue = 0 goto [clearIt]
[checkWord8] for sch = 1 to wordCount8 if Alen = 8 and lower$(Wd8$(sch)) = lower$(A$) then fd = 1:call plop pls$:print A$:gosub [w8]:exit for next if lower$(A$) = lower$(Clword$) then wr = wr + clue:clue = 0 goto [clearIt]
[checkWord9] for sch = 1 to wordCount9 if Alen = 9 and lower$(Wd9$(sch)) = lower$(A$) then fd = 1:call plop pls$:print A$:gosub [w9]:exit for next goto [clearIt]
[clearIt]'if incorrect reject it ' ---- clear word - goto next word input print "FD ->";fd if fd = 0 then print "NOT FOUND - Word Rejected":call wrong Wrs$:wr$ = wr$ +" "+A$:rw2 = rw2 +1:#w.rw2,rw2:#w.tbwr,wr$;
're-enable letters - display new 'found word' total if fd >0 and fd <2 then max = max -1: #w.w2f,max:w2f = w2f+1:#w.wfd, w2f A$ = "":fd = 0:#w.1,"!enable":#w.2,"!enable":#w.3,"!enable":#w.4,"!enable":#w.5,"!enable":#w.6,"!enable":#w.7,"!enable":#w.8,"!enable":#w.9,"!enable" fd3$ = z3;"/";DL3:print fd3$:#w.fd3,fd3$ fd4$ = z4;"/";DL4:print fd4$:#w.fd4,fd4$ fd5$ = z5;"/";DL5:print fd5$:#w.fd5,fd5$ fd6$ = z6;"/";DL6:print fd6$:#w.fd6,fd6$ fd7$ = z7;"/";DL7:print fd7$:#w.fd7,fd7$ fd8$ = z8;"/";DL8:print fd8$:#w.fd8,fd8$ fd9$ = z9;"/";DL9:print fd9$:#w.fd9,fd9$ Alen = 0:#w.inp,"":#w.ln,"":if ic = 1 then #w.inp,"!setfocus" wait
[selectWord]'get User Word call tap Ts$ call tap Ts$ #w.st,"!hide":#w.sut,"!show" redim Letr$(11):r = 1:ln = 9
'CLEAR all LISTBOXES/VARIABLES/STRINGS/ARRAYS ETC......to be done?? sw = INT(rnd(1)*wordCount9):print sw toFind$ = lower$(trim$(Wd9$(sw))) Uword$ = toFind$ print toFind$ gosub [findSelection] goto [startOver]
[loadLists] 'put correct length word into listbox and count number of words + ADD SCORE [w3] if z3>=DL3 then gosub [checkDuplicate] if dup = 1 then return else gosub [bonus]:return '<-change DL3 - DL9 to adjust difficulty level (more words to find) end if end if W3$(z3) = A$:z3 = z3 +1:holdword$(hw) = A$:hw = hw +1:print z3,W3$(z3):#w.l3,"reload":fd3$ = " ";z3;"/";DL3:#w.fd3,fd3$ if z3>= DL3 then #w.l3,"disable":sect = 1:call dding Dds$'<-change DL3 to adjust difficulty level (more words to find) gosub [score] return
[w4] if z4>= DL4 then gosub [checkDuplicate] if dup = 1 then return else gosub [bonus]:return '<-change DL3 - DL9 to adjust difficulty level (more words to find) end if end if W4$(z4) = A$:z4 = z4 +1:holdword$(hw) = A$:hw = hw +1:print z4,W4$(z4):#w.l4,"reload":fd4$ = " ";z4;"/";DL4:#w.fd4,fd4$ if z4>= DL4 then #w.l4,"disable":sect = 1:call dding Dds$ gosub [score] return
[w5] if z5>= DL5 then gosub [checkDuplicate] if dup = 1 then return else gosub [bonus]:return '<-change DL3 - DL9 to adjust difficulty level (more words to find) end if end if W5$(z5) = A$:z5 = z5 +1:holdword$(hw) = A$:hw = hw +1:print z5,W5$(z5):#w.l5,"reload":fd5$ = " ";z5;"/";DL5:#w.fd5,fd5$ if z5>= DL5 then #w.l5,"disable":sect = 1:call dding Dds$ gosub [score] return
[w6] if z6>= DL6 then gosub [checkDuplicate] if dup = 1 then return else gosub [bonus]:return '<-change DL3 - DL9 to adjust difficulty level (more words to find) end if end if W6$(z6) = A$:z6 = z6 +1:holdword$(hw) = A$:hw = hw +1:print z6,W6$(z6):#w.l6,"reload":fd6$ = " ";z6;"/";DL6:#w.fd6,fd6$ if z6>= DL6 then #w.l6,"disable":sect = 1:call dding Dds$ gosub [score] return
[w7] if z7>= DL7 then gosub [checkDuplicate] if dup = 1 then return else gosub [bonus]:return '<-change DL3 - DL9 to adjust difficulty level (more words to find) end if end if W7$(z7) = A$:z7 = z7 +1:holdword$(hw) = A$:hw = hw +1:print z7,W7$(z7):#w.l7,"reload":fd7$ = " ";z7;"/";DL7:#w.fd7,fd7$ if z7>= DL7 then #w.l7,"disable":sect = 1:call dding Dds$ gosub [score] return
[w8] if z8>= DL8 then gosub [checkDuplicate] if dup = 1 then return else gosub [bonus]:return '<-change DL3 - DL9 to adjust difficulty level (more words to find) end if end if W8$(z8) = A$:z8 = z8 +1:holdword$(hw) = A$:hw = hw +1:print z8,W8$(z8):#w.l8,"reload":fd8$ = " ";z8;"/";DL8:#w.fd8,fd8$ if z8>= DL8 then #w.l8,"disable":sect = 1:call dding Dds$ sect = 1:gosub [score] return
[w9] if z9>= DL9 then gosub [checkDuplicate] if dup = 1 then return else gosub [bonus]:return '<-change DL3 - DL9 to adjust difficulty level (more words to find) end if end if W9$(z9) = A$:z9 = z9 +1:holdword$(hw) = A$:hw = hw +1:print z9,W9$(z9):#w.l9,"reload":fd9$ = " ";z9;"/";DL9:#w.fd9,fd9$ if z9>= DL9 then #w.l9,"disable":sect = 1:call dding Dds$ gosub [score] return
[findSelection] lnwd = len(toFind$) print d1 Dcount = ct3+ct4+ct5+ct6+ct7+ct8+ct9
'print d1;" words loaded from ";Dcount;" words available"
[split] 'seperate letters in dictionary Word(dict$) lnDct = len(diction$(c)) 'len of dictionary word if lnDct > lnwd or lnDct < 3 then [nextWord] for a = 1 to lnDct Letr$(a) = mid$(diction$(c),a,1) next a
[srch] 'compare letters in Uword$ with dict$ word for b = 1 to lnwd 'Uword$ loop pos = instr(toFind$,Letr$(b)) if pos = 0 then exit for if pos <> 0 then Lct = Lct + 1:toFind$ = mid$(toFind$,1,pos-1) + mid$(toFind$,pos+1,len(toFind$)) next b if Lct = lnDct then goto [store] else goto [nextWord] end if
[store] ' store words in categories if lnDct = 3 then D3$(st3) = diction$(c):st3 = st3 +1':print "AT STORE";lnDct,diction$(c),st3 if lnDct = 4 then D4$(st4) = diction$(c):st4 = st4 +1':print "AT STORE";lnDct,diction$(c),st4 if lnDct = 5 then D5$(st5) = diction$(c):st5 = st5 +1':print "AT STORE";lnDct,diction$(c),st5 if lnDct = 6 then D6$(st6) = diction$(c):st6 = st6 +1':print "AT STORE";lnDct,diction$(c),st6 if lnDct = 7 then D7$(st7) = diction$(c):st7 = st7 +1':print "AT STORE";lnDct,diction$(c),st7 if lnDct = 8 then D8$(st8) = diction$(c):st8 = st8 +1':print "AT STORE";lnDct,diction$(c),st8 if lnDct = 9 then D9$(st9) = diction$(c):st9 = st9 +1':print "AT STORE";lnDct,diction$(c),st9
Wcount = st3+st4+st5+st6+st7+st8+st9 '-7? print Wcount;" words found in total"
[nextWord] Lct = 0:lnDct = 0:pos = 0 redim Letr$(11):ln=9:r=1 toFind$ = Uword$ c = c + 1:if c >= d1-1 then c = 1:gosub [loadListbox]: goto [startOver] goto [split]
[CancelWord] call cancel Can$ #w.inp,"":#w.ln,"":LAlen = 0:A$ = "" #w.1,"!enable":#w.2,"!enable":#w.3,"!enable":#w.4,"!enable":#w.5,"!enable":#w.6,"!enable":#w.7,"!enable":#w.8,"!enable":#w.9,"!enable" if ic = 1 then #w.inp,"!setfocus" wait
[loadListbox] #w.d3,"reload": #w.d4,"reload": #w.d5,"reload": #w.d6,"reload": #w.d7,"reload": #w.d8,"reload": #w.d9,"reload" #w.d3,"hide": #w.d4,"hide": #w.d5,"hide": #w.d6,"hide": #w.d7,"hide": #w.d8,"hide": #w.d9,"hide":lbsh = 0 #w.s, "!show":#w.h, "!hide":#w.sut,"!hide" ':#w.last,"!show":#w.word,"!show":#w.score,"!show": #w.wl3,st3:#w.wl4,st4:#w.wl5,st5:#w.wl6,st6:#w.wl7,st7:#w.wl8,st8:#w.wl9,st9:#w.lwsc,"!show" dc = 1 call countdown Cds$ return
[hideListbox] #w.d3,"hide": #w.d4,"hide": #w.d5,"hide": #w.d6,"hide": #w.d7,"hide": #w.d8,"hide": #w.d9,"hide":lbsh = 0 #w.s, "!show":#w.h, "!hide"':lbsh = 1 wait
[showListbox] #w.d3,"show": #w.d4,"show": #w.d5,"show": #w.d6,"show": #w.d7,"show": #w.d8,"show": #w.d9,"show":lbsh = 1 #w.s, "!hide":#w.h, "!show"':lbsh = 0 wait
[9letter] notice Uword$ wait
'SOUNDS----------------------------------- sub tap Ts$ playwave Ts$, async end sub sub trill Trs$ playwave Trs$, async end sub sub wrong Wrs$ playwave Wrs$, async end sub sub dding Dds$ playwave Dds$, async end sub sub countdown Cds$ playwave Cds$, async end sub sub plop pls$ playwave pls$, async end sub sub cancel Can$ playwave Can$, async end sub sub shuffle Sfl$ if st <> 1 then playwave Sfl$, async end sub sub tim sec5$ playwave sec5$, async end sub sub hint clue$ playwave clue$, async end sub sub bonus bonus$ playwave bonus$, async end sub sub sneekpeek snpk$ playwave snpk$, async end sub sub jackpot jkpt$ playwave jkpt$ end sub
'INPUT CONTROL------------------------------------------ [useKeyboard] ic = 1 wait [useMouse] ic = 2 wait
[SneekPeek] print "->";difLvl if difLvl = 1 and z3 >= DL3 and z4 >= DL4 and z5 >= DL5 then #w.d3,"show": #w.d4,"show": #w.d5,"show": #w.d6,"show": #w.d7,"show": #w.d8,"show": #w.d9,"show":lbsh = 1 #w.s, "!hide":#w.h, "!show" timer, 500, [closeSneekPeek] wait else
if difLvl = 2 and z3 >= DL3 and z4 >= DL4 and z5 >= DL5 then #w.d3,"show": #w.d4,"show": #w.d5,"show": #w.d6,"show": #w.d7,"show": #w.d8,"show": #w.d9,"show":lbsh = 1 #w.s, "!hide":#w.h, "!show" timer, 500, [closeSneekPeek] wait else
if difLvl = 3 and z3 >= DL3 and z4 >= DL4 and z5 >= DL5 then #w.d3,"show": #w.d4,"show": #w.d5,"show": #w.d6,"show": #w.d7,"show": #w.d8,"show": #w.d9,"show":lbsh = 1 #w.s, "!hide":#w.h, "!show" timer, 500, [closeSneekPeek] wait else redim Letr$(11):r = 1:ln = 9:sp = 1:goto [main]
[closeSneekPeek] 'for a = 1 to 2 'add for/next loop if longer time required playwave "L:\_WAV\5sec_Click.wav" 'next a timer, 0 playwave "" #w.d3,"hide": #w.d4,"hide": #w.d5,"hide": #w.d6,"hide": #w.d7,"hide": #w.d8,"hide": #w.d9,"hide":lbsh = 0 #w.s, "!show":#w.h, "!hide" SP = SP + 1:gosub [score]: call sneekpeek snpk$:notice "10 points deducted for using Sneek Peek!" end if end if end if
redim Letr$(11):r = 1:ln = 9:sp = 1:goto [main] wait
[endGame] '#w.eg,"!hide" if tsc < 20 then comment$ = "Whoops! Vocab Needs Some Work" if tsc >= 20 then comment$ = "Not bad" if tsc >= 35 then comment$ = "Pretty Good" if tsc >= 60 then comment$ = "Very Good" if tsc >= 78 then comment$ = "Almost an Expert!" if tsc >= 92 then comment$ = "Expert!" if tsc >= 101 then comment$ = "Brilliant!" c$ = c$ + "Your score is ";tsc;chr$(13);chr$(13) c$ = c$ +"You found ";BN;" Bonus words and received ";bonusScore;" Extra points"+ chr$(13);chr$(13) if SP > 0 then c$ = c$ +"You lost ";(10*SP);" points for ";SP;" SneekPeek"+ chr$(13);chr$(13) if sc9 <> 0 then c$ = c$ +"You received ";(50*sp9);" Bonus points for ";sp9;" Nine Letter Word"+ chr$(13);chr$(13) c$ = c$ +"Your Total Score is ";(tsc + bonusScore + SCbn - (10*SP));" (";tsc;" + ";bonusScore;" + ";SCbn;" - ";(10*SP);")";chr$(13);chr$(13) c$ = c$ + comment$+chr$(13);chr$(13);chr$(13) c$ = c$ +"Do you want another game?"+ chr$(13);chr$(13)
confirm c$; answer$ if answer$ = "yes" then c$ = "":goto [resetAll] if answer$ = "no" then '[quit] #w.d3,"show": #w.d4,"show": #w.d5,"show": #w.d6,"show": #w.d7,"show": #w.d8,"show": #w.d9,"show":lbsh = 0:eg = 1 end if wait
'CLUES------------------------------------------ [6l] sz = 6:goto [getClue1a] wait [7l] sz = 7:goto [getClue1a] wait [8l] sz = 8:goto [getClue1a] wait
[getClue1] if sz = 0 then print "Which level"
[getClue1a] call hint clue$ clue = 1 if sz = 6 then print sz:wd = INT(rnd(1)*st6-1)+1:print wd:Clword$=D6$(wd):print Clword$:Clhint$ = left$(Clword$,1):for a = 2 to 6:Clhint$ = Clhint$+"*":next if sz = 7 then print sz:wd = INT(rnd(1)*st7-1)+1:print wd:Clword$= D7$(wd):print Clword$:Clhint$ = left$(Clword$,1):for a = 2 to 7:Clhint$ = Clhint$+"*":next if sz = 8 then print sz:wd = INT(rnd(1)*st8-1)+1:print wd:Clword$= D8$(wd):print Clword$:Clhint$ = left$(Clword$,1):for a = 2 to 8:Clhint$ = Clhint$+"*":next #w.gc1,"!hide":#w.gc2,"!show":#w.gc3,"!hide":#w.gc4,"!hide" print Clhint$ goto [clue] wait
[getClue2] clue = 2 if sz = 6 then Clhint$ = mid$(Clhint$,1,5)+right$(Clword$,1)':for a = 2 to 6:Clhint$ = Clhint$+"*":next if sz = 7 then Clhint$ = mid$(Clhint$,1,6)+right$(Clword$,1)':for a = 2 to 7:Clhint$ = Clhint$+"*":next if sz = 8 then Clhint$ = mid$(Clhint$,1,7)+right$(Clword$,1)':for a = 2 to 8:Clhint$ = Clhint$+"*":next #w.gc1,"!hide":#w.gc2,"!hide":#w.gc3,"!show":#w.gc4,"!hide" print Clhint$ goto [clue] wait [getClue3] clue = 3 if sz = 6 then Clhint$ = mid$(Clhint$,1,2)+mid$(Clword$,3,1)+mid$(Clhint$,4,2)+right$(Clword$,1)':for a = 2 to 6:Clhint$ = Clhint$+"*":next if sz = 7 then Clhint$ = mid$(Clhint$,1,3)+mid$(Clword$,4,1)+mid$(Clhint$,5,2)+right$(Clword$,1)''':for a = 2 to 7:Clhint$ = Clhint$+"*":next if sz = 8 then Clhint$ = mid$(Clhint$,1,4)+mid$(Clword$,5,1)+mid$(Clhint$,6,1)+right$(Clword$,1)':'':for a = 2 to 8:Clhint$ = Clhint$+"*":next #w.gc1,"!hide":#w.gc2,"!hide":#w.gc3,"!hide":#w.gc4,"!show" print Clhint$ goto [clue] wait
[clue]'CLUE GUI------------- 'nomainwin WindowWidth = 280 WindowHeight = 200 UpperLeftX=int((DisplayWidth-WindowWidth)/2) UpperLeftY=int((DisplayHeight-WindowHeight)/2) BackgroundColor$ = "darkblue" ForegroundColor$ = "yellow" stylebits #cl.ok, _BS_DEFPUSHBUTTON, 0, 0, 0 button #cl.ok, "OK", [clueOK],UL, 200, 10, 20, 20 button #cl.gu, "GIVE UP!", [giveUp],UL, 220, 60, 80, 20 statictext #cl.st, Clhint$, 10 , 10, 170, 50 statictext #cl.st2, Clword$, 10 , 60, 170, 50 statictext #cl.st3, "No Score", 10 , 110, 200, 50
open " " for Window as #cl call hint clue$ #cl.st2, "!hide":#cl.st3, "!hide" on error goto [clueOK] #cl.st,"!font georgia 30 bold" #cl.st2,"!font georgia 30 bold" #cl.st3,"!font georgia 30 bold" if clue = 3 then [giveUp] wait
[giveUp] #cl.st2, "!show":#cl.st3, "!show":clue = 0 call wrong Wr$ wait
[clueOK] close #cl wait
'DICTIONARIES-------------------------------------- [Dictionary] open dct$ for input as #dct for wcct = 1 to 9 input #dct, data1$ if data1$ = "-2" then [pathInfo] data$(wcct) = data1$ next [pathInfo] dict = val(data$(1)) wc3 = val(data$(2)) wc4 = val(data$(3)) wc5 = val(data$(4)) wc6 = val(data$(5)) wc7 = val(data$(6)) wc8 = val(data$(7)) wc9 = val(data$(8)) close #dct return
[Dictionary1] dict = 1:name$ = "SOWPODS Dictionary" path$ = path3$+"Dictionaries\SOWPODS\" doc3$ = "3 letter words - SOWPODS.txt":wordCount3 = 1292 doc4$ = "4 letter words - SOWPODS.txt":wordCount4 = 5453 doc5$ = "5 letter words - SOWPODS.txt":wordCount5 = 12477 doc6$ = "6 letter words - SOWPODS.txt":wordCount6 = 22157 doc7$ = "7 letter words - SOWPODS.txt":wordCount7 = 32909 doc8$ = "8 letter words - SOWPODS.txt":wordCount8 = 40161 doc9$ = "9 letter words - SOWPODS.txt":wordCount9 = 40727 totalwords1 = 155176 if LdDict <> 1 then goto [newDict] return
[Dictionary2] dict = 2:name$ = "TWL06 Dictionary" path$ = path3$+"Dictionaries\TWL06\" doc3$ = "3 letter words - TWL06.txt":wordCount3 = 1014 doc4$ = "4 letter words - TWL06.txt":wordCount4 = 4029 doc5$ = "5 letter words - TWL06.txt":wordCount5 = 8937 doc6$ = "6 letter words - TWL06.txt":wordCount6 = 15787 doc7$ = "7 letter words - TWL06.txt":wordCount7 = 24028 doc8$ = "8 letter words - TWL06.txt":wordCount8 = 29765 doc9$ = "9 letter words - TWL06.txt":wordCount9 = 29149 totalwords2 = 112709 if LdDict <> 2 then goto [newDict] return
[Dictionary3] dict = 3: name$ = "Collins SCRABBLE Dictionary" path$ = path3$+"Dictionaries\SCRABBLE\" doc3$ = "3 letter words - Collins Scrabble Words.txt":wordCount3 = 1346 doc4$ = "4 letter words - Collins Scrabble Words.txt":wordCount4 = 5637 doc5$ = "5 letter words - Collins Scrabble Words.txt":wordCount5 = 12971 doc6$ = "6 letter words - Collins Scrabble Words.txt":wordCount6 = 23032 doc7$ = "7 letter words - Collins Scrabble Words.txt":wordCount7 = 34341 doc8$ = "8 letter words - Collins Scrabble Words.txt":wordCount8 = 42149 doc9$ = "9 letter words - Collins Scrabble Words.txt":wordCount9 = 42932 totalwords3 = 162409 if LdDict <> 3 then goto [newDict] return
[Dictionary4] dict = 4:name$ = "UNIXDICT Dictionary" path$ = path3$+"Dictionaries\UNIXDICT\" doc3$ = "3 letter words - unixdict.txt":wordCount3 = 759 doc4$ = "4 letter words - unixdict.txt":wordCount4 = 2186 doc5$ = "5 letter words - unixdict.txt":wordCount5 = 3160 doc6$ = "6 letter words - unixdict.txt":wordCount6 = 3872 doc7$ = "7 letter words - unixdict.txt":wordCount7 = 4059 doc8$ = "8 letter words - unixdict.txt":wordCount8 = 3617 doc9$ = "9 letter words - unixdict.txt":wordCount9 = 3091 totalwords5 = 20744 if LdDict <> 4 then goto [newDict] return
[newDict] open path3$+"dictionary.ini" for output as #wr #wr, dict #wr,wordCount3 #wr,wordCount4 #wr,wordCount5 #wr,wordCount6 #wr,wordCount7 #wr,wordCount8 #wr,wordCount9 #wr,"-2" close #wr notice "Restart for new Dictionary" close #w end
[difficultyLevel] [Easy] DL3 = 5:DL4 = 5:DL5 = 5:DL6 = 4:DL7 = 3:DL8 = 1:DL9 = 1:max = 24 c$ = c$ + "Three Letter Words =";DL3;chr$(13) c$ = c$ +"Four Letter Words =";DL4;chr$(13) c$ = c$ +"Five Letter Words =";DL5;chr$(13) c$ = c$ +"Six Letter Words =";DL6;chr$(13) c$ = c$ +"Seven Letter Words =";DL7;chr$(13) c$ = c$ +"Eight Letter Words =";DL8;chr$(13) c$ = c$ +"Nine Letter Words =";DL9;chr$(13) confirm c$; ans$ if ans$ = "yes" then DL3 = 5:DL4 = 5:DL5 = 5:DL6 = 4:DL7 = 3:DL8 = 1:DL9 = 1:max = 24:difLvl = 1:c$ = "" #w.lvl1 "show":#w.lvl2 "hide":#w.lvl3 "hide":wait else if ans$ = "no" then c$ = "" end if wait
[Medium] DL3 = 10:DL4 = 10:DL5 = 8:DL6 = 5:DL7 = 4:DL8 = 2:DL9 = 1:max = 40 c$ = c$ + "Three Letter Words =";DL3;chr$(13) c$ = c$ +"Four Letter Words =";DL4;chr$(13) c$ = c$ +"Five Letter Words =";DL5;chr$(13) c$ = c$ +"Six Letter Words =";DL6;chr$(13) c$ = c$ +"Seven Letter Words =";DL7;chr$(13) c$ = c$ +"Eight Letter Words =";DL8;chr$(13) c$ = c$ +"Nine Letter Words =";DL9;chr$(13) confirm c$; ans$ if ans$ = "yes" then DL3 = 10:DL4 = 10:DL5 = 8:DL6 = 5:DL7 = 4:DL8 = 2:DL9 = 1:max = 40:difLvl = 2:c$ = "" #w.lvl1 "hide":#w.lvl2 "show":#w.lvl3 "hide":wait else if ans$ = "no" then c$ = "" end if wait
[Hard] DL3 = 12:DL4 = 12:DL5 = 10:DL6 = 5:DL7 = 5:DL8 = 3:DL9 = 1:max = 48 c$ = c$ + "Three Letter Words =";DL3;chr$(13) c$ = c$ +"Four Letter Words =";DL4;chr$(13) c$ = c$ +"Five Letter Words =";DL5;chr$(13) c$ = c$ +"Six Letter Words =";DL6;chr$(13) c$ = c$ +"Seven Letter Words =";DL7;chr$(13) c$ = c$ +"Eight Letter Words =";DL8;chr$(13) c$ = c$ +"Nine Letter Words =";DL9;chr$(13) confirm c$; ans$ if ans$ = "yes" then DL3 = 12:DL4 = 12:DL5 = 10:DL6 = 5:DL7 = 5:DL8 = 3:DL9 = 1:max = 48:difLvl = 3:c$ = "" #w.lvl1 "hide":#w.lvl2 "hide":#w.lvl3 "show":wait else if ans$ = "no" then c$ = "" end if wait
wait [userChoice] notice "Not yet implimented - Sorry" wait
[bonus] bn$ = bn$ + " " + A$ 'concatenate bonus word for display bn1$(BN) = A$ 'save bonus word #w.tbbn,bn$ 'print bonus word (concatenated) gosub [determine] bonusScore = bonusScore + int(score)/2:#w.bnbsc,bonusScore 'int(len(A$))/2 BN = BN + 1:fd = 2 'bonus word counter 'found bonus word/fd=2 #w.bnb,BN 'print no of bonus words Wcount = Wcount - 1:#w.mw,Wcount'deduct from total available word count #w.lwsc,score 'show last word score call bonus bon$ 'sound score = 0 return
[score] if Alen = 3 then gosub [determine]:sc3 = sc3 + score:#w.sc3,sc3'word total after scrabble score added if Alen = 4 then gosub [determine]:sc4 = sc4 + score:#w.sc4,sc4 if Alen = 5 then gosub [determine]:sc5 = sc5 + score:#w.sc5,sc5 if Alen = 6 then gosub [determine]:sc6 = sc6 + score:#w.sc6,sc6 if Alen = 7 then gosub [determine]:sc7 = sc7 + score:#w.sc7,sc7 if Alen = 8 then gosub [determine]:sc8 = sc8 + score:#w.sc8,sc8 if Alen = 9 then gosub [determine]:sc9 = sc9 + score:#w.sc9,sc9:sp9 = sp9 + 1:SCbn = SCbn + 50:#w.SCbn,SCbn:call jackpot jkpt$ ' add 50 bonus points for 9 letter word if sect = 1 then SCbn = SCbn + 5:sect = 0:#w.SCbn,SCbn 'SCbn = bonus score tracker: add bonus for end ofscetion finished Wcount = Wcount - 1:#w.mw,Wcount 'deduct from total available word count tsc = tsc + (score):#w.scpt, tsc:#w.lwsc,score 'total score & last word score if SP > 0 then tsc = tsc - 10:#w.scpt, tsc 'sneekpeek - deduct 10 points if z3 = DL3 and z4 = DL4 and z5 = DL5 and z6 = DL7 and z7 = DL7 and z8 = DL8 and z9 = DL9 then [endGame] score = 0 return
[help] run "notepad How To Play.txt" wait
[info] run "notepad Difficulty Levels.txt" wait
[scoring] run "notepad Scoring.txt" wait
[scrabble] run "notepad SCRABBLE Tile Values.txt" wait
[checkDuplicate] for a = 1 to hw pos = instr(holdword$(a),A$):if pos <> 0 and len(holdword$(a)) = len(A$) then notice "This is a Duplicate":dup = 1:fd = 2 print "hold-> ";pos,holdword$(a),A$ next a for a = 1 to BN pos = instr(bn1$(a),A$):if pos <> 0 and len(bn1$(a)) = len(A$) then notice "This is a Duplicate":dup = 1:fd = 2 print "bonus-> ";pos,BN,bn1$(a),A$ next a
return
[determine] for rd = 1 to Alen value = asc(mid$(A$,rd,1)):gosub [getValue] print mid$(A$,rd,1) total = total +asc(mid$(A$,rd,1)) 'print total next score = score +Alen print "Word Score -> ";score return 'wait [getValue] 'print "here" if value = 100 or value = 103 then '+2 points D/G score = score + 1 else
if value = 98 or value = 99 or value = 109 or value = 112 then '+3 points B/C/M/P score = score + 2 else
if value = 102 or value = 104 or value = 118 or value = 119 or value = 121 then '+4 points F/H/V/X/Y score = score + 3 else
if value = 107 then '+5 points K score = score + 4 else
if value = 106 or value = 120 then '+8 points J/X score = score + 7 else
if value = 106 or value = 122 then '+10 points Q/Z score = score + 9 'else end if end if end if end if end if end if return
'DICTIONARY====================================== [EH3] sel = 3:goto [CSD] [EH4] sel = 4:goto [CSD] [EH5] sel = 5:goto [CSD] [EH6] sel = 6:goto [CSD] [EH7] sel = 7:goto [CSD] [EH8] sel = 8:goto [CSD] [EH9] sel = 9:goto [CSD] [EH10] sel = 10:goto [CSD]
[CSD] if sel = 3 then #w.l3,"selection? selected$" if sel = 3 and eg = 1 then #w.d3,"selection? selected$" if sel = 4 then #w.l4,"selection? selected$" if sel = 4 and eg = 1 then #w.d4,"selection? selected$" if sel = 5 then #w.l5,"selection? selected$" if sel = 5 and eg = 1 then #w.d5,"selection? selected$" if sel = 6 then #w.l6,"selection? selected$" if sel = 6 and eg = 1 then #w.d6,"selection? selected$" if sel = 7 then #w.l7,"selection? selected$" if sel = 7 and eg = 1 then #w.d7,"selection? selected$" if sel = 8 then #w.l8,"selection? selected$" if sel = 8 and eg = 1 then #w.d8,"selection? selected$" if sel = 9 then #w.l9,"selection? selected$" if sel = 9 and eg = 1 then #w.d9,"selection? selected$" 'if sel = 10 then #1.10,"selection? selected$" Sword$ = selected$:sel = len(Sword$)
'seek works from 0 'start letter pos for supplied file "Collins Scrabble Words (2019) with definitions.txt" letterPos$= "0 1085412 2028136 3705698 4767053 5514221 6165110 6781748 7494274 8108438 8255046 8498623 9014692 10077960 10486032 11030220 12711529 12808300 13696310 15778517 16749970 17240464 17545147 17909377 17935667 17998650" firstLtr$=upper$(left$(Sword$,1)) seekPos=val(word$(letterPos$, asc(firstLtr$)-asc("A")+1)) print firstLtr$, seekPos 'input "Press Enter to close"; a$ foundData$=Sword$;" ";" -not found in the dictionary"
t0=time$("seconds")
open d$ for input as #dic seek #dic,seekPos
while 1 if eof(#dic) then exit while line input #dic,dictData$
if left$(dictData$,1)<> firstLtr$ then exit while if lower$(left$(dictData$,sel)) = Sword$ then foundData$=dictData$: exit while if dictData$ = "" then exit while wend close #dic
dictData$=foundData$ t1=time$("seconds")
print "Time taken ";t1-t0;" secs" print print upper$(Sword$);" - ";mid$(dictData$,sel+1,len(dictData$))
[dictInfo] WindowWidth = 660 WindowHeight = 45 UpperLeftX=int((DisplayWidth-WindowWidth)/2)'706 UpperLeftY=int((DisplayHeight-WindowHeight)/2) '485 BackgroundColor$ = "darkred" TextboxColor$ = "palegray" textbox #inf1.tb, 10, 10, 550, 25 stylebits #inf1.ok1, _BS_DEFPUSHBUTTON, 0, 0, 0 button #inf1.wb, "WB", [web],UR, 15, 10, 30, 25 button #inf1.ok1, "OK", [OK1],UR, 55, 10, 30, 25 on error goto [OK1] open " " for Window_popup as #inf1 #inf1.tb, "!font georgia 10 bold" #inf1.tb,upper$(Sword$);" - ";mid$(dictData$,sel+1,len(dictData$)) wait [OK1] close #inf1 #w.l3,"select 0":#w.l4,"select 0":#w.l5,"select 0":#w.l6,"select 0":#w.l7,"select 0":#w.l8,"select 0":#w.l9,"select 0" #w.d3,"select 0":#w.d4,"select 0":#w.d5,"select 0":#w.d6,"select 0":#w.d7,"select 0":#w.d8,"select 0":#w.d9,"select 0" selected$ = "":sel = 0:dd = 0 wait
[web] sel = len(selected$) if sel = 3 then #w.l3,"selection? selected$" if sel = 3 and eg = 1 then #w.d3,"selection? selected$" if sel = 4 then #w.l4,"selection? selected$" if sel = 4 and eg = 1 then #w.d4,"selection? selected$" if sel = 5 then #w.l5,"selection? selected$" if sel = 5 and eg = 1 then #w.d5,"selection? selected$" if sel = 6 then #w.l6,"selection? selected$" if sel = 6 and eg = 1 then #w.d6,"selection? selected$" if sel = 7 then #w.l7,"selection? selected$" if sel = 7 and eg = 1 then #w.d7,"selection? selected$" if sel = 8 then #w.l8,"selection? selected$" if sel = 8 and eg = 1 then #w.d8,"selection? selected$" if sel = 9 then #w.l9,"selection? selected$" if sel = 9 and eg = 1 then #w.d9,"selection? selected$" 'if sel = 10 then #1.10,"selection? selected$" Sword$ = selected$:sel = len(Sword$)
WB$ = WBPath$+"www.dictionary.com/browse/"+selected$
Run WB$ wait
[resetAll] 'Wd3$-9 = loaded Dictionary:ct3-9 = Dictionary counters: diction$ = FULL Dictionary:d1 = diction$ counter redim holdword$(1300):redim bn$(500):redim bn1$(500):redim Letr$(11):redim wr$(30) redim W3$(100):redim W4$(100):redim W5$(100):redim W6$(100):redim W7$(100):redim W8$(100):redim W9$(100) 'LISTBOX - words found redim D3$(2000):redim D4$(2000):redim D5$(2000):redim D6$(2000):redim D7$(2000):redim D8$(2000):redim D9$(2000) 'LISTBOX - Available words to find
#w.l3, "reload":#w.l4, "reload":#w.l5, "reload":#w.l6, "reload":#w.l7, "reload":#w.l8, "reload":#w.l9, "reload" 'LISTBOX - words found #w.d3, "reload":#w.d4, "reload":#w.d5, "reload":#w.d6, "reload":#w.d7, "reload":#w.d8, "reload":#w.d9, "reload" 'LISTBOX - Available words to find
#w.inf,"":#w.inp,"":#w.ln,"":#w.scpt,"":#w.wfd,"":#w.w2f,"":#w.tbwr,"":#w.rw2,"":#w.tbbn,"":#w.bnb,"":#w.SCbn,"":#w.mw,"" '<-info boxes #w.wl3,"":#w.wl4,"":#w.wl5,"":#w.wl6,"":#w.wl7,"":#w.wl8,"":#w.wl9,"" 'TEXTBOX - no of words found #w.sc3,"":#w.sc4,"":#w.sc5,"":#w.sc6,"":#w.sc7,"":#w.sc8,"":#w.sc9,"" 'TEXTBOX -
lbsh = 2:hw = 1:BN = 0:w2f = 0:sc = 0:ic = 2 '<-input control = 2/mouse(default) z3 = 0:z4 = 0:z5 = 0:z6 = 0:z7 = 0:z8 = 0:z9 = 0 'no words to find sc3 = 0:sc4 = 0:sc5 = 0:sc6 = 0:sc7 = 0:sc8 = 0:sc9 = 0'SCORE for no words to find 'DL3 = 5:DL4 = 5:DL5 = 5:DL6 = 5:DL7 = 3:DL8 = 2:DL9 = 1:max = 26:difLvl = 1 '<- default difficuly level (EASY)
dc = 1:maxsc = 0:Alen = 0:dup = 0:fd = 0:sw = 0:hw = 0 Lct = 0:lnDct = 0:pos = 0:c = 0:d1 = 0:LAlen = 0:tsc = 0:SP = 0:sp9 = 0:sz = 0:clue = 0:BN9 = 0 'W3$ = "":W4$ = "":W5$ = "":W6$ = "":W7$ = "":W8$ = "":W9$ = "" 'LISTBOX - words found 'D3$ = "":D4$ = "":D5$ = "":D6$ = "":D7$ = "":D8$ = "":D9$ = "":A$ = "" 'LISTBOX - Available words to find
fd3$ = "":fd4$ = "":fd5$ = "":fd6$ = "":fd7$ = "":fd8$ = "":fd9$ = "" '1/5 etc words out of lvl found
SearchValue = 0:tsc = 0:Alen = 0:st = 0:shuffle = 0:ln = 9:r = 1:sp = 1 A$ = "":toFind$ = "":MC$ = "":c$ = "":comment$ = "" 'st = 1 #w.st,"!show" goto [startOver]
[quit] close #w end
|
|
|
Post by Rod on Dec 4, 2021 15:40:47 GMT -5
This fires the imagination. I started to play. I took the Scrabble dictionary and created a copy. The longest word in it is 15 characters long. It is Tab delimited file.
I created a new fixed width file with every word padded to 15 characters and then appended a sorted version of the words characters
Rosetta code uses this technique where anagrams are sorted. To find all anagrams you just sort the letters you have and list all similar.
This worked very well and I can find all possible words from a set of letters very easily.
I just sort the letters and find the similar sorted anagrams in the file
But how to find all possible words from a set of letters Caret sorts to acert
Caret Trace
Race
Car
It s the smaller words I struggle to find right now.
I am hoping to build a Scrabble Assistant., an entire Scrabble engine might be a step too far but hints and scoring are possible.
I will post graphic resources and sample code soon.
|
|
|
Post by tsh73 on Dec 5, 2021 1:59:08 GMT -5
All possible subsets could be constructed from word and a binary number, where 1 means "take letter", 0 "skip letter" Here's my take on it
'finding anagram by a subset of word letters 'using sorted letters 'and binary composition of subsets 'tsh73 Dec 2021 data "Caret" data "Trace" data "Race" data "Car" data "Nope" data "XIZZY"
maxWords=100 dim dict$(100,2) i=0 while 1 read a$ if a$="XIZZY" then exit while i=i+1 dict$(i,1)=a$ dict$(i,2)=sorted$(upper$(a$)) wend maxWords=i
print "The dictionary" for i = 1 to maxWords print i,dict$(i,1),dict$(i,2) next
src$="Caret" 'src$="Employee" 'src$="Trace" print print "The word: ";src$
wordPos=0 for i = 1 to maxWords if dict$(i,1)=src$ then wordPos=i: exit for next
if wordPos=0 then print "Not found in a dictionary" else print "Found in a dictionary at ";wordPos end if
print print "Words made of the same letters" for i = 1 to maxWords if i<> wordPos then if dict$(i,2)=dict$(wordPos,2) then print i,dict$(i,1) end if end if next
print print "subsets of same letters" print " there are could be dupes if letters in the src doubles" print " letters sorted by construction" print " take only 3 letter or more" set$=dict$(wordPos,2) subsets$="": ns=0 n=len(set$) for i = 0 to 2^n-1 subset$="" for j = 0 to n-1 if i and (2^j) then subset$=subset$+mid$(set$,j+1,1) NEXT if len(subset$)>2 then subsets$=subsets$+" "+subset$: ns=ns+1 next subsets$=subsets$+" " 'for INSTR to look for " "WORD" " print ns; "subsets" print subsets$
print print "Words made of SUBSET of the same letters" for i = 1 to maxWords if i<> wordPos then if instr(subsets$, " "+dict$(i,2)+" ") then print i,dict$(i,1) end if end if next
input "Press Enter to end";dummy$ end
'---------------------------------------------- function sorted$(src$) n=len(src$) sorted$="" for i = 1 to n c$=mid$(src$,i,1) k=1 while k <= len(sorted$) if mid$(sorted$,k,1)>c$ then exit while k=k+1 wend 'print sorted$, c$, k-1 'insert in (k-1)-th place sorted$=mid$(sorted$,1,k-1)+c$+mid$(sorted$,k) next end function
|
|