Ad
  • Custom User Avatar

    Good job not using written methods!
    By the way, you can save some code if you init your hash like: hash=Hash.new(0) (Now the default value is 0 for a key not found in your hash)

    That way you don't need one of the nested ifs

    Example of setting a new default value
    hash=Hash.new("It works!")
    hash[key_i_made_up] #=>"It works!"
    hash #=>{key_i_made_up => "It works!"}