Menu
Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Ruby
Another Easy Beginner Question
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Stephen Ball, post: 4563841"] Remember to count each gift for each day (on the second day you get another bird in a tree, on the third day you get two more doves and another bird in a tree, etc.) day = 0 gifts_for_the_day = 0 total_gifts = 0 12.times do day += 1 gifts_for_the_day += day total_gifts += gifts_for_the_day puts "Day: #{day}, Gifts for Day: #{gifts_for_the_day}, Total gifts: #{total_gifts}" end -- Stephen [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Ruby
Another Easy Beginner Question
Top