<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:
# Output:
# Steps to solve the problem.


# 1. total initial solution

def total(num_array)
  sum = 0
  num_array.each { |number|
    sum += number
  }
  return sum
end

# 3. total refactored solution
#see above


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


# 5. sentence_maker initial solution
=begin
def sentence_maker str_array
  sentence = ""
  str_array[0].capitalize!
  i = 0
  while i < str_array.length - 1
    sentence += str_array[i].to_s + " "
    i += 1
  end
  sentence += str_array[str_array.length - 1].to_s + "."
  return sentence
end
=end


# 6. sentence_maker refactored solution

def sentence_maker str_array
  sentence = ""
  str_array[0].capitalize!
  for i in 0...( str_array.length )
    sentence += str_array[i].to_s
    if( i < str_array.length - 1 )
      sentence += " "
    else
      sentence += "."
    end
  end
  return sentence
end<commit_msg>refactored further, for fun<commit_after># 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:
# Output:
# Steps to solve the problem.


# 1. total initial solution

def total(num_array)
  sum = 0
  num_array.each { |number|
    sum += number
  }
  return sum
end

# 3. total refactored solution
#see above


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


# 5. sentence_maker initial solution
=begin
def sentence_maker str_array
  sentence = ""
  str_array[0].capitalize!
  i = 0
  while i < str_array.length - 1
    sentence += str_array[i].to_s + " "
    i += 1
  end
  sentence += str_array[str_array.length - 1].to_s + "."
  return sentence
end
=end


# 6. sentence_maker refactored solution

def sentence_maker str_array
  sentence = ""
  str_array[0].capitalize!
  sentence = str_array.join(" ")
  sentence.insert(-1, '.')
  return sentence
end

sentence_maker(['Alaska', 'has', 'over', '586', 'thousand', 'miles'])
{'fraction_non_alphanumeric': 0.10043324143363529, 'fraction_numerical': 0.01260338716029933, 'mean_word_length': 3.3270868824531514, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 3, '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': '4716507', 'n_tokens_mistral': 878, 'n_tokens_neox': 825, 'n_words': 295}