<commit_before># Die Class 1: Numeric

# I worked on this challenge [by myself, <NAME> with: very little sleep]

# I spent [1.5] hours on this challenge.

# 0. Pseudocode

# Input: class object, Die
# Output: random between range of 1 and initialized sides
# Steps:
# create instance variable
# create new argument error
# find random num within range

# 1. Initial Solution

# class Die
#   def initialize(sides)
#     @sides = sides
#     raise ArgumentError.new if sides < 1
#   end

#   def sides
#     @sides
#   end

#   def roll
#     rand(1..@sides)
#   end
# end



# 3. Refactored Solution


class Die

  def initialize(sides)
    @sides = sides
    raise ArgumentError.new if sides < 1
  end
	
	attr_reader :sides

  def roll
    @sides.sample
  end
end
<commit_msg>Update my_solution.rb<commit_after># Die Class 1: Numeric

# I worked on this challenge [by myself, <NAME> with: very little sleep]

# I spent [1.5] hours on this challenge.

# 0. Pseudocode

# Input: class object, Die
# Output: random between range of 1 and initialized sides
# Steps:
# create instance variable
# create new argument error
# find random num within range

# 1. Initial Solution

# class Die
#   def initialize(sides)
#     @sides = sides
#     raise ArgumentError.new if sides < 1
#   end

#   def sides
#     @sides
#   end

#   def roll
#     rand(1..@sides)
#   end
# end



# 3. Refactored Solution


class Die

  def initialize(sides)
    @sides = sides
    raise ArgumentError.new if sides < 1
  end
	
	attr_reader :sides

  def roll
    rand(1..@sides)
  end
end

{'fraction_non_alphanumeric': 0.08695652173913043, 'fraction_numerical': 0.013427109974424553, 'mean_word_length': 2.854679802955665, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 5, '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': '6415842', 'n_tokens_mistral': 552, 'n_tokens_neox': 516, 'n_words': 197}