Skip to content

Commit

Permalink
Update readme with example for using sections
Browse files Browse the repository at this point in the history
  • Loading branch information
pacso committed Dec 5, 2024
1 parent 8db21c7 commit 63090b9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,14 @@ module Year2024
end
```

Where you have different sections of input which need to be handled differently, you can quickly split them into independent instances of `AocInput`, such as with the pussle from 2024, Day 5:

```ruby
page_rules, page_updates = aoc_input.sections
page_rules_data = page_rules.multiple_lines.columns_of_numbers("|").data
page_updates_data = page_updates.multiple_lines.columns_of_numbers(",").data
```

### Decoding printed text

```ruby
Expand Down

0 comments on commit 63090b9

Please sign in to comment.