hi,
I set an array for making each chat in random that appear for my anagram game.But when it appear some of my char are the same wth other one.So it was useless.
EX like that
j h o p j n w g n o i e
in here the words j appear second time again in my words series and o also. may be it might be better to check not to repeat the words.So how can i do?
Another thing i let the program to check if the user use the character that not given in series or not in his words.
In case , the user use illegal words , my program let the user know .

And one more thing is if user cnt make the meaningful words from given word series,I lke to do the program to put out the possible words from my dictionary.txt that concerned wth my series words...
pls fix for me ..:mad: :p

Recommended Answers

All 10 Replies

in here the words j appear second time again in my words series and o also. may be it might be better to check not to repeat the words.So how can i do?

check the array to see if the char is already in it. If not, add it to the array, otherwise if its already there then just generate another random char.

Oh .. such a good idea
Thank you so much mr dragon

check the array to see if the char is already in it. If not, add it to the array, otherwise if its already there then just generate another random char.

huh ,
I cnt do it ..

Well post your latest effort, and then perhaps we can help you solve the problem.

Are you using C-Style char arrays for your strings, or std::string strings from C++ ?

huh ,
I cnt do it ..

Didn't your momma ever tell you that "can't" never did anything:cheesy:

Well post your latest effort, and then perhaps we can help you solve the problem.

Are you using C-Style char arrays for your strings, or std::string strings from C++ ?

Give me some code pls..Do u have mail to chat?

Do u have messenger to chat .. i lke to discuss wth u ..

That's a far more complex solution to the op's problem than it needs to be. There is a pretty simple solution that takes only a few lines of code. Just think about loops and how to search an array for a certain value.

Member Avatar for iamthwee

>That's a far more complex solution to the op's problem than it needs to be.

Oh I didn't write that in MFC ;)

And he did say:

And one more thing is if user cnt make the meaningful words from given word series,I lke to do the program to put out the possible words from my dictionary.txt that concerned wth my series words...

But that may be quite some time away before they get to that stage.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.