crossword puzzle in LiveCode
J. Landman Gay
jacque at hyperactivesw.com
Thu Dec 8 13:27:31 CST 2011
On 12/8/11 1:05 PM, Chris Sheffield wrote:
> My idea right now is to have some kind of a grid that would get
> created at run-time. Not sure yet whether to use square graphics or
> just use actual fields. So the application would be fed the max
> number of spaces across and then the max number of spaces down. So
> say the longest word across has 10 letters, and the longest word down
> has 6 letters. So a grid that is 10 by 6 would be created. Then I
> would somehow determine where the letters for the words will be
> placed in the grid (still kind of fuzzy on this part), and then once
> that's done, I would hide the unused spaces, leaving behind a
> crossword layout. Tapping/clicking in a space would then allow the
> user to enter a letter for that space (or something of that nature).
Off the top of my head...
I'd use one field per square and probably group them. I'd name them
consistently with an identifier string plus a number that represents
their order in the grid; i.e., "xwd 1","xwd 2","xwd 3". I'd keep the
space between the alpha identifier and the number so that it will be
easy to grab the number position of the field.
Then I'd make a delimited string of letters corresponding to what entry
should be in each field. Leave empty items for fields that shouldn't be
Then I'd loop through the string and hide each field that has an empty
item in the string.
When the user enters a letter, get the last word of the target's name
(which will be the number of its location in the string) and see if the
entry matches that item.
Jacqueline Landman Gay | jacque at hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
More information about the use-livecode