<commit_before>module FixnumCentipad

  class Plus
    def operate(ls, rs)
      "#{ls}+#{rs}"
    end
  end

  class Minus
    def operate(ls, rs)
      "#{ls}-#{rs}"
    end
  end

  class Concat
    def operate(ls, rs)
      "#{ls}#{rs}"
    end
  end


  class World
    OPERATORS = Plus.new, Minus.new, Concat.new

    def initialize(past, future)
      @past   = past
      @cursor = future.shift.to_s
      @future = future
    end

    def children
      if @cursor.empty?
        []
      else
        OPERATORS.map do |operator|
          new_past = operator.operate(@past, @cursor)
          World.new(new_past, @future.dup)
        end
      end
    end

    def solution?
      solution == 100 && leaf?
    end

    private

    def solution
      eval @past
    end

    def leaf?
      @cursor.empty?
    end
  end


  class Centipad

    def initialize(range)
      @input     = range.to_a
      @solutions = []
      @work      = []
    end

    def solve
      enqueue_root_node

      while(world = @work.shift) do
        @work.concat world.children
        @solutions << world if world.solution?
      end

      @solutions
    end

    private

    def enqueue_root_node
      @work << World.new(@input.shift.to_s, @input)
    end
  end
end
<commit_msg>Putting in context for correctness.<commit_after>module FixnumCentipad

  class Plus
    def operate(ls, rs)
      "#{ls}+#{rs}"
    end
  end

  class Minus
    def operate(ls, rs)
      "#{ls}-#{rs}"
    end
  end

  class Concat
    def operate(ls, rs)
      "#{ls}#{rs}"
    end
  end


  class Burrito
    OPERATORS = Plus.new, Minus.new, Concat.new

    def initialize(past, future)
      @past   = past
      @cursor = future.shift.to_s
      @future = future
    end

    def children
      if @cursor.empty?
        []
      else
        OPERATORS.map do |operator|
          new_past = operator.operate(@past, @cursor)
          Burrito.new(new_past, @future.dup)
        end
      end
    end

    def solution?
      solution == 100 && leaf?
    end

    private

    def solution
      eval @past
    end

    def leaf?
      @cursor.empty?
    end
  end


  class Centipad

    def initialize(range)
      @input     = range.to_a
      @solutions = []
      @work      = []
    end

    def solve
      enqueue_root_node

      while(burrito = @work.shift) do
        @work.concat burrito.children
        @solutions << burrito if burrito.solution?
      end

      @solutions
    end

    private

    def enqueue_root_node
      @work << Burrito.new(@input.shift.to_s, @input)
    end
  end
end

{'fraction_non_alphanumeric': 0.09706109822119102, 'fraction_numerical': 0.002320185614849188, 'mean_word_length': 1.7117400419287212, 'pattern_counts': {'":': 0, '<': 11, '<?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': '1859065', 'n_tokens_mistral': 908, 'n_tokens_neox': 856, 'n_words': 220}