Page 1 of 4
Word search Nl, En, De, Fr updated
Posted: Sun Jul 19, 2015 1:49 pm
by Dutchman
I made a program to find words for the board game "Scrabble" and its digital version "WordFeud".
The search can be done for Dutch, English, German or French words.
You can find the program and its related files on Dropbox in
https://www.dropbox.com/sh/r46yin9uyjlp ... Xxd1a?dl=0
or in short:
http://bit.ly/1e8WLB1
The program is developed on iPad, but tested for iPhone's screensize.
I could not test it on iPhone, so please report on that if you can.
In the file "- Read Me.txt" you'll find info on usage, program structure, search algorithm etc.
It explains also how lists of words can be prepared for usage.

- Opening screen with language selection
- 1 start-screen.PNG (75.38 KiB) Viewed 3536 times

- Start screen with Dutch (Nl) language selected
- 2 Intro NL.PNG (687.09 KiB) Viewed 3536 times

- Help info, Dutch background
- 3 helping Nl.PNG (641.26 KiB) Viewed 3536 times

- Landscape, with French (Fr) search finished
- 4 Finished Fr landscape.PNG (691.66 KiB) Viewed 3536 times

- German (De) search finished and copied
- 5 list copied De landscape.PNG (493.14 KiB) Viewed 3536 times

- iPhone size simulation on iPad during search in English (En) language
- 6 iPhone size.PNG (106.75 KiB) Viewed 3536 times
Re: Word search
Posted: Sun Jul 19, 2015 4:01 pm
by rbytes
I tried a Search using the default Pattern and Selection and got an error. I can not seem to enter a Pattern or Selection that work. I always get Error - Letters Only, even though your default shows that I can use - and = in the Pattern and ? In the Selection.
I hope I can get this to work. I play Scrabble and Zynga's Words With Friends regularly.
Re: Word search
Posted: Sun Jul 19, 2015 5:06 pm
by Dutchman
That is really strange. Especially because the default values don't work.
Could you place a line 'debug pause' after the label 'Error:' in the functions 'CheckSelection' and 'CheckPattern'.
What is then the value of '.Pat$' and/or '.Sel$' after input?
Note: set test-option 'Short=1' to use the short words-list during testing.

Re: Word search
Posted: Sun Jul 19, 2015 5:54 pm
by Dutchman
I have changed the function 'Alphabetical()'.
Now it tests on real characters, not on ASCII values.
Maybe the ASCII values are keyboard-dependent.

Please reload 'Word search.txt'
Re: Word search
Posted: Sun Jul 19, 2015 7:56 pm
by rbytes
I reloaded Word Search and put in the debug pauses. I don't know why, but it did not do a debug pause in either place when I ran the program. So I commented out Set Toolbar Off so that I could manually select debug mode and check the values of the two variables you asked about. You referred to them as .pat$ and .sel$, but they just showed in the debug list as PAT$ and SEL$. They were both = "". The Error still appeared, no matter how I changed the Text pattern and Selection fields.
I have attached screen photos. The first shows the error message that appears when I use my own values. The other shows the same error message when I use the default values.
Hope this helps.
Re: Word search
Posted: Sun Jul 19, 2015 10:11 pm
by Dutchman
You did not give
'Enter'
Even with the default values you should give 'Enter' (2 times) otherwise the program does not know that the fields changed.
If you enter text, you should also finish with 'Enter'
Both fields should be 'entered' before touching 'Search'
I'm quite sure that this solves the problem.
Now I can sleep soundly

Re: Word search
Posted: Mon Jul 20, 2015 12:02 am
by rbytes
Yes, this was the solution. Thanks for your help.
I remember now having this problem when trying to load files into Poly Designer after typing the name into a field. Unfortunately it is not intuitive to press Enter, since outside of smartBASIC it is rarely required. I wonder if Mr. K would consider a feature request to make the Enter occur automatically after anything is typed into a field...
Re: Word search
Posted: Mon Jul 20, 2015 5:00 am
by Mr. Kibernetik
How to detect that typing into a field is finished?
Re: Word search
Posted: Mon Jul 20, 2015 5:26 am
by rbytes
I went over the field commands again, and I think you have already provided a solution with the command FIELD_TEXT$(N$). Here is a little test I coded, which allows me to extract characters from a field and use them without pressing Enter, perfect for a file requester.
Code: Select all
GRAPHICS
GRAPHICS CLEAR 0,0,0
N$ = "Entry"
A$ = "cow"
M$ = "Save"
FILL COLOR 0,0,0
FIELD N$ TEXT A$ AT 100,100 SIZE 200,40
BUTTON M$ TEXT M$ AT 100,200 SIZE 100,60
DO
IF BUTTON_PRESSED(M$) THEN
R$ = FIELD_TEXT$(N$)&".jpg" 'Extract the characters from the field
FILL RECT 100,320 TO 300,380 'Erase previous filename
DRAW TEXT R$ AT 100,320 'Display new filename
ENDIF
UNTIL 0
Once you run this program, type anything into the text field, or just leave the default text as "cow". When you press the Save button your entry will appear below the button with the extension ".jpg" appended. You can repeat this action as many times as you want. You never have to press Enter to confirm your entry, since the FIELD_CHANGED(M$) command is not being used.
Re: Word search
Posted: Mon Jul 20, 2015 5:41 am
by Mr. Kibernetik
In smart BASIC text fields does not require "enter" to be pressed.
Code: Select all
FIELD 0 AT 0,100
BUTTON 0 TEXT "button" AT 0,140
1 IF NOT BUTTON_PRESSED("0") THEN 1
PRINT FIELD_TEXT$("0")
In the program above you enter text to text field and then press button - and text from text field is printed. So there is no need to press "enter" for finishing text input in text field.