Computer Science Canada

length and index help

Author:  ZeroPaladn [ Mon Oct 24, 2005 1:18 pm ]
Post subject:  length and index help

im doing a program for school called the "word canibalizer". apparently its supped to take the raw components of a word and display them on the screen. for example...

input = 12er45yu
output
- 4 numbers
- 2 vowels
- 2 constanants
- 0 other
- 0 spaces

i do not have any clue on how either index or length work, or how they can be put together to make such a program. even after the teacher explained it to me countless times, im still lost. can any1 help me out here?

Author:  TokenHerbz [ Mon Oct 24, 2005 1:23 pm ]
Post subject: 

Try reading threw this tutorial, you may find it helpful.

http://www.compsci.ca/v2/viewtopic.php?t=8229

Author:  Cervantes [ Mon Oct 24, 2005 6:27 pm ]
Post subject: 

Here's a hint:
code:

const numbers := "0123456789"

for i : 1 .. length (input)
    if index (numbers, input (i)) > 0 then
        num_of_numbers += 1
    end if
end for

Author:  ZeroPaladn [ Tue Oct 25, 2005 9:21 am ]
Post subject: 

oh dear god i think i got it! thanks token and cervantes, that tuorial helped a bit, but i didnt quite understand it untill cervantes posted that code. i think ill be generous today.

+ 10 bits to token

cant donate to mods, sorry cervantes!

Author:  TokenHerbz [ Tue Oct 25, 2005 2:29 pm ]
Post subject: 

THANKS!

I think thats the 1st time anyones donated to me Smile

Author:  Cervantes [ Tue Oct 25, 2005 4:53 pm ]
Post subject: 

ZeroPaladn wrote:
cant donate to mods, sorry cervantes!

Technically you can. But my bits go back to 1000 when I make another post, so its wasted. It's the thought that counts, though! Smile

TokenHerbz wrote:
I think thats the 1st time anyones donated to me

Oh, I think I owed you approximately 15 bits for calling me canvas. Enjoy.

Author:  MysticVegeta [ Wed Oct 26, 2005 1:52 pm ]
Post subject: 

oh yea i remember that! Canvas - and there were others too, i forgot, i think it was different everytime. By the ways: great tut by you on string manipulation, helped me a lot last year.

Author:  beard0 [ Wed Oct 26, 2005 2:45 pm ]
Post subject: 

What is it with people calling Cervantes Canvas? Can you people not read?

Author:  codemage [ Wed Oct 26, 2005 4:00 pm ]
Post subject: 

Take it easy there 0bread. Wink


: