day05

command
v0.0.0-...-3c753f8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 31, 2024 License: Unlicense Imports: 7 Imported by: 0

README

I never solves day 5, trapped in parsing hell.

But I learn it better to use bufio.Scanner och fmt.Sscanf for string comprehension

I only thought of scanf as  taking input and storing in variable using the buffer string 
fmt.Scanf("%s %s %d %s", &name, &temp, &amount, &unit) 

But using to read a bufio.Scanner like this:

fmt.Sscanf(sc.Text(), "move %d from %d to %d", &toMove, &from, &to)

to interpret file line of "move 1 from 2 to 3" or strings with file 
contemns It's just really easier then doing strings.Split

Documentation

Overview

NOT My solution kredit goes to: https://github.com/lynerist/Advent-of-code-2022-golang.git

* Thank to lynerist nice solution, all love for help me keep on pratics * my golang skills

Package main https://adventofcode.com/2022/day/5

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL