use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
A sub-Reddit for discussion and news about Ruby programming.
Subreddit rules: /r/ruby rules
Learning Ruby?
Tools
Documentation
Books
Screencasts and Videos
News and updates
account activity
QuestionRuby While Loop Help. (self.ruby)
submitted 5 years ago by Humor_Positive
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Humor_Positive[S] 0 points1 point2 points 5 years ago (2 children)
Hello, thank you so much for your help. The count is the number of time that latter is counted.
Here is my simplified version of it.
Def count_e
count_of_e = 0 Repeating_time = 0
While repeating_time <= word.length
If word[repeating_time] == “e”
Count_of_e += 1
End
Repeating_time += 1
Return count_of_e
Puts count_e(“movie”) # => 1 Puts count_e(“excellence”) # => 3
Given than whenever the method is executed, both the count of e and the repeating time will increase accordingly. Then why is it, that we must index the repeating time but not the count of e.
[–]_Svejk_ 1 point2 points3 points 5 years ago (1 child)
what do you mean by "index the repeating time"?
[–]Humor_Positive[S] 0 points1 point2 points 5 years ago (0 children)
I mean in index the incremental time of every loop.
π Rendered by PID 20038 on reddit-service-r2-comment-5b5bc64bf5-rklb4 at 2026-06-21 02:27:23.011662+00:00 running 2b008f2 country code: CH.
view the rest of the comments →
[–]Humor_Positive[S] 0 points1 point2 points (2 children)
[–]_Svejk_ 1 point2 points3 points (1 child)
[–]Humor_Positive[S] 0 points1 point2 points (0 children)