def has_won(bag, result):
  """Tell whether the user has won or not. It takes 5 rocks in the bag to win."""
  
  if bag != {}: 
    if bag["rock"] == 5: 
      print("")
      print("Your bag starts rumbling and the rocks rise into the air and form a circle which gets larger and turns into a portal! You step through and find yourself in your own backyard again!")
      print("")
      print("CONGRATULATIONS! YOU WON!")
      print("")
      result = True
      return result