right, i had a message that was a lot more in depth that followed shortly
after but i sent it to a single address instead of the mailing list address
by accident, anyway, ill try to reproduce it.
Ok, well ive got this structure for this game called wordtwist(inspired by
the game on msn chat bot, bot2k3), if anyone wants to see it, add
[EMAIL PROTECTED] to your msn and type !wordtwist, best way to understand
what im doing). its basically a word guessing game, ive made a structure for
it:
struct wordtwist_data
{
int totalguesses; //how many guesses people have made so far(total for
everyone)
int turns_left; //how many turns are left before the round is over
char *first; //letter that correct phrases begin with
char *last; //letter that correct phrases end with
char dict[MAX_STRING_LENGTH]; //the word list file
char *word[1000]; //these are the words guessed(i think this is where
my problem is)
char *name[1000]; //these are who guessed which words
bool newround; //newround? yes or no?
};
basically how i set up whos guessed(only writes these if the first/last
letters match) its simply:
wordtwist.word[wordtwist.totalguess] = argument
wordtwist.name[wordtwist.totalguess] = ch->name
wordtwist.totalguess++;
how i try and figure out if the words already been guessed i do this:
int i;
for(i = 0;i <= wordtwist.totalguess; i++)
{
if( !str_cmp( argument, wordtwist.word[i]))
return;
}
...then it does its thing if the word hasnt been guessed yet(except this
doesnt work)
what this does is when the first word is said on this channel that matches
whatever criteria it says something like "correct, you gain x points!" but
after the first one, any word that follows hits that return, regardless of
whether or not its been guessed already...
hope that clears things up.
From: Jeremy Hill <[EMAIL PROTECTED]>
To: [email protected]
Subject: Re: a problem with checking if a word has been entered already
Date: Sat, 21 Aug 2004 04:18:09 -0500
It sounds like you want something special for a trivia channel of some
type. I am not sure, however, as I cannot decipher your paragraph-long,
rambling sentence into comprehensible English. I honestly have no idea
what you are asking for help about. Anyone help me out on this?
Sorry if that's a flat-out flame, but c'mon. If you expect help, don't be
cryptic. It is also a good idea to explain what you have already tried so
we don't feel like a code repository to be pillaged at your whim. Here's a
sample post that makes me want to help:
---------------------------
Hello,
I am trying to implement Widgets into ROM code. Widgets are made up of two
components: X and Y. Through different orderings of the two components,
different Widgets can be made. Here's what I've come up with:
struct Widget
{
Component *list;
int foo;
char *bar;
};
<etc>
I'm having difficulty in correctly issuing names to the different Widget
types. The variable 'char *bar' is set depending on the linked list
pointed to by 'Component *list', where the linked list has a number of
either X or Y components. I thought about using an array to store
combinations, like this:
const char *widget_names[] =
{
"X", "X1 Widget",
"Y", "Y1 Widget",
"XY", "X-Y Widget",
"YX", "Y-X Widget"
};
The difficulty there is that since the component list is order-specific,
the array will grow exponentially with each additional component. I
therefore do not think the array I have created is a good choice for the
problem I am trying to solve. Any ideas to get me nudged into a better
direction?
---------------------------
Things I like about the above:
- The poster explained what relevant non-familiar data structures are
involved in simple English before presenting code
- The poster clearly explained the problem he is having
- The poster posted what he had already tried for the problem, showing
initiative and not moochiness
- The poster asked for help with IDEAS first, not for straight CODE,
further showing he is willing to attack the problem himself
I'm very willing to help if you first show you've attacked the problem
yourself first.
Maybe I'm just getting too old.
-- Jeremy
Tristan M wrote:
Ok, what ive been trying to do is have people gossip words(not gossip, but
a specific channel for the game) and allow each word that is a correct
guess to not be counted towards another correct guess in the same round...
anyone help me out on this?
_________________________________________________________________
Don't just Search. Find! http://search.sympatico.msn.ca/default.aspx The
new MSN Search! Check it out!
--
ROM mailing list
[email protected]
http://www.rom.org/cgi-bin/mailman/listinfo/rom
_________________________________________________________________
Take charge with a pop-up guard built on patented Microsoft® SmartScreen
Technology
http://join.msn.com/?pgmarket=en-ca&page=byoa/prem&xAPID=1994&DI=1034&SU=http://hotmail.com/enca&HL=Market_MSNIS_Taglines
Start enjoying all the benefits of MSN® Premium right now and get the
first two months FREE*.