Word List

Put your problem here if it does not fit any of the other categories.

Word List

Postby davidj2k » Mon Dec 15, 2008 3:33 pm

I am working on a word game, and was wondering what you guys would suggest for storing the word list? I would like to be able to flag a word as used, so that it cannot be used twice, but not sure the best way to do this. I have searched but have come up with no suggestions on the best way to do this in Android.
davidj2k
Freshman
Freshman
 
Posts: 3
Joined: Mon Dec 15, 2008 3:26 pm

Top

Postby MrSnowflake » Mon Dec 15, 2008 3:45 pm

Use a Hashtable, with the word as key and the value being a Boolean.
User avatar
MrSnowflake
Moderator
Moderator
 
Posts: 1439
Joined: Sat Feb 16, 2008 3:11 pm
Location: Flanders, Belgium

Postby davidj2k » Mon Dec 15, 2008 4:01 pm

That would work per session, but it would not remember the next time the game started, is there a way to make it persistent?
davidj2k
Freshman
Freshman
 
Posts: 3
Joined: Mon Dec 15, 2008 3:26 pm

Postby MrSnowflake » Mon Dec 15, 2008 4:59 pm

Use a database.
User avatar
MrSnowflake
Moderator
Moderator
 
Posts: 1439
Joined: Sat Feb 16, 2008 3:11 pm
Location: Flanders, Belgium

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: Exabot [Bot] and 11 guests