Checking if the table cell is empty or not

v00d0v00d0 Member Posts: 143
edited April 2012 in Working with GS (Mac)
I'm working on a new game, and i'm having troubles with the tables checker.
I've to check if a table cell is empty or not, if is empty i've to put inside the cell the word that the users wrote, if it isn't i've to move to the next cell and check again; until it don't find an empty cell. Anyone have an idea on how to do it?

Best Answers

  • tatiangtatiang Posts: 11,949
    Accepted Answer
    First of all, it is not possible to write data to a table cell. That being said, if you want to check if a table cell is empty, create a game attribute (text) called game.EMPTY with an initial value that is empty/blank (the default). Then, when creating a rule, check to see if game.EMPTY equals the cell value:

    image
  • tatiangtatiang Posts: 11,949
    edited April 2012 Accepted Answer
    @tshirtbooth has a great solution for this: http://forums.gamesalad.com/discussion/40189/-free-demo-dictionary-checker-600000-words-awesome-/p1. Basically he concatenates a word between two symbols in a text attribute. So change attribute game.Words to game.Words.."!"..newWord.."!"

    Then, you can check whether game.Words contains "!"..newWord.."!"

    The reason for the symbols is so that the word "cat" is not shown to be correct if the word "caterpillar" is already part of the list of words. His solution only counts exact matches (!cat! is not the same as !caterpillar!).

Answers

  • v00d0v00d0 Member Posts: 143
    edited April 2012
    o crap! and how can i do this??? with a text attribute putting inside value like : word1,word2,word3 and check if it contains it?? cause at least i've to do this:

    user type a word in the first level => in the second level user can't use the word he used in the first one, so ive to put the words that the user used, in something that can being checked.


    Thanks for the answer.
  • v00d0v00d0 Member Posts: 143
    Oh, thanks! Amazing. Just a question for the keyboard input. There is a way to set up this behavior?? Becuase when i write from iphone it turn on CAPS automatically, and ofc it don't find the word in the table. Anyway thanks for the word checker, i'm on your blog atm.
Sign In or Register to comment.