Skip to content

Commit

Permalink
Make input chomped array (#1)
Browse files Browse the repository at this point in the history
With a lot of these problems the input typically needs to be parsed to its lines, and `File.readlines(path, chomp: true)` will also strip newlines making it relatively clean to work with inside the solutions.
  • Loading branch information
baweaver committed Dec 1, 2022
1 parent b2b8354 commit 221ca47
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/advent_of_code_cli/commands/solve.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def execute
raise MissingSolutionError unless File.exist?(solution_file_name)

say "Reading input..."
input = File.read(input_file_name).strip
input = File.readlines(input_file_name, chomp: true)

say "Loading solution..."
load(solution_file_name)
Expand Down

0 comments on commit 221ca47

Please sign in to comment.