Word games?

Member
Posts: 75
Joined: 2009.01
Post: #1
This is my first attempt at a word game and I have absolutely no idea how to start.
Say for example I have two UIImageViews one with an image letter "A" and the other "B" and if I connected them to form "AB" how can I detect that and look it up in a list of words that I provide?
Or is that the wrong approach?
Anyone who has done a game that mixes and matches letters to make words know of a good place to start?
Quote this message in a reply
Member
Posts: 283
Joined: 2006.05
Post: #2
Is this going to be grid-based? If so, it's best to think about how to represent the grid in memory. Then it'll be a much simpler task to test for words.

You might want to read up a bit on the Model-View-Controller concept. While it doesn't always apply nicely to games, it's usually a good starting point.
Quote this message in a reply
Member
Posts: 75
Joined: 2009.01
Post: #3
Thanks for the tip.
I've just finished a grid based game so that should help.
I've never done the model-view-controller way of things but i'll give it a shot now.

But I still don't get how you would test for words.
Quote this message in a reply
Member
Posts: 283
Joined: 2006.05
Post: #4
Well, say your grid was represented by an array of characters (NSString, char *, whatever). One method would be to go along each row, checking for a character. When one is found, add it to an array. Then check the next grid square, adding characters to the array until there's a blank cell or the end of the grid. Then use the array you've generated to make a string, and check if it exists in your dictionary.

You'd need to then check vertically in a similar way.
Quote this message in a reply
Member
Posts: 75
Joined: 2009.01
Post: #5
What if my grid was represented by UIViews or UIImageViews?
I'm using UIViews/UIImageViews partly because it's the only way i know of how to actually represent a grid and use images.
I'm trying to figure out how to connect my "images" of each letter to actual letters and use those letters to determine words from a dictionary.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Word Game Dictionary avidgamer101 3 3,422 Jul 24, 2012 04:08 AM
Last Post: MattDiamond
  Basic Questions for a Word Game avidgamer101 4 4,594 May 19, 2012 07:26 PM
Last Post: MattDiamond
  BetterLetter - The Perfectly SIMPLE Word Game for iOS wenbeen 1 2,772 Dec 29, 2011 09:08 AM
Last Post: AndyKorth