submit HW 2 - secret number

yes, index = 0 , it is not necessary

On Sun, Nov 9, 2014 at 12:02 PM, Hubert Lee <notifications@github.com>
wrote:

> In wilsonlam/Teddit.rb:
>
> > +  if story.downcase.include? 'cat'
> > +    upvotes *= 5
> > +  elsif story.downcase.include? 'bacon'
> > +    upvotes *= 8
> > +  end
> > +
> > +  if category.downcase == "food"
> > +    upvotes *= 3
> > +  end
> > +
> > +  upvotes
> > +end
> > +
> > +# 2. Create an empty stories array. This will be used to hold all stories we capture.
> > +stories_array = Array.new
> > +index = 0         # holds the array index
>
> As in your secret number program below, this declaration of index is
> unnecessary. Why is that?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/ga-students/BEWD_2_HK/pull/12/files#r20056465>.
>