Archived
2nd: small refactor of variables
This commit is contained in:
+3
-7
@@ -9,10 +9,6 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
var depth int
|
|
||||||
var horizontalPosition int
|
|
||||||
var aim int
|
|
||||||
|
|
||||||
func Run() {
|
func Run() {
|
||||||
commands := readInput()
|
commands := readInput()
|
||||||
fmt.Printf("1st final position: %d\n", solve(commands, false))
|
fmt.Printf("1st final position: %d\n", solve(commands, false))
|
||||||
@@ -20,9 +16,9 @@ func Run() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func solve(commands []string, alt bool) int {
|
func solve(commands []string, alt bool) int {
|
||||||
depth = 0
|
depth := 0
|
||||||
horizontalPosition = 0
|
horizontalPosition := 0
|
||||||
aim = 0
|
aim := 0
|
||||||
|
|
||||||
for _, v := range commands {
|
for _, v := range commands {
|
||||||
command := strings.Split(v, " ")
|
command := strings.Split(v, " ")
|
||||||
|
|||||||
Reference in New Issue
Block a user