<commit_before>class Captcha
  NUMBERS   = (1..9).to_a
  OPERATORS = [:+, :-, :*]

  def initialize(x=nil, y=nil, operator=nil)
    @x = x || NUMBERS.sort_by{rand}.first
    @y = y || NUMBERS.sort_by{rand}.first
    @operator = operator || OPERATORS.sort_by{rand}.first
  end
  
  def check(answer)
    answer == solution
  end
  
  def to_s
    "#{@x} #{@operator.to_s} #{@y}"
  end

  def solution
    @x.send @operator, @y
  end
end<commit_msg>sketch for crypto<commit_after>class Captcha
  NUMBERS   = (1..9).to_a
  OPERATORS = [:+, :-, :*]

  def initialize(x=nil, y=nil, operator=nil)
    @x = x || NUMBERS.sort_by{rand}.first
    @y = y || NUMBERS.sort_by{rand}.first
    @operator = operator || OPERATORS.sort_by{rand}.first
  end
  
  def check(answer)
    answer == solution
  end
  
  def to_s
    "#{@x} #{@operator.to_s} #{@y}"
  end

  def solution
    @x.send @operator, @y
  end

  def to_secret
    to_yaml.crypt
  end

  def to_yaml
    {
      :x => x,
      :y => y,
      :operator => operator
    }.to_yaml
  end

  def self.from_secret(secret)
    args = YAML.parse(secret.decrypt)
    new(args[:x], args[:y], args[:operator])
  end
end

{'fraction_non_alphanumeric': 0.16034482758620688, 'fraction_numerical': 0.0034482758620689655, 'mean_word_length': 2.6624605678233437, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, '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': '4794238', 'n_tokens_mistral': 487, 'n_tokens_neox': 468, 'n_words': 97}