Author |
Message |
ZeroPaladn
|
Posted: 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? |
|
|
|
|
|
Sponsor Sponsor
|
|
|
TokenHerbz
|
|
|
|
|
Cervantes
|
Posted: Mon Oct 24, 2005 6:27 pm Post subject: (No 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
|
|
|
|
|
|
|
ZeroPaladn
|
Posted: Tue Oct 25, 2005 9:21 am Post subject: (No 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! |
|
|
|
|
|
TokenHerbz
|
Posted: Tue Oct 25, 2005 2:29 pm Post subject: (No subject) |
|
|
THANKS!
I think thats the 1st time anyones donated to me |
|
|
|
|
|
Cervantes
|
Posted: Tue Oct 25, 2005 4:53 pm Post subject: (No 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!
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. |
|
|
|
|
|
MysticVegeta
|
Posted: Wed Oct 26, 2005 1:52 pm Post subject: (No 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. |
|
|
|
|
|
beard0
|
Posted: Wed Oct 26, 2005 2:45 pm Post subject: (No subject) |
|
|
What is it with people calling Cervantes Canvas? Can you people not read? |
|
|
|
|
|
Sponsor Sponsor
|
|
|
codemage
|
Posted: Wed Oct 26, 2005 4:00 pm Post subject: (No subject) |
|
|
Take it easy there 0bread. |
|
|
|
|
|
|