<commit_before># Add it up!

# Complete each step below according to the challenge directions and
# include it in this file. Also make sure everything that isn't code
# is commented in the file.

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

# 0. total Pseudocode
# make sure all pseudocode is commented out!

# Input: an array of intergers 
# Output: the sum of the array
# Steps to solve the problem.
	# grab first number in array
	# Add that number to the next number 
	# Keep adding till array is done
	# return the result

# 1. total initial solution
	def total(array)
		array.s 
	end



# 3. total refactored solution



# 4. sentence_maker pseudocode
# make sure all pseudocode is commented out!
# Input:
# Output:
# Steps to solve the problem.


# 5. sentence_maker initial solution



# 6. sentence_maker refactored solution<commit_msg>4.7 done<commit_after>=begin
Add it up!

Complete each step below according to the challenge directions and
include it in this file. Also make sure everything that isn't code
is commented in the file.

I worked on this challenge with <NAME>.

0. total Pseudocode
make sure all pseudocode is commented out!

Input:  an array of numbers
Output: an integer that is the sum of all the number in the input
Steps to solve the problem.
Take the first number
Add the next number
repeat until all numbers used
return the sum


1 total initial solution
def total(array)
  sum = 0
  array.each do |x|
  sum += x
  end
  return sum
end

3. total refactored solution
=end
def total(array)
p  array.inject{|y, x| y+x}
end
=begin
4. sentence_maker pseudocode
make sure all pseudocode is commented out!
Input: an array of words
Output: a string that is sentence formed form those word
Steps to solve the problem.

Get the first word
Capitalize the first word
put in a space
add the next word
repeat that until we run out of words
put in a period
return the sentence

5. sentence_maker initial solution
def sentence_maker(array)
  sentence = array.slice(0).capitalize
  sentence + " "
  array.each {|word| sentence + word}
  sentence + "."
  p sentence

Note that you could avoid using any methods other than
capitalize by using a for word in array loop and using 
#capitalize at the end since it would only affect the first 
letter in the string

# 6. sentence_maker refactored solution
=end
def sentence_maker(array)
	array.join(" ").capitalize+"."
end
{'fraction_non_alphanumeric': 0.05485762144053601, 'fraction_numerical': 0.006700167504187605, 'mean_word_length': 3.845841784989858, 'pattern_counts': {'":': 0, '<': 4, '<?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': '949173', 'n_tokens_mistral': 716, 'n_tokens_neox': 682, 'n_words': 364}