Word Game Database

Hey everyone. I am working on a physics based game and that is going pretty well. However, I know it will be quite some time before I get it all wrapped up.

I was thinking of starting a simpler, word game while I’m sorting the other out. I found this post here in the forums and was just wondering how one would go about implementing it into a Corona app.
http://developer.anscamobile.com/forum/2011/07/15/word-database-game

If my game allowed for the creation of any words, the game would need to check it against this list foe validity. Does anyone know how to make that happen?

Thanks a bunch,
Cheryl [import]uid: 93625 topic_id: 17119 reply_id: 317119[/import]

Cheryl,
like any programming language, to validate, you need to check it against something.

so compare it like if myWord == wordsInList[i]

where i is an iterator that loops through all the words in the list which are stored in the array wordsInList.

the trickier part is do you load all the words into an array? maybe not, you need to devise a method to hash the words, have an index, whatever that works for you and you can do. then you chcek it as mentioned above.

cheers,

?:slight_smile: [import]uid: 3826 topic_id: 17119 reply_id: 64397[/import]

Wow, thanks for the response Jay. Now I just need to try to understand what you just said :stuck_out_tongue:

I am new to this whole world of programming… for good or bad, I am trying to learn as I go. I do appreciate the help though! [import]uid: 93625 topic_id: 17119 reply_id: 64398[/import]

if you have sql file instead of text file. It is much easier.

please check out the link below to know how to use sqlite with corona.
http://developer.anscamobile.com/reference/index/sqlite3

Hope this help.

KC
Bonvivid

My sample amend from the corona website
______________________________________________
require “sqlite3”

–Open data.db. If the file doesn’t exist it will be created
local path3 = system.pathForFile(“data.db”, system.DocumentsDirectory)
dbb = sqlite3.open( path3 )

for row in dbb:nrows(“SELECT * FROM test WHERE word =’”…input_word…"’") do
print(row.id,row.word)
end [import]uid: 94613 topic_id: 17119 reply_id: 65427[/import]