<commit_before># Input: array of strings
# Output: random returns one of the strings, raise argurment error if empty array is passes
# Steps:
# 1. Raise ArgumentError in initialize method
# 2. Make instance variables for intialize and sides
# 3.Return random number between 1 and instance variables.length that is indexed for labels

# 3. Initial Solution
class Die
  def initialize(labels)
  	raise ArgumentError.new("Array must not be empty") if labels.length<1
  	@labels=labels
  end

  def sides
  	@labels.length
  end

  def roll
  	@labels[Random.new.rand(0..@labels.length-1)]
  end
end

# # Reflection
# # What were the main differences between this die class and the last one you created in terms of implementation? Did you need to change much logic to get this to work?
# The main differences was that I used labels as an array and index it for the return value of roll
# # What does this exercise teach you about making code that is easily changeable or modifiable? 
# It was easy to change this code due to my original die class being easily readable.
# # What new methods did you learn when working on this challenge, if any?
# I didnt use any new methods
# # What concepts about classes were you able to solidify in this challenge?
# I dont feel I benefitted from this challenge that much. Last week was a good intro into this challenge. <commit_msg>Relfection<commit_after># Input: array of strings
# Output: random returns one of the strings, raise argurment error if empty array is passes
# Steps:
# 1. Raise ArgumentError in initialize method for empty array
# 2. Make instance variables for intialize and labels
# 3. Return random number between 1 and instance variable.length that is indexed for labels

# 3. Initial Solution
class Die
  def initialize(labels)
  	raise ArgumentError.new("Array must not be empty") if labels.length < 1
  	@labels=labels
  end

  def sides
  	@labels.length
  end

  def roll
  	@labels[Random.new.rand(0..@labels.length-1)]
  end
end

# # Reflection
# # What were the main differences between this die class and the last one you created in terms of implementation? Did you need to change much logic to get this to work?
# The main differences was that I used labels as an array and index it for the return value of roll
# # What does this exercise teach you about making code that is easily changeable or modifiable? 
# It was easy to change this code due to my original die class being easily readable.
# # What new methods did you learn when working on this challenge, if any?
# I didnt use any new methods
# # What concepts about classes were you able to solidify in this challenge?
# I dont feel I benefitted from this challenge that much. Last week was a good intro into this challenge and this one didnt require much changing to workl
{'fraction_non_alphanumeric': 0.047567954220314734, 'fraction_numerical': 0.005722460658082976, 'mean_word_length': 3.994642857142857, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '896809', 'n_tokens_mistral': 729, 'n_tokens_neox': 703, 'n_words': 428}