Word search Nl, En, De, Fr updated

User avatar
Dutchman
Posts: 858
Joined: Mon May 06, 2013 9:21 am
My devices: iMac, iPad Air, iPhone
Location: Netherlands
Flag: Netherlands

Word search Nl, En, De, Fr updated

Post 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
Opening screen with language selection
1 start-screen.PNG (75.38 KiB) Viewed 3527 times
Start screen with Dutch (Nl) language  selected
Start screen with Dutch (Nl) language selected
2 Intro NL.PNG (687.09 KiB) Viewed 3527 times
Help info, Dutch background
Help info, Dutch background
3 helping Nl.PNG (641.26 KiB) Viewed 3527 times
Landscape, with French (Fr) search finished
Landscape, with French (Fr) search finished
4 Finished Fr landscape.PNG (691.66 KiB) Viewed 3527 times
German (De) search finished and copied
German (De) search finished and copied
5 list copied De landscape.PNG (493.14 KiB) Viewed 3527 times
iPhone size simulation on iPad during search in English (En) language
iPhone size simulation on iPad during search in English (En) language
6 iPhone size.PNG (106.75 KiB) Viewed 3527 times
Last edited by Dutchman on Tue Aug 09, 2016 9:48 am, edited 5 times in total.

User avatar
rbytes
Posts: 1338
Joined: Sun May 31, 2015 12:11 am
My devices: iPhone 11 Pro Max
iPad Pro 11
MacBook
Dell Inspiron laptop
CHUWI Plus 10 convertible Windows/Android tablet
Location: Calgary, Canada
Flag: Canada
Contact:

Re: Word search

Post 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.
The only thing that gets me down is gravity...

User avatar
Dutchman
Posts: 858
Joined: Mon May 06, 2013 9:21 am
My devices: iMac, iPad Air, iPhone
Location: Netherlands
Flag: Netherlands

Re: Word search

Post by Dutchman »

That is really strange. Especially because the default values don't work. :shock:
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. ;)

User avatar
Dutchman
Posts: 858
Joined: Mon May 06, 2013 9:21 am
My devices: iMac, iPad Air, iPhone
Location: Netherlands
Flag: Netherlands

Re: Word search

Post 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'

User avatar
rbytes
Posts: 1338
Joined: Sun May 31, 2015 12:11 am
My devices: iPhone 11 Pro Max
iPad Pro 11
MacBook
Dell Inspiron laptop
CHUWI Plus 10 convertible Windows/Android tablet
Location: Calgary, Canada
Flag: Canada
Contact:

Re: Word search

Post 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.
Attachments
image.jpg
image.jpg (408.98 KiB) Viewed 4066 times
image.jpg
image.jpg (541.13 KiB) Viewed 4066 times
The only thing that gets me down is gravity...

User avatar
Dutchman
Posts: 858
Joined: Mon May 06, 2013 9:21 am
My devices: iMac, iPad Air, iPhone
Location: Netherlands
Flag: Netherlands

Re: Word search

Post 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 :lol:

User avatar
rbytes
Posts: 1338
Joined: Sun May 31, 2015 12:11 am
My devices: iPhone 11 Pro Max
iPad Pro 11
MacBook
Dell Inspiron laptop
CHUWI Plus 10 convertible Windows/Android tablet
Location: Calgary, Canada
Flag: Canada
Contact:

Re: Word search

Post 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...
The only thing that gets me down is gravity...

User avatar
Mr. Kibernetik
Site Admin
Posts: 4787
Joined: Mon Nov 19, 2012 10:16 pm
My devices: iPhone, iPad, MacBook
Location: Russia
Flag: Russia

Re: Word search

Post by Mr. Kibernetik »

How to detect that typing into a field is finished?

User avatar
rbytes
Posts: 1338
Joined: Sun May 31, 2015 12:11 am
My devices: iPhone 11 Pro Max
iPad Pro 11
MacBook
Dell Inspiron laptop
CHUWI Plus 10 convertible Windows/Android tablet
Location: Calgary, Canada
Flag: Canada
Contact:

Re: Word search

Post 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.
Last edited by rbytes on Mon Jul 20, 2015 6:54 pm, edited 2 times in total.
The only thing that gets me down is gravity...

User avatar
Mr. Kibernetik
Site Admin
Posts: 4787
Joined: Mon Nov 19, 2012 10:16 pm
My devices: iPhone, iPad, MacBook
Location: Russia
Flag: Russia

Re: Word search

Post 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.

Post Reply