diff options
| author | omagdy <omar.professional8777@gmail.com> | 2024-12-05 17:39:35 +0200 |
|---|---|---|
| committer | omagdy <omar.professional8777@gmail.com> | 2024-12-05 17:39:35 +0200 |
| commit | 1061acfe4b168c1e7cf6cadf5f9dd812a10f7041 (patch) | |
| tree | 1722a8a11c46544a5d1bd7fe24859b640670e2e5 /2024/go/src/day5 | |
| parent | d5816aaccf73f7ed9577ccc544e89a73a0128386 (diff) | |
| download | aoc-1061acfe4b168c1e7cf6cadf5f9dd812a10f7041.tar.xz aoc-1061acfe4b168c1e7cf6cadf5f9dd812a10f7041.zip | |
Just renamed a Struct.
Diffstat (limited to '2024/go/src/day5')
| -rw-r--r-- | 2024/go/src/day5/main.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/2024/go/src/day5/main.go b/2024/go/src/day5/main.go index 57b0de0..65900e5 100644 --- a/2024/go/src/day5/main.go +++ b/2024/go/src/day5/main.go @@ -9,12 +9,12 @@ import ( "strings" ) -type Section struct { +type SafetyManual struct { pageOrderingRules [][2]int updates [][]int } -func (s Section) String() string { +func (s SafetyManual) String() string { var builder strings.Builder // Format pageOrderingRules @@ -56,7 +56,7 @@ func FileRead(path string) string { } -func parseInput(data string) Section { +func parseInput(data string) SafetyManual { section := strings.Split(data, "\n\n") first_section := strings.Split(section[0], "\n") second_section := strings.Split(section[1], "\n") @@ -78,14 +78,14 @@ func parseInput(data string) Section { } updates = append(updates, update) } - return Section{ + return SafetyManual{ pageOrderingRules: pageOrderingRules, updates: updates, } } -func filter_relevant_rules(s *Section, update *[]int) [][2]int { +func filter_relevant_rules(s *SafetyManual, update *[]int) [][2]int { var filtered_rules [][2]int for _, rule := range s.pageOrderingRules { if slices.Contains(*update, rule[0]) && slices.Contains(*update, rule[1]) { |
