Post by dkl on Dec 12, 2021 20:31:55 GMT -5
Although, I haven't fully completed my Word Puzzle Game, I have started a new project and wanted to try to emulate a favourite app of mine.
As seen in the pic below, I have created a two dimensional Array$, which produces a 9 x 9 grid (I have pointed out the corner co-ordinates), which relates directly to the Array$ (ie Letr$(1,1) that holds the bmp positioned at #w.11).
Using Rod's (very helpful) code - WH$ = "#w":MC$ = WH$;".";CH$
which I have added to the subroutine below (another really helful piece of code someone gave me!). I hope I've typed it correctly?
sub buttonClick handle$
SV=val(right$(handle$, 2))
CH$ = str$(SV): MC$ = WH$;".";CH$
#MC$ "disable" 'or hide
SAV$ = mid$(MC$,4,1);",";right$(MC$,1) '<---- I have added this
print MC$;"Letr1$(";SAV$;")" '<---- which when printed out will give me - #w.11,Letr$(1,1) - but i need to be able to turn this into a 'real' array that I can access
call assign MC$, SAV$ '<----last piece of code from subroutine to store info at assign'
end sub
I want to be able to click a letter and swap it with another letter. I have seen the demo in the LB Help section under bmpbuttons and I used this basis in the demo I recently posted (re Word Puzzle Game), but it relies on over laying bmpbuttons over each other and multiple branchlabels to execute the desired change.
I am planning to ............
highlight Letter 1
highlight Letter 2, which will immediately put 'letter2' into a tempfile,
update Letter 2 position/array with letter 1
replace Letter 1 with Letter 2 and update position/array
Hope you haven't completely lost me!
So what I need to be able to do is get the info from the arrays containing letter 1 and 2. This is the bit I cannot understand how to do without loads of 'IF/THEN' statements.
Any help would be appreciated. Thank you.
Grid.bmp (173.34 KB)
Rod I saw what you did with your 'Grid' in 'Scrabble Assistant' and I haven't used your way .........YET! As this query is a slightly different issue. However, to produce my grid I took the Word Puzzle demo I posted a few days ago and simply upgraded it to 9 x 9 and placed it all into a two dimensional array
Using Rod's (very helpful) code - WH$ = "#w":MC$ = WH$;".";CH$
which I have added to the subroutine below (another really helful piece of code someone gave me!). I hope I've typed it correctly?
sub buttonClick handle$
SV=val(right$(handle$, 2))
CH$ = str$(SV): MC$ = WH$;".";CH$
#MC$ "disable" 'or hide
SAV$ = mid$(MC$,4,1);",";right$(MC$,1) '<---- I have added this
print MC$;"Letr1$(";SAV$;")" '<---- which when printed out will give me - #w.11,Letr$(1,1) - but i need to be able to turn this into a 'real' array that I can access
call assign MC$, SAV$ '<----last piece of code from subroutine to store info at assign'
end sub
I want to be able to click a letter and swap it with another letter. I have seen the demo in the LB Help section under bmpbuttons and I used this basis in the demo I recently posted (re Word Puzzle Game), but it relies on over laying bmpbuttons over each other and multiple branchlabels to execute the desired change.
I am planning to ............
highlight Letter 1
highlight Letter 2, which will immediately put 'letter2' into a tempfile,
update Letter 2 position/array with letter 1
replace Letter 1 with Letter 2 and update position/array
Hope you haven't completely lost me!
So what I need to be able to do is get the info from the arrays containing letter 1 and 2. This is the bit I cannot understand how to do without loads of 'IF/THEN' statements.
Any help would be appreciated. Thank you.
Grid.bmp (173.34 KB)