Improved Word Jumble!

Started by
11 comments, last by DeathLetum 17 years, 7 months ago
Ok i got to the end of my chapter and they ask me to make a improved version of the game "Word Jumble" in this improved version they want me to add a scoring system.and they want the points to be based on the lenght of the word,and they want me to take points away when the person ask's for a 'Hint'. i know how to get the length of a word like the number of letters in it.But i sure how to do it. And i have spent alot of time now trying to figure out how i can do this and its really slowing me down right now.Yes i had alot of probs with this chapter lets just say i figured out what i dont like about programming "Arrays" lol.
Advertisement
It could help us to help you if you told us which language you're using? I assume C since you're talking about strings in an array? then you can simply call strlen(). On a std::string there's the size() member function that will tell you how long the word is.

Cheers

Eric
hehe my bad im kinda sleepy and hmm im using C++ and i didint really understand what you said in ur post
Quote:Original post by DeathLetum
hehe my bad im kinda sleepy and hmm im using C++ and i didint really understand what you said in ur post


He says that if you loop over the array (or vector, whatever you use) you can get wordlength like this:

for(int i = 0; i < arrayLength; i++){    /// char* strings:    score += strlen(arrayWithWords);    /// C++ strings:    score += arrayWithWords.size();    }


off course this is a very basic example ;)
Can anyone show me a copy of the improved Word jumble they made in C++ plz (im visual)
Hey,

I have no clue which book you're talking about or what's a "Word Jumble" game (maybe cause I'm French, heh)

If you give a little more details I might be able to help

Cheers

Eric
I'm guessing you are talking about "Beginning C++ Game Programming" by Michael Dawson.
yes i am!!
yea i got that book a while ago and i stop programming for a while and now im picking it back up. So im now re-reading that book and im on ch.2 so im just 1 chapter behind ya. maybe when i catch up we can help each other on it.
sounds good to me

This topic is closed to new replies.

Advertisement