<commit_before><commit_msg>create acct_groups.rb file<commit_after>names = ["<NAME>","<NAME>","<NAME>","<NAME>","<NAME>","<NAME>","<NAME>","<NAME>","<NAME>","<NAME>","<NAME>","<NAME>","<NAME>","<NAME>","<NAME>","<NAME>","<NAME>","<NAME>","<NAME>","<NAME>","<NAME>","<NAME>","<NAME>","<NAME>","<NAME>","<NAME>","<NAME> Jr.","<NAME>","<NAME>","<NAME>","<NAME>","<NAME>","<NAME>","JillianC","<NAME>","<NAME>","<NAME>","<NAME>","<NAME>","<NAME>","<NAME>","<NAME>","<NAME>","<NAME>","<NAME>","<NAME>","<NAME>","<NAME>","<NAME>","<NAME>","<NAME>","<NAME>","<NAME>","<NAME>","<NAME>","<NAME>","<NAME>","<NAME>","<NAME>","<NAME>","<NAME>","<NAME>","<NAME>","<NAME>","<NAME>","<NAME>","<NAME>","<NAME>","<NAME>","<NAME>","<NAME>","<NAME>","<NAME>","<NAME>","<NAME>","<NAME>","<NAME>","<NAME>"]


# create array list of students
# define method that takes the array list as the argument
# IF the length of the list is GREATER than 6
# local variable groups equal empty array
# put shuffled list inside group variable
# make groups equal itself but slice each group by 6 and convert to an array
# print groups variable
# or else print just the argument

def acct_groups(list)
  if list.length > 6
    groups = []
    groups = list.shuffle
    groups = groups.each_slice(6).to_a
    print groups
  else
    print list
  end
end

acct_groups(names)

# Reflection

# What was the most interesting and most difficult part of this challenge?

# the logic is straightforward as to what you need to do to the array of names. Looking at ruby docs for interesting methods was fun and made it easier to iterate through the data.

# Do you feel you are improving in your ability to write pseudocode and break the problem down?

# yes and no. Sometimes I feel completely stuck from the start, and other times, if my logic didnt make sense to begin with, I feel like I'm going in circles. Overall, I'm seeing how important the right pseudocode can be in accomplishing the task. I really want to improve.

# Was your approach for automating this task a good solution? What could have made it even better?

I think with the built in methods, it runs really smoothly.

# What data structure did you decide to store the accountability groups in and why?

# An array. It's simply just a list of names with no other information. Therefore, an array would be the best list to use.

# What did you learn in the process of refactoring your initial solution? Did you learn any new Ruby methods?

# .shuffle was an interesting method. This way, the names I entered in my initial array would be mixed up rather than just grouped based on the order I wrote them in.
{'fraction_non_alphanumeric': 0.17579908675799086, 'fraction_numerical': 0.0015220700152207, 'mean_word_length': 5.638888888888889, 'pattern_counts': {'":': 0, '<': 80, '<?xml version=': 0, '>': 81, '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': '5178844', 'n_tokens_mistral': 807, 'n_tokens_neox': 789, 'n_words': 312}