
-----------------------------------
ZeroPaladn
Mon Oct 24, 2005 1:18 pm

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?

-----------------------------------
TokenHerbz
Mon Oct 24, 2005 1:23 pm


-----------------------------------
Try reading threw this tutorial, you may find it helpful.

http://www.compsci.ca/v2/viewtopic.php?t=8229

-----------------------------------
Cervantes
Mon Oct 24, 2005 6:27 pm


-----------------------------------
Here's a hint:

const numbers := "0123456789"

for i : 1 .. length (input)
    if index (numbers, input (i)) > 0 then
        num_of_numbers += 1
    end if
end for


-----------------------------------
ZeroPaladn
Tue Oct 25, 2005 9:21 am


-----------------------------------
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!

-----------------------------------
TokenHerbz
Tue Oct 25, 2005 2:29 pm


-----------------------------------
THANKS!

I think thats the 1st time anyones donated to me :)

-----------------------------------
Cervantes
Tue Oct 25, 2005 4:53 pm


-----------------------------------
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! :)

I think thats the 1st time anyones donated to me
Oh, I think I owed you approximately 15 bits for calling me canvas.  Enjoy.

-----------------------------------
MysticVegeta
Wed Oct 26, 2005 1:52 pm


-----------------------------------
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.

-----------------------------------
beard0
Wed Oct 26, 2005 2:45 pm


-----------------------------------
What is it with people calling Cervantes Canvas?  Can you people not read?

-----------------------------------
codemage
Wed Oct 26, 2005 4:00 pm


-----------------------------------
Take it easy there 0bread. :wink:
