Skip to content

Conversation

@moserrya
Copy link

Both of the solutions work. Could not figure out a way to do Tiger without a global variable.

@jwo
Copy link
Member

jwo commented Nov 26, 2012

Excellent job on this. I really like the two describe blocks for finding / not-finding results.

If you wanted to get rid of the movies global array, you could wrap the loop in a method. something like

def search_loop
  movies = []
  continue = true
  while !continue do
    ## search
    ## ask if continue?
    ## set continue = false to stop
  end
  movies
end

average = calculate_average(search_loop)
## output average

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants