Sha256: ca3b898cfeaed5edd95e44810598ab9ab9d9169840a4e6ed8eba20bd1d6462ee

Contents?: true

Size: 707 Bytes

Versions: 1

Compression:

Stored size: 707 Bytes

Contents

class Languages
  ALL_LANGUAGES = %w(rb cpp)
  def initialize(solve_file)
    @solve_file = solve_file
  end

  def compile(problem_name)
    raise 'Error: Not Implemented'
  end

  def execute(input_path, output_path)
    raise 'Error: Not Implemented'
  end
end

class Rb < Languages
  def compile(problem_name)
    true
  end

  def execute(input_path, output_path)
    system "ruby #{@solve_file} < #{input_path} > #{output_path}"
  end
end

class Cpp < Languages
  def compile(problem_name)
    @exec_file = "#{problem_name}.out"
    system "g++ #{@solve_file} -o #{problem_name}.out"
  end

  def execute(input_path, output_path)
    system "./#{@exec_file} < #{input_path} > #{output_path}"
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
atcoder_greedy-0.3.0 lib/atcoder_greedy/lib/languages.rb