<commit_before># I worked on this challenge [by myself, with: ].
# This challenge took me [#] hours.

# Pseudocode
# Input: integer
# Output: true or false
# Steps:
# 1. Write a method that takes in an integer
# 2. Run a fibonacci sequence up to that integer
# 3. Check if that number equals one of the numbers in the sequence
# 4. Output true or false


# Initial Solution

# def is_fibonacci?(num)
# 	f0 = 0
# 	f1 = 1
# 	fn = 0
# 	while fn <= num
# 		fn = f1 + f0
# 		f0 = f1
# 		f1 = fn

# 		if fn == num
# 			return true
# 		elsif fn > num
# 			return false
# 		end
# 	end
# end

##### Driver code
# is_fibonacci?(145)
# is_fibonacci?(143)
# is_fibonacci?(144)

# Refactored Solution
def is_fibonacci?(num)
	fZero = 0
	fOne = 1
	fSum = 0
	while fSum <= num
		fSum = fOne + fZero
		fZero = fOne
		fOne = fSum

		if fSum == num
			return true
		elsif fSum > num
			return false
		end
	end

end


# Reflection
# I did not find any emunerate methods for this challenge.<commit_msg>Update 8.6<commit_after># I worked on this challenge [by myself, with: ].
# This challenge took me [#] hours.

# Pseudocode
# Input: integer
# Output: true or false
# Steps:
# 1. Write a method that takes in an integer
# 2. Run a fibonacci sequence up to that integer
# 3. Check if that number equals one of the numbers in the sequence
# 4. Output true or false


# Initial Solution

# def is_fibonacci?(num)
# 	f0 = 0
# 	f1 = 1
# 	fn = 0
# 	while fn <= num
# 		fn = f1 + f0
# 		f0 = f1
# 		f1 = fn

# 		if fn == num
# 			return true
# 		elsif fn > num
# 			return false
# 		end
# 	end
# end

##### Driver code
# is_fibonacci?(145)
# is_fibonacci?(143)
# is_fibonacci?(144)

# Refactored Solution
def is_fibonacci?(num)
	fZero = 0
	fOne = 1
	fSum = 0
	while fSum <= num
		fSum = fOne + fZero
		fZero = fOne
		fOne = fSum

		if fSum == num
			return true
		elsif fSum > num
			return false
		end
	end

end


# Reflection
# What concepts did you review or learn in this challenge?
# I reviewed iterating through a loop for a fibonacci sequence.

# What is still confusing to you about Ruby?
# I think Ruby is pretty straight forward at this point. I imagine there
# will be more nuances to Ruby since there will be many ways to write Ruby
# elegantly. 

# What are you going to study to get more prepared for Phase 1?
# I will study more algorithms and bruch up on JS.
# I did not find any emunerate methods for this challenge.
{'fraction_non_alphanumeric': 0.08645054031587697, 'fraction_numerical': 0.0228595178719867, 'mean_word_length': 2.933006535947712, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '6244678', 'n_tokens_mistral': 969, 'n_tokens_neox': 879, 'n_words': 360}