<commit_before># Build a simple guessing game


# I worked on this challenge [by myself, with: ].
# I spent [#] hours on this challenge.

# Pseudocode

# Input:
# Output:
# Steps:


# Initial Solution

class GuessingGame
  def initialize(answer)
    # Your initialization code goes here
  end

  # Make sure you define the other required methods, too
end




# Refactored Solution






# Reflection<commit_msg>Edit guessing game<commit_after># Build a simple guessing game


# I worked on this challenge [with: ].
# I spent [#] hours on this challenge.

# Pseudocode

# Input: Integer
# Output: Boolean or symbol
# Steps:
# 

# Initial Solution

class GuessingGame
  def initialize(answer)
    # Your initialization code goes here
    @answer = answer
    @low = :low
    @high = :high
    @correct = :correct
    @guess = 0
  end

  def guess(guess)
  	@guess = guess
  	case @guess
  	when @guess == @answer
  		return @correct
  	when @guess < @answer
  		return @low
  	when @guess > @answer
  		return @high
  	end
  end

  def solved?
  	true if @guess == @answer
  	false
  end
  # Make sure you define the other required methods, too
end




# Refactored Solution

class GuessingGame
  def initialize(answer)
    # Your initialization code goes here
    @answer = answer
    @guess = nil
  end

  def guess(guess)
  	@guess = guess
  	if @guess == @answer
  		return :correct
  	elsif @guess < @answer
  		return :low
  	else 
  		return :high
  	end
  end

  def solved?
  	if @guess == @answer
  		return true
  	else
  		return false
  	end
  end
end



# Reflection

=begin
	

How do instance variables and methods represent the characteristics and behaviors (actions) of a real-world object?
Methods describe what it is supposed to describe. Instance variables literally are descriptions of an object.

When should you use instance variables? What do they do for you?
You should use an instance variable when you want to use it over multiple methods or when it can be used over all or some of the methods.
They store specific information that you put.

Explain how to use flow control. Did you have any trouble using it in this challenge? If so, what did you struggle with?
You use flow control in order to work out each part of a problem. I did not really have a probelm with it during this problem.

Why do you think this code requires you to return symbols? What are the benefits of using symbols?
I think we had to return symbols in order to save memory. I think the way ruby allocates memory it is better to use symbols. The benefit of using symbols is to save space.

	
=end
{'fraction_non_alphanumeric': 0.0558982266769468, 'fraction_numerical': 0.00038550501156515033, 'mean_word_length': 3.125596184419714, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '230913', 'n_tokens_mistral': 791, 'n_tokens_neox': 749, 'n_words': 370}