mirror of
https://github.com/onyx-and-iris/aoc2023.git
synced 2024-11-22 02:10:48 +00:00
add one docstrings
This commit is contained in:
parent
b98379ca2b
commit
e8f7c2a63d
@ -2,6 +2,7 @@ package main
|
|||||||
|
|
||||||
const MAX = 10
|
const MAX = 10
|
||||||
|
|
||||||
|
// getload returns the load of all boulders for a single image
|
||||||
func getload(raw []string) int {
|
func getload(raw []string) int {
|
||||||
load := 0
|
load := 0
|
||||||
for _, line := range raw {
|
for _, line := range raw {
|
||||||
@ -15,6 +16,7 @@ func getload(raw []string) int {
|
|||||||
return load
|
return load
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// spacesToRight determines the number of spaces right of a boulder
|
||||||
func spacesToRight(i int, line string) int {
|
func spacesToRight(i int, line string) int {
|
||||||
num := 0
|
num := 0
|
||||||
outer:
|
outer:
|
||||||
@ -29,6 +31,7 @@ outer:
|
|||||||
return num
|
return num
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// rollRight rolls a boulder right until there's no space
|
||||||
func rollRight(line string) string {
|
func rollRight(line string) string {
|
||||||
for i := len(line) - 1; i >= 0; i-- {
|
for i := len(line) - 1; i >= 0; i-- {
|
||||||
if line[i] == 'O' {
|
if line[i] == 'O' {
|
||||||
|
Loading…
Reference in New Issue
Block a user