Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Movie JSON Wrapper Pull Request - Tiger Level #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Movie JSON Wrapper Pull Request - Tiger Level #5

wants to merge 1 commit into from

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