Skip to main content
GameDev.net gamedev.net
🔒 Locked

Improved Word Jumble!

Started by DeathLetum Sep 6, 2006 at 5:21 PM 11 replies 1.7k views
Original Post
DeathLetum
DeathLetum
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.
xEricx
xEricx
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
DeathLetum
DeathLetum
hehe my bad im kinda sleepy and hmm im using C++ and i didint really understand what you said in ur post
kire
kire
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 ;)
DeathLetum
DeathLetum
Can anyone show me a copy of the improved Word jumble they made in C++ plz (im visual)
xEricx
xEricx
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
alexmullins
alexmullins
I'm guessing you are talking about "Beginning C++ Game Programming" by Michael Dawson.
alexmullins
alexmullins
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.
DeathLetum
DeathLetum
oh well guess ill just jump the last part of this chapter for now :P
DeathLetum
DeathLetum
Quote:
Original post by tldalton1622
ive got the python version of that series.


hmm not sure if programming style is the same :S

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.