Skip to content

Commit

Permalink
Day5 construct + refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
yashpatil1998 committed Dec 5, 2022
1 parent 8285040 commit f3984d7
Show file tree
Hide file tree
Showing 6 changed files with 530 additions and 10 deletions.
6 changes: 3 additions & 3 deletions day2/day2.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"strings"
)

func Day2LogicPart1() int64 {
func day2LogicPart1() int64 {
gamesList := strings.Split(input2, "\n")
totalGameScore := int64(0)
for _, game := range gamesList {
Expand Down Expand Up @@ -32,7 +32,7 @@ func Day2LogicPart1() int64 {
return totalGameScore
}

func Day2LogicPart2() int64 {
func day2LogicPart2() int64 {
gamesList := strings.Split(input2, "\n")
totalGameScore := int64(0)
for _, game := range gamesList {
Expand Down Expand Up @@ -61,5 +61,5 @@ func Day2LogicPart2() int64 {
}

func Day2Logic() (int64, int64) {
return Day2LogicPart1(), Day2LogicPart2()
return day2LogicPart1(), day2LogicPart2()
}
6 changes: 3 additions & 3 deletions day3/day3.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ func calPriority(s string) int {
}
}

func Day3LogicPart1() int {
func day3LogicPart1() int {
inputs := strings.Split(input3, "\n")
totalSum := 0
for _, entry := range inputs {
Expand All @@ -29,7 +29,7 @@ func Day3LogicPart1() int {
return totalSum
}

func Day3LogicPart2() int {
func day3LogicPart2() int {
inputs := strings.Split(input3, "\n")
totalSum := 0
for i := 0; i < len(inputs); {
Expand All @@ -50,5 +50,5 @@ func Day3LogicPart2() int {
}

func Day3Logic() (int, int) {
return Day3LogicPart1(), Day3LogicPart2()
return day3LogicPart1(), day3LogicPart2()
}
6 changes: 3 additions & 3 deletions day4/day4.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import (
)

func Day4Logic() (int, int) {
return Day4LogicPart1(), Day4LogicPart2()
return day4LogicPart1(), day4LogicPart2()
}

func Day4LogicPart1() int {
func day4LogicPart1() int {
totalCount := 0
inputs := strings.Split(input4, "\n")
for _, assignmentPairs := range inputs {
Expand All @@ -27,7 +27,7 @@ func Day4LogicPart1() int {
return totalCount
}

func Day4LogicPart2() int {
func day4LogicPart2() int {
totalCount := 0
inputs := strings.Split(input4, "\n")
for _, assignmentPairs := range inputs {
Expand Down
13 changes: 13 additions & 0 deletions day5/day5.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package day5

func Day5Logic() (string, string) {
return day5LogicPart1(), day5LogicPart2()
}

func day5LogicPart1() string {
return ""
}

func day5LogicPart2() string {
return ""
}
Loading

0 comments on commit f3984d7

Please sign in to comment.