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? |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
TokenHerbz
![](http://compsci.ca/v3/uploads/user_avatars/717170395558e628d9452b.jpg)
|
|
|
|
![](images/spacer.gif) |
Cervantes
![](http://compsci.ca/v3/uploads/user_avatars/1023105758475ab2e040bde.jpg)
|
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
|
|
|
|
|
|
![](images/spacer.gif) |
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! |
|
|
|
|
![](images/spacer.gif) |
TokenHerbz
![](http://compsci.ca/v3/uploads/user_avatars/717170395558e628d9452b.jpg)
|
Posted: Tue Oct 25, 2005 2:29 pm Post subject: (No subject) |
|
|
THANKS!
I think thats the 1st time anyones donated to me ![Smile Smile](http://compsci.ca/v3/images/smiles/icon_smile.gif) |
|
|
|
|
![](images/spacer.gif) |
Cervantes
![](http://compsci.ca/v3/uploads/user_avatars/1023105758475ab2e040bde.jpg)
|
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. |
|
|
|
|
![](images/spacer.gif) |
MysticVegeta
![](http://www.geocities.com/ohsoinsane/my_avatar.JPG)
|
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. |
|
|
|
|
![](images/spacer.gif) |
beard0
![](http://ugray.be/compsci/silly.gif)
|
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? |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
codemage
![](http://usera.imagecave.com/codemage/codemage-small.gif)
|
Posted: Wed Oct 26, 2005 4:00 pm Post subject: (No subject) |
|
|
Take it easy there 0bread. ![Wink Wink](http://compsci.ca/v3/images/smiles/icon_wink.gif) |
|
|
|
|
![](images/spacer.gif) |
|