aoc-helper/lib/aoc.rb

21 lines
434 B
Ruby
Raw Permalink Normal View History

2022-12-02 19:42:16 +01:00
require "tty-prompt"
require_relative "tasks/new_day"
require_relative "tasks/part_two"
class AOC
def self.run
prompt = TTY::Prompt.new
day = prompt.ask("Name the day (1-24)") do |q|
q.in("1-24")
end
selected = prompt.select("What do you want to do", "New day":0, "Add part 2 to a day":1)
if selected == 0
new_day(prompt, day)
elsif selected == 1
part_two(prompt, day)
end
end
end