Any ideas on how to make a simple word search game on AI2?

568 views
Skip to first unread message

checho006

unread,
Jun 28, 2015, 5:45:24 PM6/28/15
to mitappinv...@googlegroups.com
I'm currently working on a small school project that requires me to develop an app. Having minimal coding knowlodge I found AI, but how can I create a word search game using AI, would a canvas interface suffice? Or are there any other possible(and simpler) ways to achieve this?

Thanks in advance.

SteveJG

unread,
Jun 28, 2015, 7:14:43 PM6/28/15
to mitappinv...@googlegroups.com
You have at least two choices, use a Table Layout (with Labels  or possibly Buttons with a single letter Text) or use a Canvas ...using an interface something like   
my 36 buttons example with Scotts snap    https://groups.google.com/forum/#!searchin/mitappinventortest/36$20buttons/mitappinventortest/c7xYUTKFG_Q/hlwOMxsNm6oJ  which shows how to make a grid and display on a Canvas.     I would attempt the project with a Table Layout where you place a letter in each cell using code.

Here is a Word Search game programmed using the Pascal language for a Windows PC.  http://www.delphiforfun.org/Programs/WordSearch.htm    Is this example ofwhat you have in mind or something else?  This particular game variant would be very difficult to program with App Inventor.


or do you intend to do some other type of word search game?   If so, perhaps you can give us a better description of what you want to do or an example?

Regards,
Steve

checho006

unread,
Jun 28, 2015, 7:39:21 PM6/28/15
to mitappinv...@googlegroups.com
Hi, Steve.

I intend to do the tradional type of word search puzzle, like this one: http://funboxcomedy.com/uploaded_images/wordSearch0Solution-749125.jpg

If I use the Table Layout, which commands should I use to let the user mark the words they find? 


SteveJG

unread,
Jun 28, 2015, 8:12:21 PM6/28/15
to mitappinv...@googlegroups.com
I do not believe you can do anything like highlighting the words as shown in your diagram.

A workaround:

Provide a series of Textboxes where the user can type (list) the works found.   Each textbox can have some data valuation code to confirm the user found one of the items in this list.   The valid words would have to be stored in a List.  To validate, use the  is in list? block; if true then it is correct; if false, well try again.
This is not a pretty of highlighting the words, however you will not be able to highlightif you use a Canvas either. Another option, or perhaps and additional feature might be to change the background color of the letters selected.   That could be done by using a Button inside the table cells.  When touched, it changes color, when touched again the letter cell would revert to the original.   From here he you could get very complicated, perhaps, instead of typing the letters in the text box, the letters are added to a label...if the word exists, then it is validated and all the letters stay colored.   If invalid, all the selected letters revert.  A lot of logic coding but I suspect is very doable.

I expect the more difficult part is arranging the letters of valid words in the table layout (whick is a grid), then filling in the remaining letters with random letters perhaps.   A very interesting problem.

Regards,
Steve

Abraham Getzler

unread,
Jun 29, 2015, 12:33:14 PM6/29/15
to mitappinv...@googlegroups.com
May I suggest how to do this on a canvas?

You can draw fat colored lines on the canvas for your found words.
You would have to redraw the letters over that line afterwards,
if you can't get semi-transparent colors working for you.
For end points, draw a circle to round the end off, before 
redrawing the end letters.  

For highlighting the current word, I suggest one or two Ball sprites,
to highlight the beginning letter and the end of the word being
offered by the player.  The word can be highlighted further by 
running the second ball over the length of the word, in the style
of airport runway lights, under control of a clock, with the user dragging the second ball
to the desired end point.  A double tap or a button could be used to say
"I found a word", or the game could continually check if the player got lucky.

So the user would tap the first letter of a word to drop a ball onto it,
and drag from it to the word end, where he would tap again.
If the highlighted word is in your dictionary, draw the fat line.
You might help the user by snapping the indicator ball(s) to letter centers, 
so they don't look sloppy.

To keep your code simpler, I suggest hiding the canvas pixel calculations
from the letter row and column calculations through layers of value procedures.

ABG


Reply all
Reply to author
Forward
0 new messages